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__Paperlibrary__EditPaper_...

505 lines
1.5 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[193,5,6,7,8,20],{"+BqJ":function(Wt,st,z){Wt.exports={wrap:"wrap___25UhO",img:"img___2akIE",table:"table___3IRHj",totalScore:"totalScore___2JN2k",people:"people___1rT7q",glassSeal:"glassSeal___2gAyY"}},"+NIl":function(Wt,st,z){(function(oe){oe(z("VrN/"))})(function(oe){"use strict";oe.defineMode("stex",function(Z,U){"use strict";function ee(o,l){o.cmdState.push(l)}function W(o){return o.cmdState.length>0?o.cmdState[o.cmdState.length-1]:null}function M(o){var l=o.cmdState.pop();l&&l.closeBracket()}function $(o){for(var l=o.cmdState,r=l.length-1;r>=0;r--){var i=l[r];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function X(o,l,r){return function(){this.name=o,this.bracketNo=0,this.style=l,this.styles=r,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var k={};k.importmodule=X("importmodule","tag",["string","builtin"]),k.documentclass=X("documentclass","tag",["","atom"]),k.usepackage=X("usepackage","tag",["atom"]),k.begin=X("begin","tag",["atom"]),k.end=X("end","tag",["atom"]),k.label=X("label","tag",["atom"]),k.ref=X("ref","tag",["atom"]),k.eqref=X("eqref","tag",["atom"]),k.cite=X("cite","tag",["atom"]),k.bibitem=X("bibitem","tag",["atom"]),k.Bibitem=X("Bibitem","tag",["atom"]),k.RBibitem=X("RBibitem","tag",["atom"]),k.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(o,l){o.f=l}function m(o,l){var r;if(o.match(/^\\[a-zA-Z@]+/)){var i=o.current().slice(1);return r=k.hasOwnProperty(i)?k[i]:k.DEFAULT,r=new r,ee(l,r),D(l,f),r.style}if(o.match(/^\\[$&%#{}_]/))return"tag";if(o.match(/^\\[,;!\/\\]/))return"tag";if(o.match("\\["))return D(l,function(c,h){return v(c,h,"\\]")}),"keyword";if(o.match("\\("))return D(l,function(c,h){return v(c,h,"\\)")}),"keyword";if(o.match("$$"))return D(l,function(c,h){return v(c,h,"$$")}),"keyword";if(o.match("$"))return D(l,function(c,h){return v(c,h,"$")}),"keyword";var t=o.next();if(t=="%")return o.skipToEnd(),"comment";if(t=="}"||t=="]"){if(r=W(l),r)r.closeBracket(t),D(l,f);else return"error";return"bracket"}else return t=="{"||t=="["?(r=k.DEFAULT,r=new r,ee(l,r),"bracket"):/\d/.test(t)?(o.eatWhile(/[\w.%]/),"atom"):(o.eatWhile(/[\w\-_]/),r=$(l),r.name=="begin"&&(r.argument=o.current()),r.styleIdentifier())}function v(o,l,r){if(o.eatSpace())return null;if(r&&o.match(r))return D(l,m),"keyword";if(o.match(/^\\[a-zA-Z@]+/))return"tag";if(o.match(/^[a-zA-Z]+/))return"variable-2";if(o.match(/^\\[$&%#{}_]/))return"tag";if(o.match(/^\\[,;!\/]/))return"tag";if(o.match(/^[\^_&]/))return"tag";if(o.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(o.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=o.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(o.skipToEnd(),"comment"):"error"}function f(o,l){var r=o.peek(),i;return r=="{"||r=="["?(i=W(l),i.openBracket(r),o.eat(r),D(l,m),"bracket"):/[ \t\r]/.test(r)?(o.eat(r),null):(D(l,m),M(l),m(o,l))}return{startState:function(){var o=U.inMathMode?function(l,r){return v(l,r)}:m;return{cmdState:[],f:o}},copyState:function(o){return{cmdState:o.cmdState.slice(),f:o.f}},token:function(o,l){return l.f(o,l)},blankLine:function(o){o.f=m,o.cmdState.length=0},lineComment:"%"}}),oe.defineMIME("text/x-stex","stex"),oe.defineMIME("text/x-latex","stex")})},"+ua5":function(Wt,st,z){},"19Vz":function(Wt,st,z){(function(oe){oe(z("VrN/"))})(function(oe){oe.defineOption("placeholder","",function(X,k,D){var m=D&&D!=oe.Init;if(k&&!m)X.on("blur",W),X.on("change",M),X.on("swapDoc",M),oe.on(X.getInputField(),"compositionupdate",X.state.placeholderCompose=function(){ee(X)}),M(X);else if(!k&&m){X.off("blur",W),X.off("change",M),X.off("swapDoc",M),oe.off(X.getInputField(),"compositionupdate",X.state.placeholderCompose),Z(X);var v=X.getWrapperElement();v.className=v.className.replace(" CodeMirror-empty","")}k&&!X.hasFocus()&&W(X)});function Z(X){X.state.placeholder&&(X.state.placeholder.parentNode.removeChild(X.state.placeholder),X.state.placeholder=null)}function U(X){Z(X);var k=X.state.placeholder=document.createElement("pre");k.style.cssText="height: 0; overflow: visible",k.style.direction=X.getOption("direction"),k.className="CodeMirror-placeholder CodeMirror-line-like";var D=X.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),k.appendChild(D),X.display.lineSpace.insertBefore(k,X.display.lineSpace.firstChild)}function ee(X){setTimeout(function(){var k=!1,D=X.getInputField();D.nodeName=="TEXTAREA"?k=!D.value:X.lineCount()==1&&(k=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),k?U(X):Z(X)},20)}function W(X){$(X)&&U(X)}function M(X){var k=X.getWrapperElement(),D=$(X);k.className=k.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?U(X):Z(X)}function $(X){return X.lineCount()===1&&X.getLine(0)===""}})},"1ZF9":function(Wt,st,z){Wt.exports=z.p+"static/Authorize.cc9c212f.png"},"1eCo":function(Wt,st,z){(function(oe){oe(z("VrN/"))})(function(oe){"use strict";var Z={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},U={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};oe.defineMode("xml",function(ee,W){var M=ee.indentUnit,$={},X=W.htmlMode?Z:U;for(var k in X)$[k]=X[k];for(var k in W)$[k]=W[k];var D,m;function v(d,E){function g(N){return E.tokenize=N,N(d,E)}var y=d.next();if(y=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?g(l("atom","]]>")):null:d.match("--")?g(l("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),g(r(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),E.tokenize=l("meta","?>"),"meta"):(D=d.eat("/")?"closeTag":"openTag",E.tokenize=f,"tag bracket");if(y=="&"){var F;return d.eat("#")?d.eat("x")?F=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):F=d.eatWhile(/[\d]/)&&d.eat(";"):F=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),F?"atom":"error"}else return d.eatWhile(/[^&<]/),null}v.isInText=!0;function f(d,E){var g=d.next();if(g==">"||g=="/"&&d.eat(">"))return E.tokenize=v,D=g==">"?"endTag":"selfcloseTag","tag bracket";if(g=="=")return D="equals",null;if(g=="<"){E.tokenize=v,E.state=h,E.tagName=E.tagStart=null;var y=E.tokenize(d,E);return y?y+" tag error":"tag error"}else return/[\'\"]/.test(g)?(E.tokenize=o(g),E.stringStartCol=d.column(),E.tokenize(d,E)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(d){var E=function(g,y){for(;!g.eol();)if(g.next()==d){y.tokenize=f;break}return"string"};return E.isInAttribute=!0,E}function l(d,E){return function(g,y){for(;!g.eol();){if(g.match(E)){y.tokenize=v;break}g.next()}return d}}function r(d){return function(E,g){for(var y;(y=E.next())!=null;){if(y=="<")return g.tokenize=r(d+1),g.tokenize(E,g);if(y==">")if(d==1){g.tokenize=v;break}else return g.tokenize=r(d-1),g.tokenize(E,g)}return"meta"}}function i(d,E,g){this.prev=d.context,this.tagName=E,this.indent=d.indented,this.startOfLine=g,($.doNotIndent.hasOwnProperty(E)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function t(d){d.context&&(d.context=d.context.prev)}function c(d,E){for(var g;;){if(!d.context)return;if(g=d.context.tagName,!$.contextGrabbers.hasOwnProperty(g)||!$.contextGrabbers[g].hasOwnProperty(E))return;t(d)}}function h(d,E,g){return d=="openTag"?(g.tagStart=E.column(),A):d=="closeTag"?S:h}function A(d,E,g){return d=="word"?(g.tagName=E.current(),m="tag",R):$.allowMissingTagName&&d=="endTag"?(m="tag bracket",R(d,E,g)):(m="error",A)}function S(d,E,g){if(d=="word"){var y=E.current();return g.context&&g.context.tagName!=y&&$.implicitlyClosed.hasOwnProperty(g.context.tagName)&&t(g),g.context&&g.context.tagName==y||$.matchClosing===!1?(m="tag",w):(m="tag error",O)}else return $.allowMissingTagName&&d=="endTag"?(m="tag bracket",w(d,E,g)):(m="error",O)}function w(d,E,g){return d!="endTag"?(m="error",w):(t(g),h)}function O(d,E,g){return m="error",w(d,E,g)}function R(d,E,g){if(d=="word")return m="attribute",b;if(d=="endTag"||d=="selfcloseTag"){var y=g.tagName,F=g.tagStart;return g.tagName=g.tagStart=null,d=="selfcloseTag"||$.autoSelfClosers.hasOwnProperty(y)?c(g,y):(c(g,y),g.context=new i(g,y,F==g.indented)),h}return m="error",R}function b(d,E,g){return d=="equals"?_:($.allowMissing||(m="error"),R(d,E,g))}function _(d,E,g){return d=="string"?u:d=="word"&&$.allowUnquoted?(m="string",R):(m="error",R(d,E,g))}function u(d,E,g){return d=="string"?u:R(d,E,g)}return{startState:function(d){var E={tokenize:v,state:h,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(E.baseIndent=d),E},token:function(d,E){if(!E.tagName&&d.sol()&&(E.indented=d.indentation()),d.eatSpace())return null;D=null;var g=E.tokenize(d,E);return(g||D)&&g!="comment"&&(m=null,E.state=E.state(D||g,d,E),m&&(g=m=="error"?g+" error":m)),g},indent:function(d,E,g){var y=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+M;if(y&&y.noIndent)return oe.Pass;if(d.tokenize!=f&&d.tokenize!=v)return g?g.match(/^(\s*)/)[0].length:0;if(d.tagName)return $.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+M*($.multilineTagIndentFactor||1);if($.alignCDATA&&/<!\[CDATA\[/.test(E))return 0;var F=E&&/^<(\/)?([\w_:\.-]*)/.exec(E);if(F&&F[1])for(;y;)if(y.tagName==F[2]){y=y.prev;break}else if($.implicitlyClosed.hasOwnProperty(y.tagName))y=y.prev;else break;else if(F)for(;y;){var N=$.contextGrabbers[y.tagName];if(N&&N.hasOwnProperty(F[2]))y=y.prev;else break}for(;y&&y.prev&&!y.startOfLine;)y=y.prev;return y?y.indent+M:d.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:$.htmlMode?"html":"xml",helperType:$.htmlMode?"html":"xml",skipAttribute:function(d){d.state==_&&(d.state=R)},xmlCurrentTag:function(d){return d.tagName?{name:d.tagName,close:d.type=="closeTag"}:null},xmlCurrentContext:function(d){for(var E=[],g=d.context;g;g=g.prev)g.tagName&&E.push(g.tagName);return E.reverse()}}}),oe.defineMIME("text/xml","xml"),oe.defineMIME("application/xml","xml"),oe.mimeModes.hasOwnProperty("text/html")||oe.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2aBv":function(Wt,st,z){"use strict";var oe=z("2qtc"),Z=z("kLXV"),U=z("0Owb"),ee=z("14J3"),W=z("BMrR"),M=z("jCWc"),$=z("kPKH"),X=z("+L6B"),k=z("2/Rp"),D=z("oBTY"),m=z("tJVT"),v=z("q1tI"),f=z.n(v),o=z("ngQI"),l=z("Ty5D"),r=z("YIbm"),i=z.n(r),t=function(h){var A=h.visible,S=h.onOk,w=h.onCancel,O=h.data,R=Object(v.useState)([]),b=Object(m.a)(R,2),_=b[0],u=b[1],d=Object(v.useState)(!1),E=Object(m.a)(d,2),g=E[0],y=E[1],F=Object(l.i)();Object(v.useEffect)(function(){if(!A){u([]),y(!1);return}u(Object(D.a)(O)||[])},[A]);var N=function(){y(!0),S(_,function(){y(!1)})},H=function(){w()},G=function(B,Y,re){var de=Array.from(B),he=de.splice(Y,1),xe=Object(m.a)(he,1),Pe=xe[0];return de.splice(re,0,Pe),de},I=function(B,Y){if(!B.destination)return;var re=G(Y,B.source.index,B.destination.index);u(re)};return f.a.createElement(Z.a,{title:"\u9898\u578B\u6392\u5E8F",visible:A,centered:!0,onCancel:H,footer:f.a.createElement("div",null,f.a.createElement("span",{style:{float:"left",color:"#999",paddingTop:5}},"\u63D0\u793A:\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u4E0A\u4E0B\u62D6\u52A8\u6392\u5E8F"),f.a.createElement(k.a,{onClick:H},"\u53D6\u6D88"),f.a.createElement(k.a,{type:"primary",loading:g,onClick:N},"\u786E\u8BA4")),width:"680px"},f.a.createElement("div",{className:i.a.content},f.a.createElement(W.a,null,f.a.createElement($.a,{span:12},"\u5E8F\u53F7"),f.a.createElement($.a,{span:12},"\u9898\u578B\u540D\u79F0")),f.a.createElement(o.a,{onDragEnd:function(B){return I(B,_)}},f.a.createElement(o.c,{droppableId:"droppable"},function(x,B){return f.a.createElement("div",Object(U.a)({ref:x.innerRef},x.droppableProps,{style:{width:"100%"}}),_.map(function(Y,re){return f.a.createElement(o.b,{key:re,draggableId:re.toString(),index:re},function(de,he){return f.a.createElement("aside",Object(U.a)({ref:de.innerRef},de.draggableProps,de.dragHandleProps),f.a.createElement("div",null,f.a.createElement(W.a,{style:{backgroundColor:re%2===0?"#f5f5f5":"#fff"}},f.a.createElement($.a,{span:12},re+1),f.a.createElement($.a,{span:12},Y))))})}))}))))};st.a=t},"55Ip":function(Wt,st,z){"use strict";z.d(st,"a",function(){return c});var oe=z("Ty5D"),Z=z("dI71"),U=z("q1tI"),ee=z.n(U),W=z("YS25"),M=z("17x9"),$=z.n(M),X=z("wx14"),k=z("zLVn"),D=z("9R94"),m=function(_){Object(Z.a)(u,_);function u(){for(var E,g=arguments.length,y=new Array(g),F=0;F<g;F++)y[F]=arguments[F];return E=_.call.apply(_,[this].concat(y))||this,E.history=Object(W.a)(E.props),E}var d=u.prototype;return d.render=function(){return ee.a.createElement(oe.c,{history:this.history,children:this.props.children})},u}(ee.a.Component),v=function(_){Object(Z.a)(u,_);function u(){for(var E,g=arguments.length,y=new Array(g),F=0;F<g;F++)y[F]=arguments[F];return E=_.call.apply(_,[this].concat(y))||this,E.history=Object(W.b)(E.props),E}var d=u.prototype;return d.render=function(){return ee.a.createElement(oe.c,{history:this.history,children:this.props.children})},u}(ee.a.Component),f=function(u,d){return typeof u=="function"?u(d):u},o=function(u,d){return typeof u=="string"?Object(W.c)(u,null,null,d):u},l=function(u){return u},r=ee.a.forwardRef;typeof r=="undefined"&&(r=l);function i(_){return!!(_.metaKey||_.altKey||_.ctrlKey||_.shiftKey)}var t=r(function(_,u){var d=_.innerRef,E=_.navigate,g=_.onClick,y=Object(k.a)(_,["innerRef","navigate","onClick"]),F=y.target,N=Object(X.a)({},y,{onClick:function(G){try{g&&g(G)}catch(I){throw G.preventDefault(),I}!G.defaultPrevented&&G.button===0&&(!F||F==="_self")&&!i(G)&&(G.preventDefault(),E())}});return l!==r?N.ref=u||d:N.ref=d,ee.a.createElement("a",N)}),c=r(function(_,u){var d=_.component,E=d===void 0?t:d,g=_.replace,y=_.to,F=_.innerRef,N=Object(k.a)(_,["component","replace","to","innerRef"]);return ee.a.createElement(oe.e.Consumer,null,function(H){H||Object(D.a)(!1);var G=H.history,I=o(f(y,H.location),H.location),x=I?G.createHref(I):"",B=Object(X.a)({},N,{href:x,navigate:function(){var re=f(y,H.location),de=g?G.replace:G.push;de(re)}});return l!==r?B.ref=u||F:B.innerRef=F,ee.a.createElement(E,B)})});if(!1)var h,A;var S=function(u){return u},w=ee.a.forwardRef;typeof w=="undefined"&&(w=S);function O(){for(var _=arguments.length,u=new Array(_),d=0;d<_;d++)u[d]=arguments[d];return u.filter(function(E){return E}).join(" ")}var R=w(function(_,u){var d=_["aria-current"],E=d===void 0?"page":d,g=_.activeClassName,y=g===void 0?"active":g,F=_.activeStyle,N=_.className,H=_.exact,G=_.isActive,I=_.location,x=_.sensitive,B=_.strict,Y=_.style,re=_.to,de=_.innerRef,he=Object(k.a)(_,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return ee.a.createElement(oe.e.Consumer,null,function(xe){xe||Object(D.a)(!1);var Pe=I||xe.location,Ce=o(f(re,Pe),Pe),Oe=Ce.pathname,be=Oe&&Oe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),ge=be?Object(oe.f)(Pe.pathname,{path:be,exact:H,sensitive:x,strict:B}):null,te=!!(G?G(ge,Pe):ge),fe=te?O(N,y):N,_e=te?Object(X.a)({},Y,{},F):Y,Le=Object(X.a)({"aria-current":te&&E||null,className:fe,style:_e,to:Ce},he);return S!==w?Le.ref=u||de:Le.innerRef=de,ee.a.createElement(c,Le)})});if(!1)var b},"5VLF":function(Wt,st,z){"use strict";var oe,Z;function U(ee,W,M){var $=function(X,k){return ee.js_beautify(X,k)};return $.js=ee.js_beautify,$.css=W.css_beautify,$.html=M.html_beautify,$.js_beautify=ee.js_beautify,$.css_beautify=W.css_beautify,$.html_beautify=M.html_beautify,$}!(oe=[z("6UM0"),z("TXwP"),z("psGv")],Z=function(ee,W,M){return U(ee,W,M)}.apply(st,oe),Z!==void 0&&(Wt.exports=Z))},"6+eU":function(Wt,st,z){"use strict";z.d(st,"a",function(){return w});var oe=z("wx14"),Z=z("rePB"),U=z("VTBJ"),ee=z("1OyB"),W=z("vuIU"),M=z("Ji7U"),$=z("LK+K"),X=z("q1tI"),k=z.n(X),D=z("TSYQ"),m=z.n(D),v=function(R){var b,_="".concat(R.rootPrefixCls,"-item"),u=m()(_,"".concat(_,"-").concat(R.page),(b={},Object(Z.a)(b,"".concat(_,"-active"),R.active),Object(Z.a)(b,R.className,!!R.className),Object(Z.a)(b,"".concat(_,"-disabled"),!R.page),b)),d=function(){R.onClick(R.page)},E=function(y){R.onKeyPress(y,R.onClick,R.page)};return k.a.createElement("li",{title:R.showTitle?R.page:null,className:u,onClick:d,onKeyPress:E,tabIndex:"0"},R.itemRender(R.page,"page",k.a.createElement("a",{rel:"nofollow"},R.page)))},f=v,o={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},l=function(O){Object(M.a)(b,O);var R=Object($.a)(b);function b(){var _;Object(ee.a)(this,b);for(var u=arguments.length,d=new Array(u),E=0;E<u;E++)d[E]=arguments[E];return _=R.call.apply(R,[this].concat(d)),_.state={goInputText:""},_.buildOptionText=function(g){return"".concat(g," ").concat(_.props.locale.items_per_page)},_.changeSize=function(g){_.props.changeSize(Number(g))},_.handleChange=function(g){_.setState({goInputText:g.target.value})},_.handleBlur=function(g){var y=_.props,F=y.goButton,N=y.quickGo,H=y.rootPrefixCls,G=_.state.goInputText;if(F||G==="")return;if(g.relatedTarget&&(g.relatedTarget.className.indexOf("".concat(H,"-prev"))>=0||g.relatedTarget.className.indexOf("".concat(H,"-next"))>=0))return;_.setState({goInputText:""}),N(_.getValidValue())},_.go=function(g){var y=_.state.goInputText;if(y==="")return;(g.keyCode===o.ENTER||g.type==="click")&&(_.setState({goInputText:""}),_.props.quickGo(_.getValidValue()))},_}return Object(W.a)(b,[{key:"getValidValue",value:function(){var u=this.state,d=u.goInputText,E=u.current;return!d||isNaN(d)?E:Number(d)}},{key:"getPageSizeOptions",value:function(){var u=this.props,d=u.pageSize,E=u.pageSizeOptions;return E.some(function(g){return g.toString()===d.toString()})?E:E.concat([d.toString()]).sort(function(g,y){var F=isNaN(Number(g))?0:Number(g),N=isNaN(Number(y))?0:Number(y);return F-N})}},{key:"render",value:function(){var u=this,d=this.props,E=d.pageSize,g=d.locale,y=d.rootPrefixCls,F=d.changeSize,N=d.quickGo,H=d.goButton,G=d.selectComponentClass,I=d.buildOptionText,x=d.selectPrefixCls,B=d.disabled,Y=this.state.goInputText,re="".concat(y,"-options"),de=G,he=null,xe=null,Pe=null;if(!F&&!N)return null;var Ce=this.getPageSizeOptions();if(F&&de){var Oe=Ce.map(function(be,ge){return k.a.createElement(de.Option,{key:ge,value:be.toString()},(I||u.buildOptionText)(be))});he=k.a.createElement(de,{disabled:B,prefixCls:x,showSearch:!1,className:"".concat(re,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(E||Ce[0]).toString(),onChange:this.changeSize,getPopupContainer:function(ge){return ge.parentNode}},Oe)}return N&&(H&&(Pe=typeof H=="boolean"?k.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:B,className:"".concat(re,"-quick-jumper-button")},g.jump_to_confirm):k.a.createElement("span",{onClick:this.go,onKeyUp:this.go},H)),xe=k.a.createElement("div",{className:"".concat(re,"-quick-jumper")},g.jump_to,k.a.createElement("input",{disabled:B,type:"text",value:Y,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),g.page,Pe)),k.a.createElement("li",{className:"".concat(re)},he,xe)}}]),b}(k.a.Component);l.defaultProps={pageSizeOptions:["10","20","50","100"]};var r=l,i=z("N2Kk");function t(){}function c(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O}function h(O,R,b){return b}function A(O,R,b){var _=typeof O=="undefined"?R.pageSize:O;return Math.floor((b.total-1)/_)+1}var S=function(O){Object(M.a)(b,O);var R=Object($.a)(b);function b(_){var u;Object(ee.a)(this,b),u=R.call(this,_),u.getJumpPrevPage=function(){return Math.max(1,u.state.current-(u.props.showLessItems?3:5))},u.getJumpNextPage=function(){return Math.min(A(void 0,u.state,u.props),u.state.current+(u.props.showLessItems?3:5))},u.getItemIcon=function(F,N){var H=u.props.prefixCls,G=F||k.a.createElement("button",{type:"button","aria-label":N,className:"".concat(H,"-item-link")});return typeof F=="function"&&(G=k.a.createElement(F,Object(U.a)({},u.props))),G},u.savePaginationNode=function(F){u.paginationNode=F},u.isValid=function(F){return c(F)&&F!==u.state.current},u.shouldDisplayQuickJumper=function(){var F=u.props,N=F.showQuickJumper,H=F.pageSize,G=F.total;return G<=H?!1:N},u.handleKeyDown=function(F){(F.keyCode===o.ARROW_UP||F.keyCode===o.ARROW_DOWN)&&F.preventDefault()},u.handleKeyUp=function(F){var N=u.getValidValue(F),H=u.state.currentInputValue;N!==H&&u.setState({currentInputValue:N}),F.keyCode===o.ENTER?u.handleChange(N):F.keyCode===o.ARROW_UP?u.handleChange(N-1):F.keyCode===o.ARROW_DOWN&&u.handleChange(N+1)},u.changePageSize=function(F){var N=u.state.current,H=A(F,u.state,u.props);N=N>H?H:N,H===0&&(N=u.state.current),typeof F=="number"&&("pageSize"in u.props||u.setState({pageSize:F}),"current"in u.props||u.setState({current:N,currentInputValue:N})),u.props.onShowSizeChange(N,F),"onChange"in u.props&&u.props.onChange&&u.props.onChange(N,F)},u.handleChange=function(F){var N=u.props.disabled,H=F;if(u.isValid(H)&&!N){var G=A(void 0,u.state,u.props);H>G?H=G:H<1&&(H=1),"current"in u.props||u.setState({current:H,currentInputValue:H});var I=u.state.pageSize;return u.props.onChange(H,I),H}return u.state.current},u.prev=function(){u.hasPrev()&&u.handleChange(u.state.current-1)},u.next=function(){u.hasNext()&&u.handleChange(u.state.current+1)},u.jumpPrev=function(){u.handleChange(u.getJumpPrevPage())},u.jumpNext=function(){u.handleChange(u.getJumpNextPage())},u.hasPrev=function(){return u.state.current>1},u.hasNext=function(){return u.state.current<A(void 0,u.state,u.props)},u.runIfEnter=function(F,N){if(F.key==="Enter"||F.charCode===13){for(var H=arguments.length,G=new Array(H>2?H-2:0),I=2;I<H;I++)G[I-2]=arguments[I];N.apply(void 0,G)}},u.runIfEnterPrev=function(F){u.runIfEnter(F,u.prev)},u.runIfEnterNext=function(F){u.runIfEnter(F,u.next)},u.runIfEnterJumpPrev=function(F){u.runIfEnter(F,u.jumpPrev)},u.runIfEnterJumpNext=function(F){u.runIfEnter(F,u.jumpNext)},u.handleGoTO=function(F){(F.keyCode===o.ENTER||F.type==="click")&&u.handleChange(u.state.currentInputValue)};var d=_.onChange!==t,E="current"in _;E&&!d&&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=_.defaultCurrent;"current"in _&&(g=_.current);var y=_.defaultPageSize;return"pageSize"in _&&(y=_.pageSize),g=Math.min(g,A(y,void 0,_)),u.state={current:g,currentInputValue:g,pageSize:y},u}return Object(W.a)(b,[{key:"componentDidUpdate",value:function(u,d){var E=this.props.prefixCls;if(d.current!==this.state.current&&this.paginationNode){var g=this.paginationNode.querySelector(".".concat(E,"-item-").concat(d.current));g&&document.activeElement===g&&g.blur()}}},{key:"getValidValue",value:function(u){var d=u.target.value,E=A(void 0,this.state,this.props),g=this.state.currentInputValue,y;return d===""?y=d:isNaN(Number(d))?y=g:d>=E?y=E:y=Number(d),y}},{key:"getShowSizeChanger",value:function(){var u=this.props,d=u.showSizeChanger,E=u.total,g=u.totalBoundaryShowSizeChanger;return typeof d!="undefined"?d:E>g}},{key:"renderPrev",value:function(u){var d=this.props,E=d.prevIcon,g=d.itemRender,y=g(u,"prev",this.getItemIcon(E,"prev page")),F=!this.hasPrev();return Object(X.isValidElement)(y)?Object(X.cloneElement)(y,{disabled:F}):y}},{key:"renderNext",value:function(u){var d=this.props,E=d.nextIcon,g=d.itemRender,y=g(u,"next",this.getItemIcon(E,"next page")),F=!this.hasNext();return Object(X.isValidElement)(y)?Object(X.cloneElement)(y,{disabled:F}):y}},{key:"render",value:function(){var u=this,d=this.props,E=d.prefixCls,g=d.className,y=d.style,F=d.disabled,N=d.hideOnSinglePage,H=d.total,G=d.locale,I=d.showQuickJumper,x=d.showLessItems,B=d.showTitle,Y=d.showTotal,re=d.simple,de=d.itemRender,he=d.showPrevNextJumpers,xe=d.jumpPrevIcon,Pe=d.jumpNextIcon,Ce=d.selectComponentClass,Oe=d.selectPrefixCls,be=d.pageSizeOptions,ge=this.state,te=ge.current,fe=ge.pageSize,_e=ge.currentInputValue;if(N===!0&&H<=fe)return null;var Le=A(void 0,this.state,this.props),$e=[],Ue=null,at=null,ft=null,Ct=null,yt=null,_t=I&&I.goButton,lt=x?1:2,Ft=te-1>0?te-1:0,Xt=te+1<Le?te+1:Le,Jt=Object.keys(this.props).reduce(function(me,ye){return(ye.substr(0,5)==="data-"||ye.substr(0,5)==="aria-"||ye==="role")&&(me[ye]=u.props[ye]),me},{});if(re)return _t&&(typeof _t=="boolean"?yt=k.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},G.jump_to_confirm):yt=k.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},_t),yt=k.a.createElement("li",{title:B?"".concat(G.jump_to).concat(te,"/").concat(Le):null,className:"".concat(E,"-simple-pager")},yt)),k.a.createElement("ul",Object(oe.a)({className:m()(E,"".concat(E,"-simple"),Object(Z.a)({},"".concat(E,"-disabled"),F),g),style:y,ref:this.savePaginationNode},Jt),k.a.createElement("li",{title:B?G.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:m()("".concat(E,"-prev"),Object(Z.a)({},"".concat(E,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Ft)),k.a.createElement("li",{title:B?"".concat(te,"/").concat(Le):null,className:"".concat(E,"-simple-pager")},k.a.createElement("input",{type:"text",value:_e,disabled:F,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),k.a.createElement("span",{className:"".concat(E,"-slash")},"/"),Le),k.a.createElement("li",{title:B?G.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:m()("".concat(E,"-next"),Object(Z.a)({},"".concat(E,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(Xt)),yt);if(Le<=3+lt*2){var rn={locale:G,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:B,itemRender:de};Le||$e.push(k.a.createElement(f,Object(oe.a)({},rn,{key:"noPager",page:Le,className:"".concat(E,"-disabled")})));for(var En=1;En<=Le;En+=1){var mn=te===En;$e.push(k.a.createElement(f,Object(oe.a)({},rn,{key:En,page:En,active:mn})))}}else{var Ye=x?G.prev_3:G.prev_5,Xe=x?G.next_3:G.next_5;he&&(Ue=k.a.createElement("li",{title:B?Ye:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:m()("".concat(E,"-jump-prev"),Object(Z.a)({},"".concat(E,"-jump-prev-custom-icon"),!!xe))},de(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(xe,"prev page"))),at=k.a.createElement("li",{title:B?Xe:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:m()("".concat(E,"-jump-next"),Object(Z.a)({},"".concat(E,"-jump-next-custom-icon"),!!Pe))},de(this.getJumpNextPage(),"jump-next",this.getItemIcon(Pe,"next page")))),Ct=k.a.createElement(f,{locale:G,last:!0,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Le,page:Le,active:!1,showTitle:B,itemRender:de}),ft=k.a.createElement(f,{locale:G,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:B,itemRender:de});var Ot=Math.max(1,te-lt),Et=Math.min(te+lt,Le);te-1<=lt&&(Et=1+lt*2),Le-te<=lt&&(Ot=Le-lt*2);for(var Je=Ot;Je<=Et;Je+=1){var mt=te===Je;$e.push(k.a.createElement(f,{locale:G,rootPrefixCls:E,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Je,page:Je,active:mt,showTitle:B,itemRender:de}))}te-1>=lt*2&&te!==1+2&&($e[0]=Object(X.cloneElement)($e[0],{className:"".concat(E,"-item-after-jump-prev")}),$e.unshift(Ue)),Le-te>=lt*2&&te!==Le-2&&($e[$e.length-1]=Object(X.cloneElement)($e[$e.length-1],{className:"".concat(E,"-item-before-jump-next")}),$e.push(at)),Ot!==1&&$e.unshift(ft),Et!==Le&&$e.push(Ct)}var Be=null;Y&&(Be=k.a.createElement("li",{className:"".concat(E,"-total-text")},Y(H,[H===0?0:(te-1)*fe+1,te*fe>H?H:te*fe])));var Ie=!this.hasPrev()||!Le,ke=!this.hasNext()||!Le;return k.a.createElement("ul",Object(oe.a)({className:m()(E,g,Object(Z.a)({},"".concat(E,"-disabled"),F)),style:y,unselectable:"unselectable",ref:this.savePaginationNode},Jt),Be,k.a.createElement("li",{title:B?G.prev_page:null,onClick:this.prev,tabIndex:Ie?null:0,onKeyPress:this.runIfEnterPrev,className:m()("".concat(E,"-prev"),Object(Z.a)({},"".concat(E,"-disabled"),Ie)),"aria-disabled":Ie},this.renderPrev(Ft)),$e,k.a.createElement("li",{title:B?G.next_page:null,onClick:this.next,tabIndex:ke?null:0,onKeyPress:this.runIfEnterNext,className:m()("".concat(E,"-next"),Object(Z.a)({},"".concat(E,"-disabled"),ke)),"aria-disabled":ke},this.renderNext(Xt)),k.a.createElement(r,{disabled:F,locale:G,rootPrefixCls:E,selectComponentClass:Ce,selectPrefixCls:Oe,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:te,pageSize:fe,pageSizeOptions:be,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:_t}))}}],[{key:"getDerivedStateFromProps",value:function(u,d){var E={};if("current"in u&&(E.current=u.current,u.current!==d.current&&(E.currentInputValue=E.current)),"pageSize"in u&&u.pageSize!==d.pageSize){var g=d.current,y=A(u.pageSize,d,u);g=g>y?y:g,"current"in u||(E.current=g,E.currentInputValue=g),E.pageSize=u.pageSize}return E}}]),b}(k.a.Component);S.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:i.a,style:{},itemRender:h,totalBoundaryShowSizeChanger:50};var w=S},"69hG":function(Wt,st,z){Wt.exports={customModal:"customModal___1AnAw",content:"content___1zYYV",upload:"upload___1W2G-"}},"6RRn":function(Wt,st,z){"use strict";var oe=z("wCXF"),Z=z("n6Qo");z.d(st,"b",function(){return Z.a});var U=z("IBYe"),ee=z("6eGT"),W=z("hW8S");z.d(st,"a",function(){return W.a}),st.c=oe.b},"6UM0":function(Wt,st,z){var oe,Z;(function(){var U;(function(){"use strict";var W=[function(k,D,m){var v=m(1).Beautifier,f=m(5).Options;function o(l,r){var i=new v(l,r);return i.beautify()}k.exports=o,k.exports.defaultOptions=function(){return new f}},function(k,D,m){var v=m(2).Output,f=m(3).Token,o=m(4),l=m(5).Options,r=m(7).Tokenizer,i=m(7).line_starters,t=m(7).positionable_operators,c=m(7).TOKEN;function h(x,B){return B.indexOf(x)!==-1}function A(x){return x.replace(/^\s+/g,"")}function S(x){for(var B={},Y=0;Y<x.length;Y++)B[x[Y].replace(/-/g,"_")]=x[Y];return B}function w(x,B){return x&&x.type===c.RESERVED&&x.text===B}function O(x,B){return x&&x.type===c.RESERVED&&h(x.text,B)}var R=["case","return","do","if","throw","else","await","break","continue","async"],b=["before-newline","after-newline","preserve-newline"],_=S(b),u=[_.before_newline,_.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(x,B){if(B.multiline_frame||B.mode===d.ForInitializer||B.mode===d.Conditional)return;x.remove_indent(B.start_line_index)}function g(x){x=x.replace(o.allLineBreaks,`
`);for(var B=[],Y=x.indexOf(`
`);Y!==-1;)B.push(x.substring(0,Y)),x=x.substring(Y+1),Y=x.indexOf(`
`);return x.length&&B.push(x),B}function y(x){return x===d.ArrayLiteral}function F(x){return h(x,[d.Expression,d.ForInitializer,d.Conditional])}function N(x,B){for(var Y=0;Y<x.length;Y++){var re=x[Y].trim();if(re.charAt(0)!==B)return!1}return!0}function H(x,B){for(var Y=0,re=x.length,de;Y<re;Y++)if(de=x[Y],de&&de.indexOf(B)!==0)return!1;return!0}function G(x,B){B=B||{},this._source_text=x||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new l(B)}G.prototype.create_flags=function(x,B){var Y=0;x&&(Y=x.indentation_level,!this._output.just_added_newline()&&x.line_indent_level>Y&&(Y=x.line_indent_level));var re={mode:B,parent:x,last_token:x?x.last_token:new f(c.START_BLOCK,""),last_word:x?x.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Y,alignment:0,line_indent_level:x?x.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return re},G.prototype._reset=function(x){var B=x.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new v(this._options,B),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var Y=new r(x,this._options);return this._tokens=Y.tokenize(),x},G.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x,B=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
`,B&&o.lineBreak.test(B||"")&&(Y=B.match(o.lineBreak)[0]));for(var re=this._tokens.next();re;)this.handle_token(re),this._last_last_text=this._flags.last_token.text,this._flags.last_token=re,re=this._tokens.next();return x=this._output.get_code(Y),x},G.prototype.handle_token=function(x,B){x.type===c.START_EXPR?this.handle_start_expr(x):x.type===c.END_EXPR?this.handle_end_expr(x):x.type===c.START_BLOCK?this.handle_start_block(x):x.type===c.END_BLOCK?this.handle_end_block(x):x.type===c.WORD?this.handle_word(x):x.type===c.RESERVED?this.handle_word(x):x.type===c.SEMICOLON?this.handle_semicolon(x):x.type===c.STRING?this.handle_string(x):x.type===c.EQUALS?this.handle_equals(x):x.type===c.OPERATOR?this.handle_operator(x):x.type===c.COMMA?this.handle_comma(x):x.type===c.BLOCK_COMMENT?this.handle_block_comment(x,B):x.type===c.COMMENT?this.handle_comment(x,B):x.type===c.DOT?this.handle_dot(x):x.type===c.EOF?this.handle_eof(x):x.type===c.UNKNOWN?this.handle_unknown(x,B):this.handle_unknown(x,B)},G.prototype.handle_whitespace_and_comments=function(x,B){var Y=x.newlines,re=this._options.keep_array_indentation&&y(this._flags.mode);if(x.comments_before)for(var de=x.comments_before.next();de;)this.handle_whitespace_and_comments(de,B),this.handle_token(de,B),de=x.comments_before.next();if(re)for(var he=0;he<Y;he+=1)this.print_newline(he>0,B);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,B);for(var xe=1;xe<Y;xe+=1)this.print_newline(!0,B)}};var I=["async","break","continue","return","throw","yield"];G.prototype.allow_wrap_or_preserved_newline=function(x,B){if(B=B===void 0?!1:B,this._output.just_added_newline())return;var Y=this._options.preserve_newlines&&x.newlines||B,re=h(this._flags.last_token.text,t)||h(x.text,t);if(re){var de=h(this._flags.last_token.text,t)&&h(this._options.operator_position,u)||h(x.text,t);Y=Y&&de}if(Y)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(O(this._flags.last_token,I))return;this._output.set_wrap_point()}},G.prototype.print_newline=function(x,B){if(!B&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==c.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Y=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&w(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(x)&&(this._flags.multiline_frame=!0)},G.prototype.print_token_line_indentation=function(x){this._output.just_added_newline()&&(this._options.keep_array_indentation&&x.newlines&&(x.text==="["||y(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(x.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},G.prototype.print_token=function(x){if(this._output.raw){this._output.add_raw_token(x);return}if(this._options.comma_first&&x.previous&&x.previous.type===c.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var B=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(B),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(x),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(x),this._output.non_breaking_space=!0,this._output.add_token(x.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},G.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.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))},G.prototype.set_mode=function(x){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,x),this._flags=this.create_flags(this._previous_flags,x),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},G.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===d.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},G.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},G.prototype.start_of_statement=function(x){var B=!1;return B=B||O(this._flags.last_token,["var","let","const"])&&x.type===c.WORD,B=B||w(this._flags.last_token,"do"),B=B||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&O(this._flags.last_token,I)&&!x.newlines,B=B||w(this._flags.last_token,"else")&&!(w(x,"if")&&!x.comments_before),B=B||this._flags.last_token.type===c.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),B=B||this._flags.last_token.type===c.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(x.text==="--"||x.text==="++")&&this._last_last_text!=="function"&&x.type!==c.WORD&&x.type!==c.RESERVED,B=B||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),B?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(x,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x,O(x,["do","for","if","while"])),!0):!1},G.prototype.handle_start_expr=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x);var B=d.Expression;if(x.text==="["){if(this._flags.last_token.type===c.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(x),this.set_mode(B),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}B=d.ArrayLiteral,y(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())),h(this._flags.last_token.type,[c.START_EXPR,c.END_EXPR,c.WORD,c.OPERATOR,c.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===c.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,B=d.ForInitializer):h(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,B=d.Conditional):h(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&x.whitespace_before===""?this._output.space_before_token=!1:(h(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x);else if(this._flags.last_token.type===c.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var re=this._tokens.peek(-4);O(Y,["async","function"])||Y.text==="*"&&O(re,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(re.text==="{"||re.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(x);(this._flags.last_token.type===c.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&h(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===c.START_BLOCK?this.print_newline():(this._flags.last_token.type===c.END_EXPR||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===c.COMMA)&&this.allow_wrap_or_preserved_newline(x,x.newlines),this.print_token(x),this.set_mode(B),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},G.prototype.handle_end_expr=function(x){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(x,x.text==="]"&&y(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===c.START_EXPR&&!this._options.space_in_empty_paren?(this._output.trim(),this._output.space_before_token=!1):this._output.space_before_token=!0),this.deindent(),this.print_token(x),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===d.Conditional&&(this._previous_flags.mode=d.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},G.prototype.handle_start_block=function(x){this.handle_whitespace_and_comments(x);var B=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===c.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):Y&&(h(Y.text,[":",","])&&h(B.type,[c.STRING,c.WORD,c.RESERVED])||h(B.text,["get","set","..."])&&h(Y.type,[c.WORD,c.RESERVED]))?h(this._last_last_text,["class","interface"])&&!h(Y.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===c.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):h(this._flags.last_token.type,[c.EQUALS,c.START_EXPR,c.COMMA,c.OPERATOR])||O(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(O(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var re=!B.comments_before&&B.text==="}",de=re&&this._flags.last_word==="function"&&this._flags.last_token.type===c.END_EXPR;if(this._options.brace_preserve_inline){var he=0,xe=null;this._flags.inline_frame=!0;do if(he+=1,xe=this._tokens.peek(he-1),xe.newlines){this._flags.inline_frame=!1;break}while(xe.type!==c.EOF&&!(xe.type===c.END_BLOCK&&xe.opened===x))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==c.OPERATOR&&(de||this._flags.last_token.type===c.EQUALS||O(this._flags.last_token,R)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(y(this._previous_flags.mode)&&(this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.COMMA)&&((this._flags.last_token.type===c.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(x),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==c.OPERATOR&&this._flags.last_token.type!==c.START_EXPR&&(this._flags.last_token.type===c.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(x),this.indent(),!re&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},G.prototype.handle_end_block=function(x){for(this.handle_whitespace_and_comments(x);this._flags.mode===d.Statement;)this.restore_mode();var B=this._flags.last_token.type===c.START_BLOCK;this._flags.inline_frame&&!B?this._output.space_before_token=!0:this._options.brace_style==="expand"?B||this.print_newline():B||(y(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(x)},G.prototype.handle_word=function(x){if(x.type===c.RESERVED){if(h(x.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)x.type=c.WORD;else if(x.text==="import"&&h(this._tokens.peek().text,["(","."]))x.type=c.WORD;else if(h(x.text,["as","from"])&&!this._flags.import_block)x.type=c.WORD;else if(this._flags.mode===d.ObjectLiteral){var B=this._tokens.peek();B.text===":"&&(x.type=c.WORD)}}if(this.start_of_statement(x)?O(this._flags.last_token,["var","let","const"])&&x.type===c.WORD&&(this._flags.declaration_statement=!0):x.newlines&&!F(this._flags.mode)&&(this._flags.last_token.type!==c.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==c.EQUALS&&(this._options.preserve_newlines||!O(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(x),this.print_newline()):this.handle_whitespace_and_comments(x),this._flags.do_block&&!this._flags.do_while)if(w(x,"while")){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&w(x,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&O(x,["case","default"])){this.print_newline(),!this._flags.case_block&&(this._flags.case_body||this._options.jslint_happy)&&this.deindent(),this._flags.case_body=!1,this.print_token(x),this._flags.in_case=!0;return}if((this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x)),w(x,"function")){(h(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(h(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===c.OPERATOR))&&(!this._output.just_added_blankline()&&!x.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD?O(this._flags.last_token,["get","set","new","export"])||O(this._flags.last_token,I)?this._output.space_before_token=!0:w(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===c.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(F(this._flags.mode)||y(this._flags.mode))||this.print_newline(),this.print_token(x),this._flags.last_word=x.text;return}var Y="NONE";if(this._flags.last_token.type===c.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":O(x,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&this._flags.mode===d.BlockStatement?Y="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&F(this._flags.mode)?Y="SPACE":this._flags.last_token.type===c.STRING?Y="NEWLINE":this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.last_token.text==="*"&&(h(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&h(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===c.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===c.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),O(x,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),O(x,["else","catch","finally"]))if((!(this._flags.last_token.type===c.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&x.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var re=this._output.current_line;re.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?O(this._flags.last_token,R)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&O(x,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==c.END_EXPR?(this._flags.last_token.type!==c.START_EXPR||!O(x,["var","let","const"]))&&this._flags.last_token.text!==":"&&(w(x,"if")&&w(x.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(x,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&y(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);x.previous&&(x.previous.type===c.WORD||x.previous.type===c.RESERVED)&&(this._output.space_before_token=!0),this.print_token(x),this._flags.last_word=x.text,x.type===c.RESERVED&&(x.text==="do"?this._flags.do_block=!0:x.text==="if"?this._flags.if_block=!0:x.text==="import"?this._flags.import_block=!0:this._flags.import_block&&w(x,"from")&&(this._flags.import_block=!1))},G.prototype.handle_semicolon=function(x){this.start_of_statement(x)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(x);for(var B=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&w(B,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(x)},G.prototype.handle_string=function(x){x.text.startsWith("`")&&x.newlines===0&&x.whitespace_before===""&&(x.previous.text===")"||this._flags.last_token.type===c.WORD)||(this.start_of_statement(x)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(x),this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR||this._flags.last_token.type===c.EQUALS||this._flags.last_token.type===c.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(x):x.text.startsWith("`")&&this._flags.last_token.type===c.END_EXPR&&(x.previous.text==="]"||x.previous.text===")")&&x.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(x)},G.prototype.handle_equals=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0},G.prototype.handle_comma=function(x){this.handle_whitespace_and_comments(x,!0),this.print_token(x),this._output.space_before_token=!0,this._flags.declaration_statement?(F(this._flags.parent.mode)&&(this._flags.declaration_assignment=!1),this._flags.declaration_assignment?(this._flags.declaration_assignment=!1,this.print_newline(!1,!0)):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)):this._flags.mode===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(x)},G.prototype.handle_operator=function(x){var B=x.text==="*"&&(O(this._flags.last_token,["function","yield"])||h(this._flags.last_token.type,[c.START_BLOCK,c.COMMA,c.END_BLOCK,c.SEMICOLON])),Y=h(x.text,["-","+"])&&(h(this._flags.last_token.type,[c.START_BLOCK,c.START_EXPR,c.EQUALS,c.OPERATOR])||h(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(x)){var re=!B;this.handle_whitespace_and_comments(x,re)}if(x.text==="*"&&this._flags.last_token.type===c.DOT){this.print_token(x);return}if(x.text==="::"){this.print_token(x);return}if(this._flags.last_token.type===c.OPERATOR&&h(this._options.operator_position,u)&&this.allow_wrap_or_preserved_newline(x),x.text===":"&&this._flags.in_case){this.print_token(x),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==c.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 de=!0,he=!0,xe=!1;if(x.text===":"?this._flags.ternary_depth===0?de=!1:(this._flags.ternary_depth-=1,xe=!0):x.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!B&&this._options.preserve_newlines&&h(x.text,t)){var Pe=x.text===":",Ce=Pe&&xe,Oe=Pe&&!xe;switch(this._options.operator_position){case _.before_newline:this._output.space_before_token=!Oe,this.print_token(x),(!Pe||Ce)&&this.allow_wrap_or_preserved_newline(x),this._output.space_before_token=!0;return;case _.after_newline:this._output.space_before_token=!0,!Pe||Ce?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(x):this._output.space_before_token=!1,this.print_token(x),this._output.space_before_token=!0;return;case _.preserve_newline:Oe||this.allow_wrap_or_preserved_newline(x),de=!(this._output.just_added_newline()||Oe),this._output.space_before_token=de,this.print_token(x),this._output.space_before_token=!0;return}}if(B){this.allow_wrap_or_preserved_newline(x),de=!1;var be=this._tokens.peek();he=be&&h(be.type,[c.WORD,c.RESERVED])}else if(x.text==="...")this.allow_wrap_or_preserved_newline(x),de=this._flags.last_token.type===c.START_BLOCK,he=!1;else if(h(x.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR)&&this.allow_wrap_or_preserved_newline(x),de=!1,he=!1,x.newlines&&(x.text==="--"||x.text==="++"||x.text==="~")){var ge=O(this._flags.last_token,R)&&x.newlines;ge&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ge,!0)}this._flags.last_token.text===";"&&F(this._flags.mode)&&(de=!0),this._flags.last_token.type===c.RESERVED?de=!0:this._flags.last_token.type===c.END_EXPR?de=!(this._flags.last_token.text==="]"&&(x.text==="--"||x.text==="++")):this._flags.last_token.type===c.OPERATOR&&(de=h(x.text,["--","-","++","+"])&&h(this._flags.last_token.text,["--","-","++","+"]),h(x.text,["+","-"])&&h(this._flags.last_token.text,["--","++"])&&(he=!0)),(this._flags.mode===d.BlockStatement&&!this._flags.inline_frame||this._flags.mode===d.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||de,this.print_token(x),this._output.space_before_token=he},G.prototype.handle_block_comment=function(x,B){if(this._output.raw){this._output.add_raw_token(x),x.directives&&x.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(x.directives){this.print_newline(!1,B),this.print_token(x),x.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!o.newline.test(x.text)&&!x.newlines){this._output.space_before_token=!0,this.print_token(x),this._output.space_before_token=!0;return}else this.print_block_commment(x,B)},G.prototype.print_block_commment=function(x,B){var Y=g(x.text),re,de=!1,he=!1,xe=x.whitespace_before,Pe=xe.length;if(this.print_newline(!1,B),this.print_token_line_indentation(x),this._output.add_token(Y[0]),this.print_newline(!1,B),Y.length>1){for(Y=Y.slice(1),de=N(Y,"*"),he=H(Y,xe),de&&(this._flags.alignment=1),re=0;re<Y.length;re++)de?(this.print_token_line_indentation(x),this._output.add_token(A(Y[re]))):he&&Y[re]?(this.print_token_line_indentation(x),this._output.add_token(Y[re].substring(Pe))):(this._output.current_line.set_indent(-1),this._output.add_token(Y[re])),this.print_newline(!1,B);this._flags.alignment=0}},G.prototype.handle_comment=function(x,B){x.newlines?this.print_newline(!1,B):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(x),this.print_newline(!1,B)},G.prototype.handle_dot=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),O(this._flags.last_token,R)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(x,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(x)},G.prototype.handle_unknown=function(x,B){this.print_token(x),x.text[x.text.length-1]===`
`&&this.print_newline(!1,B)},G.prototype.handle_eof=function(x){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x)},k.exports.Beautifier=G},function(k){function D(f){this.__parent=f,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=[]}D.prototype.clone_empty=function(){var f=new D(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},D.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},D.prototype.has_match=function(f){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(f))return!0;return!1},D.prototype.set_indent=function(f,o){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(f){this.__items.push(f);var o=f.lastIndexOf(`
`);o!==-1?this.__character_count=f.length-o:this.__character_count+=f.length},D.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function m(f,o){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),o=o||"",f.indent_level>0&&(o=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}m.prototype.get_indent_size=function(f,o){var l=this.__base_string_length;return o=o||0,f<0&&(l=0),l+=f*this.__indent_size,l+=o,l},m.prototype.get_indent_string=function(f,o){var l=this.__base_string;return o=o||0,f<0&&(f=0,l=""),o+=f*this.__indent_size,this.__ensure_cache(o),l+=this.__cache[o],l},m.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var f=this.__cache.length,o=0,l="";this.__indent_size&&f>=this.__indent_size&&(o=Math.floor(f/this.__indent_size),f-=o*this.__indent_size,l=new Array(o+1).join(this.__indent_string)),f&&(l+=new Array(f+1).join(" ")),this.__cache.push(l)};function v(f,o){this.__indent_cache=new m(f,o),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(f,o){return this.__indent_cache.get_indent_string(f,o)},v.prototype.get_indent_size=function(f,o){return this.__indent_cache.get_indent_size(f,o)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(f){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 l=this.__lines.join(`
`);return f!==`
`&&(l=l.replace(/[\n]/g,f)),l},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(f,o){return f=f||0,o=o||0,this.next_line.set_indent(f,o),this.__lines.length>1?(this.current_line.set_indent(f,o),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(f){for(var o=0;o<f.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(f.whitespace_before),this.current_line.push(f.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},v.prototype.add_token=function(f){this.__add_space_before_token(),this.current_line.push(f),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},v.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(" "))},v.prototype.remove_indent=function(f){for(var o=this.__lines.length;f<o;)this.__lines[f]._remove_indent(),f++;this.current_line._remove_wrap_indent()},v.prototype.trim=function(f){for(f=f===void 0?!1:f,this.current_line.trim();f&&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},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(f,o){for(var l=this.__lines.length-2;l>=0;){var r=this.__lines[l];if(r.is_empty())break;if(r.item(0).indexOf(f)!==0&&r.item(-1)!==o){this.__lines.splice(l+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},k.exports.Output=v},function(k){function D(m,v,f,o){this.type=m,this.text=v,this.comments_before=null,this.newlines=f||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}k.exports.Token=D},function(k,D){var m="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",v="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",o="\\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",l="(?:\\\\u[0-9a-fA-F]{4}|["+m+f+"])",r="(?:\\\\u[0-9a-fA-F]{4}|["+v+f+o+"])*";D.identifier=new RegExp(l+r,"g"),D.identifierStart=new RegExp(l),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+v+f+o+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(k,D,m){var v=m(6).Options,f=["before-newline","after-newline","preserve-newline"];function o(l){v.call(this,l,"js");var r=this.raw_options.brace_style||null;r==="expand-strict"?this.raw_options.brace_style="expand":r==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var t=0;t<i.length;t++)i[t]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=i[t];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",f),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}o.prototype=new v,k.exports.Options=o},function(k){function D(f,o){this.raw_options=m(f,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"])}D.prototype._get_array=function(f,o){var l=this.raw_options[f],r=o||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(r=l.concat()):typeof l=="string"&&(r=l.split(/[^a-zA-Z0-9_\/\-]+/)),r},D.prototype._get_boolean=function(f,o){var l=this.raw_options[f],r=l===void 0?!!o:!!l;return r},D.prototype._get_characters=function(f,o){var l=this.raw_options[f],r=o||"";return typeof l=="string"&&(r=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),r},D.prototype._get_number=function(f,o){var l=this.raw_options[f];o=parseInt(o,10),isNaN(o)&&(o=0);var r=parseInt(l,10);return isNaN(r)&&(r=o),r},D.prototype._get_selection=function(f,o,l){var r=this._get_selection_list(f,o,l);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values:
`+o+`
You passed in: '`+this.raw_options[f]+"'");return r[0]},D.prototype._get_selection_list=function(f,o,l){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[o[0]],!this._is_valid_selection(l,o))throw new Error("Invalid Default Value!");var r=this._get_array(f,l);if(!this._is_valid_selection(r,o))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values:
`+o+`
You passed in: '`+this.raw_options[f]+"'");return r},D.prototype._is_valid_selection=function(f,o){return f.length&&o.length&&!f.some(function(l){return o.indexOf(l)===-1})};function m(f,o){var l={};f=v(f);var r;for(r in f)r!==o&&(l[r]=f[r]);if(o&&f[o])for(r in f[o])l[r]=f[o][r];return l}function v(f){var o={},l;for(l in f){var r=l.replace(/-/g,"_");o[r]=f[l]}return o}k.exports.Options=D,k.exports.normalizeOpts=v,k.exports.mergeOpts=m},function(k,D,m){var v=m(8).InputScanner,f=m(9).Tokenizer,o=m(9).TOKEN,l=m(13).Directives,r=m(4),i=m(12).Pattern,t=m(14).TemplatablePattern;function c(N,H){return H.indexOf(N)!==-1}var h={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:o.START,RAW:o.RAW,EOF:o.EOF},A=new l(/\/\*/,/\*\//),S=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,w=/[0-9]/,O=/[^\d\.]/,R=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),b=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";b=b.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),b="\\?\\.(?!\\d) "+b,b=b.replace(/ /g,"|");var _=new RegExp(b),u="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=u.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+d.join("|")+")$"),g,y=function(N,H){f.call(this,N,H),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var G=new i(this._input),I=new t(this._input).read_options(this._options);this.__patterns={template:I,identifier:I.starting_with(r.identifier).matching(r.identifierMatch),number:G.matching(S),punct:G.matching(_),comment:G.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:G.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:G.matching(/<!--/),html_comment_end:G.matching(/-->/),include:G.starting_with(/#include/).until_after(r.lineBreak),shebang:G.starting_with(/#!/).until_after(r.lineBreak),xml:G.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:I.until(/['\\\n\r\u2028\u2029]/),double_quote:I.until(/["\\\n\r\u2028\u2029]/),template_text:I.until(/[`\\$]/),template_expression:I.until(/[`}\\]/)}};y.prototype=new f,y.prototype._is_comment=function(N){return N.type===h.COMMENT||N.type===h.BLOCK_COMMENT||N.type===h.UNKNOWN},y.prototype._is_opening=function(N){return N.type===h.START_BLOCK||N.type===h.START_EXPR},y.prototype._is_closing=function(N,H){return(N.type===h.END_BLOCK||N.type===h.END_EXPR)&&H&&(N.text==="]"&&H.text==="["||N.text===")"&&H.text==="("||N.text==="}"&&H.text==="{")},y.prototype._reset=function(){g=!1},y.prototype._get_next_token=function(N,H){var G=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(h.EOF,""):(G=G||this._read_non_javascript(I),G=G||this._read_string(I),G=G||this._read_word(N),G=G||this._read_singles(I),G=G||this._read_comment(I),G=G||this._read_regexp(I,N),G=G||this._read_xml(I,N),G=G||this._read_punctuation(),G=G||this._create_token(h.UNKNOWN,this._input.next()),G)},y.prototype._read_word=function(N){var H;if(H=this.__patterns.identifier.read(),H!=="")return H=H.replace(r.allLineBreaks,`
`),!(N.type===h.DOT||N.type===h.RESERVED&&(N.text==="set"||N.text==="get"))&&E.test(H)?(H==="in"||H==="of")&&(N.type===h.WORD||N.type===h.STRING)?this._create_token(h.OPERATOR,H):this._create_token(h.RESERVED,H):this._create_token(h.WORD,H);if(H=this.__patterns.number.read(),H!=="")return this._create_token(h.WORD,H)},y.prototype._read_singles=function(N){var H=null;return N==="("||N==="["?H=this._create_token(h.START_EXPR,N):N===")"||N==="]"?H=this._create_token(h.END_EXPR,N):N==="{"?H=this._create_token(h.START_BLOCK,N):N==="}"?H=this._create_token(h.END_BLOCK,N):N===";"?H=this._create_token(h.SEMICOLON,N):N==="."&&O.test(this._input.peek(1))?H=this._create_token(h.DOT,N):N===","&&(H=this._create_token(h.COMMA,N)),H&&this._input.next(),H},y.prototype._read_punctuation=function(){var N=this.__patterns.punct.read();if(N!=="")return N==="="?this._create_token(h.EQUALS,N):N==="?."?this._create_token(h.DOT,N):this._create_token(h.OPERATOR,N)},y.prototype._read_non_javascript=function(N){var H="";if(N==="#"){if(this._is_first_token()&&(H=this.__patterns.shebang.read(),H))return this._create_token(h.UNKNOWN,H.trim()+`
`);if(H=this.__patterns.include.read(),H)return this._create_token(h.UNKNOWN,H.trim()+`
`);N=this._input.next();var G="#";if(this._input.hasNext()&&this._input.testChar(w)){do N=this._input.next(),G+=N;while(this._input.hasNext()&&N!=="#"&&N!=="=");return N==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(G+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(G+="{}",this._input.next(),this._input.next())),this._create_token(h.WORD,G)}this._input.back()}else if(N==="<"&&this._is_first_token()){if(H=this.__patterns.html_comment_start.read(),H){for(;this._input.hasNext()&&!this._input.testChar(r.newline);)H+=this._input.next();return g=!0,this._create_token(h.COMMENT,H)}}else if(g&&N==="-"&&(H=this.__patterns.html_comment_end.read(),H))return g=!1,this._create_token(h.COMMENT,H);return null},y.prototype._read_comment=function(N){var H=null;if(N==="/"){var G="";if(this._input.peek(1)==="*"){G=this.__patterns.block_comment.read();var I=A.get_directives(G);I&&I.ignore==="start"&&(G+=A.readIgnored(this._input)),G=G.replace(r.allLineBreaks,`
`),H=this._create_token(h.BLOCK_COMMENT,G),H.directives=I}else this._input.peek(1)==="/"&&(G=this.__patterns.comment.read(),H=this._create_token(h.COMMENT,G))}return H},y.prototype._read_string=function(N){if(N==="`"||N==="'"||N==='"'){var H=this._input.next();return this.has_char_escapes=!1,N==="`"?H+=this._read_string_recursive("`",!0,"${"):H+=this._read_string_recursive(N),this.has_char_escapes&&this._options.unescape_strings&&(H=F(H)),this._input.peek()===N&&(H+=this._input.next()),H=H.replace(r.allLineBreaks,`
`),this._create_token(h.STRING,H)}return null},y.prototype._allow_regexp_or_xml=function(N){return N.type===h.RESERVED&&c(N.text,["return","case","throw","else","do","typeof","yield"])||N.type===h.END_EXPR&&N.text===")"&&N.opened.previous.type===h.RESERVED&&c(N.opened.previous.text,["if","while","for"])||c(N.type,[h.COMMENT,h.START_EXPR,h.START_BLOCK,h.START,h.END_BLOCK,h.OPERATOR,h.EQUALS,h.EOF,h.SEMICOLON,h.COMMA])},y.prototype._read_regexp=function(N,H){if(N==="/"&&this._allow_regexp_or_xml(H)){for(var G=this._input.next(),I=!1,x=!1;this._input.hasNext()&&(I||x||this._input.peek()!==N)&&!this._input.testChar(r.newline);)G+=this._input.peek(),I?I=!1:(I=this._input.peek()==="\\",this._input.peek()==="["?x=!0:this._input.peek()==="]"&&(x=!1)),this._input.next();return this._input.peek()===N&&(G+=this._input.next(),G+=this._input.read(r.identifier)),this._create_token(h.STRING,G)}return null},y.prototype._read_xml=function(N,H){if(this._options.e4x&&N==="<"&&this._allow_regexp_or_xml(H)){var G="",I=this.__patterns.xml.read_match();if(I){for(var x=I[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),B=x.indexOf("{")===0,Y=0;I;){var re=!!I[1],de=I[2],he=!!I[I.length-1]||de.slice(0,8)==="![CDATA[";if(!he&&(de===x||B&&de.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(re?--Y:++Y),G+=I[0],Y<=0)break;I=this.__patterns.xml.read_match()}return I||(G+=this._input.match(/[\s\S]*/g)[0]),G=G.replace(r.allLineBreaks,`
`),this._create_token(h.STRING,G)}}return null};function F(N){for(var H="",G=0,I=new v(N),x=null;I.hasNext();)if(x=I.match(/([\s]|[^\\]|\\\\)+/g),x&&(H+=x[0]),I.peek()==="\\"){if(I.next(),I.peek()==="x")x=I.match(/x([0-9A-Fa-f]{2})/g);else if(I.peek()==="u")x=I.match(/u([0-9A-Fa-f]{4})/g);else{H+="\\",I.hasNext()&&(H+=I.next());continue}if(!x)return N;if(G=parseInt(x[1],16),G>126&&G<=255&&x[0].indexOf("x")===0)return N;if(G>=0&&G<32){H+="\\"+x[0];continue}else G===34||G===39||G===92?H+="\\"+String.fromCharCode(G):H+=String.fromCharCode(G)}return H}y.prototype._read_string_recursive=function(N,H,G){var I,x;N==="'"?x=this.__patterns.single_quote:N==='"'?x=this.__patterns.double_quote:N==="`"?x=this.__patterns.template_text:N==="}"&&(x=this.__patterns.template_expression);for(var B=x.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===N||!H&&r.newline.test(Y)){this._input.back();break}else Y==="\\"&&this._input.hasNext()?(I=this._input.peek(),I==="x"||I==="u"?this.has_char_escapes=!0:I==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Y+=this._input.next()):G&&(G==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),G===Y&&(N==="`"?Y+=this._read_string_recursive("}",H,"`"):Y+=this._read_string_recursive("`",H,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=x.read(),B+=Y}return B},k.exports.Tokenizer=y,k.exports.TOKEN=h,k.exports.positionable_operators=R.slice(),k.exports.line_starters=u.slice()},function(k){var D=RegExp.prototype.hasOwnProperty("sticky");function m(v){this.__input=v||"",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 v=null;return this.hasNext()&&(v=this.__input.charAt(this.__position),this.__position+=1),v},m.prototype.peek=function(v){var f=null;return v=v||0,v+=this.__position,v>=0&&v<this.__input_length&&(f=this.__input.charAt(v)),f},m.prototype.__match=function(v,f){v.lastIndex=f;var o=v.exec(this.__input);return o&&!(D&&v.sticky)&&(o.index!==f&&(o=null)),o},m.prototype.test=function(v,f){return f=f||0,f+=this.__position,f>=0&&f<this.__input_length?!!this.__match(v,f):!1},m.prototype.testChar=function(v,f){var o=this.peek(f);return v.lastIndex=0,o!==null&&v.test(o)},m.prototype.match=function(v){var f=this.__match(v,this.__position);return f?this.__position+=f[0].length:f=null,f},m.prototype.read=function(v,f,o){var l="",r;return v&&(r=this.match(v),r&&(l+=r[0])),f&&(r||!v)&&(l+=this.readUntil(f,o)),l},m.prototype.readUntil=function(v,f){var o="",l=this.__position;v.lastIndex=this.__position;var r=v.exec(this.__input);return r?(l=r.index,f&&(l+=r[0].length)):l=this.__input_length,o=this.__input.substring(this.__position,l),this.__position=l,o},m.prototype.readUntilAfter=function(v){return this.readUntil(v,!0)},m.prototype.get_regexp=function(v,f){var o=null,l="g";return f&&D&&(l="y"),typeof v=="string"&&v!==""?o=new RegExp(v,l):v&&(o=new RegExp(v.source,l)),o},m.prototype.get_literal_regexp=function(v){return RegExp(v.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(v){var f=this.__position,o=this.readUntilAfter(v);return this.__position=f,o},m.prototype.lookBack=function(v){var f=this.__position-1;return f>=v.length&&this.__input.substring(f-v.length,f).toLowerCase()===v},k.exports.InputScanner=m},function(k,D,m){var v=m(8).InputScanner,f=m(3).Token,o=m(10).TokenStream,l=m(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,c){this._input=new v(t),this._options=c||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var t,c=new f(r.START,""),h=null,A=[],S=new o;c.type!==r.EOF;){for(t=this._get_next_token(c,h);this._is_comment(t);)S.add(t),t=this._get_next_token(c,h);S.isEmpty()||(t.comments_before=S,S=new o),t.parent=h,this._is_opening(t)?(A.push(h),h=t):h&&this._is_closing(t,h)&&(t.opened=h,h.closed=t,h=A.pop(),t.parent=h),t.previous=c,c.next=t,this.__tokens.add(t),c=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,c){this._readWhitespace();var h=this._input.read(/.+/g);return h?this._create_token(r.RAW,h):this._create_token(r.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,c){return!1},i.prototype._create_token=function(t,c){var h=new f(t,c,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return h},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},k.exports.Tokenizer=i,k.exports.TOKEN=r},function(k){function D(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}D.prototype.restart=function(){this.__position=0},D.prototype.isEmpty=function(){return this.__tokens_length===0},D.prototype.hasNext=function(){return this.__position<this.__tokens_length},D.prototype.next=function(){var m=null;return this.hasNext()&&(m=this.__tokens[this.__position],this.__position+=1),m},D.prototype.peek=function(m){var v=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(v=this.__tokens[m]),v},D.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},k.exports.TokenStream=D},function(k,D,m){var v=m(12).Pattern;function f(o,l){v.call(this,o,l),l?this._line_regexp=this._input.get_regexp(l._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}f.prototype=new v,f.prototype.__set_whitespace_patterns=function(o,l){o+="\\t ",l+="\\n\\r",this._match_pattern=this._input.get_regexp("["+o+l+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+l+"]")},f.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 l=this.__split(this._newline_regexp,o);this.newline_count=l.length-1,this.whitespace_before_token=l[this.newline_count]}return o},f.prototype.matching=function(o,l){var r=this._create();return r.__set_whitespace_patterns(o,l),r._update(),r},f.prototype._create=function(){return new f(this._input,this)},f.prototype.__split=function(o,l){o.lastIndex=0;for(var r=0,i=[],t=o.exec(l);t;)i.push(l.substring(r,t.index)),r=t.index+t[0].length,t=o.exec(l);return r<l.length?i.push(l.substring(r,l.length)):i.push(""),i},k.exports.WhitespacePattern=f},function(k){function D(m,v){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,v&&(this._starting_pattern=this._input.get_regexp(v._starting_pattern,!0),this._match_pattern=this._input.get_regexp(v._match_pattern,!0),this._until_pattern=this._input.get_regexp(v._until_pattern),this._until_after=v._until_after)}D.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},D.prototype.read_match=function(){return this._input.match(this._match_pattern)},D.prototype.until_after=function(m){var v=this._create();return v._until_after=!0,v._until_pattern=this._input.get_regexp(m),v._update(),v},D.prototype.until=function(m){var v=this._create();return v._until_after=!1,v._until_pattern=this._input.get_regexp(m),v._update(),v},D.prototype.starting_with=function(m){var v=this._create();return v._starting_pattern=this._input.get_regexp(m,!0),v._update(),v},D.prototype.matching=function(m){var v=this._create();return v._match_pattern=this._input.get_regexp(m,!0),v._update(),v},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},k.exports.Pattern=D},function(k){function D(m,v){m=typeof m=="string"?m:m.source,v=typeof v=="string"?v:v.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+v,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+v,"g")}D.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var v={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(m);f;)v[f[1]]=f[2],f=this.__directive_pattern.exec(m);return v},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=D},function(k,D,m){var v=m(12).Pattern,f={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function o(l,r){v.call(this,l,r),this.__template_pattern=null,this._disabled=Object.assign({},f),this._excluded=Object.assign({},f),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var i=new v(l);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 v,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(l){var r=this._create();return r._disabled[l]=!0,r._update(),r},o.prototype.read_options=function(l){var r=this._create();for(var i in f)r._disabled[i]=l.templating.indexOf(i)===-1;return r._update(),r},o.prototype.exclude=function(l){var r=this._create();return r._excluded[l]=!0,r._update(),r},o.prototype.read=function(){var l="";this._match_pattern?l=this._input.read(this._starting_pattern):l=this._input.read(this._starting_pattern,this.__template_pattern);for(var r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),l+=r,r=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},o.prototype.__set_templated_pattern=function(){var l=[];this._disabled.php||l.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||l.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||l.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(l.push(this.__patterns.django._starting_pattern.source),l.push(this.__patterns.django_value._starting_pattern.source),l.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||l.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&l.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+l.join("|")+")")},o.prototype._read_template=function(){var l="",r=this._input.peek();if(r==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(l=l||this.__patterns.erb.read())}else r==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(l=l||this.__patterns.handlebars_comment.read(),l=l||this.__patterns.handlebars_unescaped.read(),l=l||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(l=l||this.__patterns.django_value.read()),this._excluded.django||(l=l||this.__patterns.django_comment.read(),l=l||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(l=l||this.__patterns.smarty_comment.read(),l=l||this.__patterns.smarty_literal.read(),l=l||this.__patterns.smarty.read()));return l},k.exports.TemplatablePattern=o}],M={};function $(k){var D=M[k];if(D!==void 0)return D.exports;var m=M[k]={exports:{}};return W[k](m,m.exports,$),m.exports}var X=$(0);U=X})();var ee=U;!(oe=[],Z=function(){return{js_beautify:ee}}.apply(st,oe),Z!==void 0&&(Wt.exports=Z))})()},"6eGT":function(Wt,st,z){"use strict";function oe(Z){return null}st.a=oe},"7Cbv":function(Wt,st,z){"use strict";var oe=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Z=new Uint8Array(16);function U(){if(!oe)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return oe(Z)}var ee=/^(?:[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 W(f){return typeof f=="string"&&ee.test(f)}for(var M=W,$=[],X=0;X<256;++X)$.push((X+256).toString(16).substr(1));function k(f){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=($[f[o+0]]+$[f[o+1]]+$[f[o+2]]+$[f[o+3]]+"-"+$[f[o+4]]+$[f[o+5]]+"-"+$[f[o+6]]+$[f[o+7]]+"-"+$[f[o+8]]+$[f[o+9]]+"-"+$[f[o+10]]+$[f[o+11]]+$[f[o+12]]+$[f[o+13]]+$[f[o+14]]+$[f[o+15]]).toLowerCase();if(!M(l))throw TypeError("Stringified UUID is invalid");return l}var D=k;function m(f,o,l){f=f||{};var r=f.random||(f.rng||U)();if(r[6]=r[6]&15|64,r[8]=r[8]&63|128,o){l=l||0;for(var i=0;i<16;++i)o[l+i]=r[i];return o}return D(r)}var v=st.a=m},"7ahc":function(Wt,st,z){"use strict";z.d(st,"a",function(){return A});var oe=z("k1fw"),Z=z("0Owb"),U=z("+L6B"),ee=z("2/Rp"),W=z("y8nQ"),M=z("Vl3Y"),$=z("tJVT"),X=z("OaEy"),k=z("2fM7"),D=z("q1tI"),m=z.n(D),v=z("VrN/"),f=z.n(v),o=z("p77/"),l=z.n(o),r=z("c5Ni"),i=z.n(r),t=k.a.Option,c={labelCol:{span:4},wrapperCol:{span:20}},h={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"]};st.b=function(S){var w=S.callback,O=S.onCancel,R=Object(D.useState)("python"),b=Object($.a)(R,2),_=b[0],u=b[1];function d(g){u(h[g][1])}function E(g){w(g)}return m.a.createElement(M.a,Object(Z.a)({},c,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:E}),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},m.a.createElement(k.a,{onChange:d},Object.keys(h).map(function(g){return m.a.createElement(t,{key:g,value:g},h[g][0])}))),m.a.createElement(M.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},m.a.createElement(A,{mode:_})),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(ee.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(ee.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function A(S){var w=S.value,O=S.onChange,R=S.mode,b=S.options,_=b===void 0?{}:b,u=Object(D.useRef)(),d=Object(D.useState)(),E=Object($.a)(d,2),g=E[0],y=E[1];return Object(D.useEffect)(function(){if(g){function F(N){var H=N.getValue();O&&O(H)}return g.on("change",F),function(){g.off("change",F)}}},[g,O]),Object(D.useEffect)(function(){g&&g.setOption("mode",R)},[g,R]),Object(D.useEffect)(function(){g&&((w!==g.getValue()||w==="")&&setTimeout(function(){g.setValue(w||" ")},300))},[g,w]),Object(D.useEffect)(function(){if(u.current&&!g){var F=f.a.fromTextArea(u.current,Object(oe.a)({mode:R,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_));y(F)}},[u.current,g]),m.a.createElement("div",{className:"my-codemirror-container"},m.a.createElement("textarea",{ref:u}))}},"7qnI":function(Wt,st,z){"use strict";var oe=z("5Dmo"),Z=z("3S7+"),U=z("fWQN"),ee=z("mtLc"),W=z("yKVA"),M=z("879j"),$=z("5NDa"),X=z("5rEg"),k=z("q1tI"),D=z.n(k),m=z("O2Wb"),v=z.n(m),f=X.a.TextArea,o=function(l){Object(W.a)(i,l);var r=Object(M.a)(i);function i(){return Object(U.a)(this,i),r.apply(this,arguments)}return Object(ee.a)(i,[{key:"render",value:function(){var c=this,h=this.props,A=h.index,S=h.onAnswerChange,w=h.addChildAnswer,O=h.exerciseIsPublish,R=h.answers,b=h.activeOptionErrorIndex,_=h.flex,u=_===void 0?"0 0 1000px":_;return D.a.createElement("div",{className:v.a.flex},D.a.createElement("div",{className:"".concat(v.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",A+1,"):"),D.a.createElement("div",{className:"".concat(v.a.flex," ").concat(v.a.flex1),style:{flexDirection:"column"}},R.map(function(d,E){var g="".concat(A,"-").concat(E);return D.a.createElement("div",{className:"".concat(v.a.flex," ").concat(v.a.flex1),key:E},D.a.createElement("div",{className:v.a.flex1,style:{flex:u}},D.a.createElement("div",null,D.a.createElement(f,{className:g===b?v.a.error:"",spellCheck:!1,rows:4,value:d||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(E==0?"":"(\u53EF\u9009)"),onChange:function(F){return S(A,E,F.target.value)},style:{minHeight:95}}))),!O&&D.a.createElement(D.a.Fragment,null,E!=0&&D.a.createElement(Z.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(v.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return c.props.deleteChildAnswer(A,E)},style:{float:"right"}})),E===0&&D.a.createElement(Z.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(v.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return c.props.deleteChildAnswermain(A,E)},style:{float:"right"}})),D.a.createElement(Z.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},D.a.createElement("i",{className:"".concat(v.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return w(A)},style:{float:"right",visibility:E==R.length-1?"":"hidden"}}))))})))}}]),i}(k.Component);st.a=o},"815F":function(Wt,st,z){"use strict";z.d(st,"e",function(){return $}),z.d(st,"c",function(){return k}),z.d(st,"d",function(){return D}),z.d(st,"a",function(){return v}),z.d(st,"f",function(){return f}),z.d(st,"b",function(){return o});var oe=z("KQm4"),Z=z("VTBJ"),U=z("Ff2n"),ee=z("Zm9Q"),W=z("Kwbf"),M=z("OZM5");function $(l,r){return l!=null?l:r}function X(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=new Map;function i(t){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(h){var A=h.key,S=h.children;Object(W.a)(A!=null,"Tree node must have a certain key: [".concat(c).concat(A,"]"));var w=String(A);Object(W.a)(!r.has(w)||A===null||A===void 0,"Same 'key' exist in the Tree: ".concat(w)),r.set(w,!0),i(S,"".concat(c).concat(w," > "))})}i(l)}function k(l){function r(i){var t=Object(ee.a)(i);return t.map(function(c){if(!Object(M.i)(c))return Object(W.a)(!c,"Tree/TreeNode can only accept TreeNode as children."),null;var h=c.key,A=c.props,S=A.children,w=Object(U.a)(A,["children"]),O=Object(Z.a)({key:h},w),R=r(S);return R.length&&(O.children=R),O}).filter(function(c){return c})}return r(l)}function D(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(r===!0?[]:r),t=[];function c(h){var A=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return h.map(function(S,w){var O=Object(M.h)(A?A.pos:"0",w),R=$(S.key,O),b=Object(Z.a)(Object(Z.a)({},S),{},{parent:A,pos:O,children:null,data:S,isStart:[].concat(Object(oe.a)(A?A.isStart:[]),[w===0]),isEnd:[].concat(Object(oe.a)(A?A.isEnd:[]),[w===h.length-1])});return t.push(b),r===!0||i.has(R)?b.children=c(S.children||[],b):b.children=[],b})}return c(l),t}function m(l,r,i){var t;i?typeof i=="string"?t=function(A){return A[i]}:typeof i=="function"&&(t=function(A){return i(A)}):t=function(A,S){return $(A.key,S)};function c(h,A,S){var w=h?h.children:l,O=h?Object(M.h)(S.pos,A):"0";if(h){var R=t(h,O),b={node:h,index:A,pos:O,key:R,parentPos:S.node?S.pos:null,level:S.level+1};r(b)}w&&w.forEach(function(_,u){c(_,u,{node:h,pos:O,level:S?S.level+1:-1})})}c(null)}function v(l){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.initWrapper,t=r.processEntity,c=r.onProcessFinished,h=arguments.length>2?arguments[2]:void 0,A={},S={},w={posEntities:A,keyEntities:S};return i&&(w=i(w)||w),m(l,function(O){var R=O.node,b=O.index,_=O.pos,u=O.key,d=O.parentPos,E=O.level,g={node:R,index:b,key:u,pos:_,level:E},y=$(u,_);A[_]=g,S[y]=g,g.parent=A[d],g.parent&&(g.parent.children=g.parent.children||[],g.parent.children.push(g)),t&&t(g,w)},h),c&&c(w),w}function f(l,r){var i=r.expandedKeys,t=r.selectedKeys,c=r.loadedKeys,h=r.loadingKeys,A=r.checkedKeys,S=r.halfCheckedKeys,w=r.dragOverNodeKey,O=r.dropPosition,R=r.keyEntities,b=R[l],_={eventKey:l,expanded:i.indexOf(l)!==-1,selected:t.indexOf(l)!==-1,loaded:c.indexOf(l)!==-1,loading:h.indexOf(l)!==-1,checked:A.indexOf(l)!==-1,halfChecked:S.indexOf(l)!==-1,pos:String(b?b.pos:""),dragOver:w===l&&O===0,dragOverGapTop:w===l&&O===-1,dragOverGapBottom:w===l&&O===1};return _}function o(l){var r=l.data,i=l.expanded,t=l.selected,c=l.checked,h=l.loaded,A=l.loading,S=l.halfChecked,w=l.dragOver,O=l.dragOverGapTop,R=l.dragOverGapBottom,b=l.pos,_=l.active,u=Object(Z.a)(Object(Z.a)({},r),{},{expanded:i,selected:t,checked:c,loaded:h,loading:A,halfChecked:S,dragOver:w,dragOverGapTop:O,dragOverGapBottom:R,pos:b,active:_});return"props"in u||Object.defineProperty(u,"props",{get:function(){return Object(W.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),l}}),u}},"8EBN":function(Wt,st,z){(function(oe){oe(z("VrN/"))})(function(oe){"use strict";oe.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Z=0;Z<oe.modeInfo.length;Z++){var U=oe.modeInfo[Z];U.mimes&&(U.mime=U.mimes[0])}oe.findModeByMIME=function(ee){ee=ee.toLowerCase();for(var W=0;W<oe.modeInfo.length;W++){var M=oe.modeInfo[W];if(M.mime==ee)return M;if(M.mimes){for(var $=0;$<M.mimes.length;$++)if(M.mimes[$]==ee)return M}}if(/\+xml$/.test(ee))return oe.findModeByMIME("application/xml");if(/\+json$/.test(ee))return oe.findModeByMIME("application/json")},oe.findModeByExtension=function(ee){ee=ee.toLowerCase();for(var W=0;W<oe.modeInfo.length;W++){var M=oe.modeInfo[W];if(M.ext){for(var $=0;$<M.ext.length;$++)if(M.ext[$]==ee)return M}}},oe.findModeByFileName=function(ee){for(var W=0;W<oe.modeInfo.length;W++){var M=oe.modeInfo[W];if(M.file&&M.file.test(ee))return M}var $=ee.lastIndexOf("."),X=$>-1&&ee.substring($+1,ee.length);if(X)return oe.findModeByExtension(X)},oe.findModeByName=function(ee){ee=ee.toLowerCase();for(var W=0;W<oe.modeInfo.length;W++){var M=oe.modeInfo[W];if(M.name.toLowerCase()==ee)return M;if(M.alias){for(var $=0;$<M.alias.length;$++)if(M.alias[$].toLowerCase()==ee)return M}}}})},"8hTe":function(Wt,st,z){Wt.exports={button:"button___1wy9m"}},"9Bee":function(Wt,st,z){"use strict";var oe=z("DYRE"),Z=z("zeV3"),U=z("+L6B"),ee=z("2/Rp"),W=z("k1fw"),M=z("9og8"),$=z("tJVT"),X=z("WmNS"),k=z.n(X),D=z("q1tI"),m=z.n(D),v=z("vg9a"),f=z("DlQD"),o=z.n(f),l=z("rUJ1");function r(q,C){var L=q.match(/^(\s+)(?:```)/);if(L===null)return C;var V=L[1];return C.split(`
`).map(function(ae){var Q=ae.match(/^\s+/);if(Q===null)return ae;var Ae=Object($.a)(Q,1),nt=Ae[0];return nt.length>=V.length?ae.slice(V.length):ae}).join(`
`)}var i=[],t=["<ul>"],c=new o.a.Renderer,h=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function A(){i.length=0,t=["<ul>"]}var S={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function w(q,C,L,V){if(C>=q.length||q[C].level<=L)return C;var ae=q[C];V.push("<li><a href='#"+ae.anchor+"'>"+ae.text+"</a>"),C++;var Q=[];return C=w(q,C,ae.level,Q),Q.length>0&&(V.push("<ul>"),Q.forEach(function(Ae){V.push(Ae)}),V.push("</ul>")),V.push("</li>"),C=w(q,C,L,V),C}function O(){return w(i,0,0,t),t.push("</ul>"),t.join("")}var R={heading:function(C){var L=h.exec(C);if(L)return{type:"heading",raw:L[0],depth:L[1].length,text:L[2]}},fences:function(C){var L=this.rules.block.fences.exec(C);if(L){var V=L[0],ae=r(V,L[3]||""),Q=L[2]?L[2].trim():L[2];if(["latex","katex","math"].indexOf(Q)>=0){var Ae=u(),nt=ae;ae=Ae,d[Ae]={type:"block",expression:nt}}return{type:"code",raw:V,lang:Q,text:ae}}}},b=/(?:\${2})([^\n`]+?)(?:\${2})/gi,_=0,u=function(){return"__special_katext_id_".concat(_++,"__")},d={};function E(){return d}function g(){_=0,d={}}function y(q){return q=q.replace(b,function(C,L){var V=u();return d[V]={type:"inline",expression:L},V}),q}var F=c.listitem;c.listitem=function(q){return F(y(q))};var N=c.paragraph;c.paragraph=function(q){return N(y(q))};var H=c.tablecell;c.tablecell=function(q,C){return H(y(q),C)},c.code=function(q,C,L){var V=(C||"").match(/\S*/)[0];return V?["latex","katex","math"].indexOf(V)>=0?"<p class='editormd-tex'>".concat(q,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(C,'">').concat(L?q:Object(l.escape)(q,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(L?q:Object(l.escape)(q,!0))+"</code></pre>"},c.heading=function(q,C,L){var V=this.options.headerPrefix+L.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:V,level:C,text:q}),"<h"+C+' id="'+V+'">'+q+"</h"+C+">"},o.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),o.a.use({tokenizer:R,renderer:c});var G=o.a,I=z("SJMd"),x=z("ulZh"),B=z.n(x),Y=z("m3rI"),re=z("Oy/b"),de=z("p5ED"),he=z("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(q,C){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,V){L.__proto__=V}||function(L,V){for(var ae in V)Object.prototype.hasOwnProperty.call(V,ae)&&(L[ae]=V[ae])})(q,C)};function Pe(q,C){function L(){this.constructor=q}xe(q,C),q.prototype=C===null?Object.create(C):(L.prototype=C.prototype,new L)}function Ce(q,C,L,V){return new(L||(L=Promise))(function(ae,Q){function Ae(Dt){try{xt(V.next(Dt))}catch(ot){Q(ot)}}function nt(Dt){try{xt(V.throw(Dt))}catch(ot){Q(ot)}}function xt(Dt){var ot;Dt.done?ae(Dt.value):(ot=Dt.value,ot instanceof L?ot:new L(function(vt){vt(ot)})).then(Ae,nt)}xt((V=V.apply(q,C||[])).next())})}function Oe(q,C){var L,V,ae,Q,Ae={label:0,sent:function(){if(1&ae[0])throw ae[1];return ae[1]},trys:[],ops:[]};return Q={next:nt(0),throw:nt(1),return:nt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function nt(xt){return function(Dt){return function(ot){if(L)throw new TypeError("Generator is already executing.");for(;Ae;)try{if(L=1,V&&(ae=2&ot[0]?V.return:ot[0]?V.throw||((ae=V.return)&&ae.call(V),0):V.next)&&!(ae=ae.call(V,ot[1])).done)return ae;switch(V=0,ae&&(ot=[2&ot[0],ae.value]),ot[0]){case 0:case 1:ae=ot;break;case 4:return Ae.label++,{value:ot[1],done:!1};case 5:Ae.label++,V=ot[1],ot=[0];continue;case 7:ot=Ae.ops.pop(),Ae.trys.pop();continue;default:if(!(ae=Ae.trys,(ae=ae.length>0&&ae[ae.length-1])||ot[0]!==6&&ot[0]!==2)){Ae=0;continue}if(ot[0]===3&&(!ae||ot[1]>ae[0]&&ot[1]<ae[3])){Ae.label=ot[1];break}if(ot[0]===6&&Ae.label<ae[1]){Ae.label=ae[1],ae=ot;break}if(ae&&Ae.label<ae[2]){Ae.label=ae[2],Ae.ops.push(ot);break}ae[2]&&Ae.ops.pop(),Ae.trys.pop();continue}ot=C.call(q,Ae)}catch(vt){ot=[6,vt],V=0}finally{L=ae=0}if(5&ot[0])throw ot[1];return{value:ot[0]?ot[1]:void 0,done:!0}}([xt,Dt])}}}function be(){for(var q=0,C=0,L=arguments.length;C<L;C++)q+=arguments[C].length;var V=Array(q),ae=0;for(C=0;C<L;C++)for(var Q=arguments[C],Ae=0,nt=Q.length;Ae<nt;Ae++,ae++)V[ae]=Q[Ae];return V}var ge=function(){function q(){}return q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},q.setAttributes=function(C,L){for(var V=0,ae=L;V<ae.length;V++){var Q=ae[V],Ae=Q[0],nt=Q[1];C.setAttribute(Ae,nt)}},q.createRect=function(C,L,V){var ae=document.createElementNS("http://www.w3.org/2000/svg","rect");return ae.setAttribute("width",C.toString()),ae.setAttribute("height",L.toString()),V&&q.setAttributes(ae,V),ae},q.createLine=function(C,L,V,ae,Q){var Ae=document.createElementNS("http://www.w3.org/2000/svg","line");return Ae.setAttribute("x1",C.toString()),Ae.setAttribute("y1",L.toString()),Ae.setAttribute("x2",V.toString()),Ae.setAttribute("y2",ae.toString()),Q&&q.setAttributes(Ae,Q),Ae},q.createPolygon=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",C),L&&q.setAttributes(V,L),V},q.createCircle=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(C/2).toString()),V.setAttribute("cy",(C/2).toString()),V.setAttribute("r",C.toString()),L&&q.setAttributes(V,L),V},q.createEllipse=function(C,L,V){var ae=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ae.setAttribute("cx",(C/2).toString()),ae.setAttribute("cy",(L/2).toString()),ae.setAttribute("rx",(C/2).toString()),ae.setAttribute("ry",(L/2).toString()),V&&q.setAttributes(ae,V),ae},q.createGroup=function(C){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return C&&q.setAttributes(L,C),L},q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},q.createMarker=function(C,L,V,ae,Q,Ae,nt){var xt=document.createElementNS("http://www.w3.org/2000/svg","marker");return q.setAttributes(xt,[["id",C],["orient",L],["markerWidth",V.toString()],["markerHeight",ae.toString()],["refX",Q.toString()],["refY",Ae.toString()]]),xt.appendChild(nt),xt},q.createText=function(C){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),C&&q.setAttributes(L,C),L},q.createTSpan=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=C,L&&q.setAttributes(V,L),V},q.createImage=function(C){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return C&&q.setAttributes(L,C),L},q.createPoint=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=C,V.y=L,V},q.createPath=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",C),L&&q.setAttributes(V,L),V},q}(),te=function(){function q(){}return q.addKey=function(C){q.key=C},Object.defineProperty(q,"isLicensed",{get:function(){return!!q.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(q.key)},enumerable:!1,configurable:!0}),q}(),fe=function(){function q(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return q.prototype.rasterize=function(C,L,V){var ae=this;return new Promise(function(Q){var Ae=V!==void 0?V:document.createElement("canvas");C===null&&(ae.markersOnly=!0,ae.naturalSize=!1);var nt=document.createElementNS("http://www.w3.org/2000/svg","svg");nt.setAttribute("xmlns","http://www.w3.org/2000/svg"),nt.setAttribute("width",L.width.baseVal.valueAsString),nt.setAttribute("height",L.height.baseVal.valueAsString),nt.setAttribute("viewBox","0 0 "+L.viewBox.baseVal.width.toString()+" "+L.viewBox.baseVal.height.toString()),nt.innerHTML=L.innerHTML,ae.naturalSize===!0?(nt.width.baseVal.value=C.naturalWidth,nt.height.baseVal.value=C.naturalHeight):ae.width!==void 0&&ae.height!==void 0&&(nt.width.baseVal.value=ae.width,nt.height.baseVal.value=ae.height),Ae.width=nt.width.baseVal.value,Ae.height=nt.height.baseVal.value;var xt=nt.outerHTML,Dt=Ae.getContext("2d");ae.markersOnly!==!0&&Dt.drawImage(C,0,0,Ae.width,Ae.height);var ot=window.URL,vt=new Image(Ae.width,Ae.height);vt.setAttribute("crossOrigin","anonymous");var Lt=new Blob([xt],{type:"image/svg+xml"}),wn=ot.createObjectURL(Lt);vt.onload=function(){Dt.drawImage(vt,0,0),ot.revokeObjectURL(wn);var Xn=Ae.toDataURL(ae.imageType,ae.imageQuality);Q(Xn)},vt.src=wn})},q}(),_e=function(){},Le=function(){function q(C){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+C+"_"}return Object.defineProperty(q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(q.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(q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),q.prototype.addClass=function(C){return this.styleSheet===void 0&&this.addStyleSheet(),C.name=""+this.classNamePrefix+C.localName,this.classes.push(C),this.styleSheet.sheet.insertRule("."+C.name+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length),C},q.prototype.addRule=function(C){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(C),this.styleSheet.sheet.insertRule(C.selector+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length)},q.prototype.addStyleSheet=function(){var C;this.styleSheet=document.createElement("style"),((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).appendChild(this.styleSheet),this.addRule(new $e("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new $e("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new $e("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Ue("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Ue("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},q.prototype.removeStyleSheet=function(){var C;this.styleSheet&&(((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},q}(),$e=function(q,C){this.selector=q,this.style=C},Ue=function(q,C){this.localName=q,this.style=C},at=function(){function q(C,L,V,ae,Q){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=C,this.displayMode=L,this.markerItems=V,this.uiStyleSettings=ae,this.styles=Q,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return q.prototype.show=function(C){var L=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=C,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var V=document.createElement("div");V.className=this.toolbarBlockStyleClass.name,V.style.whiteSpace="nowrap",this.uiContainer.appendChild(V),this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(V,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Q){var Ae=document.createElement("div");Ae.className=""+L.toolbarButtonStyleClass.name,Ae.setAttribute("data-type-name",Q.typeName),Ae.innerHTML=Q.icon,Ae.addEventListener("click",function(){L.markerToolbarButtonClicked(Ae,Q)}),L.buttons.push(Ae),L.markerButtons.push(Ae)}),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 ae=document.createElement("div");ae.className=this.toolbarBlockStyleClass.name,ae.style.whiteSpace="nowrap",ae.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(ae),this.addActionButton(ae,'<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(ae,'<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()},q.prototype.addButtonClickListener=function(C){this.buttonClickListeners.push(C)},q.prototype.removeButtonClickListener=function(C){this.buttonClickListeners.indexOf(C)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(C),1)},q.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},q.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var C=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var L=0;L<this.markerButtons.length;L++)L<C||L===C&&this.markerButtons.length-1===C?this.markerButtonBlock.appendChild(this.markerButtons[L]):(L===C&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[L]))}},q.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")},q.prototype.resetButtonStyles=function(){var C=this;this.buttons.forEach(function(L){L.className=L.className.replace(C.uiStyleSettings.toolbarButtonStyleColorsClassName?C.uiStyleSettings.toolbarButtonStyleColorsClassName:C.toolbarButtonStyleColorsClass.name,"").trim(),L.className=L.className.replace(C.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?C.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:C.toolbarActiveButtonStyleColorsClass.name,"").trim(),L.className+=" "+(C.uiStyleSettings.toolbarButtonStyleColorsClassName?C.uiStyleSettings.toolbarButtonStyleColorsClassName:C.toolbarButtonStyleColorsClass.name)})},q.prototype.addActionButton=function(C,L,V){var ae=this,Q=document.createElement("div");switch(Q.className=""+this.toolbarButtonStyleClass.name,Q.innerHTML=L,Q.setAttribute("data-action",V),Q.addEventListener("click",function(){ae.actionToolbarButtonClicked(Q,V)}),V){case"select":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Q.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Q.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Q.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Q.style.fill=this.uiStyleSettings.closeButtonColor}C.appendChild(Q),this.buttons.push(Q)},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ue("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 Ue("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ue("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Ue("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 Ue("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var C=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ue("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*C)+`px;
padding: `+C+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ue("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ue("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new $e("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new $e("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},q.prototype.markerToolbarButtonClicked=function(C,L){this.setActiveButton(C),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("marker",L)}),this.markerButtonOverflowBlock.style.display="none"},q.prototype.actionToolbarButtonClicked=function(C,L){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(V){return V("action",L)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},q.prototype.setActiveButton=function(C){this.resetButtonStyles(),C.className=C.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),C.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},q.prototype.setActiveMarkerButton=function(C){var L=this.markerButtons.find(function(V){return V.getAttribute("data-type-name")===C});L&&this.setActiveButton(L)},q.prototype.setCurrentMarker=function(C){var L=this;this.currentMarker=C,this.buttons.filter(function(V){return/delete|notes/.test(V.getAttribute("data-action"))}).forEach(function(V){L.currentMarker===void 0?(V.style.fillOpacity="0.4",V.style.pointerEvents="none"):(V.style.fillOpacity="1",V.style.pointerEvents="all")})},q}(),ft=function(){function q(C,L,V,ae){this.panels=[],this.panelButtons=[],this.markerjsContainer=C,this.displayMode=L,this.uiStyleSettings=V,this.styles=ae,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return q.prototype.addStyles=function(){var C;this.toolboxStyleClass=this.styles.addClass(new Ue("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 Ue("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var L=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Ue("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Ue("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Ue("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 Ue("toolbox-panel-row_colors",`
background-color: `+((C=this.uiStyleSettings.toolboxBackgroundColor)!==null&&C!==void 0?C:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Ue("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*L)+`px;
padding: `+L+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Ue("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Ue("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new $e("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new $e("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},q.prototype.show=function(C){var L;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=C,this.uiContainer.className=this.toolboxStyleClass.name+" "+((L=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},q.prototype.setPanelButtons=function(C){var L,V,ae=this;this.panels=C,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((L=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&L!==void 0?L:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((V=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&V!==void 0?V:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Q){var Ae;Q.uiStyleSettings=ae.uiStyleSettings;var nt=document.createElement("div");nt.className=ae.toolboxButtonStyleClass.name+" "+((Ae=ae.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Ae!==void 0?Ae:ae.toolboxButtonStyleColorsClass.name),nt.innerHTML=Q.icon,nt.title=Q.title,nt.addEventListener("click",function(){ae.panelButtonClick(Q)}),ae.panelButtons.push(nt),ae.buttonRow.appendChild(nt)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},q.prototype.panelButtonClick=function(C){var L=this,V=-1;if(C!==this.activePanel){V=this.panels.indexOf(C),this.panelRow.innerHTML="";var ae=C.getUi();ae.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(ae),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=C}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){L.displayMode==="inline"?L.panelRow.style.display="none":L.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Q,Ae){var nt,xt;Q.className=L.toolboxButtonStyleClass.name+" "+(Ae===V?""+((nt=L.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&nt!==void 0?nt:L.toolboxActiveButtonStyleColorsClass.name):""+((xt=L.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&xt!==void 0?xt:L.toolboxButtonStyleColorsClass.name))})},q}(),Ct=function(q,C){this.title=q,this.icon=C},yt=function(q){function C(L,V,ae,Q){var Ae=q.call(this,L,Q||'<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 Ae.colors=[],Ae.addTransparent=!1,Ae.colorBoxes=[],Ae.colors=V,Ae.currentColor=ae,Ae.setCurrentColor=Ae.setCurrentColor.bind(Ae),Ae.getColorBox=Ae.getColorBox.bind(Ae),Ae}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.whiteSpace="nowrap",this.colors.forEach(function(ae){var Q=L.getColorBox(ae);V.appendChild(Q),L.colorBoxes.push(Q)}),V},C.prototype.getColorBox=function(L){var V=this,ae=this.uiStyleSettings.toolbarHeight/4,Q=this.uiStyleSettings.toolbarHeight-ae,Ae=document.createElement("div");Ae.style.display="inline-block",Ae.style.boxSizing="content-box",Ae.style.width=Q-2+"px",Ae.style.height=Q-2+"px",Ae.style.padding="1px",Ae.style.marginRight="2px",Ae.style.marginBottom="2px",Ae.style.borderWidth="2px",Ae.style.borderStyle="solid",Ae.style.borderRadius=(Q+2)/2+"px",Ae.style.borderColor=L===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Ae.addEventListener("click",function(){V.setCurrentColor(L,Ae)});var nt=document.createElement("div");return nt.style.display="inline-block",nt.style.width=Q-2+"px",nt.style.height=Q-2+"px",nt.style.backgroundColor=L,nt.style.borderRadius=Q/2+"px",L==="transparent"&&(nt.style.fill=this.uiStyleSettings.toolboxAccentColor,nt.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>`),Ae.appendChild(nt),Ae},C.prototype.setCurrentColor=function(L,V){var ae=this;this.currentColor=L,this.colorBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(L)},C}(Ct),_t=function(){function q(C,L,V){this._state="new",this._isSelected=!1,this._container=C,this._overlayContainer=L,this.globalSettings=V,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(q.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),q.prototype.ownsTarget=function(C){return!1},Object.defineProperty(q.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),q.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},q.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},q.prototype.pointerDown=function(C,L){},q.prototype.dblClick=function(C,L){},q.prototype.manipulate=function(C){},q.prototype.pointerUp=function(C){this.stateChanged()},q.prototype.dispose=function(){},q.prototype.addMarkerVisualToContainer=function(C){this.container.childNodes.length>0?this.container.insertBefore(C,this.container.childNodes[0]):this.container.appendChild(C)},q.prototype.getState=function(){return{typeName:q.typeName,state:this.state,notes:this.notes}},q.prototype.restoreState=function(C){this._state=C.state,this.notes=C.notes},q.prototype.scale=function(C,L){},q.prototype.colorChanged=function(C){this.onColorChanged&&this.onColorChanged(C),this.stateChanged()},q.prototype.fillColorChanged=function(C){this.onFillColorChanged&&this.onFillColorChanged(C),this.stateChanged()},q.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var C=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),C.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(C)&&this.onStateChanged(this)}},q.typeName="MarkerBase",q}(),lt=function(){function q(){this.findGripByVisual=this.findGripByVisual.bind(this)}return q.prototype.findGripByVisual=function(C){return this.topLeft.ownsTarget(C)?this.topLeft:this.topCenter.ownsTarget(C)?this.topCenter:this.topRight.ownsTarget(C)?this.topRight:this.centerLeft.ownsTarget(C)?this.centerLeft:this.centerRight.ownsTarget(C)?this.centerRight:this.bottomLeft.ownsTarget(C)?this.bottomLeft:this.bottomCenter.ownsTarget(C)?this.bottomCenter:this.bottomRight.ownsTarget(C)?this.bottomRight:void 0},q}(),Ft=function(){function q(){this.GRIP_SIZE=10,this.visual=ge.createGroup(),this.visual.appendChild(ge.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(ge.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(C){return C===this.visual||C===this.visual.childNodes[0]||C===this.visual.childNodes[1]},q}(),Xt=function(){function q(){}return q.toITransformMatrix=function(C){return{a:C.a,b:C.b,c:C.c,d:C.d,e:C.e,f:C.f}},q.toSVGMatrix=function(C,L){return C.a=L.a,C.b=L.b,C.c=L.c,C.d=L.d,C.e=L.e,C.f=L.f,C},q}(),Jt=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.left=0,Q.top=0,Q.width=0,Q.height=0,Q.defaultSize={x:50,y:20},Q.offsetX=0,Q.offsetY=0,Q.rotationAngle=0,Q.CB_DISTANCE=10,Q._suppressMarkerCreateEvent=!1,Q.container.transform.baseVal.appendItem(ge.createTransform()),Q.setupControlBox(),Q}return Pe(C,q),Object.defineProperty(C.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(C.prototype,"visual",{get:function(){return this._visual},set:function(L){this._visual=L;var V=ge.createTransform();this._visual.transform.baseVal.appendItem(V)},enumerable:!1,configurable:!0}),C.prototype.ownsTarget=function(L){return!!q.prototype.ownsTarget.call(this,L)||!!(this.controlGrips.findGripByVisual(L)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(L))},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.left=L.x,this.top=L.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var ae=this.unrotatePoint(L);if(this.manipulationStartX=ae.x,this.manipulationStartY=ae.y,this.offsetX=ae.x-this.left,this.offsetY=ae.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(V),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(V)){this.activeGrip=this.rotatorGrip;var Q=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Q.x-this.width/2,this.top=Q.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Ae=this.container.transform.baseVal.getItem(0);Ae.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Ae,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},C.prototype.pointerUp=function(L){var V=this.state;q.prototype.pointerUp.call(this,L),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(L),this._state="select",V==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},C.prototype.moveVisual=function(L){this.visual.style.transform="translate("+L.x+"px, "+L.y+"px)"},C.prototype.manipulate=function(L){var V=this.unrotatePoint(L);this.state==="creating"?this.resize(L):this.state==="move"?(this.left=this.manipulationStartLeft+(V.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(V.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(V):this.state==="rotate"&&this.rotate(L)},C.prototype.resize=function(L){var V=this.manipulationStartLeft,ae=this.manipulationStartWidth,Q=this.manipulationStartTop,Ae=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:V=this.manipulationStartLeft+L.x-this.manipulationStartX,ae=this.manipulationStartWidth+this.manipulationStartLeft-V;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:ae=this.manipulationStartWidth+L.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Q=this.manipulationStartTop+L.y-this.manipulationStartY,Ae=this.manipulationStartHeight+this.manipulationStartTop-Q;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Ae=this.manipulationStartHeight+L.y-this.manipulationStartY}ae>=0?(this.left=V,this.width=ae):(this.left=V+ae,this.width=-ae),Ae>=0?(this.top=Q,this.height=Ae):(this.top=Q+Ae,this.height=-Ae),this.setSize()},C.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},C.prototype.rotate=function(L){if(Math.abs(L.x-this.centerX)>.1){var V=Math.sign(L.x-this.centerX);this.rotationAngle=180*Math.atan((L.y-this.centerY)/(L.x-this.centerX))/Math.PI+90*V,this.applyRotation()}},C.prototype.applyRotation=function(){var L=this.container.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(L,0)},C.prototype.rotatePoint=function(L){if(this.rotationAngle===0)return L;var V=this.container.getCTM(),ae=ge.createPoint(L.x,L.y);return{x:(ae=ae.matrixTransform(V)).x,y:ae.y}},C.prototype.unrotatePoint=function(L){if(this.rotationAngle===0)return L;var V=this.container.getCTM();V=V.inverse();var ae=ge.createPoint(L.x,L.y);return{x:(ae=ae.matrixTransform(V)).x,y:ae.y}},C.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},C.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},C.prototype.setupControlBox=function(){this.controlBox=ge.createGroup();var L=ge.createTransform();L.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(L),this.container.appendChild(this.controlBox),this.controlRect=ge.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=ge.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 lt,this.addControlGrips(),this.controlBox.style.display="none"},C.prototype.adjustControlBox=function(){var L=this.controlBox.transform.baseVal.getItem(0);L.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(L,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},C.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()},C.prototype.createGrip=function(){var L=new Ft;return L.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(L.visual),L},C.prototype.positionGrips=function(){var L=this.controlGrips.topLeft.GRIP_SIZE,V=-L/2,ae=V,Q=(this.width+this.CB_DISTANCE)/2-L/2,Ae=(this.height+this.CB_DISTANCE)/2-L/2,nt=this.height+this.CB_DISTANCE-L/2,xt=this.width+this.CB_DISTANCE-L/2;this.positionGrip(this.controlGrips.topLeft.visual,V,ae),this.positionGrip(this.controlGrips.topCenter.visual,Q,ae),this.positionGrip(this.controlGrips.topRight.visual,xt,ae),this.positionGrip(this.controlGrips.centerLeft.visual,V,Ae),this.positionGrip(this.controlGrips.centerRight.visual,xt,Ae),this.positionGrip(this.controlGrips.bottomLeft.visual,V,nt),this.positionGrip(this.controlGrips.bottomCenter.visual,Q,nt),this.positionGrip(this.controlGrips.bottomRight.visual,xt,nt),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Q,ae-3*this.CB_DISTANCE)},C.prototype.positionGrip=function(L,V,ae){var Q=L.transform.baseVal.getItem(0);Q.setTranslate(V,ae),L.transform.baseVal.replaceItem(Q,0)},C.prototype.hideControlBox=function(){this.controlBox.style.display="none"},C.prototype.showControlBox=function(){this.controlBox.style.display=""},C.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:Xt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:Xt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},q.prototype.getState.call(this))},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var V=L;this.left=V.left,this.top=V.top,this.width=V.width,this.height=V.height,this.rotationAngle=V.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(Xt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,V.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(Xt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,V.containerTransformMatrix))},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V);var ae=this.rotatePoint({x:this.left,y:this.top}),Q=this.unrotatePoint({x:ae.x*L,y:ae.y*V});this.left=Q.x,this.top=Q.y,this.width=this.width*L,this.height=this.height*V,this.adjustControlBox()},C}(_t),rn=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual)},C.prototype.createVisual=function(){this.visual=ge.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)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},C.prototype.manipulate=function(L){q.prototype.manipulate.call(this,L)},C.prototype.resize=function(L){q.prototype.resize.call(this,L),this.setSize()},C.prototype.setSize=function(){q.prototype.setSize.call(this),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},C.prototype.pointerUp=function(L){q.prototype.pointerUp.call(this,L),this.setSize()},C.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},C.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},C.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},C.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},C.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this))},C.prototype.restoreState=function(L){var V=L;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),q.prototype.restoreState.call(this,L),this.setSize()},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.setSize()},C.title="Rectangle marker",C}(Jt),En=function(q){function C(L,V,ae,Q){var Ae=q.call(this,L,Q||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Ae.widths=[],Ae.widthBoxes=[],Ae.widths=V,Ae.currentWidth=ae,Ae.setCurrentWidth=Ae.setCurrentWidth.bind(Ae),Ae}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.widths.forEach(function(ae){var Q=document.createElement("div");Q.style.display="flex",Q.style.flexGrow="2",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=ae===L.currentWidth?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentWidth(ae,Q)}),V.appendChild(Q);var Ae=document.createElement("div");Ae.innerText=ae.toString(),Ae.style.marginRight="5px",Q.appendChild(Ae);var nt=document.createElement("div");nt.style.minHeight="20px",nt.style.flexGrow="2",nt.style.display="flex",nt.style.alignItems="center";var xt=document.createElement("hr");xt.style.minWidth="20px",xt.style.border="0px",xt.style.borderTop=ae+"px solid "+L.uiStyleSettings.toolboxColor,xt.style.flexGrow="2",nt.appendChild(xt),Q.appendChild(nt),L.widthBoxes.push(Q)}),V},C.prototype.setCurrentWidth=function(L,V){var ae=this;this.currentWidth=L,this.widthBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},C}(Ct),mn=function(q){function C(L,V,ae,Q){var Ae=q.call(this,L,Q||'<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 Ae.styles=[],Ae.styleBoxes=[],Ae.styles=V,Ae.currentStyle=ae,Ae.setCurrentStyle=Ae.setCurrentStyle.bind(Ae),Ae}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",this.styles.forEach(function(ae){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/L.styles.length-5+"%",Q.style.borderColor=ae===L.currentStyle?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentStyle(ae,Q)}),V.appendChild(Q);var Ae=document.createElement("div");Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.overflow="hidden";var nt=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+L.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(ae!==""?'stroke-dasharray="'+ae+'"':"")+` />
</svg>`;Ae.innerHTML=nt,Q.appendChild(Ae),L.styleBoxes.push(Q)}),V},C.prototype.setCurrentStyle=function(L,V){var ae=this;this.currentStyle=L,this.styleBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},C}(Ct),Ye=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.strokeColor=ae.defaultColor,Q.strokeWidth=ae.defaultStrokeWidth,Q.strokeDasharray=ae.defaultStrokeDasharray,Q.strokePanel=new yt("Line color",ae.defaultColorSet,ae.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new En("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new mn("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Pe(C,q),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=C.typeName,L},C.typeName="FrameMarker",C.title="Frame marker",C.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',C}(rn),Xe=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},Ot=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.x1=0,Q.y1=0,Q.x2=0,Q.y2=0,Q.defaultLength=50,Q.manipulationStartX=0,Q.manipulationStartY=0,Q.manipulationStartX1=0,Q.manipulationStartY1=0,Q.manipulationStartX2=0,Q.manipulationStartY2=0,Q.setupControlBox(),Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!!q.prototype.ownsTarget.call(this,L)||!(!this.grip1.ownsTarget(L)&&!this.grip2.ownsTarget(L))},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.manipulationStartX=L.x,this.manipulationStartY=L.y,this.state==="new"&&(this.x1=L.x,this.y1=L.y,this.x2=L.x,this.y2=L.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(V)?this.activeGrip=this.grip1:this.grip2.ownsTarget(V)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},C.prototype.pointerUp=function(L){var V=this.state;q.prototype.pointerUp.call(this,L),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(L),this._state="select",V==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},C.prototype.adjustVisual=function(){},C.prototype.manipulate=function(L){this.state==="creating"?this.resize(L):this.state==="move"?(this.x1=this.manipulationStartX1+L.x-this.manipulationStartX,this.y1=this.manipulationStartY1+L.y-this.manipulationStartY,this.x2=this.manipulationStartX2+L.x-this.manipulationStartX,this.y2=this.manipulationStartY2+L.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(L)},C.prototype.resize=function(L){switch(this.activeGrip){case this.grip1:this.x1=L.x,this.y1=L.y;break;case this.grip2:case void 0:this.x2=L.x,this.y2=L.y}this.adjustVisual(),this.adjustControlBox()},C.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},C.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},C.prototype.setupControlBox=function(){this.controlBox=ge.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},C.prototype.adjustControlBox=function(){this.positionGrips()},C.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},C.prototype.createGrip=function(){var L=new Ft;return L.visual.transform.baseVal.appendItem(ge.createTransform()),this.controlBox.appendChild(L.visual),L},C.prototype.positionGrips=function(){var L=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-L/2,this.y1-L/2),this.positionGrip(this.grip2.visual,this.x2-L/2,this.y2-L/2)},C.prototype.positionGrip=function(L,V,ae){var Q=L.transform.baseVal.getItem(0);Q.setTranslate(V,ae),L.transform.baseVal.replaceItem(Q,0)},C.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},q.prototype.getState.call(this))},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var V=L;this.x1=V.x1,this.y1=V.y1,this.x2=V.x2,this.y2=V.y2},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.x1=this.x1*L,this.y1=this.y1*V,this.x2=this.x2*L,this.y2=this.y2*V,this.adjustVisual(),this.adjustControlBox()},C}(_t),Et=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.strokeColor=ae.defaultColor,Q.strokeWidth=ae.defaultStrokeWidth,Q.strokeDasharray=ae.defaultStrokeDasharray,Q.strokePanel=new yt("Line color",ae.defaultColorSet,ae.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new En("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new mn("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorLine&&L!==this.visibleLine)},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorLine=ge.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=ge.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)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},C.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()),ge.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},C.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},C.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},C.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var V=L;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.createVisual(),this.adjustVisual()},C.typeName="LineMarker",C.title="Line marker",C.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',C}(Ot),Je=function(q){function C(L,V,ae,Q){var Ae=q.call(this,L,Q||'<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 Ae.fonts=[],Ae.fontBoxes=[],Ae.fonts=V,Ae.currentFont=ae,Ae.setCurrentFont=Ae.setCurrentFont.bind(Ae),Ae}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.overflow="hidden",V.style.flexGrow="2",this.fonts.forEach(function(ae){var Q=document.createElement("div");Q.style.display="inline-block",Q.style.alignItems="center",Q.style.justifyContent="space-between",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.overflow="hidden",Q.style.maxWidth=100/L.fonts.length-5+"%",Q.style.borderColor=ae===L.currentFont?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentFont(ae,Q)}),V.appendChild(Q);var Ae=document.createElement("div");Ae.style.display="flex",Ae.style.minHeight="20px",Ae.style.flexGrow="2",Ae.style.fontFamily=ae,Ae.style.overflow="hidden";var nt=document.createElement("div");nt.style.whiteSpace="nowrap",nt.style.overflow="hidden",nt.style.textOverflow="ellipsis",nt.innerHTML="The quick brown fox jumps over the lazy dog",Ae.appendChild(nt),Q.appendChild(Ae),L.fontBoxes.push(Q)}),V},C.prototype.setCurrentFont=function(L,V){var ae=this;this.currentFont=L,this.fontBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},C}(Ct),mt=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.color="transparent",Q.padding=5,Q.DEFAULT_TEXT="your text here",Q.text=Q.DEFAULT_TEXT,Q.isMoved=!1,Q.color=ae.defaultColor,Q.fontFamily=ae.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setColor=Q.setColor.bind(Q),Q.setFont=Q.setFont.bind(Q),Q.renderText=Q.renderText.bind(Q),Q.sizeText=Q.sizeText.bind(Q),Q.textEditDivClicked=Q.textEditDivClicked.bind(Q),Q.showTextEditor=Q.showTextEditor.bind(Q),Q.setSize=Q.setSize.bind(Q),Q.positionTextEditor=Q.positionTextEditor.bind(Q),Q.colorPanel=new yt("Color",ae.defaultColorSet,ae.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.fontFamilyPanel=new Je("Font",ae.defaultFontFamilies,ae.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){if(q.prototype.ownsTarget.call(this,L)||L===this.visual||L===this.textElement||L===this.bgRectangle)return!0;var V=!1;return this.textElement.childNodes.forEach(function(ae){ae===L&&(V=!0)}),V},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.bgRectangle=ge.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=ge.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.textElement.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.isMoved=!1,this.pointerDownPoint=L,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},C.prototype.renderText=function(){var L=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(V){L.textElement.appendChild(ge.createTSpan(V.trim()===""?" ":V.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},C.prototype.getTextScale=function(){var L=this.textElement.getBBox(),V=1;if(L.width>0&&L.height>0){var ae=(1*this.width-this.width*this.padding*2/100)/L.width,Q=(1*this.height-this.height*this.padding*2/100)/L.height;V=Math.min(ae,Q)}return V},C.prototype.getTextPosition=function(L){var V=this.textElement.getBBox(),ae=0,Q=0;return V.width>0&&V.height>0&&(ae=(this.width-V.width*L)/2,Q=this.height/2-V.height*L/2),{x:ae,y:Q}},C.prototype.sizeText=function(){var L=this.textElement.getBBox(),V=this.getTextScale(),ae=this.getTextPosition(V);ae.y-=L.y*V,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+ae.x+"px, "+ae.y+"px) scale("+V+", "+V+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(ae.x,ae.y),this.textElement.transform.baseVal.getItem(1).setScale(V,V))},C.prototype.manipulate=function(L){q.prototype.manipulate.call(this,L),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(L.x-this.pointerDownPoint.x)>5||Math.abs(L.y-this.pointerDownPoint.y)>5)},C.prototype.resize=function(L){q.prototype.resize.call(this,L),this.isMoved=!0,this.setSize(),this.sizeText()},C.prototype.setSize=function(){q.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},C.prototype.pointerUp=function(L){var V=this.state;V==="creating"&&(this._suppressMarkerCreateEvent=!0),q.prototype.pointerUp.call(this,L),this.setSize(),(V==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},C.prototype.showTextEditor=function(){var L=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(V){V.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var V=Number.parseFloat(L.textEditor.style.fontSize);L.textEditor.clientWidth>=Number.parseInt(L.textEditor.style.maxWidth)&&V>.9;)V-=.1,L.textEditor.style.fontSize=Math.max(V,.9)+"em"}),this.textEditor.addEventListener("keyup",function(V){V.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(V){if(V.clipboardData){var ae=V.clipboardData.getData("text"),Q=window.getSelection();if(!Q.rangeCount)return!1;Q.deleteFromDocument(),Q.getRangeAt(0).insertNode(document.createTextNode(ae)),V.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){L.textEditDivClicked(L.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},C.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var L=this.getTextScale(),V=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),ae=this.textElement.getBBox(),Q={x:ae.width*L,y:ae.height*L};V.x-=Q.x/2,V.y-=Q.y/2,this.textEditor.style.top=V.y+"px",this.textEditor.style.left=V.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-V.x+"px",this.textEditor.style.fontSize=Math.max(16*L,12)+"px",this.textElement.style.display="none"}},C.prototype.textEditDivClicked=function(L){this.text=L.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},C.prototype.select=function(){q.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},C.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),q.prototype.deselect.call(this)},C.prototype.dblClick=function(L,V){q.prototype.dblClick.call(this,L,V),this.showTextEditor()},C.prototype.setColor=function(L){this.textElement&&ge.setAttributes(this.textElement,[["fill",L]]),this.color=L,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(L)},C.prototype.setFont=function(L){this.textElement&&ge.setAttributes(this.textElement,[["font-family",L]]),this.fontFamily=L,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},C.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},C.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){var V=L;this.color=V.color,this.fontFamily=V.fontFamily,this.padding=V.padding,this.text=V.text,this.createVisual(),q.prototype.restoreState.call(this,L),this.setSize()},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.setSize(),this.sizeText(),this.positionTextEditor()},C.typeName="TextMarker",C.title="Text marker",C.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>',C}(Jt),Be=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.color="transparent",Q.lineWidth=3,Q.drawing=!1,Q.pixelRatio=1,Q.color=ae.defaultColor,Q.lineWidth=ae.defaultStrokeWidth,Q.pixelRatio=ae.freehandPixelRatio,Q.setColor=Q.setColor.bind(Q),Q.addCanvas=Q.addCanvas.bind(Q),Q.finishCreation=Q.finishCreation.bind(Q),Q.setLineWidth=Q.setLineWidth.bind(Q),Q.colorPanel=new yt("Color",ae.defaultColorSet,ae.defaultColor),Q.colorPanel.onColorChanged=Q.setColor,Q.lineWidthPanel=new En("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),Q.lineWidthPanel.onWidthChanged=Q.setLineWidth,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.drawingImage)},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.drawingImage=ge.createImage(),this.visual.appendChild(this.drawingImage);var L=ge.createTransform();this.visual.transform.baseVal.appendItem(L),this.addMarkerVisualToContainer(this.visual)},C.prototype.pointerDown=function(L,V){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(L.x,L.y),this.drawing=!0):q.prototype.pointerDown.call(this,L,V)},C.prototype.manipulate=function(L){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(L.x,L.y),this.canvasContext.stroke()):q.prototype.manipulate.call(this,L)},C.prototype.resize=function(L){q.prototype.resize.call(this,L),ge.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},C.prototype.pointerUp=function(L){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):q.prototype.pointerUp.call(this,L)},C.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)},C.prototype.select=function(){this.state==="creating"&&this.finishCreation(),q.prototype.select.call(this)},C.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),q.prototype.deselect.call(this)},C.prototype.finishCreation=function(){for(var L=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),V=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],ae=V[0],Q=V[1],Ae=V[2],nt=V[3],xt=!1,Dt=0;Dt<this.canvasElement.height;Dt++)for(var ot=0;ot<this.canvasElement.width;ot++)L.data[Dt*this.canvasElement.width*4+4*ot+3]>0&&(xt=!0,Dt<Q&&(Q=Dt),ot<ae&&(ae=ot),Dt>nt&&(nt=Dt),ot>Ae&&(Ae=ot));if(xt){this.left=ae/this.pixelRatio,this.top=Q/this.pixelRatio,this.width=(Ae-ae)/this.pixelRatio,this.height=(nt-Q)/this.pixelRatio;var vt=document.createElement("canvas");vt.width=Ae-ae,vt.height=nt-Q,vt.getContext("2d").putImageData(this.canvasContext.getImageData(ae,Q,Ae-ae,nt-Q),0,0),this.drawingImgUrl=vt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},C.prototype.setDrawingImage=function(){ge.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),ge.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},C.prototype.setColor=function(L){this.color=L,this.colorChanged(L)},C.prototype.setLineWidth=function(L){this.lineWidth=L},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({drawingImgUrl:this.drawingImgUrl},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){this.createVisual(),q.prototype.restoreState.call(this,L),this.drawingImgUrl=L.drawingImgUrl,this.setDrawingImage()},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.setDrawingImage()},C.typeName="FreehandMarker",C.title="Freehand marker",C.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>',C}(Jt),Ie=function(q){function C(L,V,ae){var Q=q.call(this,L,ae||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Q.typeBoxes=[],Q.currentType=V,Q.setCurrentType=Q.setCurrentType.bind(Q),Q}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2";for(var ae=function(nt){var xt="both";switch(nt){case 0:xt="both";break;case 1:xt="start";break;case 2:xt="end";break;case 3:xt="none"}var Dt=document.createElement("div");if(Dt.style.display="flex",Dt.style.flexGrow="2",Dt.style.alignItems="center",Dt.style.justifyContent="space-between",Dt.style.padding="5px",Dt.style.borderWidth="2px",Dt.style.borderStyle="solid",Dt.style.borderColor=xt===Q.currentType?Q.uiStyleSettings.toolboxAccentColor:"transparent",Dt.addEventListener("click",function(){L.setCurrentType(xt,Dt)}),V.appendChild(Dt),xt==="both"||xt==="start"){var ot=document.createElement("div");ot.style.display="flex",ot.style.alignItems="center",ot.style.minHeight="20px",ot.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="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,ot.style.marginLeft="5px",Dt.appendChild(ot)}var vt=document.createElement("div");vt.style.display="flex",vt.style.alignItems="center",vt.style.minHeight="20px",vt.style.flexGrow="2";var Lt=document.createElement("hr");if(Lt.style.minWidth="20px",Lt.style.border="0px",Lt.style.borderTop="3px solid "+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee"),Lt.style.flexGrow="2",vt.appendChild(Lt),Dt.appendChild(vt),xt==="both"||xt==="end"){var wn=document.createElement("div");wn.style.display="flex",wn.style.alignItems="center",wn.style.minHeight="20px",wn.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="`+(Q.uiStyleSettings!==void 0?Q.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,wn.style.marginRight="5px",Dt.appendChild(wn)}Q.typeBoxes.push(Dt)},Q=this,Ae=0;Ae<4;Ae++)ae(Ae);return V},C.prototype.setCurrentType=function(L,V){var ae=this;this.currentType=L,this.typeBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings!==void 0?ae.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},C}(Ct),ke=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.arrowType="end",Q.arrowBaseHeight=10,Q.arrowBaseWidth=10,Q.getArrowPoints=Q.getArrowPoints.bind(Q),Q.setArrowType=Q.setArrowType.bind(Q),Q.arrowTypePanel=new Ie("Arrow type","end"),Q.arrowTypePanel.onArrowTypeChanged=Q.setArrowType,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.arrow1&&L!==this.arrow2)},C.prototype.getArrowPoints=function(L,V){var ae=this.arrowBaseWidth+2*this.strokeWidth,Q=this.arrowBaseHeight+2*this.strokeWidth;return L-ae/2+","+(V+Q/2)+" "+L+","+(V-Q/2)+" "+(L+ae/2)+","+(V+Q/2)},C.prototype.createTips=function(){this.arrow1=ge.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=ge.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(ge.createTransform()),this.visual.appendChild(this.arrow2)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="creating"&&this.createTips()},C.prototype.adjustVisual=function(){if(q.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",ge.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),ge.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.arrow1.transform.baseVal.getItem(0);V.setRotate(L,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(V,0);var ae=this.arrow2.transform.baseVal.getItem(0);ae.setRotate(L+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(ae,0)}},C.prototype.setArrowType=function(L){this.arrowType=L,this.adjustVisual(),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({arrowType:this.arrowType},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var V=L;this.arrowType=V.arrowType,this.createTips(),this.adjustVisual()},C.typeName="ArrowMarker",C.title="Arrow marker",C.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',C}(Et),me=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.fillColor=ae.defaultFillColor,Q.strokeWidth=0,Q.fillPanel=new yt("Color",ae.defaultColorSet,ae.defaultFillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q}return Pe(C,q),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=C.typeName,L},C.typeName="CoverMarker",C.title="Cover marker",C.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',C}(rn),ye=function(q){function C(L,V,ae,Q){var Ae=q.call(this,L,Q||'<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 Ae.opacities=[],Ae.opacityBoxes=[],Ae.opacities=V,Ae.currentOpacity=ae,Ae.setCurrentOpacity=Ae.setCurrentOpacity.bind(Ae),Ae}return Pe(C,q),C.prototype.getUi=function(){var L=this,V=document.createElement("div");return V.style.display="flex",V.style.overflow="hidden",V.style.flexGrow="2",V.style.justifyContent="space-between",this.opacities.forEach(function(ae){var Q=document.createElement("div");Q.style.display="flex",Q.style.alignItems="center",Q.style.justifyContent="center",Q.style.padding="5px",Q.style.borderWidth="2px",Q.style.borderStyle="solid",Q.style.borderColor=ae===L.currentOpacity?L.uiStyleSettings.toolboxAccentColor:"transparent",Q.addEventListener("click",function(){L.setCurrentOpacity(ae,Q)}),V.appendChild(Q);var Ae=document.createElement("div");Ae.innerText=100*ae+"%",Q.appendChild(Ae),L.opacityBoxes.push(Q)}),V},C.prototype.setCurrentOpacity=function(L,V){var ae=this;this.currentOpacity=L,this.opacityBoxes.forEach(function(Q){Q.style.borderColor=Q===V?ae.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},C}(Ct),Re=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.setOpacity=Q.setOpacity.bind(Q),Q.fillColor=ae.defaultHighlightColor,Q.strokeWidth=0,Q.opacity=ae.defaultHighlightOpacity,Q.fillPanel=new yt("Color",ae.defaultColorSet,Q.fillColor),Q.fillPanel.onColorChanged=Q.setFillColor,Q.opacityPanel=new ye("Opacity",ae.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Pe(C,q),C.prototype.setOpacity=function(L){this.opacity=L,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=C.typeName,L},C.typeName="HighlightMarker",C.title="Highlight marker",C.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>',C}(me),ce='<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>',Me=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.bgColor="transparent",Q.tipPosition={x:0,y:0},Q.tipBase1Position={x:0,y:0},Q.tipBase2Position={x:0,y:0},Q.tipMoving=!1,Q.color=ae.defaultStrokeColor,Q.bgColor=ae.defaultFillColor,Q.fontFamily=ae.defaultFontFamily,Q.defaultSize={x:100,y:30},Q.setBgColor=Q.setBgColor.bind(Q),Q.getTipPoints=Q.getTipPoints.bind(Q),Q.positionTip=Q.positionTip.bind(Q),Q.setTipPoints=Q.setTipPoints.bind(Q),Q.colorPanel=new yt("Text color",ae.defaultColorSet,Q.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>'),Q.colorPanel.onColorChanged=Q.setColor,Q.bgColorPanel=new yt("Fill color",ae.defaultColorSet,Q.bgColor,ce),Q.bgColorPanel.onColorChanged=Q.setBgColor,Q.fontFamilyPanel=new Je("Font",ae.defaultFontFamilies,ae.defaultFontFamily),Q.fontFamilyPanel.onFontChanged=Q.setFont,Q.tipGrip=new Ft,Q.tipGrip.visual.transform.baseVal.appendItem(ge.createTransform()),Q.controlBox.appendChild(Q.tipGrip.visual),Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return q.prototype.ownsTarget.call(this,L)||this.tipGrip.ownsTarget(L)||this.tip===L},C.prototype.createTip=function(){ge.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=ge.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},C.prototype.pointerDown=function(L,V){this.state==="new"&&q.prototype.pointerDown.call(this,L,V),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(V)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):q.prototype.pointerDown.call(this,L,V)},C.prototype.pointerUp=function(L){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,q.prototype.pointerUp.call(this,L);else{var V=this.state==="creating";q.prototype.pointerUp.call(this,L),this.setTipPoints(V),this.positionTip()}},C.prototype.manipulate=function(L){if(this.tipMoving){var V=this.unrotatePoint(L);this.tipPosition={x:V.x-this.manipulationStartLeft,y:V.y-this.manipulationStartTop},this.positionTip()}else q.prototype.manipulate.call(this,L)},C.prototype.setBgColor=function(L){this.bgRectangle&&this.tip&&(ge.setAttributes(this.bgRectangle,[["fill",L]]),ge.setAttributes(this.tip,[["fill",L]])),this.bgColor=L,this.fillColorChanged(L)},C.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},C.prototype.setTipPoints=function(L){L===void 0&&(L=!1);var V=Math.min(this.height/2,15),ae=this.height/5;L&&(this.tipPosition={x:V+ae/2,y:this.height+20});var Q=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(ae=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:0},this.tipBase2Position={x:V+ae,y:0}):(this.tipBase1Position={x:0,y:V},this.tipBase2Position={x:0,y:V+ae}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Q<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(ae=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-ae,y:0},this.tipBase2Position={x:this.width-V,y:0}):(this.tipBase1Position={x:this.width,y:V},this.tipBase2Position={x:this.width,y:V+ae}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Q<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(ae=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-V-ae,y:this.height},this.tipBase2Position={x:this.width-V,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-V-ae},this.tipBase2Position={x:this.width,y:this.height-V}):Q<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(ae=this.width/5,V=Math.min(this.width/2,15),this.tipBase1Position={x:V,y:this.height},this.tipBase2Position={x:V+ae,y:this.height}):(this.tipBase1Position={x:0,y:this.height-V},this.tipBase2Position={x:0,y:this.height-V-ae})},C.prototype.resize=function(L){q.prototype.resize.call(this,L),this.positionTip()},C.prototype.positionTip=function(){ge.setAttributes(this.tip,[["points",this.getTipPoints()]]);var L=this.tipGrip.visual.transform.baseVal.getItem(0);L.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(L,0)},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),C.prototype.select=function(){this.positionTip(),q.prototype.select.call(this)},C.prototype.getState=function(){var L=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){var V=L;this.bgColor=V.bgColor,this.tipPosition=V.tipPosition,q.prototype.restoreState.call(this,L),this.createTip(),this.setTipPoints()},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.tipPosition={x:this.tipPosition.x*L,y:this.tipPosition.y*V},this.positionTip()},C.typeName="CalloutMarker",C.title="Callout marker",C.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>',C}(mt),tt=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.fillColor="transparent",Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.opacity=1,Q.strokeColor=ae.defaultColor,Q.strokeWidth=ae.defaultStrokeWidth,Q.strokeDasharray=ae.defaultStrokeDasharray,Q.fillColor=ae.defaultFillColor,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setFillColor=Q.setFillColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.setOpacity=Q.setOpacity.bind(Q),Q.createVisual=Q.createVisual.bind(Q),Q.strokePanel=new yt("Line color",be(ae.defaultColorSet,["transparent"]),ae.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.fillPanel=new yt("Fill color",be(ae.defaultColorSet,["transparent"]),Q.fillColor,ce),Q.fillPanel.onColorChanged=Q.setFillColor,Q.strokeWidthPanel=new En("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new mn("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q.opacityPanel=new ye("Opacity",ae.defaultOpacitySteps,Q.opacity),Q.opacityPanel.onOpacityChanged=Q.setOpacity,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual)},C.prototype.createVisual=function(){this.visual=ge.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)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="new"&&(this.createVisual(),this.moveVisual(L),this._state="creating")},C.prototype.manipulate=function(L){q.prototype.manipulate.call(this,L)},C.prototype.resize=function(L){q.prototype.resize.call(this,L),this.setSize()},C.prototype.setSize=function(){q.prototype.setSize.call(this),ge.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},C.prototype.pointerUp=function(L){q.prototype.pointerUp.call(this,L),this.setSize()},C.prototype.setStrokeColor=function(L){this.strokeColor=L,this.visual&&ge.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(L),this.stateChanged()},C.prototype.setFillColor=function(L){this.fillColor=L,this.visual&&ge.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(L),this.stateChanged()},C.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.visual&&ge.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},C.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.visual&&ge.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},C.prototype.setOpacity=function(L){this.opacity=L,this.visual&&ge.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){var V=L;this.fillColor=V.fillColor,this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.opacity=V.opacity,this.createVisual(),q.prototype.restoreState.call(this,L),this.setSize()},C.prototype.scale=function(L,V){q.prototype.scale.call(this,L,V),this.setSize()},C.typeName="EllipseMarker",C.title="Ellipse marker",C.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>',C}(Jt),bt=function(q){function C(L,V,ae){return q.call(this,L,V,ae)||this}return Pe(C,q),Object.defineProperty(C.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.tip1&&L!==this.tip2)},C.prototype.createTips=function(){this.tip1=ge.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(ge.createTransform()),this.visual.appendChild(this.tip1),this.tip2=ge.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(ge.createTransform()),this.visual.appendChild(this.tip2)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.state==="creating"&&this.createTips()},C.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(ge.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()]]),ge.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 L=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),V=this.tip1.transform.baseVal.getItem(0);V.setRotate(L,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(V,0);var ae=this.tip2.transform.baseVal.getItem(0);ae.setRotate(L+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(ae,0)}},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L),this.createTips(),this.adjustVisual()},C.typeName="MeasurementMarker",C.title="Measurement marker",C.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>',C}(Et),Kt=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.strokePanel.colors=ae.defaultColorSet,Q.fillColor="transparent",Q}return Pe(C,q),Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=q.prototype.getState.call(this);return L.typeName=C.typeName,L},C.typeName="EllipseFrameMarker",C.title="Ellipse frame marker",C.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>',C}(tt),Gt=function(){function q(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),q.prototype.addUndoStep=function(C){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(C)||(this.undoStack.push(C),JSON.stringify(this.lastRedoStep)!==JSON.stringify(C)&&this.redoStack.splice(0,this.redoStack.length))},q.prototype.replaceLastUndoStep=function(C){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=C)},q.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},q.prototype.undo=function(){if(this.undoStack.length>1){var C=this.undoStack.pop();return C!==void 0&&this.redoStack.push(C),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},q.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},q}(),$t=function(q){function C(L,V,ae){var Q=q.call(this,L,V,ae)||this;return Q.strokeColor="transparent",Q.strokeWidth=0,Q.strokeDasharray="",Q.curveX=0,Q.curveY=0,Q.manipulationStartCurveX=0,Q.manipulationStartCurveY=0,Q.setStrokeColor=Q.setStrokeColor.bind(Q),Q.setStrokeWidth=Q.setStrokeWidth.bind(Q),Q.setStrokeDasharray=Q.setStrokeDasharray.bind(Q),Q.positionGrips=Q.positionGrips.bind(Q),Q.addControlGrips=Q.addControlGrips.bind(Q),Q.adjustVisual=Q.adjustVisual.bind(Q),Q.setupControlBox=Q.setupControlBox.bind(Q),Q.resize=Q.resize.bind(Q),Q.strokeColor=ae.defaultColor,Q.strokeWidth=ae.defaultStrokeWidth,Q.strokeDasharray=ae.defaultStrokeDasharray,Q.strokePanel=new yt("Line color",ae.defaultColorSet,ae.defaultColor),Q.strokePanel.onColorChanged=Q.setStrokeColor,Q.strokeWidthPanel=new En("Line width",ae.defaultStrokeWidths,ae.defaultStrokeWidth),Q.strokeWidthPanel.onWidthChanged=Q.setStrokeWidth,Q.strokeStylePanel=new mn("Line style",ae.defaultStrokeDasharrays,ae.defaultStrokeDasharray),Q.strokeStylePanel.onStyleChanged=Q.setStrokeDasharray,Q}return Pe(C,q),C.prototype.ownsTarget=function(L){return!(!q.prototype.ownsTarget.call(this,L)&&L!==this.visual&&L!==this.selectorCurve&&L!==this.visibleCurve&&!this.curveGrip.ownsTarget(L))},C.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},C.prototype.createVisual=function(){this.visual=ge.createGroup(),this.selectorCurve=ge.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=ge.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)},C.prototype.pointerDown=function(L,V){q.prototype.pointerDown.call(this,L,V),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=L.x,this.curveY=L.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(V)&&(this.activeGrip=this.curveGrip,this._state="resize")},C.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),ge.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),ge.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),ge.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},C.prototype.setupControlBox=function(){q.prototype.setupControlBox.call(this),this.curveControlLine1=ge.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=ge.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)},C.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,q.prototype.addControlGrips.call(this)},C.prototype.positionGrips=function(){q.prototype.positionGrips.call(this);var L=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-L/2,this.curveY-L/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},C.prototype.manipulate=function(L){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+L.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+L.y-this.manipulationStartY),q.prototype.manipulate.call(this,L)},C.prototype.resize=function(L){this.activeGrip===this.curveGrip&&(this.curveX=L.x,this.curveY=L.y),q.prototype.resize.call(this,L),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},C.prototype.setStrokeColor=function(L){this.strokeColor=L,this.adjustVisual(),this.colorChanged(L)},C.prototype.setStrokeWidth=function(L){this.strokeWidth=L,this.adjustVisual()},C.prototype.setStrokeDasharray=function(L){this.strokeDasharray=L,this.adjustVisual()},C.prototype.scale=function(L,V){this.curveX=this.curveX*L,this.curveY=this.curveY*V,q.prototype.scale.call(this,L,V)},Object.defineProperty(C.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),C.prototype.getState=function(){var L=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},q.prototype.getState.call(this));return L.typeName=C.typeName,L},C.prototype.restoreState=function(L){q.prototype.restoreState.call(this,L);var V=L;this.strokeColor=V.strokeColor,this.strokeWidth=V.strokeWidth,this.strokeDasharray=V.strokeDasharray,this.curveX=V.curveX,this.curveY=V.curveY,this.createVisual(),this.adjustVisual()},C.typeName="CurveMarker",C.title="Curve marker",C.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>',C}(Ot),ei=function(){function q(C,L){L===void 0&&(L=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=C,this.cancelable=L}return Object.defineProperty(q.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),q.prototype.preventDefault=function(){this._defaultPrevented=!0},q}(),gn=function(q){function C(L,V,ae){var Q=q.call(this,L,!1)||this;return Q.dataUrl=V,Q.state=ae,Q}return Pe(C,q),C}(ei),an=function(q){function C(L,V,ae){ae===void 0&&(ae=!1);var Q=q.call(this,L,ae)||this;return Q.marker=V,Q}return Pe(C,q),C}(ei),dn=function(){function q(){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 q.prototype.addEventListener=function(C,L){this[C].push(L)},q.prototype.removeEventListener=function(C,L){var V=this[C].indexOf(L);V>-1&&this[C].splice(V,1)},q}(),zn=function(){function q(C){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Xe,this._isOpen=!1,this.undoRedoManager=new Gt,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 dn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=q.instanceCounter++,this.styles=new Le(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=C,this.targetRoot=document.body,this.width=C.clientWidth,this.height=C.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(q.prototype,"ALL_MARKER_TYPES",{get:function(){return[Ye,Be,ke,mt,Kt,tt,Re,Me,bt,me,Et,$t]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Ye,Be,ke,mt,tt,Re,Me]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Ye,Be,ke,mt,Re]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(C){var L=this;this._availableMarkerTypes.splice(0),C.forEach(function(V){if(typeof V=="string"){var ae=L.ALL_MARKER_TYPES.find(function(Q){return Q.typeName===V});ae!==void 0&&L._availableMarkerTypes.push(ae)}else L._availableMarkerTypes.push(V)})},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(C){this._zoomLevel=C,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(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),te.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},q.prototype.show=function(){var C=this;this.styles.styleSheetRoot===void 0&&_e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=_e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(L){return L(new ei(C))})},q.prototype.render=function(){return Ce(this,void 0,void 0,function(){var C;return Oe(this,function(L){switch(L.label){case 0:return this.setCurrentMarker(),(C=new fe).naturalSize=this.renderAtNaturalSize,C.imageType=this.renderImageType,C.imageQuality=this.renderImageQuality,C.markersOnly=this.renderMarkersOnly,C.width=this.renderWidth,C.height=this.renderHeight,[4,C.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return L.sent(),[4,C.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,L.sent()]}})})},q.prototype.close=function(C){var L=this;if(C===void 0&&(C=!1),this.isOpen){var V=!1;C||this.eventListeners.beforeclose.forEach(function(ae){var Q=new ei(L,!0);ae(Q),Q.defaultPrevented&&(V=!0)}),V||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(ae){return ae(new ei(L))}),this.detachEvents(),this._isOpen=!1)}},q.prototype.addMarkersToToolbar=function(){for(var C,L=[],V=0;V<arguments.length;V++)L[V]=arguments[V];(C=this._availableMarkerTypes).push.apply(C,L)},q.prototype.addRenderEventListener=function(C){this.addEventListener("render",function(L){C(L.dataUrl,L.state)})},q.prototype.removeRenderEventListener=function(C){},q.prototype.addCloseEventListener=function(C){this.addEventListener("close",function(){C()})},q.prototype.removeCloseEventListener=function(C){},q.prototype.setupResizeObserver=function(){var C=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){C.resize(C.target.clientWidth,C.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return C.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},q.prototype.onPopupTargetResize=function(){var C=1*this.target.clientWidth/this.target.clientHeight,L=this.editorCanvas.clientWidth/C>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*C:this.editorCanvas.clientWidth,V=L<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/C;this.resize(L,V)},q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},q.prototype.resize=function(C,L){this._isResizing=!0;var V=C/this.imageWidth,ae=L/this.imageHeight;this.imageWidth=Math.round(C),this.imageHeight=Math.round(L),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(V,ae),this._isResizing=!1},q.prototype.scaleMarkers=function(C,L){var V,ae=this;this._currentMarker&&this._currentMarker instanceof mt?this._currentMarker.scale(C,L):(V=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Q){Q!==ae._currentMarker&&Q.scale(C,L)}),V!==void 0&&this.setCurrentMarker(V)},q.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"},q.prototype.setTopLeft=function(){var C=this.editingTarget.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=C.left-L.left,this.top=C.top-L.top},q.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)},q.prototype.addDefs=function(){for(var C,L=[],V=0;V<arguments.length;V++)L[V]=arguments[V];this.defs=ge.createDefs(),this.addDefsToImage(),(C=this.defs).append.apply(C,L)},q.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},q.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)},q.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},q.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},q.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)},q.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},q.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)},q.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 C=document.createElement("a");C.href="https://markerjs.com/",C.target="_blank",C.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>',C.title="Powered by marker.js",C.style.display="grid",C.style.alignItems="center",C.style.justifyItems="center",C.style.padding="3px",C.style.width="20px",C.style.height="20px",this.logoUI.appendChild(C),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},q.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")},q.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"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.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 C=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=C+"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 at(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 ft(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},q.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.removeMarker=function(C){this.markerImage.removeChild(C.container),this.markers.indexOf(C)>-1&&this.markers.splice(this.markers.indexOf(C),1),C.dispose()},q.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())},q.prototype.toolbarButtonClicked=function(C,L){if(C==="marker"&&L!==void 0)this.createNewMarker(L);else if(C==="action")switch(L){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},q.prototype.deleteSelectedMarker=function(){var C=this;if(this._currentMarker!==void 0){var L=!1;if(this.eventListeners.markerbeforedelete.forEach(function(ae){var Q=new an(C,C._currentMarker,!0);ae(Q),Q.defaultPrevented&&(L=!0)}),!L){var V=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(ae){return ae(new an(C,V))})}}},q.prototype.clear=function(){var C=this,L=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Ae){var nt=new an(C,void 0,!0);Ae(nt),nt.defaultPrevented&&(L=!0)}),!L)){this.setCurrentMarker();for(var V=function(Ae){var nt=ae.markers[Ae];ae.setCurrentMarker(ae.markers[Ae]),ae._currentMarker.dispose(),ae.markerImage.removeChild(ae._currentMarker.container),ae.markers.splice(ae.markers.indexOf(ae._currentMarker),1),ae.eventListeners.markerdelete.forEach(function(xt){return xt(new an(C,nt))})},ae=this,Q=this.markers.length-1;Q>=0;Q--)V(Q);this.addUndoStep()}},Object.defineProperty(q.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),q.prototype.showNotesEditor=function(){var C;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=(C=this._currentMarker.notes)!==null&&C!==void 0?C:"",this.overlayContainer.appendChild(this.notesArea))},q.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)},q.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},q.prototype.addUndoStep=function(){var C=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var L=this.getState(),V=this.undoRedoManager.getLastUndoStep();if(!V||V.width===L.width&&V.height===L.height){var ae=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(L),ae<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Q){return Q(new ei(C))})}else this.undoRedoManager.replaceLastUndoStep(L),this.eventListeners.statechange.forEach(function(Q){return Q(new ei(C))})}},q.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},q.prototype.undoStep=function(){var C=this,L=this.undoRedoManager.undo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new ei(C))}))},q.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},q.prototype.redoStep=function(){var C=this,L=this.undoRedoManager.redo();L!==void 0&&(this.restoreState(L),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(V){return V(new ei(C))}))},q.prototype.stepZoom=function(){var C=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=C<this.zoomSteps.length-1?this.zoomSteps[C+1]:this.zoomSteps[0]},q.prototype.panTo=function(C){this.contentDiv.scrollBy({left:this.prevPanPoint.x-C.x,top:this.prevPanPoint.y-C.y}),this.prevPanPoint=C},q.prototype.startRenderAndClose=function(){return Ce(this,void 0,void 0,function(){var C,L,V=this;return Oe(this,function(ae){switch(ae.label){case 0:return[4,this.render()];case 1:return C=ae.sent(),L=this.getState(),this.eventListeners.render.forEach(function(Q){return Q(new gn(V,C,L))}),this.close(!0),[2]}})})},q.prototype.getState=function(C){C===!0&&this.setCurrentMarker();var L={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(V){return L.markers.push(V.getState())}),L},q.prototype.restoreState=function(C){var L=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);C.markers.forEach(function(V){var ae=L._availableMarkerTypes.find(function(Ae){return Ae.typeName===V.typeName});if(ae!==void 0){var Q=L.addNewMarker(ae);Q.restoreState(V),L.markers.push(Q)}}),C.width&&C.height&&(C.width!==this.imageWidth||C.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/C.width,this.imageHeight/C.height),this.eventListeners.restorestate.forEach(function(V){return V(new ei(L))})},q.prototype.addNewMarker=function(C){var L=ge.createGroup();return this.markerImage.appendChild(L),new C(L,this.overlayContainer,this.settings)},q.prototype.createNewMarker=function(C){var L,V=this;(L=typeof C=="string"?this._availableMarkerTypes.find(function(ae){return ae.typeName===C}):C)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(L),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(L.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(ae){return ae(new an(V,V._currentMarker))}))},q.prototype.markerCreated=function(C){var L=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(C),this.setCurrentMarker(C),C instanceof Be&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Be):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(V){return V(new an(L,L._currentMarker))})},q.prototype.colorChanged=function(C){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=C,this.settings.defaultStrokeColor=C)},q.prototype.fillColorChanged=function(C){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=C)},q.prototype.markerStateChanged=function(C){var L=this;this.eventListeners.markerchange.forEach(function(V){return V(new an(L,C))})},q.prototype.setCurrentMarker=function(C){var L=this;this._currentMarker!==C&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(V){return V(new an(L,L._currentMarker))})),this._currentMarker=C,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(V){return V(new an(L,L._currentMarker))}))},q.prototype.onPointerDown=function(C){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||C.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var L=this.markers.find(function(V){return V.ownsTarget(C.target)});L!==void 0?(this.setCurrentMarker(L),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(C.clientX,C.clientY),C.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:C.clientX,y:C.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(C.clientX,C.clientY))},q.prototype.onDblClick=function(C){if(this._isFocused||this.focus(),this.mode==="select"){var L=this.markers.find(function(V){return V.ownsTarget(C.target)});L!==void 0&&L!==this._currentMarker&&this.setCurrentMarker(L),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(C.clientX,C.clientY),C.target):this.setCurrentMarker()}},q.prototype.onPointerMove=function(C){this.touchPoints!==1&&C.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||C.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(C.clientX,C.clientY)):this.zoomLevel>1&&this.panTo({x:C.clientX,y:C.clientY}))},q.prototype.onPointerUp=function(C){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(C.clientX,C.clientY)),this.isDragging=!1,this.addUndoStep()},q.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},q.prototype.onKeyUp=function(C){this._currentMarker===void 0||this.notesArea!==void 0||C.key!=="Delete"&&C.key!=="Backspace"||this.deleteSelectedMarker()},q.prototype.clientToLocalCoordinates=function(C,L){var V=this.markerImage.getBoundingClientRect();return{x:(C-V.left)/this.zoomLevel,y:(L-V.top)/this.zoomLevel}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var C=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=C+"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()},q.prototype.addLicenseKey=function(C){te.addKey(C)},q.prototype.addEventListener=function(C,L){this.eventListeners.addEventListener(C,L)},q.prototype.removeEventListener=function(C,L){this.eventListeners.removeEventListener(C,L)},q.prototype.renderState=function(C){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(C),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(q.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),q.prototype.focus=function(){var C=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(L){return L(new ei(C))}))},q.prototype.blur=function(){var C=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(L){return L(new ei(C))}))},q.instanceCounter=0,q}();/* **********************************
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 pi=function(q,C){return(pi=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(L,V){L.__proto__=V}||function(L,V){for(var ae in V)Object.prototype.hasOwnProperty.call(V,ae)&&(L[ae]=V[ae])})(q,C)};function mi(q,C){if(typeof C!="function"&&C!==null)throw new TypeError("Class extends value "+String(C)+" is not a constructor or null");function L(){this.constructor=q}pi(q,C),q.prototype=C===null?Object.create(C):(L.prototype=C.prototype,new L)}function ri(q,C,L,V){return new(L||(L=Promise))(function(ae,Q){function Ae(Dt){try{xt(V.next(Dt))}catch(ot){Q(ot)}}function nt(Dt){try{xt(V.throw(Dt))}catch(ot){Q(ot)}}function xt(Dt){var ot;Dt.done?ae(Dt.value):(ot=Dt.value,ot instanceof L?ot:new L(function(vt){vt(ot)})).then(Ae,nt)}xt((V=V.apply(q,C||[])).next())})}function _i(q,C){var L,V,ae,Q,Ae={label:0,sent:function(){if(1&ae[0])throw ae[1];return ae[1]},trys:[],ops:[]};return Q={next:nt(0),throw:nt(1),return:nt(2)},typeof Symbol=="function"&&(Q[Symbol.iterator]=function(){return this}),Q;function nt(xt){return function(Dt){return function(ot){if(L)throw new TypeError("Generator is already executing.");for(;Ae;)try{if(L=1,V&&(ae=2&ot[0]?V.return:ot[0]?V.throw||((ae=V.return)&&ae.call(V),0):V.next)&&!(ae=ae.call(V,ot[1])).done)return ae;switch(V=0,ae&&(ot=[2&ot[0],ae.value]),ot[0]){case 0:case 1:ae=ot;break;case 4:return Ae.label++,{value:ot[1],done:!1};case 5:Ae.label++,V=ot[1],ot=[0];continue;case 7:ot=Ae.ops.pop(),Ae.trys.pop();continue;default:if(!(ae=Ae.trys,(ae=ae.length>0&&ae[ae.length-1])||ot[0]!==6&&ot[0]!==2)){Ae=0;continue}if(ot[0]===3&&(!ae||ot[1]>ae[0]&&ot[1]<ae[3])){Ae.label=ot[1];break}if(ot[0]===6&&Ae.label<ae[1]){Ae.label=ae[1],ae=ot;break}if(ae&&Ae.label<ae[2]){Ae.label=ae[2],Ae.ops.push(ot);break}ae[2]&&Ae.ops.pop(),Ae.trys.pop();continue}ot=C.call(q,Ae)}catch(vt){ot=[6,vt],V=0}finally{L=ae=0}if(5&ot[0])throw ot[1];return{value:ot[0]?ot[1]:void 0,done:!0}}([xt,Dt])}}}var Si=function(){function q(){}return q.addKey=function(C){q.key=C},Object.defineProperty(q,"isLicensed",{get:function(){return!!q.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(q.key)},enumerable:!1,configurable:!0}),q}(),At=function(){function q(){}return q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},q.setAttributes=function(C,L){for(var V=0,ae=L;V<ae.length;V++){var Q=ae[V],Ae=Q[0],nt=Q[1];C.setAttribute(Ae,nt)}},q.createRect=function(C,L,V){var ae=document.createElementNS("http://www.w3.org/2000/svg","rect");return ae.setAttribute("width",C.toString()),ae.setAttribute("height",L.toString()),V&&q.setAttributes(ae,V),ae},q.createLine=function(C,L,V,ae,Q){var Ae=document.createElementNS("http://www.w3.org/2000/svg","line");return Ae.setAttribute("x1",C.toString()),Ae.setAttribute("y1",L.toString()),Ae.setAttribute("x2",V.toString()),Ae.setAttribute("y2",ae.toString()),Q&&q.setAttributes(Ae,Q),Ae},q.createPolygon=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg","polygon");return V.setAttribute("points",C),L&&q.setAttributes(V,L),V},q.createCircle=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg","circle");return V.setAttribute("cx",(C/2).toString()),V.setAttribute("cy",(C/2).toString()),V.setAttribute("r",C.toString()),L&&q.setAttributes(V,L),V},q.createEllipse=function(C,L,V){var ae=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ae.setAttribute("cx",(C/2).toString()),ae.setAttribute("cy",(L/2).toString()),ae.setAttribute("rx",(C/2).toString()),ae.setAttribute("ry",(L/2).toString()),V&&q.setAttributes(ae,V),ae},q.createGroup=function(C){var L=document.createElementNS("http://www.w3.org/2000/svg","g");return C&&q.setAttributes(L,C),L},q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},q.createMarker=function(C,L,V,ae,Q,Ae,nt){var xt=document.createElementNS("http://www.w3.org/2000/svg","marker");return q.setAttributes(xt,[["id",C],["orient",L],["markerWidth",V.toString()],["markerHeight",ae.toString()],["refX",Q.toString()],["refY",Ae.toString()]]),xt.appendChild(nt),xt},q.createText=function(C){var L=document.createElementNS("http://www.w3.org/2000/svg","text");return L.setAttribute("x","0"),L.setAttribute("y","0"),C&&q.setAttributes(L,C),L},q.createTSpan=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg","tspan");return V.textContent=C,L&&q.setAttributes(V,L),V},q.createImage=function(C){var L=document.createElementNS("http://www.w3.org/2000/svg","image");return C&&q.setAttributes(L,C),L},q.createPoint=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return V.x=C,V.y=L,V},q.createPath=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg","path");return V.setAttribute("d",C),L&&q.setAttributes(V,L),V},q.createElement=function(C,L){var V=document.createElementNS("http://www.w3.org/2000/svg",C);return L&&q.setAttributes(V,L),V},q.getHollowRectanglePath=function(C,L,V,ae,Q,Ae,nt,xt){return"M"+C+","+L+"V"+(L+ae)+"H"+(C+V)+"V"+L+"H"+Q+"V"+Ae+"H"+(Q+nt)+"V"+(Ae+xt)+"H"+Q+"V"+L+"Z"},q}(),Wn=function(){function q(C){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+C+"_"}return Object.defineProperty(q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(q.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(q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),q.prototype.addClass=function(C){return this.styleSheet===void 0&&this.addStyleSheet(),C.name=""+this.classNamePrefix+C.localName,this.classes.push(C),this.styleSheet.sheet.insertRule("."+C.name+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length),C},q.prototype.addRule=function(C){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(C),this.styleSheet.sheet.insertRule(C.selector+" {"+C.style+"}",this.styleSheet.sheet.cssRules.length)},q.prototype.addStyleSheet=function(){var C;this.styleSheet=document.createElement("style"),((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).appendChild(this.styleSheet),this.addRule(new hi("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new hi("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new hi("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new ti("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new ti("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},q.prototype.removeStyleSheet=function(){var C;this.styleSheet&&(((C=this.styleSheetRoot)!==null&&C!==void 0?C:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},q}(),hi=function(q,C){this.selector=q,this.style=C},ti=function(q,C){this.localName=q,this.style=C},Oi=function(){function q(){this.blocks=[],this.display=""}return q.prototype.addButtonBlock=function(C){C.className=this.blockClassName,C.buttonClassName=this.buttonClassName,C.buttonColorsClassName=this.buttonColorsClassName,C.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(C)},q.prototype.addElementBlock=function(C){C.className===void 0&&(C.className=this.blockClassName),this.blocks.push(C)},q.prototype.getUI=function(){var C=document.createElement("div");return C.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,C.style.display=this.display,this.blocks.forEach(function(L){return C.appendChild(L.getUI())}),C},q}(),Ai=function(){function q(){}return q.prototype.getUI=function(){var C=document.createElement("div");if(C.className=this.className,this.minWidth!==void 0&&(C.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":C.style.justifyContent="flex-start";break;case"center":C.style.justifyContent="center";break;case"end":C.style.justifyContent="flex-end"}return C.style.whiteSpace="nowrap",C},q}(),Ni=function(q){function C(){var L=q!==null&&q.apply(this,arguments)||this;return L.buttons=[],L}return mi(C,q),C.prototype.addButton=function(L){L.className=this.buttonClassName,L.colorsClassName=this.buttonColorsClassName,L.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(L)},C.prototype.getUI=function(){var L=q.prototype.getUI.call(this);return this.buttons.forEach(function(V){return L.appendChild(V.getUI())}),L},C}(Ai),wi=function(){function q(C,L){this._isActive=!1,this._isHidden=!1,this._icon=C,this.title=L,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(q.prototype,"icon",{get:function(){return this._icon},set:function(C){this._icon=C,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isActive",{get:function(){return this._isActive},set:function(C){this._isActive=C,this.adjustClassName()},enumerable:!1,configurable:!0}),q.prototype.getUI=function(){var C=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 C.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},q.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,"")))},q.prototype.hide=function(){this._isHidden=!0},q}(),ct=function(q){function C(){var L=q!==null&&q.apply(this,arguments)||this;return L.elements=[],L}return mi(C,q),C.prototype.addElement=function(L){this.elements.push(L)},C.prototype.getUI=function(){var L=q.prototype.getUI.call(this);return this.elements.forEach(function(V){return L.appendChild(V)}),L},C}(Ai),je=function(){function q(C,L){this.horizontal=C,this.vertical=L}return Object.defineProperty(q.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),q.prototype.getVerticalLength=function(C){return C/this.ratio},q.prototype.getHorizontalLength=function(C){return C*this.ratio},q}(),It=function(){function q(){}return q.getIcon=function(C,L){if(C>0&&L>0){var V=new je(C,L),ae=V.ratio>=1?20:V.getHorizontalLength(20),Q=V.ratio<1?20:V.getVerticalLength(20),Ae=document.createElementNS("http://www.w3.org/2000/svg","svg");Ae.setAttribute("xmlns","http://www.w3.org/2000/svg"),Ae.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Ae);var nt=At.createDefs();Ae.appendChild(nt);var xt=At.createElement("clipPath",[["id","text-bg-clip"]]);nt.appendChild(xt);var Dt=At.createPath(At.getHollowRectanglePath((24-ae)/2,(24-Q)/2,ae,Q,(24-ae)/2+2,(24-Q)/2+2,ae-4,Q-4));Ae.appendChild(Dt);var ot=At.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ot.appendChild(At.createTSpan(C+":"+L)),Ae.appendChild(ot);var vt=ot.getBBox();At.setAttributes(ot,[["x",((24-vt.width)/2).toString()],["y",((24-vt.height)/2-vt.y).toString()]]);var Lt=At.createPath(At.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(vt.width))/2,(24-Math.ceil(vt.height))/2,Math.ceil(vt.width),Math.ceil(vt.height)));return xt.appendChild(Lt),At.setAttributes(Dt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Ae),Ae.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>'},q}(),Ne=function(q){function C(L,V,ae){var Q=q.call(this,L,V)||this;return Q.isDropdownOpen=!1,Q.onClick=Q.dropdownButtonClicked,Q.dropdownButtons=ae,Q}return mi(C,q),C.prototype.setupDropdown=function(){var L=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(V){V.className=L.className,V.colorsClassName=L.colorsClassName,L.dropdownBlock.appendChild(V.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},C.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},C.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},C.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},C.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},C.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},C}(wi),Ee=function(){function q(C,L){this.GRIP_SIZE=10,this.color=C,this.fillColor=L,this.visual=At.createGroup(),this.visual.appendChild(At.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(At.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(C){return C===this.visual||C===this.visual.childNodes[0]||C===this.visual.childNodes[1]},q.prototype.setCenter=function(C,L){this.visual.childNodes.forEach(function(V){return At.setAttributes(V,[["cx",C.toString()],["cy",L.toString()]])})},q}(),ve=function(){function q(C,L,V,ae){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=C,this.canvasHeight=L,this.margin=V,this.container=ae,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(q.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(C){this._aspectRatio=C,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(C){this._isGridVisible=C,this.gridContainer&&At.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(C){this._zoomFactor=C,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),q.prototype.open=function(){var C=this;this.cropShadeElement=At.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=At.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var L=0;L<this.numberOfGridLines;L++)this.horizontalGridLines.push(At.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(At.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(V){return C.gridContainer.appendChild(V)}),this.verticalGridLines.forEach(function(V){return C.gridContainer.appendChild(V)}),this.cropRectElement=At.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ee(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ee(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ee(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ee(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},q.prototype.setCropRectangle=function(C){this.cropRect=C;var L=Object.assign({},this.cropRect);this.zoomFactor!==1&&(L.width=this.cropRect.width*this.zoomFactor,L.height=this.cropRect.height*this.zoomFactor,L.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-L.width/2,L.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-L.height/2),At.setAttributes(this.cropRectElement,[["x",L.x.toString()],["y",L.y.toString()],["width",L.width.toString()],["height",L.height.toString()]]);var V=L.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Q,Ae){var nt=L.y+V*(Ae+1);At.setAttributes(Q,[["x1",""+L.x],["y1",""+nt],["x2",""+(L.x+L.width)],["y2",""+nt]])});var ae=L.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Q,Ae){var nt=L.x+ae*(Ae+1);At.setAttributes(Q,[["x1",""+nt],["y1",""+L.y],["x2",""+nt],["y2",""+(L.y+L.height)]])}),At.setAttributes(this.cropShadeElement,[["d",At.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,L.x,L.y,L.width,L.height)]]),this.topLeftGrip.setCenter(L.x,L.y),this.topRightGrip.setCenter(L.x+L.width,L.y),this.bottomLeftGrip.setCenter(L.x,L.y+L.height),this.bottomRightGrip.setCenter(L.x+L.width,L.y+L.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},q.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)},q.prototype.clientToLocalCoordinates=function(C,L){var V=this.container.getBoundingClientRect();return{x:C-V.left+this.margin,y:L-V.top+this.margin}},q.prototype.onPointerDown=function(C){this.container.setPointerCapture(C.pointerId),this.previousPoint=this.clientToLocalCoordinates(C.clientX,C.clientY),this.cropRectElement===C.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(C.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(C.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(C.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(C.target)&&(this.activeGrip=this.bottomRightGrip)},q.prototype.onPointerMove=function(C){if(this.isMoving)this.move(this.clientToLocalCoordinates(C.clientX,C.clientY));else if(this.activeGrip){var L=this.clientToLocalCoordinates(C.clientX,C.clientY);this.resize(L)}C.preventDefault()},q.prototype.onPointerUp=function(C){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(C.pointerId)},q.prototype.move=function(C){var L=C.x-this.previousPoint.x,V=C.y-this.previousPoint.y;this.zoomFactor!==1&&(L=-L/this.zoomFactor,V=-V/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+L),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+V),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=C},q.prototype.resize=function(C){var L=Object.assign({},this.cropRect),V=C.x-this.previousPoint.x,ae=C.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:L.x+V<this.margin&&(V=this.margin-L.x),L.x+=V,L.width=this.cropRect.x+this.cropRect.width-L.x;break;case this.bottomRightGrip:case this.topRightGrip:L.width+V>this.canvasWidth*this.zoomFactor&&(V=this.canvasWidth*this.zoomFactor-L.width),L.width+=V}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(L.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(V),L.height=this.aspectRatio.getVerticalLength(L.width)):(L.y+=ae,L.height=this.cropRect.y+this.cropRect.height-L.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?L.height=this.aspectRatio.getVerticalLength(L.width):L.height+=ae}L.width<10&&(L.x=this.cropRect.x,L.width=10),L.height<10&&(L.y=this.cropRect.y,L.height=10),this.previousPoint=C,L.x>=this.margin&&L.y>=this.margin&&L.x-this.margin+L.width<=this.canvasWidth&&L.y-this.margin+L.height<=this.canvasHeight&&(this.cropRect=L,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},q.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var C=this.cropRect.x+this.cropRect.width/2,L=this.cropRect.y+this.cropRect.height/2,V=this.aspectRatio.getHorizontalLength(this.cropRect.height),ae=this.aspectRatio.getVerticalLength(this.cropRect.width);V/this.canvasWidth<ae/this.canvasHeight?this.cropRect.width=V:this.cropRect.height=ae,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=C-this.cropRect.width/2,this.cropRect.y=L-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},q.prototype.getRescaledRect=function(C,L,V,ae,Q,Ae){var nt=V/C,xt=ae/L;return{x:(Q.x-Ae)*nt+Ae,y:(Q.y-Ae)*xt+Ae,width:Q.width*nt,height:Q.height*xt}},q.prototype.scaleCanvas=function(C,L){var V=this.getRescaledRect(this.canvasWidth,this.canvasHeight,C,L,this.cropRect,this.margin);this.canvasWidth=C,this.canvasHeight=L,this.onCropChange&&this.onCropChange(V),this.setCropRectangle(V)},q}(),di=function(){function q(C){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=C,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(q.prototype,"angle",{get:function(){return this._angle},set:function(C){this._angle=C,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),q.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},q.prototype.onPointerDown=function(C){this.controlContainer.setPointerCapture(C.pointerId),this.isDragging=!0,this.previousPoint={x:C.clientX,y:C.clientY}},q.prototype.onPointerMove=function(C){this.isDragging&&(this.onAngleChange&&this.onAngleChange((C.clientX-this.previousPoint.x)/5),this.previousPoint.x=C.clientX)},q.prototype.onPointerUp=function(C){this.isDragging&&this.onAngleChange&&this.onAngleChange((C.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(C.pointerId)},q.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var C=this.angleLabelText.getBBox();At.setAttributes(this.angleLabelElement,[["x",((this.width-C.width)/2).toString()],["y",(this.height/2).toString()]])}},q.prototype.positionScaleShape=function(){if(this.scaleShape){var C=this.scaleShape.transform.baseVal.getItem(0);C.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(C,0)}},q.prototype.getVisual=function(){var C=document.createElementNS("http://www.w3.org/2000/svg","svg");C.setAttribute("xmlns","http://www.w3.org/2000/svg"),C.setAttribute("width",this.width+"px"),C.setAttribute("height",this.height+"px"),C.setAttribute("viewBox","0 0 "+this.width+" "+this.height),C.style.flexShrink="0",document.body.appendChild(C);for(var L="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,V=1;V<=this.width/5+10;V++){var ae=V%5==0?this.height/3:this.height/6;L+="h4v"+-ae+"h1v"+ae}L+="v1H0Z",this.scaleShape=At.createPath(L);var Q=At.createTransform();this.scaleShape.transform.baseVal.appendItem(Q),C.appendChild(this.scaleShape),this.angleLabelElement=At.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=At.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Ae=At.createTSpan("");return Ae.innerHTML="&deg;",this.angleLabelElement.appendChild(Ae),C.appendChild(this.angleLabelElement),document.body.removeChild(C),C},q}(),en=function(){function q(){this.naturalSize=!1,this.imageType="image/png"}return q.prototype.rasterize=function(C,L,V,ae,Q,Ae,nt){var xt=this;return new Promise(function(Dt){var ot=document.createElement("canvas");ot.width=C.width.baseVal.value-2*ae,ot.height=C.height.baseVal.value-2*ae;var vt=1,Lt=1;xt.naturalSize===!0?(vt=L.naturalWidth/(C.width.baseVal.value-2*ae)/Ae,Lt=L.naturalHeight/(C.height.baseVal.value-2*ae)/nt,ot.width=L.naturalWidth/Ae,ot.height=L.naturalHeight/nt):xt.width!==void 0&&xt.height!==void 0&&(vt=xt.width/V.width,Lt=xt.height/V.height,ot.width*=vt,ot.height*=Lt);var wn=ot.getContext("2d");wn.translate(ot.width/2,ot.height/2),wn.rotate(Q*Math.PI/180),wn.scale(Ae,nt),wn.translate(-ot.width/2,-ot.height/2),wn.drawImage(L,0,0,ot.width,ot.height);var Xn=document.createElement("canvas");Xn.width=V.width*vt,Xn.height=V.height*Lt,Xn.getContext("2d").putImageData(wn.getImageData((V.x-ae)*vt,(V.y-ae)*Lt,V.width*vt,V.height*Lt),0,0),Dt(Xn.toDataURL(xt.imageType,xt.imageQuality))})},q}(),De=function(){function q(C){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=q.instanceCounter++,this.styles=new Wn(this.instanceNo),this.target=C,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(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(C){this._zoomToCropEnabled=C,C?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(C){this._isGridVisible=C,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"gridLines",{get:function(){return this._gridLines},set:function(C){this._gridLines=C,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(C){this._rotationAngle=C,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"aspectRatio",{get:function(){var C;return(C=this._aspectRatio)!==null&&C!==void 0?C:this.aspectRatios[0]},set:function(C){this._aspectRatio=C},enumerable:!1,configurable:!0}),q.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},q.prototype.show=function(){this.showUI(),this.open()},q.prototype.close=function(C){C===void 0&&(C=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),C||this.closeEventListeners.forEach(function(L){return L()}),this._isOpen=!1)},q.prototype.addRenderEventListener=function(C){this.renderEventListeners.push(C)},q.prototype.removeRenderEventListener=function(C){this.renderEventListeners.indexOf(C)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(C),1)},q.prototype.addCloseEventListener=function(C){this.closeEventListeners.push(C)},q.prototype.removeCloseEventListener=function(C){this.closeEventListeners.indexOf(C)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(C),1)},q.prototype.setupResizeObserver=function(){var C=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){C.resize(C.target.clientWidth,C.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))},q.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var C=1*this.target.clientWidth/this.target.clientHeight,L=this.contentDiv.clientWidth/C>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*C:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,V=L+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/C;this.resize(L,V)}},q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},q.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",At.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},q.prototype.resize=function(C,L){this.imageWidth=Math.round(C),this.imageHeight=Math.round(L),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()},q.prototype.setEditingTarget=function(){var C=document.createElement("canvas");C.width=this.target.naturalWidth,C.height=this.target.naturalHeight,C.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var L=C.toDataURL();At.setAttributes(this.editingTarget,[["href",L]]),this.setEditingTargetSize()},q.prototype.setTopLeft=function(){var C=this.target.getBoundingClientRect(),L=this.editorCanvas.getBoundingClientRect();this.left=C.left-L.left-this.CANVAS_MARGIN,this.top=C.top-L.top-this.CANVAS_MARGIN},q.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=At.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=At.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=At.createGroup(),this.editingTargetRotationScaleContainer=At.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var C=At.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(C);var L=At.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(L),this.editingTargetContainer=At.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)},q.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},q.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=At.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new ve(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()},q.prototype.zoomToCrop=function(){if(this.cropRect){var C=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,L=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=C+"px "+L+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-C+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-L+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},q.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)},q.prototype.cropRectChanged=function(C){this.cropRect=C,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},q.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},q.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"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.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 C=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,L=this.target.offsetTop>C+this.CANVAS_MARGIN?this.target.offsetTop-(C+this.CANVAS_MARGIN):0;this.coverDiv.style.top=L+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},q.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},q.prototype.addTopToolbar=function(){var C=this;this.topToolbar=new Oi,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var L=new Ni;L.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(L);var V=[];this.aspectRatios.forEach(function(Lt){var wn=new wi(It.getIcon(Lt.horizontal,Lt.vertical),Lt.horizontal===0&&Lt.vertical===0?"FREE":Lt.horizontal+":"+Lt.vertical);wn.onClick=function(){return C.ratioButtonClicked(Lt)},V.push(wn)}),this.aspectRatioButton=new Ne(It.getIcon(0,0),"Aspect ratio",V),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,L.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ae=new wi('<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");ae.isActive=this.isGridVisible,ae.onClick=function(){C.isGridVisible=!C.isGridVisible,ae.isActive=C.isGridVisible},L.addButton(ae);var Q=new wi('<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(Q.isActive=this.zoomToCropEnabled,Q.onClick=function(){C.zoomToCropEnabled=!C.zoomToCropEnabled,Q.isActive=C.zoomToCropEnabled},L.addButton(Q),!Si.isLicensed){var Ae=new ct;this.topToolbar.addElementBlock(Ae);var nt=document.createElement("div");nt.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var xt=document.createElement("a");xt.style.color="currentColor",xt.href="https://markerjs.com/products/cropro",xt.target="_blank",xt.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>',nt.appendChild(xt),Ae.addElement(nt)}var Dt=new Ni;Dt.minWidth=3*this.toolbarHeight+"px",Dt.contentAlign="end",this.topToolbar.addButtonBlock(Dt);var ot=new wi('<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");ot.onClick=this.startRenderAndClose,Dt.addButton(ot),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ot.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var vt=new wi('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");vt.onClick=this.close,Dt.addButton(vt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(vt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},q.prototype.addBottomToolbar=function(){var C=this;this.bottomToolbar=new Oi,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var L=new Ni;L.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(L);var V=new wi('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");V.onClick=this.rotateLeftButtonClicked,L.addButton(V);var ae=new wi('<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");ae.onClick=this.rotateRightButtonClicked,L.addButton(ae);var Q=new ct;Q.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Q),this.straightener=new di("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(Dt){C.rotateBy(Dt),C.straightener.angle=C.rotationAngle},Q.addElement(this.straightener.getUI());var Ae=new Ni;Ae.minWidth=2*this.toolbarHeight+"px",Ae.contentAlign="end",this.bottomToolbar.addButtonBlock(Ae);var nt=new wi('<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");nt.onClick=this.flipHorizontallyButtonClicked,Ae.addButton(nt);var xt=new wi('<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");xt.onClick=this.flipVerticallyButtonClicked,Ae.addButton(xt)},q.prototype.ratioButtonClicked=function(C){this.aspectRatio=C,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},q.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=It.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},q.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new je(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},q.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},q.prototype.restoreState=function(C){if(C){var L=this.cropLayer.getRescaledRect(C.width,C.height,this.imageWidth,this.imageHeight,C.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(L),this.cropRectChanged(L),this.flippedHorizontally=C.flippedHorizontally,this.flippedVertically=C.flippedVertically,this.applyFlip(),this.rotationAngle=C.rotationAngle,this.applyRotation()}},q.prototype.clientToLocalCoordinates=function(C,L){var V=this.cropImage.getBoundingClientRect();return{x:C-V.left,y:L-V.top}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var C=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=C+"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()},q.prototype.rotateLeftButtonClicked=function(){var C=this.rotationAngle-90;this.rotationAngle%90!=0&&(C+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(C)},q.prototype.rotateRightButtonClicked=function(){var C=this.rotationAngle+90;this.rotationAngle%90!=0&&(C-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(C)},q.prototype.rotateTo=function(C){C=(C=C>180?C-360:C)<=-180?C+360:C,this.rotationAngle=C,this.applyRotation()},q.prototype.rotateBy=function(C){this.rotateTo((this.rotationAngle+C)%360)},q.prototype.applyRotation=function(){var C=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var L=this.editingTargetRotationContainer.transform.baseVal.getItem(0);L.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(L,0);var V=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/V.width,this.imageHeight/V.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=C},q.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},q.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},q.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},q.prototype.startRenderAndClose=function(){return ri(this,void 0,void 0,function(){var C,L;return _i(this,function(V){switch(V.label){case 0:return[4,this.render()];case 1:return C=V.sent(),L=this.getState(),this.renderEventListeners.forEach(function(ae){return ae(C,L)}),this.close(!0),[2]}})})},q.prototype.render=function(){return ri(this,void 0,void 0,function(){var C;return _i(this,function(L){switch(L.label){case 0:return(C=new en).naturalSize=this.renderAtNaturalSize,C.imageType=this.renderImageType,C.imageQuality=this.renderImageQuality,C.width=this.renderWidth,C.height=this.renderHeight,this.unzoomFromCrop(),At.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,C.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return L.sent(),[4,C.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,L.sent()]}})})},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new ti("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 ti("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new ti("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var C=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new ti("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*C)+`px;
height: `+(this.toolbarHeight-2*C)+`px;
padding: `+C+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new ti("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new ti("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new hi("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new hi("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new ti("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 ti("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new ti("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 ti("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*C)+`px;
padding: `+C+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new ti("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},q.instanceCounter=0,q}(),ht=z("8hTe"),we=z.n(ht),un=/<pre[^>]*>/g;function fi(q){var C=document.createElement("div");return C.innerHTML=q,C.childNodes.length===0?"":C.childNodes[0].nodeValue}var gi=st.a=function(q){var C=q.value,L=C===void 0?"":C,V=q.edit,ae=V===void 0?!1:V,Q=q.className,Ae=q.showTextOnly,nt=q.showLines,xt=q.replaces,Dt=q.zoomImg,ot=q.hasMask,vt=q.style,Lt=vt===void 0?{}:vt,wn=q.stylesPrev,Xn=wn===void 0?{}:wn,jn=String(L),cn=Object(D.useRef)(),jt=Object(D.useRef)(),nn=Object(D.useState)(""),qt=Object($.a)(nn,2),Nt=qt[0],$n=qt[1],Un=Object(D.useState)("office"),xn=Object($.a)(Un,2),Yn=xn[0],hn=xn[1],Tn=function(){var vn=new De(jt.current);vn.displayMode="popup",vn.addRenderEventListener(function(){var Ln=Object(M.a)(k.a.mark(function Cn(Qn){var _n;return k.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return cn.current.style.display="none",qn.next=3,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qn}});case 3:_n=qn.sent,_n!=null&&_n.id&&xt(jt.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(_n==null?void 0:_n.id,"?type=").concat(_n.content_type));case 5:case"end":return qn.stop()}},Cn)}));return function(Cn){return Ln.apply(this,arguments)}}()),vn.show()},ln=function(){var vn=new zn(jt.current);vn.settings.displayMode="popup",vn.addEventListener("render",function(){var Ln=Object(M.a)(k.a.mark(function Cn(Qn){var _n;return k.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(cn.current.style.display="none",!jt.current){qn.next=6;break}return qn.next=4,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Qn.dataUrl}});case 4:_n=qn.sent,_n!=null&&_n.id&&xt(jt.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(_n==null?void 0:_n.id,"?type=").concat(_n.content_type));case 6:case"end":return qn.stop()}},Cn)}));return function(Cn){return Ln.apply(this,arguments)}}()),vn.show(),window.markerArea=vn},Mn=Object(D.useMemo)(function(){cn.current&&(cn.current.style.zIndex=-1);try{var tn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,vn=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ln=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;jn=jn.replace(tn,"("+Y.a.API_SERVER+"/api/attachments/").replace(vn,'"'+Y.a.API_SERVER+"/api/attachments/").replace(Ln,'"'+Y.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(Gn){}var Cn=G(jn),Qn=E();if(jn.match(/\[TOC\]/)&&(Cn=Cn.replace("<p>[TOC]</p>",O()),A()),Cn=Cn.replace(/(__special_katext_id_\d+__)/g,function(Gn,qn){var In=Qn[qn],Dn=In.type,kn=In.expression;return Object(re.renderToString)(fi(kn)||"",{displayMode:Dn==="block",throwOnError:!1,output:"html"})}),Cn=Cn.replace(/▁/g,"\u2581\u2581\u2581"),g(),Ae){var _n=document.createElement("div");return _n.innerHTML=Cn,_n.innerText}return setTimeout(function(){return Pn()},500),Cn},[jn]),Vn=Object(D.useRef)();S.WebkitLineClamp=nt,nt&&(Lt=Object(W.a)(Object(W.a)({},Lt),S));function ni(tn){var vn=tn.target;if(vn.tagName.toUpperCase()==="IMG"){if(Dt){var Ln=vn.getAttribute("src");$n(Ln),hn("image")}}else if(vn.tagName.toUpperCase()==="A"){var Cn=vn.getAttribute("href");if(Cn.indexOf("office")>-1)tn.preventDefault(),$n(Cn),hn("office");else if(Cn.indexOf("application/pdf")>-1)tn.preventDefault(),$n(Cn),hn("pdf");else if(Cn.indexOf("text/html")>-1)tn.preventDefault(),$n(Cn),hn("html");else if(Cn.startsWith("#")){tn.preventDefault();var Qn=document.getElementById(Cn.replace("#",""));Qn&&Qn.scrollIntoView(!0)}}}var Pn=function(){var vn,Ln=(vn=Vn.current)===null||vn===void 0?void 0:vn.querySelectorAll("video");Ln==null||Ln.forEach(function(Cn){if(Cn.oncontextmenu=function(){return!1},Cn.src.indexOf(".m3u8")>-1&&!Cn.canPlayType("application/vnd.apple.mpegurl")){if(B.a.isSupported()){var Qn=new B.a;Qn.loadSource(Cn.src),Qn.attachMedia(Cn)}}})};Object(D.useEffect)(function(){if(Vn.current&&Mn&&(Mn.match(un)&&window.PR.prettyPrint()),Vn.current)return Vn.current.addEventListener("click",ni),function(){Vn.current.removeEventListener("click",ni),g(),A()}},[Mn,Vn.current,ni]);var Hn=function(vn){if(!ae)return;vn.target.nodeName==="IMG"?(cn.current.style.zIndex=1,cn.current.style.display="flex",cn.current.style.width=vn.target.clientWidth+"px",cn.current.style.height=vn.target.clientHeight+"px",cn.current.style.top=vn.target.offsetTop+"px",cn.current.style.left=vn.target.offsetLeft+"px",jt.current.src=vn.target.getAttribute("src")):cn.current.style.display="none"};return m.a.createElement("div",{style:{position:"relative"}},m.a.createElement("div",{ref:Vn,style:Object(W.a)({},Lt),className:"".concat(Q||""," markdown-body ").concat(we.a.mdBody),onMouseOver:Hn,dangerouslySetInnerHTML:{__html:Mn}}),m.a.createElement("div",{ref:cn,className:we.a.button},m.a.createElement(Z.a,null,m.a.createElement(ee.a,{onClick:function(){return Tn()}},"\u88C1\u526A"),m.a.createElement(ee.a,{onClick:function(){return ln()}},"\u7F16\u8F91"))),m.a.createElement("img",{ref:jt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),m.a.createElement(de.a,{close:!0,data:Nt,type:Nt!=null&&Nt.length?Yn:"",style:Object(W.a)({},Xn),onClose:function(){return $n("")}}))}},"9VGf":function(Wt,st,z){"use strict";z.d(st,"a",function(){return U});var oe=z("q1tI"),Z=z.n(oe);function U(ee,W){var M=Object(oe.useRef)();Object(oe.useEffect)(function(){M.current=ee}),Object(oe.useEffect)(function(){function $(){M.current()}if(W!==null){var X=setInterval($,W);return function(){return clearInterval(X)}}},[W])}},"9z17":function(Wt,st,z){"use strict";z.d(st,"b",function(){return w});var oe=z("g9YV"),Z=z("wCAj"),U=z("5NDa"),ee=z("5rEg"),W=z("y8nQ"),M=z("Vl3Y"),$=z("2qtc"),X=z("kLXV"),k=z("7Kak"),D=z("9yH6"),m=z("9og8"),v=z("tJVT"),f=z("WmNS"),o=z.n(f),l=z("q1tI"),r=z.n(l),i=z("ie49"),t=z.n(i),c=z("HBuW"),h=function(_){var u=_.total,d=_.used,E=_.copy,g=_.canNotCopy,y=_.inPaper,F="";return E>0&&g>0?F="\u5176\u4E2D\u6709".concat(E,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236\uFF0C\u6709").concat(g,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236"):E>0&&g===0?F="\u5176\u4E2D\u6709".concat(E,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236"):E===0&&g>0&&(F="\u5176\u4E2D\u6709".concat(g,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236")),"\u5F53\u524D\u9009\u4E2D".concat(u,"\u4E2A\u5B9E\u8BAD\u4E2D\uFF0C\u6709").concat(d,"\u4E2A\u5B9E\u8BAD\u5DF2\u5728\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C").concat(F).concat(y?"\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4F7F\u7528\u8BD5\u5377\uFF1F":"")},A=function(_){return _?{reproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u8BD5\u5377\u4E2D\u4E0B\u5217\u91CD\u590D\u4F7F\u7528\u7684\u5B9E\u8BAD\u672A\u5F00\u542F\u590D\u5236\u6743\u9650\uFF0C\u82E5\u7EE7\u7EED\u4F7F\u7528\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD"}:{reproducible:"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u9009\u62E9\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\u548C\u662F\u5426\u590D\u5236\u4E3A\u65B0\u7684\u5B9E\u8BAD\u53D1\u9001\u5230\u8BFE\u5802\uFF1F",irreproducible:"\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F"}},S=function(_){var u=_.onCancel,d=_.onOk,E=_.visible,g=_.inPaper,y=_.renderData,F=_.type,N=Object(l.useState)(1),H=Object(v.a)(N,2),G=H[0],I=H[1],x=Object(l.useState)(!1),B=Object(v.a)(x,2),Y=B[0],re=B[1],de=Object(l.useMemo)(function(){return(y==null?void 0:y.total_num)===1&&(y==null?void 0:y.can_copy_num)===1},[y]);return r.a.createElement(r.a.Fragment,null,de?r.a.createElement(X.a,{centered:!0,closable:!0,visible:E,title:"\u63D0\u793A",width:600,confirmLoading:Y,onCancel:u,onOk:Object(m.a)(o.a.mark(function he(){return o.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return re(!0),Pe.next=3,d(G);case 3:re(!1);case 4:case"end":return Pe.stop()}},he)}))},r.a.createElement("div",{className:t.a.content,style:{marginBottom:20}},"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u8BF7\u95EE\u662F\u5426\u590D\u5236\u6210\u65B0\u5B9E\u8BAD\u53D1\u9001\u81F3\u6559\u5B66\u8BFE\u5802\u4E2D\uFF1F"),r.a.createElement(D.a.Group,{value:G,onChange:function(xe){return I(xe.target.value)},className:t.a.content,style:{marginBottom:30}},r.a.createElement(D.a,{value:1,style:{color:"#464f66"}},"\u590D\u5236\u5B9E\u8BAD"),r.a.createElement(D.a,{value:0,style:{color:"#464f66"}},"\u4E0D\u590D\u5236\u5B9E\u8BAD")),r.a.createElement("div",{className:t.a.content,style:{marginBottom:10}},"\u8BF4\u660E\uFF1A"),r.a.createElement("div",{className:t.a.content},"\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"),r.a.createElement("div",{className:t.a.content},"\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002")):r.a.createElement(X.a,{centered:!0,closable:!0,visible:E,title:"\u63D0\u793A",width:600,onCancel:u,onOk:Object(m.a)(o.a.mark(function he(){return o.a.wrap(function(Pe){for(;;)switch(Pe.prev=Pe.next){case 0:return re(!0),Pe.next=3,d(0);case 3:re(!1);case 4:case"end":return Pe.stop()}},he)}))},r.a.createElement("div",{className:t.a.content},"\u5F53\u524D\u5B9E\u8BAD\u5DF2\u5728\u6559\u5B66\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u7EE7\u7EED\u4F7F\u7528\uFF1F")))},w=function(){var _=Object(l.useState)(!1),u=Object(v.a)(_,2),d=u[0],E=u[1],g=Object(l.useState)(),y=Object(v.a)(g,2),F=y[0],N=y[1],H=function(){return E(!1)},G=function(){var I=Object(m.a)(o.a.mark(function x(B){var Y;return o.a.wrap(function(de){for(;;)switch(de.prev=de.next){case 0:return de.next=2,Object(c.p)(B);case 2:if(Y=de.sent,!("status"in Y)){de.next=5;break}return de.abrupt("return",!1);case 5:if(!(Y.repeat_shixun_num===0)){de.next=7;break}return de.abrupt("return",!1);case 7:return N(Y),E(!0),de.abrupt("return",!0);case 10:case"end":return de.stop()}},x)}));return function(B){return I.apply(this,arguments)}}();return[d,H,F,G]},O=function(_){var u=M.a.useForm(),d=Object(v.a)(u,1),E=d[0],g=Object(l.useState)(!1),y=Object(v.a)(g,2),F=y[0],N=y[1],H=_.onCancel,G=_.onOk,I=_.visible,x=_.inPaper,B=x===void 0?!1:x,Y=_.renderData,re=_.type,de=Object(l.useMemo)(function(){return B?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,align:"center",className:t.a.tableCell},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(Oe,be){return r.a.createElement(r.a.Fragment,null,r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be.stage_shixun_id:be.id),"is_copy"],initialValue:1},r.a.createElement(D.a.Group,null,r.a.createElement(D.a,{value:1},"\u662F"),r.a.createElement(D.a,{value:0},"\u5426"))),r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_use"],hidden:!0,initialValue:1},r.a.createElement(ee.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,align:"center",className:t.a.tableCell},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Oe,be){return r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be.stage_shixun_id:be.id),"is_use"],initialValue:1},r.a.createElement(D.a.Group,null,r.a.createElement(D.a,{value:1},"\u662F"),r.a.createElement(D.a,{value:0},"\u5426")))}},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(Oe,be){return r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be.stage_shixun_id:be.id),"is_copy"],initialValue:1},r.a.createElement(D.a.Group,null,r.a.createElement(D.a,{value:1},"\u662F"),r.a.createElement(D.a,{value:0},"\u5426")))}}]},[B]),he=Object(l.useMemo)(function(){return B?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center",render:function(Oe,be){return r.a.createElement(r.a.Fragment,null,r.a.createElement("span",null,Oe),r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_copy"],hidden:!0,initialValue:0},r.a.createElement(ee.a,{type:"hidden"})),r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_use"],hidden:!0,initialValue:1},r.a.createElement(ee.a,{type:"hidden"})))}}]:[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center"},{title:"\u662F\u5426\u4F7F\u7528",dataIndex:"is_use",align:"center",render:function(Oe,be){return r.a.createElement(r.a.Fragment,null,r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_use"],initialValue:0},r.a.createElement(D.a.Group,null,r.a.createElement(D.a,{value:1},"\u662F"),r.a.createElement(D.a,{value:0},"\u5426"))),r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?be==null?void 0:be.stage_shixun_id:be.id),"is_copy"],hidden:!0,initialValue:0},r.a.createElement(ee.a,{type:"hidden"})))}}]},[B]),xe=Object(l.useMemo)(function(){return h({total:Y==null?void 0:Y.total_num,used:Y==null?void 0:Y.repeat_shixun_num,copy:Y==null?void 0:Y.can_copy_num,canNotCopy:Y==null?void 0:Y.no_copy_num,inPaper:B})},[Y,B]),Pe=Object(l.useMemo)(function(){return A(B)},[B]);return r.a.createElement(X.a,{title:"\u5B9E\u8BAD\u91CD\u590D\u4F7F\u7528\u63D0\u793A",centered:!0,visible:I,confirmLoading:F,onOk:Object(m.a)(o.a.mark(function Ce(){var Oe,be;return o.a.wrap(function(te){for(;;)switch(te.prev=te.next){case 0:return N(!0),Oe=E.getFieldsValue(),be=Object.keys(Oe).map(function(fe){return{id:parseInt(fe),is_use:Oe[fe].is_use,is_copy:Oe[fe].is_copy}}),te.next=5,G(be);case 5:N(!1);case 6:case"end":return te.stop()}},Ce)})),onCancel:H,width:800,okText:"\u786E\u8BA4",className:t.a.antdModal,destroyOnClose:!0},r.a.createElement(M.a,{form:E,preserve:!1},r.a.createElement("div",{className:t.a.brief},xe),(Y==null?void 0:Y.can_copy_num)>0&&r.a.createElement("div",null,r.a.createElement("div",{className:t.a.contentTitle},"\u53EF\u590D\u5236\u5B9E\u8BAD"),r.a.createElement("div",{className:t.a.content},Pe.reproducible),r.a.createElement("div",{className:t.a.tips},r.a.createElement("div",null,"\u590D\u5236\u5B9E\u8BAD\uFF1A\u590D\u5236\u4E00\u4EFD\u65B0\u7684\u5B9E\u8BAD\u8FDB\u5165\u8BFE\u5802\uFF0C\u539F\u5B9E\u8BAD\u7684\u8C03\u6574\u4E0D\u4F1A\u5F71\u54CD\u5230\u590D\u5236\u7684\u5B9E\u8BAD\u4E2D\u3002"),r.a.createElement("div",null,"\u4E0D\u590D\u5236\u5B9E\u8BAD\uFF1A\u540C\u4E00\u5B9E\u8BAD\u5728\u4E00\u4E2A\u8BFE\u5802\u4E2D\u91CD\u590D\u4F7F\u7528\u65F6\uFF0C\u4F1A\u5BFC\u81F4\u6210\u7EE9\u76F8\u4E92\u5F71\u54CD\u3002")),r.a.createElement(Z.a,{columns:de,className:t.a.antdTable,dataSource:Y==null?void 0:Y.can_copy_list,rowKey:re==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:240},bordered:!0})),(Y==null?void 0:Y.no_copy_num)>0&&r.a.createElement("div",null,r.a.createElement("div",{className:t.a.contentTitle},"\u4E0D\u53EF\u590D\u5236\u5B9E\u8BAD"),r.a.createElement("div",{className:t.a.content},Pe.irreproducible),r.a.createElement(Z.a,{columns:he,className:t.a.antdTable,dataSource:Y==null?void 0:Y.no_copy_list,rowKey:re==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:200},bordered:!0})),(Y==null?void 0:Y.no_use_list.length)>0&&(Y==null?void 0:Y.no_use_list.map(function(Ce){return r.a.createElement("div",{key:re==="subject"?Ce.stage_shixun_id:Ce.id},r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?Ce==null?void 0:Ce.stage_shixun_id:Ce.id),"is_copy"],hidden:!0,initialValue:0},r.a.createElement(ee.a,{type:"hidden"})),r.a.createElement(M.a.Item,{name:["".concat(re==="subject"?Ce==null?void 0:Ce.stage_shixun_id:Ce.id),"is_use"],hidden:!0,initialValue:1},r.a.createElement(ee.a,{type:"hidden"})))}))))},R=function(_){var u=_.modalType;return u==="multiple"?r.a.createElement(O,_):r.a.createElement(S,_)};st.a=R},BU3w:function(Wt,st,z){"use strict";z.d(st,"a",function(){return M});var oe=z("MNnm"),Z="rc-util-key";function U($){if($.attachTo)return $.attachTo;var X=document.querySelector("head");return X||document.body}function ee($){var X,k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(oe.a)())return null;var D=document.createElement("style");if((X=k.csp)===null||X===void 0?void 0:X.nonce){var m;D.nonce=(m=k.csp)===null||m===void 0?void 0:m.nonce}D.innerHTML=$;var v=U(k),f=v.firstChild;return k.prepend&&v.prepend?v.prepend(D):k.prepend&&f?v.insertBefore(D,f):v.appendChild(D),D}var W=new Map;function M($,X){var k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=U(k);if(!W.has(D)){var m=ee("",k),v=m.parentNode;W.set(D,v),v.removeChild(m)}var f=Array.from(W.get(D).children).find(function(t){return t.tagName==="STYLE"&&t[Z]===X});if(f){var o,l;if(((o=k.csp)===null||o===void 0?void 0:o.nonce)&&f.nonce!==((l=k.csp)===null||l===void 0?void 0:l.nonce)){var r;f.nonce=(r=k.csp)===null||r===void 0?void 0:r.nonce}return f.innerHTML!==$&&(f.innerHTML=$),f}var i=ee($,k);return i[Z]=X,i}},Bd2K:function(Wt,st,z){(function(oe){oe(z("VrN/"),z("osHv"))})(function(oe){oe.defineOption("autoCloseTags",!1,function(k,D,m){if(m!=oe.Init&&m&&k.removeKeyMap("autoCloseTags"),!D)return;var v={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(v["'/'"]=function(f){return M(f)}),(typeof D!="object"||D.whenOpening!==!1)&&(v["'>'"]=function(f){return ee(f)}),k.addKeyMap(v)});var Z=["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 ee(k){if(k.getOption("disableInput"))return oe.Pass;for(var D=k.listSelections(),m=[],v=k.getOption("autoCloseTags"),f=0;f<D.length;f++){if(!D[f].empty())return oe.Pass;var o=D[f].head,l=k.getTokenAt(o),r=oe.innerMode(k.getMode(),l.state),i=r.state,t=r.mode.xmlCurrentTag&&r.mode.xmlCurrentTag(i),c=t&&t.name;if(!c)return oe.Pass;var h=r.mode.configuration=="html",A=typeof v=="object"&&v.dontCloseTags||h&&Z,S=typeof v=="object"&&v.indentTags||h&&U;l.end>o.ch&&(c=c.slice(0,c.length-l.end+o.ch));var w=c.toLowerCase();if(!c||l.type=="string"&&(l.end!=o.ch||!/[\"\']/.test(l.string.charAt(l.string.length-1))||l.string.length==1)||l.type=="tag"&&t.close||l.string.indexOf("/")==o.ch-l.start-1||A&&$(A,w)>-1||X(k,r.mode.xmlCurrentContext&&r.mode.xmlCurrentContext(i)||[],c,o,!0))return oe.Pass;var O=typeof v=="object"&&v.emptyTags;if(O&&$(O,c)>-1){m[f]={text:"/>",newPos:oe.Pos(o.line,o.ch+2)};continue}var R=S&&$(S,w)>-1;m[f]={indent:R,text:">"+(R?`
`:"")+"</"+c+">",newPos:R?oe.Pos(o.line+1,0):oe.Pos(o.line,o.ch+1)}}for(var b=typeof v=="object"&&v.dontIndentOnAutoClose,f=D.length-1;f>=0;f--){var _=m[f];k.replaceRange(_.text,D[f].head,D[f].anchor,"+insert");var u=k.listSelections().slice(0);u[f]={head:_.newPos,anchor:_.newPos},k.setSelections(u),!b&&_.indent&&(k.indentLine(_.newPos.line,null,!0),k.indentLine(_.newPos.line+1,null,!0))}}function W(k,D){for(var m=k.listSelections(),v=[],f=D?"/":"</",o=k.getOption("autoCloseTags"),l=typeof o=="object"&&o.dontIndentOnSlash,r=0;r<m.length;r++){if(!m[r].empty())return oe.Pass;var i=m[r].head,t=k.getTokenAt(i),c=oe.innerMode(k.getMode(),t.state),h=c.state;if(D&&(t.type=="string"||t.string.charAt(0)!="<"||t.start!=i.ch-1))return oe.Pass;var A,S=c.mode.name!="xml"&&k.getMode().name=="htmlmixed";if(S&&c.mode.name=="javascript")A=f+"script";else if(S&&c.mode.name=="css")A=f+"style";else{var w=c.mode.xmlCurrentContext&&c.mode.xmlCurrentContext(h);if(!w||w.length&&X(k,w,w[w.length-1],i))return oe.Pass;A=f+w[w.length-1]}k.getLine(i.line).charAt(t.end)!=">"&&(A+=">"),v[r]=A}if(k.replaceSelections(v),m=k.listSelections(),!l)for(var r=0;r<m.length;r++)(r==m.length-1||m[r].head.line<m[r+1].head.line)&&k.indentLine(m[r].head.line)}function M(k){return k.getOption("disableInput")?oe.Pass:W(k,!0)}oe.commands.closeTag=function(k){return W(k)};function $(k,D){if(k.indexOf)return k.indexOf(D);for(var m=0,v=k.length;m<v;++m)if(k[m]==D)return m;return-1}function X(k,D,m,v,f){if(!oe.scanForClosingTag)return!1;var o=Math.min(k.lastLine()+1,v.line+500),l=oe.scanForClosingTag(k,v,null,o);if(!l||l.tag!=m)return!1;for(var r=f?1:0,i=D.length-1;i>=0&&D[i]==m;i--)++r;v=l.to;for(var i=1;i<r;i++){var t=oe.scanForClosingTag(k,v,null,o);if(!t||t.tag!=m)return!1;v=t.to}return!0}})},BjJ7:function(Wt,st,z){"use strict";z.d(st,"d",function(){return Z}),z.d(st,"c",function(){return U}),z.d(st,"e",function(){return ee}),z.d(st,"b",function(){return W}),z.d(st,"a",function(){return $});var oe=z("m3rI");function Z(X){var k=!0;if(X.length>0){for(var D=0;D<X.length;D++)if(X[D].compile_success==0||!X[D].compile_success){k=!1;break}}else k=!1;return k}function U(X){for(var k=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],m=0;m<X.length;m++){var v=X[m],f=k?"".concat(k,"/").concat(v.name):"".concat(v.name);D.push({title:v.name,isLeaf:!(v.type==="tree"),key:f})}return D}function ee(X,k,D){for(var m=0;m<X.length;m++){var v=X[m];if(v.key===k){v.children=D;break}v.children&&ee(v.children,k,D)}return X}function W(X,k,D){var m;return function(){var v=this,f=arguments,o=function(){m=null,D||X.apply(v,f)},l=D&&!m;clearTimeout(m),m=setTimeout(o,k),l&&X.apply(v,f)}}var M=!0,$=oe.a.API_SERVER},"C+DQ":function(Wt,st,z){},DlQD:function(Wt,st,z){(function(oe,Z){Wt.exports=Z()})(this,function(){"use strict";function oe(Be,Ie){for(var ke=0;ke<Ie.length;ke++){var me=Ie[ke];me.enumerable=me.enumerable||!1,me.configurable=!0,"value"in me&&(me.writable=!0),Object.defineProperty(Be,me.key,me)}}function Z(Be,Ie,ke){return Ie&&oe(Be.prototype,Ie),ke&&oe(Be,ke),Be}function U(Be,Ie){if(!Be)return;if(typeof Be=="string")return ee(Be,Ie);var ke=Object.prototype.toString.call(Be).slice(8,-1);if(ke==="Object"&&Be.constructor&&(ke=Be.constructor.name),ke==="Map"||ke==="Set")return Array.from(Be);if(ke==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ke))return ee(Be,Ie)}function ee(Be,Ie){(Ie==null||Ie>Be.length)&&(Ie=Be.length);for(var ke=0,me=new Array(Ie);ke<Ie;ke++)me[ke]=Be[ke];return me}function W(Be,Ie){var ke;if(typeof Symbol=="undefined"||Be[Symbol.iterator]==null){if(Array.isArray(Be)||(ke=U(Be))||Ie&&Be&&typeof Be.length=="number"){ke&&(Be=ke);var me=0;return function(){return me>=Be.length?{done:!0}:{done:!1,value:Be[me++]}}}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 ke=Be[Symbol.iterator](),ke.next.bind(ke)}function M(Be,Ie){return Ie={exports:{}},Be(Ie,Ie.exports),Ie.exports}var $=M(function(Be){function Ie(){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 ke(me){Be.exports.defaults=me}Be.exports={defaults:Ie(),getDefaults:Ie,changeDefaults:ke}}),X=$.defaults,k=$.getDefaults,D=$.changeDefaults,m=/[&<>"']/,v=/[&<>"']/g,f=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},r=function(Ie){return l[Ie]};function i(Be,Ie){if(Ie){if(m.test(Be))return Be.replace(v,r)}else if(f.test(Be))return Be.replace(o,r);return Be}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function c(Be){return Be.replace(t,function(Ie,ke){return ke=ke.toLowerCase(),ke==="colon"?":":ke.charAt(0)==="#"?ke.charAt(1)==="x"?String.fromCharCode(parseInt(ke.substring(2),16)):String.fromCharCode(+ke.substring(1)):""})}var h=/(^|[^\[])\^/g;function A(Be,Ie){Be=Be.source||Be,Ie=Ie||"";var ke={replace:function(ye,Re){return Re=Re.source||Re,Re=Re.replace(h,"$1"),Be=Be.replace(ye,Re),ke},getRegex:function(){return new RegExp(Be,Ie)}};return ke}var S=/[^\w:]/g,w=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Be,Ie,ke){if(Be){var me;try{me=decodeURIComponent(c(ke)).replace(S,"").toLowerCase()}catch(ye){return null}if(me.indexOf("javascript:")===0||me.indexOf("vbscript:")===0||me.indexOf("data:")===0)return null}Ie&&!w.test(ke)&&(ke=d(Ie,ke));try{ke=encodeURI(ke).replace(/%25/g,"%")}catch(ye){return null}return ke}var R={},b=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(Be,Ie){R[" "+Be]||(b.test(Be)?R[" "+Be]=Be+"/":R[" "+Be]=F(Be,"/",!0)),Be=R[" "+Be];var ke=Be.indexOf(":")===-1;return Ie.substring(0,2)==="//"?ke?Ie:Be.replace(_,"$1")+Ie:Ie.charAt(0)==="/"?ke?Ie:Be.replace(u,"$1")+Ie:Be+Ie}var E={exec:function(){}};function g(Be){for(var Ie=1,ke,me;Ie<arguments.length;Ie++){ke=arguments[Ie];for(me in ke)Object.prototype.hasOwnProperty.call(ke,me)&&(Be[me]=ke[me])}return Be}function y(Be,Ie){var ke=Be.replace(/\|/g,function(Re,ce,Me){for(var tt=!1,bt=ce;--bt>=0&&Me[bt]==="\\";)tt=!tt;return tt?"|":" |"}),me=ke.split(/ \|/),ye=0;if(me.length>Ie)me.splice(Ie);else for(;me.length<Ie;)me.push("");for(;ye<me.length;ye++)me[ye]=me[ye].trim().replace(/\\\|/g,"|");return me}function F(Be,Ie,ke){var me=Be.length;if(me===0)return"";for(var ye=0;ye<me;){var Re=Be.charAt(me-ye-1);if(Re===Ie&&!ke)ye++;else if(Re!==Ie&&ke)ye++;else break}return Be.substr(0,me-ye)}function N(Be,Ie){if(Be.indexOf(Ie[1])===-1)return-1;for(var ke=Be.length,me=0,ye=0;ye<ke;ye++)if(Be[ye]==="\\")ye++;else if(Be[ye]===Ie[0])me++;else if(Be[ye]===Ie[1]&&(me--,me<0))return ye;return-1}function H(Be){Be&&Be.sanitize&&!Be.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var G={escape:i,unescape:c,edit:A,cleanUrl:O,resolveUrl:d,noopTest:E,merge:g,splitCells:y,rtrim:F,findClosingBracket:N,checkSanitizeDeprecation:H},I=$.defaults,x=G.rtrim,B=G.splitCells,Y=G.escape,re=G.findClosingBracket;function de(Be,Ie,ke){var me=Ie.href,ye=Ie.title?Y(Ie.title):null,Re=Be[1].replace(/\\([\[\]])/g,"$1");return Be[0].charAt(0)!=="!"?{type:"link",raw:ke,href:me,title:ye,text:Re}:{type:"image",raw:ke,href:me,title:ye,text:Y(Re)}}function he(Be,Ie){var ke=Be.match(/^(\s+)(?:```)/);if(ke===null)return Ie;var me=ke[1];return Ie.split(`
`).map(function(ye){var Re=ye.match(/^\s+/);if(Re===null)return ye;var ce=Re[0];return ce.length>=me.length?ye.slice(me.length):ye}).join(`
`)}var xe=function(){function Be(ke){this.options=ke||I}var Ie=Be.prototype;return Ie.space=function(me){var ye=this.rules.block.newline.exec(me);if(ye)return ye[0].length>1?{type:"space",raw:ye[0]}:{raw:`
`}},Ie.code=function(me,ye){var Re=this.rules.block.code.exec(me);if(Re){var ce=ye[ye.length-1];if(ce&&ce.type==="paragraph")return{raw:Re[0],text:Re[0].trimRight()};var Me=Re[0].replace(/^ {4}/gm,"");return{type:"code",raw:Re[0],codeBlockStyle:"indented",text:this.options.pedantic?Me:x(Me,`
`)}}},Ie.fences=function(me){var ye=this.rules.block.fences.exec(me);if(ye){var Re=ye[0],ce=he(Re,ye[3]||"");return{type:"code",raw:Re,lang:ye[2]?ye[2].trim():ye[2],text:ce}}},Ie.heading=function(me){var ye=this.rules.block.heading.exec(me);if(ye)return{type:"heading",raw:ye[0],depth:ye[1].length,text:ye[2]}},Ie.nptable=function(me){var ye=this.rules.block.nptable.exec(me);if(ye){var Re={type:"table",header:B(ye[1].replace(/^ *| *\| *$/g,"")),align:ye[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ye[3]?ye[3].replace(/\n$/,"").split(`
`):[],raw:ye[0]};if(Re.header.length===Re.align.length){var ce=Re.align.length,Me;for(Me=0;Me<ce;Me++)/^ *-+: *$/.test(Re.align[Me])?Re.align[Me]="right":/^ *:-+: *$/.test(Re.align[Me])?Re.align[Me]="center":/^ *:-+ *$/.test(Re.align[Me])?Re.align[Me]="left":Re.align[Me]=null;for(ce=Re.cells.length,Me=0;Me<ce;Me++)Re.cells[Me]=B(Re.cells[Me],Re.header.length);return Re}}},Ie.hr=function(me){var ye=this.rules.block.hr.exec(me);if(ye)return{type:"hr",raw:ye[0]}},Ie.blockquote=function(me){var ye=this.rules.block.blockquote.exec(me);if(ye){var Re=ye[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:ye[0],text:Re}}},Ie.list=function(me){var ye=this.rules.block.list.exec(me);if(ye){for(var Re=ye[0],ce=ye[2],Me=ce.length>1,tt=ce[ce.length-1]===")",bt={type:"list",raw:Re,ordered:Me,start:Me?+ce.slice(0,-1):"",loose:!1,items:[]},Kt=ye[0].match(this.rules.block.item),Gt=!1,$t,ei,gn,an,dn,zn,pi,mi=Kt.length,ri=0;ri<mi;ri++)$t=Kt[ri],Re=$t,ei=$t.length,$t=$t.replace(/^ *([*+-]|\d+[.)]) */,""),~$t.indexOf(`
`)&&(ei-=$t.length,$t=this.options.pedantic?$t.replace(/^ {1,4}/gm,""):$t.replace(new RegExp("^ {1,"+ei+"}","gm"),"")),ri!==mi-1&&(gn=this.rules.block.bullet.exec(Kt[ri+1])[0],(Me?gn.length===1||!tt&&gn[gn.length-1]===")":gn.length>1||this.options.smartLists&&gn!==ce)&&(an=Kt.slice(ri+1).join(`
`),bt.raw=bt.raw.substring(0,bt.raw.length-an.length),ri=mi-1)),dn=Gt||/\n\n(?!\s*$)/.test($t),ri!==mi-1&&(Gt=$t.charAt($t.length-1)===`
`,dn||(dn=Gt)),dn&&(bt.loose=!0),zn=/^\[[ xX]\] /.test($t),pi=void 0,zn&&(pi=$t[1]!==" ",$t=$t.replace(/^\[[ xX]\] +/,"")),bt.items.push({type:"list_item",raw:Re,task:zn,checked:pi,loose:dn,text:$t});return bt}},Ie.html=function(me){var ye=this.rules.block.html.exec(me);if(ye)return{type:this.options.sanitize?"paragraph":"html",raw:ye[0],pre:!this.options.sanitizer&&(ye[1]==="pre"||ye[1]==="script"||ye[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ye[0]):Y(ye[0]):ye[0]}},Ie.def=function(me){var ye=this.rules.block.def.exec(me);if(ye){ye[3]&&(ye[3]=ye[3].substring(1,ye[3].length-1));var Re=ye[1].toLowerCase().replace(/\s+/g," ");return{tag:Re,raw:ye[0],href:ye[2],title:ye[3]}}},Ie.table=function(me){var ye=this.rules.block.table.exec(me);if(ye){var Re={type:"table",header:B(ye[1].replace(/^ *| *\| *$/g,"")),align:ye[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ye[3]?ye[3].replace(/\n$/,"").split(`
`):[]};if(Re.header.length===Re.align.length){Re.raw=ye[0];var ce=Re.align.length,Me;for(Me=0;Me<ce;Me++)/^ *-+: *$/.test(Re.align[Me])?Re.align[Me]="right":/^ *:-+: *$/.test(Re.align[Me])?Re.align[Me]="center":/^ *:-+ *$/.test(Re.align[Me])?Re.align[Me]="left":Re.align[Me]=null;for(ce=Re.cells.length,Me=0;Me<ce;Me++)Re.cells[Me]=B(Re.cells[Me].replace(/^ *\| *| *\| *$/g,""),Re.header.length);return Re}}},Ie.lheading=function(me){var ye=this.rules.block.lheading.exec(me);if(ye)return{type:"heading",raw:ye[0],depth:ye[2].charAt(0)==="="?1:2,text:ye[1]}},Ie.paragraph=function(me){var ye=this.rules.block.paragraph.exec(me);if(ye)return{type:"paragraph",raw:ye[0],text:ye[1].charAt(ye[1].length-1)===`
`?ye[1].slice(0,-1):ye[1]}},Ie.text=function(me,ye){var Re=this.rules.block.text.exec(me);if(Re){var ce=ye[ye.length-1];return ce&&ce.type==="text"?{raw:Re[0],text:Re[0]}:{type:"text",raw:Re[0],text:Re[0]}}},Ie.escape=function(me){var ye=this.rules.inline.escape.exec(me);if(ye)return{type:"escape",raw:ye[0],text:Y(ye[1])}},Ie.tag=function(me,ye,Re){var ce=this.rules.inline.tag.exec(me);if(ce)return!ye&&/^<a /i.test(ce[0])?ye=!0:ye&&/^<\/a>/i.test(ce[0])&&(ye=!1),!Re&&/^<(pre|code|kbd|script)(\s|>)/i.test(ce[0])?Re=!0:Re&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ce[0])&&(Re=!1),{type:this.options.sanitize?"text":"html",raw:ce[0],inLink:ye,inRawBlock:Re,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ce[0]):Y(ce[0]):ce[0]}},Ie.link=function(me){var ye=this.rules.inline.link.exec(me);if(ye){var Re=re(ye[2],"()");if(Re>-1){var ce=ye[0].indexOf("!")===0?5:4,Me=ce+ye[1].length+Re;ye[2]=ye[2].substring(0,Re),ye[0]=ye[0].substring(0,Me).trim(),ye[3]=""}var tt=ye[2],bt="";if(this.options.pedantic){var Kt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(tt);Kt?(tt=Kt[1],bt=Kt[3]):bt=""}else bt=ye[3]?ye[3].slice(1,-1):"";tt=tt.trim().replace(/^<([\s\S]*)>$/,"$1");var Gt=de(ye,{href:tt&&tt.replace(this.rules.inline._escapes,"$1"),title:bt&&bt.replace(this.rules.inline._escapes,"$1")},ye[0]);return Gt}},Ie.reflink=function(me,ye){var Re;if((Re=this.rules.inline.reflink.exec(me))||(Re=this.rules.inline.nolink.exec(me))){var ce=(Re[2]||Re[1]).replace(/\s+/g," ");if(ce=ye[ce.toLowerCase()],!ce||!ce.href){var Me=Re[0].charAt(0);return{type:"text",raw:Me,text:Me}}var tt=de(Re,ce,Re[0]);return tt}},Ie.strong=function(me,ye,Re){Re===void 0&&(Re="");var ce=this.rules.inline.strong.start.exec(me);if(ce&&(!ce[1]||ce[1]&&(Re===""||this.rules.inline.punctuation.exec(Re)))){ye=ye.slice(-1*me.length);var Me=ce[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Me.lastIndex=0;for(var tt;(ce=Me.exec(ye))!=null;)if(tt=this.rules.inline.strong.middle.exec(ye.slice(0,ce.index+3)),tt)return{type:"strong",raw:me.slice(0,tt[0].length),text:me.slice(2,tt[0].length-2)}}},Ie.em=function(me,ye,Re){Re===void 0&&(Re="");var ce=this.rules.inline.em.start.exec(me);if(ce&&(!ce[1]||ce[1]&&(Re===""||this.rules.inline.punctuation.exec(Re)))){ye=ye.slice(-1*me.length);var Me=ce[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Me.lastIndex=0;for(var tt;(ce=Me.exec(ye))!=null;)if(tt=this.rules.inline.em.middle.exec(ye.slice(0,ce.index+2)),tt)return{type:"em",raw:me.slice(0,tt[0].length),text:me.slice(1,tt[0].length-1)}}},Ie.codespan=function(me){var ye=this.rules.inline.code.exec(me);if(ye){var Re=ye[2].replace(/\n/g," "),ce=/[^ ]/.test(Re),Me=Re.startsWith(" ")&&Re.endsWith(" ");return ce&&Me&&(Re=Re.substring(1,Re.length-1)),Re=Y(Re,!0),{type:"codespan",raw:ye[0],text:Re}}},Ie.br=function(me){var ye=this.rules.inline.br.exec(me);if(ye)return{type:"br",raw:ye[0]}},Ie.del=function(me){var ye=this.rules.inline.del.exec(me);if(ye)return{type:"del",raw:ye[0],text:ye[1]}},Ie.autolink=function(me,ye){var Re=this.rules.inline.autolink.exec(me);if(Re){var ce,Me;return Re[2]==="@"?(ce=Y(this.options.mangle?ye(Re[1]):Re[1]),Me="mailto:"+ce):(ce=Y(Re[1]),Me=ce),{type:"link",raw:Re[0],text:ce,href:Me,tokens:[{type:"text",raw:ce,text:ce}]}}},Ie.url=function(me,ye){var Re;if(Re=this.rules.inline.url.exec(me)){var ce,Me;if(Re[2]==="@")ce=Y(this.options.mangle?ye(Re[0]):Re[0]),Me="mailto:"+ce;else{var tt;do tt=Re[0],Re[0]=this.rules.inline._backpedal.exec(Re[0])[0];while(tt!==Re[0]);ce=Y(Re[0]),Re[1]==="www."?Me="http://"+ce:Me=ce}return{type:"link",raw:Re[0],text:ce,href:Me,tokens:[{type:"text",raw:ce,text:ce}]}}},Ie.inlineText=function(me,ye,Re){var ce=this.rules.inline.text.exec(me);if(ce){var Me;return ye?Me=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ce[0]):Y(ce[0]):ce[0]:Me=Y(this.options.smartypants?Re(ce[0]):ce[0]),{type:"text",raw:ce[0],text:Me}}},Be}(),Pe=G.noopTest,Ce=G.edit,Oe=G.merge,be={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\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:Pe,table:Pe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};be._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,be._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,be.def=Ce(be.def).replace("label",be._label).replace("title",be._title).getRegex(),be.bullet=/(?:[*+-]|\d{1,9}[.)])/,be.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,be.item=Ce(be.item,"gm").replace(/bull/g,be.bullet).getRegex(),be.list=Ce(be.list).replace(/bull/g,be.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+be.def.source+")").getRegex(),be._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",be._comment=/<!--(?!-?>)[\s\S]*?-->/,be.html=Ce(be.html,"i").replace("comment",be._comment).replace("tag",be._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),be.paragraph=Ce(be._paragraph).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.blockquote=Ce(be.blockquote).replace("paragraph",be.paragraph).getRegex(),be.normal=Oe({},be),be.gfm=Oe({},be.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),be.gfm.nptable=Ce(be.gfm.nptable).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.gfm.table=Ce(be.gfm.table).replace("hr",be.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",be._tag).getRegex(),be.pedantic=Oe({},be.normal,{html:Ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",be._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:Pe,paragraph:Ce(be.normal._paragraph).replace("hr",be.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",be.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var ge={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Pe,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:Pe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};ge._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",ge.punctuation=Ce(ge.punctuation).replace(/punctuation/g,ge._punctuation).getRegex(),ge._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",ge._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",ge.em.start=Ce(ge.em.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.middle=Ce(ge.em.middle).replace(/punctuation/g,ge._punctuation).replace(/overlapSkip/g,ge._overlapSkip).getRegex(),ge.em.endAst=Ce(ge.em.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.em.endUnd=Ce(ge.em.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.start=Ce(ge.strong.start).replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.middle=Ce(ge.strong.middle).replace(/punctuation/g,ge._punctuation).replace(/blockSkip/g,ge._blockSkip).getRegex(),ge.strong.endAst=Ce(ge.strong.endAst,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.strong.endUnd=Ce(ge.strong.endUnd,"g").replace(/punctuation/g,ge._punctuation).getRegex(),ge.blockSkip=Ce(ge._blockSkip,"g").getRegex(),ge.overlapSkip=Ce(ge._overlapSkip,"g").getRegex(),ge._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,ge._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,ge._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])?)+(?![-_])/,ge.autolink=Ce(ge.autolink).replace("scheme",ge._scheme).replace("email",ge._email).getRegex(),ge._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,ge.tag=Ce(ge.tag).replace("comment",be._comment).replace("attribute",ge._attribute).getRegex(),ge._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,ge._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,ge._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,ge.link=Ce(ge.link).replace("label",ge._label).replace("href",ge._href).replace("title",ge._title).getRegex(),ge.reflink=Ce(ge.reflink).replace("label",ge._label).getRegex(),ge.reflinkSearch=Ce(ge.reflinkSearch,"g").replace("reflink",ge.reflink).replace("nolink",ge.nolink).getRegex(),ge.normal=Oe({},ge),ge.pedantic=Oe({},ge.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:Ce(/^!?\[(label)\]\((.*?)\)/).replace("label",ge._label).getRegex(),reflink:Ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",ge._label).getRegex()}),ge.gfm=Oe({},ge.normal,{escape:Ce(ge.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),ge.gfm.url=Ce(ge.gfm.url,"i").replace("email",ge.gfm._extended_email).getRegex(),ge.breaks=Oe({},ge.gfm,{br:Ce(ge.br).replace("{2,}","*").getRegex(),text:Ce(ge.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var te={block:be,inline:ge},fe=$.defaults,_e=te.block,Le=te.inline;function $e(Be){return Be.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function Ue(Be){var Ie="",ke,me,ye=Be.length;for(ke=0;ke<ye;ke++)me=Be.charCodeAt(ke),Math.random()>.5&&(me="x"+me.toString(16)),Ie+="&#"+me+";";return Ie}var at=function(){function Be(ke){this.tokens=[],this.tokens.links=Object.create(null),this.options=ke||fe,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var me={block:_e.normal,inline:Le.normal};this.options.pedantic?(me.block=_e.pedantic,me.inline=Le.pedantic):this.options.gfm&&(me.block=_e.gfm,this.options.breaks?me.inline=Le.breaks:me.inline=Le.gfm),this.tokenizer.rules=me}Be.lex=function(me,ye){var Re=new Be(ye);return Re.lex(me)};var Ie=Be.prototype;return Ie.lex=function(me){return me=me.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(me,this.tokens,!0),this.inline(this.tokens),this.tokens},Ie.blockTokens=function(me,ye,Re){ye===void 0&&(ye=[]),Re===void 0&&(Re=!0),me=me.replace(/^ +$/gm,"");for(var ce,Me,tt,bt;me;){if(ce=this.tokenizer.space(me)){me=me.substring(ce.raw.length),ce.type&&ye.push(ce);continue}if(ce=this.tokenizer.code(me,ye)){me=me.substring(ce.raw.length),ce.type?ye.push(ce):(bt=ye[ye.length-1],bt.raw+=`
`+ce.raw,bt.text+=`
`+ce.text);continue}if(ce=this.tokenizer.fences(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(ce=this.tokenizer.heading(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(ce=this.tokenizer.nptable(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(ce=this.tokenizer.hr(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(ce=this.tokenizer.blockquote(me)){me=me.substring(ce.raw.length),ce.tokens=this.blockTokens(ce.text,[],Re),ye.push(ce);continue}if(ce=this.tokenizer.list(me)){for(me=me.substring(ce.raw.length),tt=ce.items.length,Me=0;Me<tt;Me++)ce.items[Me].tokens=this.blockTokens(ce.items[Me].text,[],!1);ye.push(ce);continue}if(ce=this.tokenizer.html(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(Re&&(ce=this.tokenizer.def(me))){me=me.substring(ce.raw.length),this.tokens.links[ce.tag]||(this.tokens.links[ce.tag]={href:ce.href,title:ce.title});continue}if(ce=this.tokenizer.table(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(ce=this.tokenizer.lheading(me)){me=me.substring(ce.raw.length),ye.push(ce);continue}if(Re&&(ce=this.tokenizer.paragraph(me))){me=me.substring(ce.raw.length),ye.push(ce);continue}if(ce=this.tokenizer.text(me,ye)){me=me.substring(ce.raw.length),ce.type?ye.push(ce):(bt=ye[ye.length-1],bt.raw+=`
`+ce.raw,bt.text+=`
`+ce.text);continue}if(me){var Kt="Infinite loop on byte: "+me.charCodeAt(0);if(this.options.silent){console.error(Kt);break}else throw new Error(Kt)}}return ye},Ie.inline=function(me){var ye,Re,ce,Me,tt,bt,Kt=me.length;for(ye=0;ye<Kt;ye++){bt=me[ye];switch(bt.type){case"paragraph":case"text":case"heading":{bt.tokens=[],this.inlineTokens(bt.text,bt.tokens);break}case"table":{for(bt.tokens={header:[],cells:[]},Me=bt.header.length,Re=0;Re<Me;Re++)bt.tokens.header[Re]=[],this.inlineTokens(bt.header[Re],bt.tokens.header[Re]);for(Me=bt.cells.length,Re=0;Re<Me;Re++)for(tt=bt.cells[Re],bt.tokens.cells[Re]=[],ce=0;ce<tt.length;ce++)bt.tokens.cells[Re][ce]=[],this.inlineTokens(tt[ce],bt.tokens.cells[Re][ce]);break}case"blockquote":{this.inline(bt.tokens);break}case"list":{for(Me=bt.items.length,Re=0;Re<Me;Re++)this.inline(bt.items[Re].tokens);break}}}return me},Ie.inlineTokens=function(me,ye,Re,ce,Me){ye===void 0&&(ye=[]),Re===void 0&&(Re=!1),ce===void 0&&(ce=!1),Me===void 0&&(Me="");var tt,bt=me,Kt;if(this.tokens.links){var Gt=Object.keys(this.tokens.links);if(Gt.length>0)for(;(Kt=this.tokenizer.rules.inline.reflinkSearch.exec(bt))!=null;)Gt.includes(Kt[0].slice(Kt[0].lastIndexOf("[")+1,-1))&&(bt=bt.slice(0,Kt.index)+"["+"a".repeat(Kt[0].length-2)+"]"+bt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Kt=this.tokenizer.rules.inline.blockSkip.exec(bt))!=null;)bt=bt.slice(0,Kt.index)+"["+"a".repeat(Kt[0].length-2)+"]"+bt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;me;){if(tt=this.tokenizer.escape(me)){me=me.substring(tt.raw.length),ye.push(tt);continue}if(tt=this.tokenizer.tag(me,Re,ce)){me=me.substring(tt.raw.length),Re=tt.inLink,ce=tt.inRawBlock,ye.push(tt);continue}if(tt=this.tokenizer.link(me)){me=me.substring(tt.raw.length),tt.type==="link"&&(tt.tokens=this.inlineTokens(tt.text,[],!0,ce)),ye.push(tt);continue}if(tt=this.tokenizer.reflink(me,this.tokens.links)){me=me.substring(tt.raw.length),tt.type==="link"&&(tt.tokens=this.inlineTokens(tt.text,[],!0,ce)),ye.push(tt);continue}if(tt=this.tokenizer.strong(me,bt,Me)){me=me.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Re,ce),ye.push(tt);continue}if(tt=this.tokenizer.em(me,bt,Me)){me=me.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Re,ce),ye.push(tt);continue}if(tt=this.tokenizer.codespan(me)){me=me.substring(tt.raw.length),ye.push(tt);continue}if(tt=this.tokenizer.br(me)){me=me.substring(tt.raw.length),ye.push(tt);continue}if(tt=this.tokenizer.del(me)){me=me.substring(tt.raw.length),tt.tokens=this.inlineTokens(tt.text,[],Re,ce),ye.push(tt);continue}if(tt=this.tokenizer.autolink(me,Ue)){me=me.substring(tt.raw.length),ye.push(tt);continue}if(!Re&&(tt=this.tokenizer.url(me,Ue))){me=me.substring(tt.raw.length),ye.push(tt);continue}if(tt=this.tokenizer.inlineText(me,ce,$e)){me=me.substring(tt.raw.length),Me=tt.raw.slice(-1),ye.push(tt);continue}if(me){var $t="Infinite loop on byte: "+me.charCodeAt(0);if(this.options.silent){console.error($t);break}else throw new Error($t)}}return ye},Z(Be,null,[{key:"rules",get:function(){return{block:_e,inline:Le}}}]),Be}(),ft=$.defaults,Ct=G.cleanUrl,yt=G.escape,_t=function(){function Be(ke){this.options=ke||ft}var Ie=Be.prototype;return Ie.code=function(me,ye,Re){var ce=(ye||"").match(/\S*/)[0];if(this.options.highlight){var Me=this.options.highlight(me,ce);Me!=null&&Me!==me&&(Re=!0,me=Me)}return ce?'<pre><code class="'+this.options.langPrefix+yt(ce,!0)+'">'+(Re?me:yt(me,!0))+`</code></pre>
`:"<pre><code>"+(Re?me:yt(me,!0))+`</code></pre>
`},Ie.blockquote=function(me){return`<blockquote>
`+me+`</blockquote>
`},Ie.html=function(me){return me},Ie.heading=function(me,ye,Re,ce){return this.options.headerIds?"<h"+ye+' id="'+this.options.headerPrefix+ce.slug(Re)+'">'+me+"</h"+ye+`>
`:"<h"+ye+">"+me+"</h"+ye+`>
`},Ie.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Ie.list=function(me,ye,Re){var ce=ye?"ol":"ul",Me=ye&&Re!==1?' start="'+Re+'"':"";return"<"+ce+Me+`>
`+me+"</"+ce+`>
`},Ie.listitem=function(me){return"<li>"+me+`</li>
`},Ie.checkbox=function(me){return"<input "+(me?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ie.paragraph=function(me){return"<p>"+me+`</p>
`},Ie.table=function(me,ye){return ye&&(ye="<tbody>"+ye+"</tbody>"),`<table>
<thead>
`+me+`</thead>
`+ye+`</table>
`},Ie.tablerow=function(me){return`<tr>
`+me+`</tr>
`},Ie.tablecell=function(me,ye){var Re=ye.header?"th":"td",ce=ye.align?"<"+Re+' align="'+ye.align+'">':"<"+Re+">";return ce+me+"</"+Re+`>
`},Ie.strong=function(me){return"<strong>"+me+"</strong>"},Ie.em=function(me){return"<em>"+me+"</em>"},Ie.codespan=function(me){return"<code>"+me+"</code>"},Ie.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ie.del=function(me){return"<del>"+me+"</del>"},Ie.link=function(me,ye,Re){if(me=Ct(this.options.sanitize,this.options.baseUrl,me),me===null)return Re;var ce='<a href="'+yt(me)+'"';return ye&&(ce+=' title="'+ye+'"'),ce+=">"+Re+"</a>",ce},Ie.image=function(me,ye,Re){if(me=Ct(this.options.sanitize,this.options.baseUrl,me),me===null)return Re;var ce='<img src="'+me+'" alt="'+Re+'"';return ye&&(ce+=' title="'+ye+'"'),ce+=this.options.xhtml?"/>":">",ce},Ie.text=function(me){return me},Be}(),lt=function(){function Be(){}var Ie=Be.prototype;return Ie.strong=function(me){return me},Ie.em=function(me){return me},Ie.codespan=function(me){return me},Ie.del=function(me){return me},Ie.html=function(me){return me},Ie.text=function(me){return me},Ie.link=function(me,ye,Re){return""+Re},Ie.image=function(me,ye,Re){return""+Re},Ie.br=function(){return""},Be}(),Ft=function(){function Be(){this.seen={}}var Ie=Be.prototype;return Ie.slug=function(me){var ye=me.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ye)){var Re=ye;do this.seen[Re]++,ye=Re+"-"+this.seen[Re];while(this.seen.hasOwnProperty(ye))}return this.seen[ye]=0,ye},Be}(),Xt=$.defaults,Jt=G.unescape,rn=function(){function Be(ke){this.options=ke||Xt,this.options.renderer=this.options.renderer||new _t,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new lt,this.slugger=new Ft}Be.parse=function(me,ye){var Re=new Be(ye);return Re.parse(me)};var Ie=Be.prototype;return Ie.parse=function(me,ye){ye===void 0&&(ye=!0);var Re="",ce,Me,tt,bt,Kt,Gt,$t,ei,gn,an,dn,zn,pi,mi,ri,_i,Si,At,Wn=me.length;for(ce=0;ce<Wn;ce++){an=me[ce];switch(an.type){case"space":continue;case"hr":{Re+=this.renderer.hr();continue}case"heading":{Re+=this.renderer.heading(this.parseInline(an.tokens),an.depth,Jt(this.parseInline(an.tokens,this.textRenderer)),this.slugger);continue}case"code":{Re+=this.renderer.code(an.text,an.lang,an.escaped);continue}case"table":{for(ei="",$t="",bt=an.header.length,Me=0;Me<bt;Me++)$t+=this.renderer.tablecell(this.parseInline(an.tokens.header[Me]),{header:!0,align:an.align[Me]});for(ei+=this.renderer.tablerow($t),gn="",bt=an.cells.length,Me=0;Me<bt;Me++){for(Gt=an.tokens.cells[Me],$t="",Kt=Gt.length,tt=0;tt<Kt;tt++)$t+=this.renderer.tablecell(this.parseInline(Gt[tt]),{header:!1,align:an.align[tt]});gn+=this.renderer.tablerow($t)}Re+=this.renderer.table(ei,gn);continue}case"blockquote":{gn=this.parse(an.tokens),Re+=this.renderer.blockquote(gn);continue}case"list":{for(dn=an.ordered,zn=an.start,pi=an.loose,bt=an.items.length,gn="",Me=0;Me<bt;Me++)ri=an.items[Me],_i=ri.checked,Si=ri.task,mi="",ri.task&&(At=this.renderer.checkbox(_i),pi?ri.tokens.length>0&&ri.tokens[0].type==="text"?(ri.tokens[0].text=At+" "+ri.tokens[0].text,ri.tokens[0].tokens&&ri.tokens[0].tokens.length>0&&ri.tokens[0].tokens[0].type==="text"&&(ri.tokens[0].tokens[0].text=At+" "+ri.tokens[0].tokens[0].text)):ri.tokens.unshift({type:"text",text:At}):mi+=At),mi+=this.parse(ri.tokens,pi),gn+=this.renderer.listitem(mi,Si,_i);Re+=this.renderer.list(gn,dn,zn);continue}case"html":{Re+=this.renderer.html(an.text);continue}case"paragraph":{Re+=this.renderer.paragraph(this.parseInline(an.tokens));continue}case"text":{for(gn=an.tokens?this.parseInline(an.tokens):an.text;ce+1<Wn&&me[ce+1].type==="text";)an=me[++ce],gn+=`
`+(an.tokens?this.parseInline(an.tokens):an.text);Re+=ye?this.renderer.paragraph(gn):gn;continue}default:{var hi='Token with "'+an.type+'" type was not found.';if(this.options.silent){console.error(hi);return}else throw new Error(hi)}}}return Re},Ie.parseInline=function(me,ye){ye=ye||this.renderer;var Re="",ce,Me,tt=me.length;for(ce=0;ce<tt;ce++){Me=me[ce];switch(Me.type){case"escape":{Re+=ye.text(Me.text);break}case"html":{Re+=ye.html(Me.text);break}case"link":{Re+=ye.link(Me.href,Me.title,this.parseInline(Me.tokens,ye));break}case"image":{Re+=ye.image(Me.href,Me.title,Me.text);break}case"strong":{Re+=ye.strong(this.parseInline(Me.tokens,ye));break}case"em":{Re+=ye.em(this.parseInline(Me.tokens,ye));break}case"codespan":{Re+=ye.codespan(Me.text);break}case"br":{Re+=ye.br();break}case"del":{Re+=ye.del(this.parseInline(Me.tokens,ye));break}case"text":{Re+=ye.text(Me.text);break}default:{var bt='Token with "'+Me.type+'" type was not found.';if(this.options.silent){console.error(bt);return}else throw new Error(bt)}}}return Re},Be}(),En=G.merge,mn=G.checkSanitizeDeprecation,Ye=G.escape,Xe=$.getDefaults,Ot=$.changeDefaults,Et=$.defaults;function Je(Be,Ie,ke){if(typeof Be=="undefined"||Be===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Be!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Be)+", string expected");if(typeof Ie=="function"&&(ke=Ie,Ie=null),Ie=En({},Je.defaults,Ie||{}),mn(Ie),ke){var me=Ie.highlight,ye;try{ye=at.lex(Be,Ie)}catch(tt){return ke(tt)}var Re=function(bt){var Kt;if(!bt)try{Kt=rn.parse(ye,Ie)}catch(Gt){bt=Gt}return Ie.highlight=me,bt?ke(bt):ke(null,Kt)};if(!me||me.length<3)return Re();if(delete Ie.highlight,!ye.length)return Re();var ce=0;Je.walkTokens(ye,function(tt){tt.type==="code"&&(ce++,setTimeout(function(){me(tt.text,tt.lang,function(bt,Kt){if(bt)return Re(bt);Kt!=null&&Kt!==tt.text&&(tt.text=Kt,tt.escaped=!0),ce--,ce===0&&Re()})},0))}),ce===0&&Re();return}try{var Me=at.lex(Be,Ie);return Ie.walkTokens&&Je.walkTokens(Me,Ie.walkTokens),rn.parse(Me,Ie)}catch(tt){if(tt.message+=`
Please report this to https://github.com/markedjs/marked.`,Ie.silent)return"<p>An error occurred:</p><pre>"+Ye(tt.message+"",!0)+"</pre>";throw tt}}Je.options=Je.setOptions=function(Be){return En(Je.defaults,Be),Ot(Je.defaults),Je},Je.getDefaults=Xe,Je.defaults=Et,Je.use=function(Be){var Ie=En({},Be);if(Be.renderer&&function(){var me=Je.defaults.renderer||new _t,ye=function(Me){var tt=me[Me];me[Me]=function(){for(var bt=arguments.length,Kt=new Array(bt),Gt=0;Gt<bt;Gt++)Kt[Gt]=arguments[Gt];var $t=Be.renderer[Me].apply(me,Kt);return $t===!1&&($t=tt.apply(me,Kt)),$t}};for(var Re in Be.renderer)ye(Re);Ie.renderer=me}(),Be.tokenizer&&function(){var me=Je.defaults.tokenizer||new xe,ye=function(Me){var tt=me[Me];me[Me]=function(){for(var bt=arguments.length,Kt=new Array(bt),Gt=0;Gt<bt;Gt++)Kt[Gt]=arguments[Gt];var $t=Be.tokenizer[Me].apply(me,Kt);return $t===!1&&($t=tt.apply(me,Kt)),$t}};for(var Re in Be.tokenizer)ye(Re);Ie.tokenizer=me}(),Be.walkTokens){var ke=Je.defaults.walkTokens;Ie.walkTokens=function(me){Be.walkTokens(me),ke&&ke(me)}}Je.setOptions(Ie)},Je.walkTokens=function(Be,Ie){for(var ke=W(Be),me;!(me=ke()).done;){var ye=me.value;Ie(ye);switch(ye.type){case"table":{for(var Re=W(ye.tokens.header),ce;!(ce=Re()).done;){var Me=ce.value;Je.walkTokens(Me,Ie)}for(var tt=W(ye.tokens.cells),bt;!(bt=tt()).done;)for(var Kt=bt.value,Gt=W(Kt),$t;!($t=Gt()).done;){var ei=$t.value;Je.walkTokens(ei,Ie)}break}case"list":{Je.walkTokens(ye.items,Ie);break}default:ye.tokens&&Je.walkTokens(ye.tokens,Ie)}}},Je.Parser=rn,Je.parser=rn.parse,Je.Renderer=_t,Je.TextRenderer=lt,Je.Lexer=at,Je.lexer=at.lex,Je.Tokenizer=xe,Je.Slugger=Ft,Je.parse=Je;var mt=Je;return mt})},ELLl:function(Wt,st,z){(function(oe){oe(z("VrN/"))})(function(oe){var Z={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},U=oe.Pos;oe.defineOption("autoCloseBrackets",!1,function(l,r,i){i&&i!=oe.Init&&(l.removeKeyMap(W),l.state.closeBrackets=null),r&&(M(ee(r,"pairs")),l.state.closeBrackets=r,l.addKeyMap(W))});function ee(l,r){return r=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[r]!=null?l[r]:Z[r]}var W={Backspace:k,Enter:D};function M(l){for(var r=0;r<l.length;r++){var i=l.charAt(r),t="'"+i+"'";W[t]||(W[t]=$(i))}}M(Z.pairs+"`");function $(l){return function(r){return v(r,l)}}function X(l){var r=l.state.closeBrackets;if(!r||r.override)return r;var i=l.getModeAt(l.getCursor());return i.closeBrackets||r}function k(l){var r=X(l);if(!r||l.getOption("disableInput"))return oe.Pass;for(var i=ee(r,"pairs"),t=l.listSelections(),c=0;c<t.length;c++){if(!t[c].empty())return oe.Pass;var h=f(l,t[c].head);if(!h||i.indexOf(h)%2!=0)return oe.Pass}for(var c=t.length-1;c>=0;c--){var A=t[c].head;l.replaceRange("",U(A.line,A.ch-1),U(A.line,A.ch+1),"+delete")}}function D(l){var r=X(l),i=r&&ee(r,"explode");if(!i||l.getOption("disableInput"))return oe.Pass;for(var t=l.listSelections(),c=0;c<t.length;c++){if(!t[c].empty())return oe.Pass;var h=f(l,t[c].head);if(!h||i.indexOf(h)%2!=0)return oe.Pass}l.operation(function(){var A=l.lineSeparator()||`
`;l.replaceSelection(A+A,null),l.execCommand("goCharLeft"),t=l.listSelections();for(var S=0;S<t.length;S++){var w=t[S].head.line;l.indentLine(w,null,!0),l.indentLine(w+1,null,!0)}})}function m(l){var r=oe.cmpPos(l.anchor,l.head)>0;return{anchor:new U(l.anchor.line,l.anchor.ch+(r?-1:1)),head:new U(l.head.line,l.head.ch+(r?1:-1))}}function v(l,r){var i=X(l);if(!i||l.getOption("disableInput"))return oe.Pass;var t=ee(i,"pairs"),c=t.indexOf(r);if(c==-1)return oe.Pass;for(var h=ee(i,"closeBefore"),A=ee(i,"triples"),S=t.charAt(c+1)==r,w=l.listSelections(),O=c%2==0,R,b=0;b<w.length;b++){var _=w[b],u=_.head,d,E=l.getRange(u,U(u.line,u.ch+1));if(O&&!_.empty())d="surround";else if((S||!O)&&E==r)S&&o(l,u)?d="both":A.indexOf(r)>=0&&l.getRange(u,U(u.line,u.ch+3))==r+r+r?d="skipThree":d="skip";else if(S&&u.ch>1&&A.indexOf(r)>=0&&l.getRange(U(u.line,u.ch-2),u)==r+r){if(u.ch>2&&/\bstring/.test(l.getTokenTypeAt(U(u.line,u.ch-2))))return oe.Pass;d="addFour"}else if(S){var g=u.ch==0?" ":l.getRange(U(u.line,u.ch-1),u);if(!oe.isWordChar(E)&&g!=r&&!oe.isWordChar(g))d="both";else return oe.Pass}else if(O&&(E.length===0||/\s/.test(E)||h.indexOf(E)>-1))d="both";else return oe.Pass;if(!R)R=d;else if(R!=d)return oe.Pass}var y=c%2?t.charAt(c-1):r,F=c%2?r:t.charAt(c+1);l.operation(function(){if(R=="skip")l.execCommand("goCharRight");else if(R=="skipThree")for(var N=0;N<3;N++)l.execCommand("goCharRight");else if(R=="surround"){for(var H=l.getSelections(),N=0;N<H.length;N++)H[N]=y+H[N]+F;l.replaceSelections(H,"around"),H=l.listSelections().slice();for(var N=0;N<H.length;N++)H[N]=m(H[N]);l.setSelections(H)}else R=="both"?(l.replaceSelection(y+F,null),l.triggerElectric(y+F),l.execCommand("goCharLeft")):R=="addFour"&&(l.replaceSelection(y+y+y+y,"before"),l.execCommand("goCharRight"))})}function f(l,r){var i=l.getRange(U(r.line,r.ch-1),U(r.line,r.ch+1));return i.length==2?i:null}function o(l,r){var i=l.getTokenAt(U(r.line,r.ch+1));return/\bstring/.test(i.type)&&i.start==r.ch&&(r.ch==0||!/\bstring/.test(l.getTokenTypeAt(r)))}})},GfqC:function(Wt,st,z){"use strict";var oe=z("q1tI"),Z=z.n(oe),U=z("TSYQ"),ee=z.n(U);function W(G,I){var x="cannot "+G.method+" "+G.action+" "+I.status+"'",B=new Error(x);return B.status=I.status,B.method=G.method,B.url=G.action,B}function M(G){var I=G.responseText||G.response;if(!I)return I;try{return JSON.parse(I)}catch(x){return I}}function $(G){var I=new XMLHttpRequest;G.onProgress&&I.upload&&(I.upload.onprogress=function(re){re.total>0&&(re.percent=re.loaded/re.total*100),G.onProgress(re)});var x=new FormData;G.data&&Object.keys(G.data).forEach(function(Y){var re=G.data[Y];if(Array.isArray(re)){re.forEach(function(de){x.append(Y+"[]",de)});return}x.append(Y,G.data[Y])}),G.file instanceof Blob?x.append(G.filename,G.file,G.file.name):x.append(G.filename,G.file),I.onerror=function(re){G.onError(re)},I.onload=function(){return I.status<200||I.status>=300?G.onError(W(G,I),M(I)):G.onSuccess(M(I),I)},I.open(G.method,G.action,!0),G.withCredentials&&"withCredentials"in I&&(I.withCredentials=!0);var B=G.headers||{};return B["X-Requested-With"]!==null&&I.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(B).forEach(function(Y){B[Y]!==null&&I.setRequestHeader(Y,B[Y])}),I.send(x),{abort:function(){I.abort()}}}var X=+new Date,k=0;function D(){return"rc-upload-"+X+"-"+ ++k}function m(G,I){return G.indexOf(I,G.length-I.length)!==-1}var v=function(G,I){if(G&&I){var x=Array.isArray(I)?I:I.split(","),B=G.name||"",Y=G.type||"",re=Y.replace(/\/.*$/,"");return x.some(function(de){var he=de.trim();return he.charAt(0)==="."?m(B.toLowerCase(),he.toLowerCase()):/\/\*$/.test(he)?re===he.replace(/\/.*$/,""):Y===he})}return!0};function f(G,I){var x=G.createReader(),B=[];function Y(){x.readEntries(function(re){var de=Array.prototype.slice.apply(re);B=B.concat(de);var he=!de.length;he?I(B):Y()})}Y()}var o=function(I,x,B){var Y=function re(de,he){he=he||"",de.isFile?de.file(function(xe){B(xe)&&(de.fullPath&&!xe.webkitRelativePath&&(Object.defineProperties(xe,{webkitRelativePath:{writable:!0}}),xe.webkitRelativePath=de.fullPath.replace(/^\//,""),Object.defineProperties(xe,{webkitRelativePath:{writable:!1}})),x([xe]))}):de.isDirectory&&f(de,function(xe){xe.forEach(function(Pe){re(Pe,""+he+de.name+"/")})})};I.forEach(function(re){Y(re.webkitGetAsEntry())})},l=o,r=Object.assign||function(G){for(var I=1;I<arguments.length;I++){var x=arguments[I];for(var B in x)Object.prototype.hasOwnProperty.call(x,B)&&(G[B]=x[B])}return G},i=function(){function G(I,x){var B=[],Y=!0,re=!1,de=void 0;try{for(var he=I[Symbol.iterator](),xe;!(Y=(xe=he.next()).done)&&!(B.push(xe.value),x&&B.length===x);Y=!0);}catch(Pe){re=!0,de=Pe}finally{try{!Y&&he.return&&he.return()}finally{if(re)throw de}}return B}return function(I,x){if(Array.isArray(I))return I;if(Symbol.iterator in Object(I))return G(I,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),t=function(){function G(I,x){for(var B=0;B<x.length;B++){var Y=x[B];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(I,Y.key,Y)}}return function(I,x,B){return x&&G(I.prototype,x),B&&G(I,B),I}}();function c(G,I,x){return I in G?Object.defineProperty(G,I,{value:x,enumerable:!0,configurable:!0,writable:!0}):G[I]=x,G}function h(G,I){var x={};for(var B in G){if(I.indexOf(B)>=0)continue;if(!Object.prototype.hasOwnProperty.call(G,B))continue;x[B]=G[B]}return x}function A(G,I){if(!(G instanceof I))throw new TypeError("Cannot call a class as a function")}function S(G,I){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:G}function w(G,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);G.prototype=Object.create(I&&I.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(G,I):G.__proto__=I)}var O=function(I){return Object.keys(I).reduce(function(x,B){return(B.substr(0,5)==="data-"||B.substr(0,5)==="aria-"||B==="role")&&(x[B]=I[B]),x},{})},R=function(G){w(I,G);function I(){var x,B,Y,re;A(this,I);for(var de=arguments.length,he=Array(de),xe=0;xe<de;xe++)he[xe]=arguments[xe];return re=(B=(Y=S(this,(x=I.__proto__||Object.getPrototypeOf(I)).call.apply(x,[this].concat(he))),Y),Y.state={uid:D()},Y.reqs={},Y.onChange=function(Pe){var Ce=Pe.target.files;Y.uploadFiles(Ce),Y.reset()},Y.onClick=function(Pe){var Ce=Y.fileInput;if(!Ce)return;var Oe=Y.props,be=Oe.children,ge=Oe.onClick;be&&be.type==="button"&&(Ce.parentNode.focus(),Ce.parentNode.querySelector("button").blur()),Ce.click(),ge&&ge(Pe)},Y.onKeyDown=function(Pe){Pe.key==="Enter"&&Y.onClick()},Y.onFileDrop=function(Pe){var Ce=Y.props.multiple;if(Pe.preventDefault(),Pe.type==="dragover")return;if(Y.props.directory)l(Array.prototype.slice.call(Pe.dataTransfer.items),Y.uploadFiles,function(be){return v(be,Y.props.accept)});else{var Oe=Array.prototype.slice.call(Pe.dataTransfer.files).filter(function(be){return v(be,Y.props.accept)});Ce===!1&&(Oe=Oe.slice(0,1)),Y.uploadFiles(Oe)}},Y.uploadFiles=function(Pe){var Ce=Array.prototype.slice.call(Pe);Ce.map(function(Oe){return Oe.uid=D(),Oe}).forEach(function(Oe){Y.upload(Oe,Ce)})},Y.saveFileInput=function(Pe){Y.fileInput=Pe},B),S(Y,re)}return t(I,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(B,Y){var re=this,de=this.props;if(!de.beforeUpload)return setTimeout(function(){return re.post(B)},0);var he=de.beforeUpload(B,Y);he&&he.then?he.then(function(xe){var Pe=Object.prototype.toString.call(xe);return Pe==="[object File]"||Pe==="[object Blob]"?re.post(xe):re.post(B)}).catch(function(xe){console.log(xe)}):he!==!1&&setTimeout(function(){return re.post(B)},0);return}},{key:"post",value:function(B){var Y=this;if(!this._isMounted)return;var re=this.props,de=re.onStart,he=re.onProgress,xe=re.transformFile,Pe=xe===void 0?function(Ce){return Ce}:xe;new Promise(function(Ce){var Oe=re.action;return typeof Oe=="function"&&(Oe=Oe(B)),Ce(Oe)}).then(function(Ce){var Oe=B.uid,be=re.customRequest||$,ge=Promise.resolve(Pe(B)).then(function(te){var fe=re.data;return typeof fe=="function"&&(fe=fe(te)),Promise.all([te,fe])}).catch(function(te){console.error(te)});ge.then(function(te){var fe=i(te,2),_e=fe[0],Le=fe[1],$e={action:Ce,filename:re.name,data:Le,file:_e,headers:re.headers,withCredentials:re.withCredentials,method:re.method||"post",onProgress:he?function(Ue){he(Ue,B)}:null,onSuccess:function(at,ft){delete Y.reqs[Oe],re.onSuccess(at,B,ft)},onError:function(at,ft){delete Y.reqs[Oe],re.onError(at,ft,B)}};de(B),Y.reqs[Oe]=be($e)})})}},{key:"reset",value:function(){this.setState({uid:D()})}},{key:"abort",value:function(B){var Y=this.reqs;if(B){var re=B;B&&B.uid&&(re=B.uid),Y[re]&&Y[re].abort&&Y[re].abort(),delete Y[re]}else Object.keys(Y).forEach(function(de){Y[de]&&Y[de].abort&&Y[de].abort(),delete Y[de]})}},{key:"render",value:function(){var B,Y=this.props,re=Y.component,de=Y.prefixCls,he=Y.className,xe=Y.disabled,Pe=Y.id,Ce=Y.style,Oe=Y.multiple,be=Y.accept,ge=Y.children,te=Y.directory,fe=Y.openFileDialogOnClick,_e=Y.onMouseEnter,Le=Y.onMouseLeave,$e=h(Y,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Ue=ee()((B={},c(B,de,!0),c(B,de+"-disabled",xe),c(B,he,he),B)),at=xe?{}:{onClick:fe?this.onClick:function(){},onKeyDown:fe?this.onKeyDown:function(){},onMouseEnter:_e,onMouseLeave:Le,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Z.a.createElement(re,r({},at,{className:Ue,role:"button",style:Ce}),Z.a.createElement("input",r({},O($e),{id:Pe,type:"file",ref:this.saveFileInput,onClick:function(Ct){return Ct.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:be,directory:te?"directory":null,webkitdirectory:te?"webkitdirectory":null,multiple:Oe,onChange:this.onChange})),ge)}}]),I}(oe.Component),b=R,_=Object.assign||function(G){for(var I=1;I<arguments.length;I++){var x=arguments[I];for(var B in x)Object.prototype.hasOwnProperty.call(x,B)&&(G[B]=x[B])}return G},u=function(){function G(I,x){for(var B=0;B<x.length;B++){var Y=x[B];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(I,Y.key,Y)}}return function(I,x,B){return x&&G(I.prototype,x),B&&G(I,B),I}}();function d(G,I){if(!(G instanceof I))throw new TypeError("Cannot call a class as a function")}function E(G,I){if(!G)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return I&&(typeof I=="object"||typeof I=="function")?I:G}function g(G,I){if(typeof I!="function"&&I!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof I);G.prototype=Object.create(I&&I.prototype,{constructor:{value:G,enumerable:!1,writable:!0,configurable:!0}}),I&&(Object.setPrototypeOf?Object.setPrototypeOf(G,I):G.__proto__=I)}function y(){}var F=function(G){g(I,G);function I(){var x,B,Y,re;d(this,I);for(var de=arguments.length,he=Array(de),xe=0;xe<de;xe++)he[xe]=arguments[xe];return re=(B=(Y=E(this,(x=I.__proto__||Object.getPrototypeOf(I)).call.apply(x,[this].concat(he))),Y),Y.saveUploader=function(Pe){Y.uploader=Pe},B),E(Y,re)}return u(I,[{key:"abort",value:function(B){this.uploader.abort(B)}},{key:"render",value:function(){return Z.a.createElement(b,_({},this.props,{ref:this.saveUploader}))}}]),I}(oe.Component);F.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:y,onError:y,onSuccess:y,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var N=F,H=st.a=N},HmJG:function(Wt,st,z){},IBYe:function(Wt,st,z){"use strict";function oe(Z){return null}st.a=oe},LYsE:function(Wt,st,z){"use strict";var oe=z("9og8"),Z=z("giR+"),U=z("fyUT"),ee=z("2qtc"),W=z("kLXV"),M=z("/zsF"),$=z("PArb"),X=z("14J3"),k=z("BMrR"),D=z("+L6B"),m=z("2/Rp"),v=z("k1fw"),f=z("0Owb"),o=z("tJVT"),l=z("WmNS"),r=z.n(l),i=z("q1tI"),t=z.n(i),c=z("5Dmo"),h=z("3S7+"),A=z("5NDa"),S=z("5rEg"),w=z("jCWc"),O=z("kPKH"),R=z("BoS7"),b=z("Sdc0"),_=z("7Kak"),u=z("9yH6"),d=z("sRBo"),E=z("kaz8"),g=z("miYZ"),y=z("tsqr"),F=z("oBTY"),N=z("PpiC"),H=z("Ty5D"),G=z("9kvl"),I=z("V0Rq"),x=z("Ot1p"),B=z("kqOp"),Y=z("7qnI"),re=z("1vsH"),de=z("YJx+"),he=z.n(de),xe=z("9Bee"),Pe=z("u2Z1"),Ce=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Oe="\u2581",be=function(je,It){var Ne=je.problemset,Ee=je.globalSetting,ve=je.exercise,di=je.loading,en=je.dispatch,De=je.editData,ht=je.editKey,we=je.setEditKey,un=we===void 0?function(){}:we,fi=je.cancelAdd,gi=fi===void 0?function(){}:fi,q=je.addCallback,C=q===void 0?function(){}:q,L=je.reload,V=L===void 0?function(){}:L,ae=je.setIsClaer,Q=ae===void 0?function(){}:ae,Ae=Object(N.a)(je,["problemset","globalSetting","exercise","loading","dispatch","editData","editKey","setEditKey","cancelAdd","addCallback","reload","setIsClaer"]),nt=Object(i.useState)(""),xt=Object(o.a)(nt,2),Dt=xt[0],ot=xt[1],vt=Object(i.useState)(""),Lt=Object(o.a)(vt,2),wn=Lt[0],Xn=Lt[1],jn=Object(i.useState)([]),cn=Object(o.a)(jn,2),jt=cn[0],nn=cn[1],qt=Object(i.useState)(""),Nt=Object(o.a)(qt,2),$n=Nt[0],Un=Nt[1],xn=Object(i.useState)(),Yn=Object(o.a)(xn,2),hn=Yn[0],Tn=Yn[1],ln=Object(i.useState)(!1),Mn=Object(o.a)(ln,2),Vn=Mn[0],ni=Mn[1],Pn=Object(i.useState)(),Hn=Object(o.a)(Pn,2),tn=Hn[0],vn=Hn[1],Ln=Object(i.useState)(0),Cn=Object(o.a)(Ln,2),Qn=Cn[0],_n=Cn[1],Gn=Object(i.useState)(!1),qn=Object(o.a)(Gn,2),In=qn[0],Dn=qn[1],kn=Object(i.useState)(!1),An=Object(o.a)(kn,2),sn=An[0],Mt=An[1],zt=Object(i.useState)([]),Vt=Object(o.a)(zt,2),Bt=Vt[0],Zt=Vt[1],yn=Object(i.useState)(1),pn=Object(o.a)(yn,2),gt=pn[0],it=pn[1],Ve=Object(i.useState)(!1),qe=Object(o.a)(Ve,2),We=qe[0],dt=qe[1],Ze=Object(i.useRef)(!1),wt=Object(H.i)(),kt=Object(i.useState)([]),Tt=Object(o.a)(kt,2),Ht=Tt[0],St=Tt[1],Pt=function(si){St([].concat(Object(F.a)(Ht),[Object(v.a)({},si)]))};Object(i.useEffect)(function(){if(Ze.current)return;if(!(De!=null&&De.question_title)){Dn(!0),ot(""),Tn(!1),vn(2),nn([]),Un(""),ni(!1);return}ot(De==null?void 0:De.question_title),Tn(De==null?void 0:De.is_ordered),it(De==null?void 0:De.difficulty),dt(!(De!=null&&De.repeat_answer)),vn(De==null?void 0:De.question_score);var bi=De==null?void 0:De.standard_answer.map(function(si){return si.answer_text});nn(Object(F.a)(bi)),Zt(De.tag_discipline_ids),Xn(De==null?void 0:De.analysis)},[De,In]),Object(i.useEffect)(function(){ni(!1),In&&bi();function bi(){return si.apply(this,arguments)}function si(){return si=Object(oe.a)(r.a.mark(function Ei(){var yi,xi,Ui;return r.a.wrap(function(Fi){for(;;)switch(Fi.prev=Fi.next){case 0:return Fi.next=2,Object(I.I)({sub_discipline_id:(yi=ve.editData)===null||yi===void 0||((xi=yi.exercise)===null||xi===void 0)?void 0:xi.sub_discipline_id});case 2:Ui=Fi.sent,St(Ui.tag_disciplines);case 4:case"end":return Fi.stop()}},Ei)})),si.apply(this,arguments)}},[In]),Object(i.useImperativeHandle)(It,function(){return{onSave:on,isEdit:In}}),Object(i.useEffect)(function(){var bi,si=ve!=null&&(bi=ve.tagDisciplineData)!==null&&bi!==void 0&&bi.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];St(si)},[ve.tagDisciplineData]);var bn=function(si){(si==null?void 0:si.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Dn(!1),un(-1),Ze.current=!1,V())},on=function(){var bi=Object(oe.a)(r.a.mark(function si(){var Ei,yi,xi,Ui,Vi,Fi,Ii;return r.a.wrap(function(Ki){for(;;)switch(Ki.prev=Ki.next){case 0:if(Ei=[],yi=!1,Mt(!0),jt.forEach(function(Sr,Ji){Ei.push({choice_id:Ji+1,answer_text:[]}),Sr.forEach(function(er,yr){Ei[Ji].answer_text.push(er),(!er||!Object(re.db)(er,1e4))&&(Un("".concat(Ji,"-").concat(yr)),y.b.info(er?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),yi=!0)})}),!yi){Ki.next=7;break}return Mt(!1),Ki.abrupt("return",!1);case 7:if(Ze.current=!0,!De.question_id){Ki.next=19;break}if(!((De==null?void 0:De.is_my)===1)){Ki.next=13;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Sr=Object(oe.a)(r.a.mark(function er(){var yr,Or;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return fr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:De.question_id,question_title:Dt,question_type:3,question_score:tn,is_ordered:hn,standard_answers:Ei,tag_discipline_ids:Bt,sub_discipline_id:(yr=ve.editData)===null||yr===void 0||((Or=yr.exercise)===null||Or===void 0)?void 0:Or.sub_discipline_id,difficulty:gt,is_cover:1,repeat_answer:!We,analysis:wn}});case 2:xi=fr.sent,bn(xi);case 4:case"end":return fr.stop()}},er)}));function Ji(){return Sr.apply(this,arguments)}return Ji}(),onCancel:function(){var Sr=Object(oe.a)(r.a.mark(function er(){var yr,Or;return r.a.wrap(function(fr){for(;;)switch(fr.prev=fr.next){case 0:return fr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:De.question_id,question_title:Dt,question_type:3,question_score:tn,is_ordered:hn,standard_answers:Ei,tag_discipline_ids:Bt,sub_discipline_id:(yr=ve.editData)===null||yr===void 0||((Or=yr.exercise)===null||Or===void 0)?void 0:Or.sub_discipline_id,difficulty:gt,repeat_answer:!We,analysis:wn}});case 2:xi=fr.sent,bn(xi);case 4:case"end":return fr.stop()}},er)}));function Ji(){return Sr.apply(this,arguments)}return Ji}()}),Ki.next=17;break;case 13:return Ki.next=15,en({type:"exercise/editExerciseQuestion",payload:{id:De.question_id,question_title:Dt,question_type:3,question_score:tn,is_ordered:hn,standard_answers:Ei,tag_discipline_ids:Bt,sub_discipline_id:(Ui=ve.editData)===null||Ui===void 0||((Vi=Ui.exercise)===null||Vi===void 0)?void 0:Vi.sub_discipline_id,difficulty:gt,repeat_answer:!We,analysis:wn}});case 15:xi=Ki.sent,bn(xi);case 17:Ki.next=23;break;case 19:return Ki.next=21,en({type:"exercise/addExerciseQuestion",payload:{insert_id:De==null?void 0:De.insert_id,categoryId:wt.categoryId,question_title:Dt,question_type:3,question_score:tn,is_ordered:hn,standard_answers:Ei,tag_discipline_ids:Bt,sub_discipline_id:(Fi=ve.editData)===null||Fi===void 0||((Ii=Fi.exercise)===null||Ii===void 0)?void 0:Ii.sub_discipline_id,difficulty:gt,repeat_answer:!We,analysis:wn}});case 21:xi=Ki.sent,bn(xi);case 23:return Mt(!1),Ki.abrupt("return",{name:Dt,analysis:wn,standard_answers:Ei,is_ordered:hn});case 25:case"end":return Ki.stop()}},si)}));return function(){return bi.apply(this,arguments)}}(),vi=function(si,Ei,yi){var xi=jt.slice();if(Ei&&xi.splice(si,Ei),yi&&Vn||!De.question_id)for(var Ui=0;Ui<yi;Ui++)xi.splice(si+Ui,0,[""]);_n(xi==null?void 0:xi.length),ni(!0),console.log(xi,"newStandardAnswers"),nn(xi)},Jn=function(si,Ei,yi){Un("");var xi=jt.slice();xi[si][Ei]=yi,nn(xi)},Zn=function(si){var Ei=jt.slice();Ei[si]=[].concat(Object(F.a)(Ei[si]),[""]),nn(Ei)},Yt=function(si,Ei){var yi=jt.slice();if(!yi[si][Ei]){yi[si]=yi[si].filter(function(xi,Ui){return Ui!==Ei}),nn(yi);return}W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:he.a.modal,onOk:function(){yi[si]=yi[si].filter(function(Ui,Vi){return Vi!==Ei}),nn(yi)}})},Sn=function(si){W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:he.a.modal,onOk:function(){var yi=0;ot(Dt.replace(/\▁/g,function(xi){return yi++,yi-1===si?"":xi})),setTimeout(function(){var xi=jt.slice();xi=jt.filter(function(Ui,Vi){return si!==Vi}),nn(xi)},500)}})},Kn=function(){},ii=function(){var si,Ei,yi,xi,Ui,Vi;return console.log(jt,"answers"),t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),t.a.createElement("div",null,t.a.createElement(B.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:Dt,onChange:function(Ii){return ot(Ii)},showNullButton:((si=ve.editData)===null||si===void 0||((Ei=si.exercise)===null||Ei===void 0)?void 0:Ei.exercise_status)===1,deleteEmptyDisabled:!(((yi=ve.editData)===null||yi===void 0||((xi=yi.exercise)===null||xi===void 0)?void 0:xi.exercise_status)===1)||sn,onPlaceholderChange:vi})),t.a.createElement("div",{className:"mt20"},jt.map(function(Fi,Ii){var Tr,Ki;return t.a.createElement(Y.a,{key:Ii,answers:Fi,index:Ii,is_md:!0,exerciseIsPublish:((Tr=ve.editData)===null||Tr===void 0||((Ki=Tr.exercise)===null||Ki===void 0)?void 0:Ki.exercise_status)!==1,activeOptionErrorIndex:$n,onAnswerChange:Jn,addChildAnswer:Zn,deleteChildAnswer:Yt,deleteChildAnswermain:Sn})})),t.a.createElement("div",{className:"mt20"},jt.length>1&&t.a.createElement("span",null,t.a.createElement(E.a,{checked:hn,onChange:function(Ii){return Tn(Ii.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:wn,onChange:function(Ii){return Xn(Ii)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:tn,max:1e4,min:0,onChange:function(Ii){vn(Ii)}})," ","\u5206 \xA0"," ",!!tn&&!!Qn&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(tn/Qn).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:gt,onChange:function(Ii){it(Ii.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Bt,selectvalues:De==null?void 0:De.tag_discipline_ids,onChange:Zt,subId:(Ui=ve.editData)===null||Ui===void 0||((Vi=Ui.exercise)===null||Vi===void 0)?void 0:Vi.sub_discipline_id,knowledgeOptions:Ht,onAddKnowledgeFinish:Pt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:We,onChange:function(Ii){dt(Ii)}}))),t.a.createElement("aside",{className:"tr"},(ht!==-1||De.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){gi(),Dn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){on()}},"\u4FDD\u5B58")))},On=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(bi){var si,Ei;return(ve==null||((si=ve.editData)===null||si===void 0||((Ei=si.exercise)===null||Ei===void 0))?void 0:Ei.exercise_status)===1?bi:bi.id!=="del"&&bi.id!=="add"}),Li=function(){var bi=Object(oe.a)(r.a.mark(function si(Ei){return r.a.wrap(function(xi){for(;;)switch(xi.prev=xi.next){case 0:if(!(ht!==-1)){xi.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),xi.abrupt("return");case 3:xi.t0=Ei.id,xi.next=xi.t0==="del"?6:xi.t0==="up"||xi.t0==="down"?8:xi.t0==="edit"?12:xi.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Vi(){return r.a.wrap(function(Ii){for(;;)switch(Ii.prev=Ii.next){case 0:return Ii.next=2,Object(I.n)({id:De.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},wt)});case 3:case"end":return Ii.stop()}},Vi)}))()}}),xi.abrupt("break",17);case 8:return xi.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:De.question_id,opr:Ei.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},wt)}),xi.abrupt("break",17);case 12:return un(De.dragKey),Dn(!0),xi.abrupt("break",17);case 15:return C({key:De.key,insert_id:De==null?void 0:De.question_id,question_type:3}),xi.abrupt("break",17);case 17:case"end":return xi.stop()}},si)}));return function(Ei){return bi.apply(this,arguments)}}(),ji=function(){var si;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(De!=null&&De.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},De.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",De.question_score,"\u5206\uFF09")),De!=null&&De.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},De.key,"."),t.a.createElement(xe.a,{value:De.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",De.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:De.question_title})),t.a.createElement("div",{className:he.a.questionChoices},De==null||((si=De.standard_answer)===null||si===void 0)?void 0:si.map(function(Ei,yi){return t.a.createElement(k.a,{key:yi,align:"middle"},t.a.createElement(O.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",Ei.choice_id,"\uFF09\uFF1A"),t.a.createElement(O.a,{flex:"1"},t.a.createElement(k.a,{align:"middle",gutter:[1,1]},Ei.answer_text.map(function(xi,Ui){return t.a.createElement(O.a,{span:24,key:Ui},t.a.createElement(S.a,{key:yi,checked:De.standard_answer.includes(yi),disabled:!0,value:xi}))}))))})),t.a.createElement("div",{className:he.a.action},!De.hideAction&&On.map(function(Ei,yi){return Ei.id==="up"&&De.key===1||Ei.id==="down"&&De.key===De.len?null:t.a.createElement(h.a,{key:yi,placement:"bottom",title:Ei.name},t.a.createElement("span",{onClick:function(){return Li(Ei)},className:Ei.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!In&&ji(),In&&ii())},ge=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.exercise,Ee=ct.globalSetting;return{problemset:je,globalSetting:Ee,exercise:Ne,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(be)),te=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],fe=function(je,It){var Ne=je.problemset,Ee=je.globalSetting,ve=je.exercise,di=je.loading,en=je.dispatch,De=je.onRef,ht=De===void 0?function(){}:De,we=je.editData,un=je.editKey,fi=je.setEditKey,gi=fi===void 0?function(){}:fi,q=je.cancelAdd,C=q===void 0?function(){}:q,L=je.reload,V=L===void 0?function(){}:L,ae=je.addCallback,Q=ae===void 0?function(){}:ae,Ae=je.setIsClaer,nt=Ae===void 0?function(){}:Ae,xt=Object(N.a)(je,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","editKey","setEditKey","cancelAdd","reload","addCallback","setIsClaer"]),Dt=Object(i.useState)(),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(""),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(!1),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)(),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)([]),Tn=Object(o.a)(hn,2),ln=Tn[0],Mn=Tn[1],Vn=Object(i.useState)([]),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(1),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useState)(!1),_n=Object(o.a)(Qn,2),Gn=_n[0],qn=_n[1],In=Object(i.useState)(""),Dn=Object(o.a)(In,2),kn=Dn[0],An=Dn[1],sn=Object(i.useRef)(!1),Mt=function(Ve){Hn([].concat(Object(F.a)(Pn),[Object(v.a)({},Ve)]))},zt=Object(H.i)();Object(i.useEffect)(function(){if(sn.current)return;if(!(we!=null&&we.question_choices)){Nt(!0),cn(""),Yn(2),Lt("");return}qn(!(we!=null&&we.repeat_answer)),cn(we==null?void 0:we.question_title),Yn(we==null?void 0:we.question_score),Cn(we==null?void 0:we.difficulty),Lt(we.standard_answer[0]+""),Mn(we.tag_discipline_ids),An(we==null?void 0:we.analysis)},[we,qt]),Object(i.useEffect)(function(){qt&&it();function it(){return Ve.apply(this,arguments)}function Ve(){return Ve=Object(oe.a)(r.a.mark(function qe(){var We,dt,Ze;return r.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(I.I)({sub_discipline_id:(We=ve.editData)===null||We===void 0||((dt=We.exercise)===null||dt===void 0)?void 0:dt.sub_discipline_id});case 2:Ze=kt.sent,Hn(Ze.tag_disciplines);case 4:case"end":return kt.stop()}},qe)})),Ve.apply(this,arguments)}},[qt]),Object(i.useImperativeHandle)(It,function(){return{onSave:Bt,isEdit:qt}}),Object(i.useEffect)(function(){var it,Ve=ve!=null&&(it=ve.tagDisciplineData)!==null&&it!==void 0&&it.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];Hn(Ve)},[ve.tagDisciplineData]);var Vt=function(Ve){(Ve==null?void 0:Ve.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Nt(!1),gi(-1),sn.current=!1,V())},Bt=function(){var it=Object(oe.a)(r.a.mark(function Ve(){var qe,We,dt,Ze,wt,kt;return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:if(jn){Ht.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Ht.abrupt("return",!1);case 3:if(vt){Ht.next=6;break}return y.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Ht.abrupt("return",!1);case 6:if(qe=[{choice_text:"\u6B63\u786E",is_answer:vt==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:vt==="2"?2:0}],sn.current=!0,!we.question_id){Ht.next=19;break}if(!((we==null?void 0:we.is_my)===1)){Ht.next=13;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var St=Object(oe.a)(r.a.mark(function bn(){var on,vi;return r.a.wrap(function(Zn){for(;;)switch(Zn.prev=Zn.next){case 0:return Zn.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:jn,question_type:2,question_score:xn,question_choices:qe.map(function(Yt){return Yt.choice_text}),standard_answers:qe.filter(function(Yt){return Yt.is_answer}).map(function(Yt){return Yt.is_answer}),tag_discipline_ids:ln,sub_discipline_id:(on=ve.editData)===null||on===void 0||((vi=on.exercise)===null||vi===void 0)?void 0:vi.sub_discipline_id,difficulty:Ln,is_cover:1,repeat_answer:!Gn,analysis:kn}});case 2:We=Zn.sent,Vt(We);case 4:case"end":return Zn.stop()}},bn)}));function Pt(){return St.apply(this,arguments)}return Pt}(),onCancel:function(){var St=Object(oe.a)(r.a.mark(function bn(){var on,vi;return r.a.wrap(function(Zn){for(;;)switch(Zn.prev=Zn.next){case 0:return Zn.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:jn,question_type:2,question_score:xn,question_choices:qe.map(function(Yt){return Yt.choice_text}),standard_answers:qe.filter(function(Yt){return Yt.is_answer}).map(function(Yt){return Yt.is_answer}),tag_discipline_ids:ln,sub_discipline_id:(on=ve.editData)===null||on===void 0||((vi=on.exercise)===null||vi===void 0)?void 0:vi.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:kn}});case 2:We=Zn.sent,Vt(We);case 4:case"end":return Zn.stop()}},bn)}));function Pt(){return St.apply(this,arguments)}return Pt}()}),Ht.next=17;break;case 13:return Ht.next=15,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:jn,question_type:2,question_score:xn,question_choices:qe.map(function(St){return St.choice_text}),standard_answers:qe.filter(function(St){return St.is_answer}).map(function(St){return St.is_answer}),tag_discipline_ids:ln,sub_discipline_id:(dt=ve.editData)===null||dt===void 0||((Ze=dt.exercise)===null||Ze===void 0)?void 0:Ze.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:kn}});case 15:We=Ht.sent,Vt(We);case 17:Ht.next=23;break;case 19:return Ht.next=21,en({type:"exercise/addExerciseQuestion",payload:{insert_id:we==null?void 0:we.insert_id,categoryId:zt.categoryId,question_title:jn,question_type:2,question_score:xn,question_choices:qe.map(function(St){return St.choice_text}),standard_answers:qe.filter(function(St){return St.is_answer}).map(function(St){return St.is_answer}),tag_discipline_ids:ln,sub_discipline_id:(wt=ve.editData)===null||wt===void 0||((kt=wt.exercise)===null||kt===void 0)?void 0:kt.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:kn}});case 21:We=Ht.sent,Vt(We);case 23:return Ht.abrupt("return",{name:jn,choices:qe});case 24:case"end":return Ht.stop()}},Ve)}));return function(){return it.apply(this,arguments)}}(),Zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(it){var Ve,qe;return(ve==null||((Ve=ve.editData)===null||Ve===void 0||((qe=Ve.exercise)===null||qe===void 0))?void 0:qe.exercise_status)===1?it:it.id!=="del"&&it.id!=="add"}),yn=function(){var it=Object(oe.a)(r.a.mark(function Ve(qe){return r.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:if(!(un!==-1)){dt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),dt.abrupt("return");case 3:dt.t0=qe.id,dt.next=dt.t0==="del"?6:dt.t0==="up"||dt.t0==="down"?8:dt.t0==="edit"?12:dt.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function wt(){return r.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(I.n)({id:we.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},zt)});case 3:case"end":return Tt.stop()}},wt)}))()}}),dt.abrupt("break",17);case 8:return dt.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:qe.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},zt)}),dt.abrupt("break",17);case 12:return gi(we.dragKey),Nt(!0),dt.abrupt("break",17);case 15:return Q({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:2}),dt.abrupt("break",17);case 17:case"end":return dt.stop()}},Ve)}));return function(qe){return it.apply(this,arguments)}}(),pn=function(){var Ve;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",we.question_score,"\u5206\uFF09")),we!=null&&we.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,"."),t.a.createElement(xe.a,{value:we.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",we.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:we.question_title})),t.a.createElement("div",{className:he.a.questionChoices},we==null||((Ve=we.question_choices)===null||Ve===void 0)?void 0:Ve.map(function(qe,We){return t.a.createElement(u.a,{key:We,checked:we.standard_answer.includes(We+1),disabled:!0},te[We],"."," ",t.a.createElement("span",{className:"c-black font14"},qe.choice_text))})),t.a.createElement("div",{className:he.a.action},!we.hideAction&&Zt.map(function(qe,We){return qe.id==="up"&&we.key===1||qe.id==="down"&&we.key===we.len?null:t.a.createElement(h.a,{key:We,placement:"bottom",title:qe.name},t.a.createElement("span",{onClick:function(){return yn(qe)},className:qe.icon}))})))},gt=function(){var Ve,qe;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:jn,onChange:function(dt){return cn(dt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(u.a.Group,{buttonStyle:"solid",value:vt,onChange:function(dt){return Lt(dt.target.value)}},t.a.createElement(u.a.Button,{value:"1",className:"".concat(he.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(u.a.Button,{value:"2",className:he.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:kn,onChange:function(dt){return An(dt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:xn,max:1e4,min:0,onChange:function(dt){Yn(dt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Ln,onChange:function(dt){Cn(dt.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:ln,selectvalues:we==null?void 0:we.tag_discipline_ids,onChange:Mn,subId:(Ve=ve.editData)===null||Ve===void 0||((qe=Ve.exercise)===null||qe===void 0)?void 0:qe.sub_discipline_id,knowledgeOptions:Pn,onAddKnowledgeFinish:Mt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Gn,onChange:function(dt){qn(dt)}}))),t.a.createElement("aside",{className:"tr"},(un!==-1||we.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){C(),Nt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Bt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!qt&&pn(),qt&&gt())},_e=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.exercise,Ee=ct.globalSetting;return{problemset:je,globalSetting:Ee,exercise:Ne,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(fe)),Le=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],$e=Object(i.forwardRef)(function(ct,je){var It=ct.problemset,Ne=ct.globalSetting,Ee=ct.exercise,ve=ct.loading,di=ct.dispatch,en=ct.onRef,De=en===void 0?function(){}:en,ht=ct.editData,we=ct.cancelAdd,un=we===void 0?function(){}:we,fi=ct.editKey,gi=ct.setEditKey,q=gi===void 0?function(){}:gi,C=ct.setIsClaer,L=C===void 0?function(){}:C,V=ct.addCallback,ae=V===void 0?function(kt){}:V,Q=ct.reload,Ae=Q===void 0?function(){}:Q,nt=Object(N.a)(ct,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),xt=Object(i.useState)([]),Dt=Object(o.a)(xt,2),ot=Dt[0],vt=Dt[1],Lt=Object(i.useState)(),wn=Object(o.a)(Lt,2),Xn=wn[0],jn=wn[1],cn=Object(i.useState)([]),jt=Object(o.a)(cn,2),nn=jt[0],qt=jt[1],Nt=Object(i.useState)(""),$n=Object(o.a)(Nt,2),Un=$n[0],xn=$n[1],Yn=Object(i.useState)(),hn=Object(o.a)(Yn,2),Tn=hn[0],ln=hn[1],Mn=Object(i.useState)(!1),Vn=Object(o.a)(Mn,2),ni=Vn[0],Pn=Vn[1],Hn=Object(i.useState)([]),tn=Object(o.a)(Hn,2),vn=tn[0],Ln=tn[1],Cn=Object(i.useState)(1),Qn=Object(o.a)(Cn,2),_n=Qn[0],Gn=Qn[1],qn=Object(i.useState)(!1),In=Object(o.a)(qn,2),Dn=In[0],kn=In[1],An=Object(i.useState)(""),sn=Object(o.a)(An,2),Mt=sn[0],zt=sn[1],Vt=Object(i.useState)([]),Bt=Object(o.a)(Vt,2),Zt=Bt[0],yn=Bt[1],pn=Object(i.useRef)(!1),gt=function(Tt){yn([].concat(Object(F.a)(Zt),[Object(v.a)({},Tt)]))},it=Object(H.i)();Object(i.useEffect)(function(){vt(["","","",""])},[]),Object(i.useEffect)(function(){if(pn.current)return;if(!(ht!=null&&ht.question_choices)){Pn(!0),xn(""),ln(5),vt(["","","",""]),qt([]);return}xn(ht==null?void 0:ht.question_title),ln(ht==null?void 0:ht.question_score),kn(!(ht!=null&&ht.repeat_answer)),Gn(ht==null?void 0:ht.difficulty),vt(ht==null?void 0:ht.question_choices.map(function(Tt){return Tt.choice_text}));var kt=[];ht==null||ht.standard_answer.map(function(Tt,Ht){kt.push(Tt-1)}),qt(kt),Ln(ht.tag_discipline_ids),zt(ht==null?void 0:ht.analysis)},[ht,ni]),Object(i.useEffect)(function(){ni&&kt();function kt(){return Tt.apply(this,arguments)}function Tt(){return Tt=Object(oe.a)(r.a.mark(function Ht(){var St,Pt,bn;return r.a.wrap(function(vi){for(;;)switch(vi.prev=vi.next){case 0:return vi.next=2,Object(I.I)({sub_discipline_id:(St=Ee.editData)===null||St===void 0||((Pt=St.exercise)===null||Pt===void 0)?void 0:Pt.sub_discipline_id});case 2:bn=vi.sent,yn(bn.tag_disciplines);case 4:case"end":return vi.stop()}},Ht)})),Tt.apply(this,arguments)}},[ni]),Object(i.useImperativeHandle)(je,function(){return{onSave:qe,isEdit:ni}}),Object(i.useEffect)(function(){var kt,Tt=Ee!=null&&(kt=Ee.tagDisciplineData)!==null&&kt!==void 0&&kt.tag_disciplines&&Array.isArray(Ee.tagDisciplineData.tag_disciplines)?Ee.tagDisciplineData.tag_disciplines:[];yn(Tt)},[Ee.tagDisciplineData]);var Ve=function(Tt){(Tt==null?void 0:Tt.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Pn(!1),q(-1),pn.current=!1,Ae())},qe=function(){var kt=Object(oe.a)(r.a.mark(function Tt(){var Ht,St,Pt,bn,on,vi,Jn;return r.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(Un){Yt.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Yt.abrupt("return",!1);case 3:if(Ht=ot.findIndex(function(Sn){return!Sn}),!(Ht>-1)){Yt.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Le[Ht]," \u9009\u9879\u7684\u5185\u5BB9")),Yt.abrupt("return",!1);case 7:if(nn.length){Yt.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Yt.abrupt("return",!1);case 10:if(!(nn.length<1)){Yt.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Yt.abrupt("return",!1);case 13:if(St=ot.map(function(Sn,Kn){return{choice_text:Sn,is_answer:nn.includes(Kn)?Kn+1:0}}),pn.current=!0,!ht.question_id){Yt.next=26;break}if(!((ht==null?void 0:ht.is_my)===1)){Yt.next=20;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Sn=Object(oe.a)(r.a.mark(function ii(){var On,Li;return r.a.wrap(function(bi){for(;;)switch(bi.prev=bi.next){case 0:return bi.next=2,di({type:"exercise/editExerciseQuestion",payload:{id:ht.question_id,question_title:Un,question_type:1,question_score:Tn,question_choices:St.map(function(si){return si.choice_text}),standard_answers:St.filter(function(si){return si.is_answer}).map(function(si){return si.is_answer}),tag_discipline_ids:vn,sub_discipline_id:(On=Ee.editData)===null||On===void 0||((Li=On.exercise)===null||Li===void 0)?void 0:Li.sub_discipline_id,difficulty:_n,is_cover:1,repeat_answer:!Dn,analysis:Mt}});case 2:Pt=bi.sent,Ve(Pt);case 4:case"end":return bi.stop()}},ii)}));function Kn(){return Sn.apply(this,arguments)}return Kn}(),onCancel:function(){var Sn=Object(oe.a)(r.a.mark(function ii(){var On,Li;return r.a.wrap(function(bi){for(;;)switch(bi.prev=bi.next){case 0:return bi.next=2,di({type:"exercise/editExerciseQuestion",payload:{id:ht.question_id,question_title:Un,question_type:1,question_score:Tn,question_choices:St.map(function(si){return si.choice_text}),standard_answers:St.filter(function(si){return si.is_answer}).map(function(si){return si.is_answer}),tag_discipline_ids:vn,sub_discipline_id:(On=Ee.editData)===null||On===void 0||((Li=On.exercise)===null||Li===void 0)?void 0:Li.sub_discipline_id,difficulty:_n,repeat_answer:!Dn,analysis:Mt}});case 2:Pt=bi.sent,Ve(Pt);case 4:case"end":return bi.stop()}},ii)}));function Kn(){return Sn.apply(this,arguments)}return Kn}()}),Yt.next=24;break;case 20:return Yt.next=22,di({type:"exercise/editExerciseQuestion",payload:{id:ht.question_id,question_title:Un,question_type:1,question_score:Tn,question_choices:St.map(function(Sn){return Sn.choice_text}),standard_answers:St.filter(function(Sn){return Sn.is_answer}).map(function(Sn){return Sn.is_answer}),tag_discipline_ids:vn,sub_discipline_id:(bn=Ee.editData)===null||bn===void 0||((on=bn.exercise)===null||on===void 0)?void 0:on.sub_discipline_id,difficulty:_n,repeat_answer:!Dn,analysis:Mt}});case 22:Pt=Yt.sent,Ve(Pt);case 24:Yt.next=30;break;case 26:return Yt.next=28,di({type:"exercise/addExerciseQuestion",payload:{insert_id:ht==null?void 0:ht.insert_id,categoryId:it.categoryId,question_title:Un,question_type:1,question_score:Tn,question_choices:St.map(function(Sn){return Sn.choice_text}),standard_answers:St.filter(function(Sn){return Sn.is_answer}).map(function(Sn){return Sn.is_answer}),tag_discipline_ids:vn,sub_discipline_id:(vi=Ee.editData)===null||vi===void 0||((Jn=vi.exercise)===null||Jn===void 0)?void 0:Jn.sub_discipline_id,difficulty:_n,repeat_answer:!Dn,analysis:Mt}});case 28:Pt=Yt.sent,Ve(Pt);case 30:case"end":return Yt.stop()}},Tt)}));return function(){return kt.apply(this,arguments)}}(),We=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(kt){var Tt,Ht;return(Ee==null||((Tt=Ee.editData)===null||Tt===void 0||((Ht=Tt.exercise)===null||Ht===void 0))?void 0:Ht.exercise_status)===1?kt:kt.id!=="del"&&kt.id!=="add"}),dt=function(){var kt=Object(oe.a)(r.a.mark(function Tt(Ht){return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if(!(fi!==-1)){Pt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Pt.abrupt("return");case 3:Pt.t0=Ht.id,Pt.next=Pt.t0==="del"?6:Pt.t0==="up"||Pt.t0==="down"?8:Pt.t0==="edit"?12:Pt.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function on(){return r.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:return Jn.next=2,Object(I.n)({id:ht.question_id});case 2:di({type:"exercise/editExercise",payload:Object(v.a)({},it)});case 3:case"end":return Jn.stop()}},on)}))()}}),Pt.abrupt("break",17);case 8:return Pt.next=10,di({type:"exercise/exeriseMoveUpDown",payload:{id:ht.question_id,opr:Ht.id}});case 10:return di({type:"exercise/editExercise",payload:Object(v.a)({},it)}),Pt.abrupt("break",17);case 12:return q(ht.dragKey),Pn(!0),Pt.abrupt("break",17);case 15:return ae({key:ht.key,insert_id:ht==null?void 0:ht.question_id,question_type:1}),Pt.abrupt("break",17);case 17:case"end":return Pt.stop()}},Tt)}));return function(Ht){return kt.apply(this,arguments)}}(),Ze=function(){var Tt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(ht!=null&&ht.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ht.key,"\u3001\u591A\u9009\u9898"),"\uFF08",ht.question_score,"\u5206\uFF09")),ht!=null&&ht.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ht.key,"."),t.a.createElement(xe.a,{value:ht.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ht.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ht.question_title})),t.a.createElement("div",{className:he.a.questionChoices},ht==null||((Tt=ht.question_choices)===null||Tt===void 0)?void 0:Tt.map(function(Ht,St){return t.a.createElement(k.a,{key:St},t.a.createElement(O.a,null,t.a.createElement(E.a,{key:St,checked:ht.standard_answer.includes(St+1),disabled:!0},Le[St],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Ht.choice_text}))))})),t.a.createElement("div",{className:he.a.action},!ht.hideAction&&We.map(function(Ht,St){return Ht.id==="up"&&ht.key===1||Ht.id==="down"&&ht.key===ht.len?null:t.a.createElement(h.a,{key:St,placement:"bottom",title:Ht.name},t.a.createElement("span",{onClick:function(){return dt(Ht)},className:Ht.icon}))})))},wt=function(){var Tt,Ht;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Un,onChange:function(Pt){return xn(Pt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ot.map(function(St,Pt){var bn,on;return t.a.createElement("div",{className:he.a.choiceWrap,key:Pt},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(nn.includes(Pt)?he.a.activeAnswer:""),onClick:function(){nn.includes(Pt)?qt(nn.filter(function(Jn){return Jn!==Pt})):qt([].concat(Object(F.a)(nn),[Pt]))}},Le[Pt])),t.a.createElement("div",{className:he.a.editorWrap},Xn===Pt?t.a.createElement(x.a,{id:"single-question-option-".concat(Pt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:St,onChange:function(Jn){ot[Pt]=Jn,vt(ot)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return jn(Pt)}},t.a.createElement(xe.a,{value:St}))),((bn=Ee.editData)===null||bn===void 0||((on=bn.exercise)===null||on===void 0)?void 0:on.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,Pt>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return vt(ot.filter(function(Jn,Zn){return Zn!==Pt}))}})),Pt<7&&Pt===ot.length-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return vt([].concat(Object(F.a)(ot),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Mt,onChange:function(Pt){return zt(Pt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Tn,max:1e4,min:0,onChange:function(Pt){ln(Pt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:_n,onChange:function(Pt){Gn(Pt.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:vn,selectvalues:ht==null?void 0:ht.tag_discipline_ids,onChange:Ln,subId:(Tt=Ee.editData)===null||Tt===void 0||((Ht=Tt.exercise)===null||Ht===void 0)?void 0:Ht.sub_discipline_id,knowledgeOptions:Zt,onAddKnowledgeFinish:gt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Dn,onChange:function(Pt){kn(Pt)}}))),t.a.createElement("aside",{className:"tr"},(fi!==-1||ht.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){un(),Pn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){qe()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!ni&&Ze(),ni&&wt())}),Ue=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.exercise,Ee=ct.globalSetting;return{problemset:je,globalSetting:Ee,exercise:Ne,loading:It.effects}},null,null,{forwardRef:!0})($e),at=z("55Ip"),ft=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ct=function(je,It){var Ne=je.problemset,Ee=je.globalSetting,ve=je.exercise,di=je.loading,en=je.dispatch,De=je.editData,ht=je.cancelAdd,we=ht===void 0?function(){}:ht,un=je.editKey,fi=je.setEditKey,gi=fi===void 0?function(){}:fi,q=je.addCallback,C=q===void 0?function(){}:q,L=je.reload,V=L===void 0?function(){}:L,ae=je.setIsClaer,Q=ae===void 0?function(){}:ae,Ae=Object(N.a)(je,["problemset","globalSetting","exercise","loading","dispatch","editData","cancelAdd","editKey","setEditKey","addCallback","reload","setIsClaer"]),nt=Object(i.useState)(""),xt=Object(o.a)(nt,2),Dt=xt[0],ot=xt[1],vt=Object(i.useState)(""),Lt=Object(o.a)(vt,2),wn=Lt[0],Xn=Lt[1],jn=Object(i.useState)(""),cn=Object(o.a)(jn,2),jt=cn[0],nn=cn[1],qt=Object(i.useState)([]),Nt=Object(o.a)(qt,2),$n=Nt[0],Un=Nt[1],xn=Object(i.useState)(""),Yn=Object(o.a)(xn,2),hn=Yn[0],Tn=Yn[1],ln=Object(i.useState)(),Mn=Object(o.a)(ln,2),Vn=Mn[0],ni=Mn[1],Pn=Object(i.useState)(!1),Hn=Object(o.a)(Pn,2),tn=Hn[0],vn=Hn[1],Ln=Object(i.useState)([]),Cn=Object(o.a)(Ln,2),Qn=Cn[0],_n=Cn[1],Gn=Object(i.useState)(!1),qn=Object(o.a)(Gn,2),In=qn[0],Dn=qn[1],kn=Object(i.useState)(!1),An=Object(o.a)(kn,2),sn=An[0],Mt=An[1],zt=Object(H.i)(),Vt=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Ve;if(Vt.current)return;De.edit&&(Dn(!0),Xn(""),ot(""),_n([])),ot(De.shixun_name),Xn(De.question_title);var qe=[];(Ve=De.shixun)===null||Ve===void 0||Ve.map(function(We){qe.push(We.challenge_score)}),_n(qe)},[De]),Object(i.useEffect)(function(){vn(!1)},[In]),Object(i.useImperativeHandle)(It,function(){return{onSave:Zt,isEdit:In}});var Bt=function(qe){(qe==null?void 0:qe.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Dn(!1),gi(-1),Vt.current=!1,V())},Zt=function(){var Ve=Object(oe.a)(r.a.mark(function qe(){var We,dt,Ze;return r.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:if(We=[],dt=!1,!dt){kt.next=4;break}return kt.abrupt("return",!1);case 4:if(Vt.current=!0,Mt(!0),!De.question_id){kt.next=12;break}return kt.next=9,en({type:"exercise/editExerciseQuestion",payload:{id:De.question_id,question_title:wn,shixun_name:Dt,shixun_id:De.shixun_id,question_type:5,question_scores:Qn}});case 9:Ze=kt.sent,kt.next=15;break;case 12:return kt.next=14,en({type:"exercise/addExerciseQuestion",payload:{insert_id:De==null?void 0:De.insert_id,categoryId:zt.categoryId,question_title:wn,shixun_name:Dt,shixun_id:De.shixun_id,question_type:5,question_scores:Qn,is_copy:De.is_copy}});case 14:Ze=kt.sent;case 15:return Bt(Ze),Mt(!1),kt.abrupt("return",{name:wn,analysis:jt,standard_answers:We,is_ordered:Vn});case 18:case"end":return kt.stop()}},qe)}));return function(){return Ve.apply(this,arguments)}}(),yn=function(){var qe;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(S.a,{defaultValue:Dt,onChange:function(dt){ot(dt.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(x.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:wn,onChange:function(dt){Xn(dt)}})),t.a.createElement("div",{className:"mt20"},(qe=De.shixun)===null||qe===void 0?void 0:qe.map(function(We,dt){return t.a.createElement(k.a,{gutter:[20,20]},t.a.createElement(O.a,{flex:"1"},dt+1,".",We.challenge_name),t.a.createElement(O.a,null,t.a.createElement(U.a,{defaultValue:Qn[dt],onChange:function(wt){Qn[dt]=wt,_n(Qn),console.log("srore:L",Qn[dt])}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},$n.length>1&&t.a.createElement("span",null,t.a.createElement(E.a,{checked:Vn,onChange:function(dt){return ni(dt.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(un!==-1||!(De!=null&&De.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){we(),Dn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:sn,className:"ml20",type:"primary",onClick:function(){Zt()}},"\u4FDD\u5B58")))},pn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Ve){var qe,We;return(ve==null||((qe=ve.editData)===null||qe===void 0||((We=qe.exercise)===null||We===void 0))?void 0:We.exercise_status)===1?Ve:Ve.id!=="del"&&Ve.id!=="add"}),gt=function(){var Ve=Object(oe.a)(r.a.mark(function qe(We){return r.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:if(!(un!==-1)){Ze.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ze.abrupt("return");case 3:Ze.t0=We.id,Ze.next=Ze.t0==="del"?6:Ze.t0==="up"||Ze.t0==="down"?8:Ze.t0==="edit"?12:Ze.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function kt(){return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(I.n)({id:De.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},zt)});case 3:case"end":return Ht.stop()}},kt)}))()}}),Ze.abrupt("break",17);case 8:return Ze.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:De.question_id,opr:We.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},zt)}),Ze.abrupt("break",17);case 12:return gi(De.dragKey),Dn(!0),Ze.abrupt("break",17);case 15:return en({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:De.key,insert_id:De==null?void 0:De.question_id,question_type:5}}}),Ze.abrupt("break",17);case 17:case"end":return Ze.stop()}},qe)}));return function(We){return Ve.apply(this,arguments)}}(),it=function(){var qe,We;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(De!=null&&De.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},De.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",De.question_score,"\u5206\uFF09")),De!=null&&De.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},De.key,"."),t.a.createElement(xe.a,{value:De.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",De.question_score,"\u5206\uFF09"),!!((qe=De.schools)!==null&&qe!==void 0&&qe.length)&&t.a.createElement(h.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:De.shixun_name})),t.a.createElement("div",{className:"mt30"}),(We=De.shixun)===null||We===void 0?void 0:We.map(function(dt,Ze){return t.a.createElement("div",{key:Ze},"\u7B2C",Ze+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},dt.challenge_name)," ",t.a.createElement("span",{className:"ml10"},dt.challenge_score," \u5206"))}),t.a.createElement("div",{className:he.a.action},t.a.createElement(at.a,{target:"_blank",to:"/shixuns/".concat(De.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!De.hideAction&&pn.map(function(dt,Ze){return dt.id==="up"&&De.key===1||dt.id==="down"&&De.key===De.len?null:t.a.createElement(h.a,{key:Ze,placement:"bottom",title:dt.name},t.a.createElement("span",{onClick:function(){return gt(dt)},className:dt.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!In&&it(),In&&yn())},yt=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.globalSetting,Ee=ct.exercise;return{problemset:je,globalSetting:Ne,exercise:Ee,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ct)),_t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],lt=function(je,It){var Ne=je.problemset,Ee=je.exercise,ve=je.globalSetting,di=je.loading,en=je.dispatch,De=je.onRef,ht=De===void 0?function(){}:De,we=je.editData,un=je.cancelAdd,fi=un===void 0?function(){}:un,gi=je.editKey,q=je.setEditKey,C=q===void 0?function(){}:q,L=je.setIsClaer,V=L===void 0?function(){}:L,ae=je.reload,Q=ae===void 0?function(){}:ae,Ae=je.addCallback,nt=Ae===void 0?function(Ht){}:Ae,xt=Object(N.a)(je,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","reload","addCallback"]),Dt=Object(i.useState)([]),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)([]),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)(""),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(),Tn=Object(o.a)(hn,2),ln=Tn[0],Mn=Tn[1],Vn=Object(i.useState)([]),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(!1),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useState)(1),_n=Object(o.a)(Qn,2),Gn=_n[0],qn=_n[1],In=Object(i.useState)(!1),Dn=Object(o.a)(In,2),kn=Dn[0],An=Dn[1],sn=Object(i.useState)(""),Mt=Object(o.a)(sn,2),zt=Mt[0],Vt=Mt[1],Bt=Object(H.i)(),Zt=Object(i.useRef)(null),yn=Object(i.useRef)(!1),pn=Object(i.useState)([]),gt=Object(o.a)(pn,2),it=gt[0],Ve=gt[1],qe=function(St){Ve([].concat(Object(F.a)(it),[Object(v.a)({},St)]))};Object(i.useEffect)(function(){Lt(["","","",""])},[]),Object(i.useEffect)(function(){if(yn.current)return;if(!(we!=null&&we.question_choices)){Cn(!0),Yn(""),Mn(5),Lt(["","","",""]),Nt([]);return}Yn(we==null?void 0:we.question_title),Mn(we==null?void 0:we.question_score),An(!(we!=null&&we.repeat_answer)),Vt(we==null?void 0:we.analysis),qn(we==null?void 0:we.difficulty),Lt(we==null?void 0:we.question_choices.map(function(St){return St.choice_text}));var Ht=[];we==null||we.standard_answer.map(function(St,Pt){Ht.push(St-1)}),Hn(we.tag_discipline_ids),Nt(Ht)},[we,Ln]),Object(i.useEffect)(function(){Ln&&Ht();function Ht(){return St.apply(this,arguments)}function St(){return St=Object(oe.a)(r.a.mark(function Pt(){var bn,on,vi;return r.a.wrap(function(Zn){for(;;)switch(Zn.prev=Zn.next){case 0:return Zn.next=2,Object(I.I)({sub_discipline_id:(bn=Ee.editData)===null||bn===void 0||((on=bn.exercise)===null||on===void 0)?void 0:on.sub_discipline_id});case 2:vi=Zn.sent,Ve(vi.tag_disciplines);case 4:case"end":return Zn.stop()}},Pt)})),St.apply(this,arguments)}},[Ln]),Object(i.useEffect)(function(){var Ht,St=Ee!=null&&(Ht=Ee.tagDisciplineData)!==null&&Ht!==void 0&&Ht.tag_disciplines&&Array.isArray(Ee.tagDisciplineData.tag_disciplines)?Ee.tagDisciplineData.tag_disciplines:[];Ve(St)},[Ee.tagDisciplineData]),Object(i.useImperativeHandle)(It,function(){return{onSave:dt,isEdit:Ln}});var We=function(St){(St==null?void 0:St.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Cn(!1),C(-1),yn.current=!1,Q())},dt=function(){var Ht=Object(oe.a)(r.a.mark(function St(){var Pt,bn,on,vi,Jn,Zn,Yt;return r.a.wrap(function(Kn){for(;;)switch(Kn.prev=Kn.next){case 0:if(xn){Kn.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Kn.abrupt("return",!1);case 3:if(Pt=vt.findIndex(function(ii){return!ii}),!(Pt>-1)){Kn.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(_t[Pt]," \u9009\u9879\u7684\u5185\u5BB9")),Kn.abrupt("return",!1);case 7:if(qt.length){Kn.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Kn.abrupt("return",!1);case 10:if(!(qt.length<1)){Kn.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Kn.abrupt("return",!1);case 13:if(bn=vt.map(function(ii,On){return{choice_text:ii,is_answer:qt.includes(On)?On+1:0}}),yn.current=!0,!we.question_id){Kn.next=26;break}if(!((we==null?void 0:we.is_my)===1)){Kn.next=20;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var ii=Object(oe.a)(r.a.mark(function Li(){var ji,bi;return r.a.wrap(function(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:xn,question_type:1,question_score:ln,question_choices:bn.map(function(yi){return yi.choice_text}),standard_answers:bn.filter(function(yi){return yi.is_answer}).map(function(yi){return yi.is_answer}),tag_discipline_ids:Pn,sub_discipline_id:(ji=Ee.editData)===null||ji===void 0||((bi=ji.exercise)===null||bi===void 0)?void 0:bi.sub_discipline_id,difficulty:Gn,is_cover:1,repeat_answer:!kn,analysis:zt}});case 2:on=Ei.sent,We(on);case 4:case"end":return Ei.stop()}},Li)}));function On(){return ii.apply(this,arguments)}return On}(),onCancel:function(){var ii=Object(oe.a)(r.a.mark(function Li(){var ji,bi;return r.a.wrap(function(Ei){for(;;)switch(Ei.prev=Ei.next){case 0:return Ei.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:xn,question_type:1,question_score:ln,question_choices:bn.map(function(yi){return yi.choice_text}),standard_answers:bn.filter(function(yi){return yi.is_answer}).map(function(yi){return yi.is_answer}),tag_discipline_ids:Pn,sub_discipline_id:(ji=Ee.editData)===null||ji===void 0||((bi=ji.exercise)===null||bi===void 0)?void 0:bi.sub_discipline_id,difficulty:Gn,repeat_answer:!kn,analysis:zt}});case 2:on=Ei.sent,We(on);case 4:case"end":return Ei.stop()}},Li)}));function On(){return ii.apply(this,arguments)}return On}()}),Kn.next=24;break;case 20:return Kn.next=22,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:xn,question_type:1,question_score:ln,question_choices:bn.map(function(ii){return ii.choice_text}),standard_answers:bn.filter(function(ii){return ii.is_answer}).map(function(ii){return ii.is_answer}),tag_discipline_ids:Pn,sub_discipline_id:(vi=Ee.editData)===null||vi===void 0||((Jn=vi.exercise)===null||Jn===void 0)?void 0:Jn.sub_discipline_id,difficulty:Gn,repeat_answer:!kn,analysis:zt}});case 22:on=Kn.sent,We(on);case 24:Kn.next=30;break;case 26:return Kn.next=28,en({type:"exercise/addExerciseQuestion",payload:{insert_id:we==null?void 0:we.insert_id,categoryId:Bt.categoryId,question_title:xn,question_type:1,question_score:ln,question_choices:bn.map(function(ii){return ii.choice_text}),standard_answers:bn.filter(function(ii){return ii.is_answer}).map(function(ii){return ii.is_answer}),tag_discipline_ids:Pn,sub_discipline_id:(Zn=Ee.editData)===null||Zn===void 0||((Yt=Zn.exercise)===null||Yt===void 0)?void 0:Yt.sub_discipline_id,difficulty:Gn,repeat_answer:!kn,analysis:zt}});case 28:on=Kn.sent,We(on);case 30:case"end":return Kn.stop()}},St)}));return function(){return Ht.apply(this,arguments)}}(),Ze=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Ht){var St,Pt;return(Ee==null||((St=Ee.editData)===null||St===void 0||((Pt=St.exercise)===null||Pt===void 0))?void 0:Pt.exercise_status)===1?Ht:Ht.id!=="del"&&Ht.id!=="add"}),wt=function(){var Ht=Object(oe.a)(r.a.mark(function St(Pt){return r.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(!(gi!==-1)){on.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),on.abrupt("return");case 3:on.t0=Pt.id,on.next=on.t0==="del"?6:on.t0==="up"||on.t0==="down"?8:on.t0==="edit"?12:on.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Jn(){return r.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(I.n)({id:we.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},Bt)});case 3:case"end":return Yt.stop()}},Jn)}))()}}),on.abrupt("break",17);case 8:return on.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:Pt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},Bt)}),on.abrupt("break",17);case 12:return C(we.dragKey),Cn(!0),on.abrupt("break",17);case 15:return nt({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:0}),on.abrupt("break",17);case 17:case"end":return on.stop()}},St)}));return function(Pt){return Ht.apply(this,arguments)}}(),kt=function(){var St;return t.a.createElement("aside",{ref:Zt},t.a.createElement("div",{className:he.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u5355\u9009\u9898"),"\uFF08",we.question_score,"\u5206\uFF09")),we!=null&&we.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,"."),t.a.createElement(xe.a,{value:we.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",we.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:we.question_title})),t.a.createElement("div",{className:he.a.questionChoices},we==null||((St=we.question_choices)===null||St===void 0)?void 0:St.map(function(Pt,bn){return t.a.createElement(k.a,{key:bn},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:bn,checked:we.standard_answer.includes(bn+1),disabled:!0},_t[bn],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Pt.choice_text}))))})),t.a.createElement("div",{className:he.a.action},!we.hideAction&&Ze.map(function(Pt,bn){return Pt.id==="up"&&we.key===1||Pt.id==="down"&&we.key===we.len?null:t.a.createElement(h.a,{key:bn,placement:"bottom",title:Pt.name},t.a.createElement("span",{onClick:function(){return wt(Pt)},className:Pt.icon}))})))},Tt=function(){var St,Pt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:xn,onChange:function(on){return Yn(on)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),vt.map(function(bn,on){var vi,Jn;return t.a.createElement("div",{className:he.a.choiceWrap,key:on},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(qt.includes(on)?he.a.activeAnswer:""),onClick:function(){qt.includes(on)?Nt(qt.filter(function(Yt){return Yt!==on})):Nt([].concat(Object(F.a)(qt),[on]))}},_t[on])),t.a.createElement("div",{className:he.a.editorWrap},jn===on?t.a.createElement(x.a,{id:"single-question-option-".concat(on),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:bn,onChange:function(Yt){vt[on]=Yt,Lt(vt)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return cn(on)}},t.a.createElement(xe.a,{value:bn}))),((vi=Ee.editData)===null||vi===void 0||((Jn=vi.exercise)===null||Jn===void 0)?void 0:Jn.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,on>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Lt(vt.filter(function(Yt,Sn){return Sn!==on}))}})),on<7&&on===vt.length-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Lt([].concat(Object(F.a)(vt),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:zt,onChange:function(on){return Vt(on)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:ln,max:1e4,min:0,onChange:function(on){Mn(on)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Gn,onChange:function(on){qn(on.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:we==null?void 0:we.tag_discipline_ids,value:Pn,onChange:Hn,subId:(St=Ee.editData)===null||St===void 0||((Pt=St.exercise)===null||Pt===void 0)?void 0:Pt.sub_discipline_id,knowledgeOptions:it,onAddKnowledgeFinish:qe})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:kn,onChange:function(on){An(on)}}))),t.a.createElement("aside",{className:"tr"},(gi!==-1||we.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){fi(),Cn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){dt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!Ln&&kt(),Ln&&Tt())},Ft=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.globalSetting,Ee=ct.exercise;return{problemset:je,globalSetting:Ne,exercise:Ee,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(lt)),Xt=z("Z9P2"),Jt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],rn=function(je,It){var Ne=je.problemset,Ee=je.exercise,ve=je.globalSetting,di=je.loading,en=je.dispatch,De=je.onRef,ht=De===void 0?function(){}:De,we=je.editData,un=je.cancelAdd,fi=un===void 0?function(){}:un,gi=je.editKey,q=je.setEditKey,C=q===void 0?function(){}:q,L=je.reload,V=L===void 0?function(){}:L,ae=je.addCallback,Q=ae===void 0?function(){}:ae,Ae=je.setIsClaer,nt=Ae===void 0?function(){}:Ae,xt=Object(N.a)(je,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","reload","addCallback","setIsClaer"]),Dt=Object(i.useState)(""),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(""),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(""),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)(),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(!1),Tn=Object(o.a)(hn,2),ln=Tn[0],Mn=Tn[1],Vn=Object(i.useState)([]),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(1),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useState)(!1),_n=Object(o.a)(Qn,2),Gn=_n[0],qn=_n[1],In=Object(i.useState)([[],[]]),Dn=Object(o.a)(In,2),kn=Dn[0],An=Dn[1],sn=Object(i.useRef)(!1),Mt=Object(H.i)(),zt=Object(i.useState)([]),Vt=Object(o.a)(zt,2),Bt=Vt[0],Zt=Vt[1],yn=function(Ze){Zt([].concat(Object(F.a)(Bt),[Object(v.a)({},Ze)]))};Object(i.useEffect)(function(){var dt;if(sn.current)return;if(!(we!=null&&we.question_title)){Mn(!0),Lt(""),Nt(""),Yn(10);return}qn(!(we!=null&&we.repeat_answer)),Lt(we==null?void 0:we.question_title),Nt(we==null||((dt=we.standard_answer)===null||dt===void 0)?void 0:dt[0]),Yn(we==null?void 0:we.question_score),Hn(we.tag_discipline_ids),Cn(we==null?void 0:we.difficulty),cn(we==null?void 0:we.analysis),An([we==null?void 0:we.normal_keywords,we==null?void 0:we.main_keywords])},[Ne.editData,ln]),Object(i.useEffect)(function(){var dt,Ze=Ee!=null&&(dt=Ee.tagDisciplineData)!==null&&dt!==void 0&&dt.tag_disciplines&&Array.isArray(Ee.tagDisciplineData.tag_disciplines)?Ee.tagDisciplineData.tag_disciplines:[];Zt(Ze)},[Ee.tagDisciplineData]),Object(i.useEffect)(function(){ln&&dt();function dt(){return Ze.apply(this,arguments)}function Ze(){return Ze=Object(oe.a)(r.a.mark(function wt(){var kt,Tt,Ht;return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(I.I)({sub_discipline_id:(kt=Ee.editData)===null||kt===void 0||((Tt=kt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id});case 2:Ht=Pt.sent,Zt(Ht.tag_disciplines);case 4:case"end":return Pt.stop()}},wt)})),Ze.apply(this,arguments)}},[ln]),Object(i.useImperativeHandle)(It,function(){return{onSave:gt,isEdit:ln}});var pn=function(Ze){(Ze==null?void 0:Ze.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Mn(!1),C(-1),sn.current=!1,V())},gt=function(){var dt=Object(oe.a)(r.a.mark(function Ze(){var wt,kt,Tt,Ht,St,Pt,bn;return r.a.wrap(function(vi){for(;;)switch(vi.prev=vi.next){case 0:if(vt){vi.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),vi.abrupt("return",!1);case 3:if(wt=kn[0],kt=kn[1],sn.current=!0,!we.question_id){vi.next=17;break}if(!((we==null?void 0:we.is_my)===1)){vi.next=11;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Jn=Object(oe.a)(r.a.mark(function Yt(){var Sn,Kn;return r.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:vt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Pn,sub_discipline_id:(Sn=Ee.editData)===null||Sn===void 0||((Kn=Sn.exercise)===null||Kn===void 0)?void 0:Kn.sub_discipline_id,difficulty:Ln,is_cover:1,repeat_answer:!Gn,analysis:jn,normal_keywords:wt,main_keywords:kt}});case 2:Tt=On.sent,pn(Tt);case 4:case"end":return On.stop()}},Yt)}));function Zn(){return Jn.apply(this,arguments)}return Zn}(),onCancel:function(){var Jn=Object(oe.a)(r.a.mark(function Yt(){var Sn,Kn;return r.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:vt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Pn,sub_discipline_id:(Sn=Ee.editData)===null||Sn===void 0||((Kn=Sn.exercise)===null||Kn===void 0)?void 0:Kn.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:jn,normal_keywords:wt,main_keywords:kt}});case 2:Tt=On.sent,pn(Tt);case 4:case"end":return On.stop()}},Yt)}));function Zn(){return Jn.apply(this,arguments)}return Zn}()}),vi.next=15;break;case 11:return vi.next=13,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:vt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Pn,sub_discipline_id:(Ht=Ee.editData)===null||Ht===void 0||((St=Ht.exercise)===null||St===void 0)?void 0:St.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:jn,normal_keywords:wt,main_keywords:kt}});case 13:Tt=vi.sent,pn(Tt);case 15:vi.next=21;break;case 17:return vi.next=19,en({type:"exercise/addExerciseQuestion",payload:{insert_id:we==null?void 0:we.insert_id,categoryId:Mt.categoryId,exercise_bank_id:Mt.categoryId,question_title:vt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Pn,sub_discipline_id:(Pt=Ee.editData)===null||Pt===void 0||((bn=Pt.exercise)===null||bn===void 0)?void 0:bn.sub_discipline_id,difficulty:Ln,repeat_answer:!Gn,analysis:jn,normal_keywords:wt,main_keywords:kt}});case 19:Tt=vi.sent,pn(Tt);case 21:return vi.abrupt("return",{name:vt,answer_texts:[qt],analysis:jn,normal_keywords:wt,main_keywords:kt});case 22:case"end":return vi.stop()}},Ze)}));return function(){return dt.apply(this,arguments)}}(),it=function(){var Ze,wt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:vt,onChange:function(Tt){return Lt(Tt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(x.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:qt,onChange:function(Tt){return Nt(Tt)}}),t.a.createElement(Xt.a,{value:kn,onChange:An}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:jn,onChange:function(Tt){return cn(Tt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:xn,max:1e4,min:0,onChange:function(Tt){Yn(Tt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Ln,onChange:function(Tt){Cn(Tt.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Pn,selectvalues:we==null?void 0:we.tag_discipline_ids,onChange:Hn,subId:(Ze=Ee.editData)===null||Ze===void 0||((wt=Ze.exercise)===null||wt===void 0)?void 0:wt.sub_discipline_id,knowledgeOptions:Bt,onAddKnowledgeFinish:yn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Gn,onChange:function(Tt){qn(Tt)}}))),t.a.createElement("aside",{className:"tr"},(gi!==-1||we.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){fi(),Mn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){gt()}},"\u4FDD\u5B58")))},Ve=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(dt){var Ze,wt;return(Ee==null||((Ze=Ee.editData)===null||Ze===void 0||((wt=Ze.exercise)===null||wt===void 0))?void 0:wt.exercise_status)===1?dt:dt.id!=="del"&&dt.id!=="add"}),qe=function(){var dt=Object(oe.a)(r.a.mark(function Ze(wt){return r.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:if(!(gi!==-1)){Tt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Tt.abrupt("return");case 3:Tt.t0=wt.id,Tt.next=Tt.t0==="del"?6:Tt.t0==="up"||Tt.t0==="down"?8:Tt.t0==="edit"?12:Tt.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function St(){return r.a.wrap(function(bn){for(;;)switch(bn.prev=bn.next){case 0:return bn.next=2,Object(I.n)({id:we.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},Mt)});case 3:case"end":return bn.stop()}},St)}))()}}),Tt.abrupt("break",17);case 8:return Tt.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:wt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},Mt)}),Tt.abrupt("break",17);case 12:return C(we.dragKey),Mn(!0),Tt.abrupt("break",17);case 15:return Q({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:4}),Tt.abrupt("break",17);case 17:case"end":return Tt.stop()}},Ze)}));return function(wt){return dt.apply(this,arguments)}}(),We=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",we.question_score,"\u5206\uFF09")),we!=null&&we.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,"."),t.a.createElement(xe.a,{value:we.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",we.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:we.question_title})),t.a.createElement("div",{className:he.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(xe.a,{value:qt||""})),t.a.createElement("div",{className:he.a.action},!we.hideAction&&Ve.map(function(Ze,wt){return Ze.id==="up"&&we.key===1||Ze.id==="down"&&we.key===we.len?null:t.a.createElement(h.a,{key:wt,placement:"bottom",title:Ze.name},t.a.createElement("span",{onClick:function(){return qe(Ze)},className:Ze.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!ln&&We(),ln&&it())},En=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.exercise,Ee=ct.globalSetting;return{problemset:je,globalSetting:Ee,exercise:Ne,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(rn)),mn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ye=function(je,It){var Ne=je.problemset,Ee=je.exercise,ve=je.globalSetting,di=je.loading,en=je.dispatch,De=je.onRef,ht=De===void 0?function(){}:De,we=je.editData,un=je.cancelAdd,fi=un===void 0?function(){}:un,gi=je.editKey,q=je.setEditKey,C=q===void 0?function(){}:q,L=je.addCallback,V=L===void 0?function(){}:L,ae=je.setIsClaer,Q=ae===void 0?function(){}:ae,Ae=Object(N.a)(je,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","addCallback","setIsClaer"]),nt=Object(i.useState)([]),xt=Object(o.a)(nt,2),Dt=xt[0],ot=xt[1],vt=Object(i.useState)(),Lt=Object(o.a)(vt,2),wn=Lt[0],Xn=Lt[1],jn=Object(i.useState)([]),cn=Object(o.a)(jn,2),jt=cn[0],nn=cn[1],qt=Object(i.useState)(""),Nt=Object(o.a)(qt,2),$n=Nt[0],Un=Nt[1],xn=Object(i.useState)(5),Yn=Object(o.a)(xn,2),hn=Yn[0],Tn=Yn[1],ln=Object(i.useState)(!1),Mn=Object(o.a)(ln,2),Vn=Mn[0],ni=Mn[1],Pn=Object(H.g)(),Hn=Object(H.i)();Object(i.useEffect)(function(){ot(["","","",""])},[]),Object(i.useEffect)(function(){if(!(we!=null&&we.question_choices)){ni(!0),Un(""),Tn(5),ot(["","","",""]),nn([]);return}Un(we==null?void 0:we.question_title),Tn(we==null?void 0:we.question_score),ot(we==null?void 0:we.question_choices.map(function(Gn){return Gn.choice_text}));var _n=[];we==null||we.standard_answer.map(function(Gn,qn){_n.push(Gn-1)}),nn(_n)},[we]),Object(i.useImperativeHandle)(It,function(){return{onSave:tn,isEdit:Vn}});var tn=function(){var _n=Object(oe.a)(r.a.mark(function Gn(){var qn,In,Dn;return r.a.wrap(function(An){for(;;)switch(An.prev=An.next){case 0:if($n){An.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),An.abrupt("return",!1);case 3:if(qn=Dt.findIndex(function(sn){return!sn}),!(qn>-1)){An.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(mn[qn]," \u9009\u9879\u7684\u5185\u5BB9")),An.abrupt("return",!1);case 7:if(jt.length){An.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),An.abrupt("return",!1);case 10:if(!(jt.length<1)){An.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),An.abrupt("return",!1);case 13:if(In=Dt.map(function(sn,Mt){return{choice_text:sn,is_answer:jt.includes(Mt)?Mt+1:0}}),!we.question_id){An.next=20;break}return An.next=17,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:$n,question_type:1,question_score:hn,question_choices:In.map(function(sn){return sn.choice_text}),standard_answers:In.filter(function(sn){return sn.is_answer}).map(function(sn){return sn.is_answer})}});case 17:Dn=An.sent,An.next=23;break;case 20:return An.next=22,en({type:"exercise/addExerciseQuestion",payload:{insert_id:we==null?void 0:we.insert_id,categoryId:Hn.categoryId,question_title:$n,question_type:1,question_score:"5.0",question_choices:In.map(function(sn){return sn.choice_text}),standard_answers:In.filter(function(sn){return sn.is_answer}).map(function(sn){return sn.is_answer})}});case 22:Dn=An.sent;case 23:Dn.status===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),ni(!1),en({type:"exercise/editExercise",payload:Object(v.a)({},Hn)}));case 24:case"end":return An.stop()}},Gn)}));return function(){return _n.apply(this,arguments)}}(),vn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(_n){var Gn,qn;return(Ee==null||((Gn=Ee.editData)===null||Gn===void 0||((qn=Gn.exercise)===null||qn===void 0))?void 0:qn.exercise_status)===1?_n:_n.id!=="del"&&_n.id!=="add"}),Ln=function(){var _n=Object(oe.a)(r.a.mark(function Gn(qn){return r.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:if(!(gi!==-1)){Dn.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Dn.abrupt("return");case 3:Dn.t0=qn.id,Dn.next=Dn.t0==="del"?6:Dn.t0==="up"||Dn.t0==="down"?8:Dn.t0==="edit"?12:Dn.t0==="add"?14:16;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function An(){return r.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:return Mt.next=2,Object(I.n)({id:we.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},Hn)});case 3:case"end":return Mt.stop()}},An)}))()}}),Dn.abrupt("break",16);case 8:return Dn.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:qn.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},Hn)}),Dn.abrupt("break",16);case 12:return Pn.push("/problems/".concat(we==null?void 0:we.hack_identifier,"/edit?type=exercises&express_id=").concat(Hn.categoryId,"&question_id=").concat(we==null?void 0:we.question_id,"&score=").concat(we==null?void 0:we.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Dn.abrupt("break",16);case 14:return V({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:6}),Dn.abrupt("break",16);case 16:case"end":return Dn.stop()}},Gn)}));return function(qn){return _n.apply(this,arguments)}}(),Cn=function(){var _n=Object(oe.a)(r.a.mark(function Gn(qn){var In;return r.a.wrap(function(kn){for(;;)switch(kn.prev=kn.next){case 0:return qn.preventDefault(),kn.next=3,Object(I.X)({id:we==null?void 0:we.hack_identifier});case 3:In=kn.sent,In.status===0&&Object(re.S)("/myproblems/".concat(In==null?void 0:In.identifier));case 5:case"end":return kn.stop()}},Gn)}));return function(qn){return _n.apply(this,arguments)}}(),Qn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",we.question_score,"\u5206\uFF09")),we!=null&&we.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,"."),t.a.createElement(xe.a,{value:we.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",we.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:we.question_title})),t.a.createElement("div",{className:he.a.questionChoices},t.a.createElement(xe.a,{value:we.description||""})),t.a.createElement("div",{className:he.a.action},!we.hideAction&&vn.map(function(Gn,qn){return Gn.id==="up"&&we.key===1||Gn.id==="down"&&we.key===we.len?null:t.a.createElement(h.a,{key:qn,placement:"bottom",title:Gn.name},t.a.createElement("span",{onClick:function(){return Ln(Gn)},className:Gn.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},Qn())},Xe=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.globalSetting,Ee=ct.exercise;return{problemset:je,globalSetting:Ne,exercise:Ee,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ye)),Ot=z("LvDl"),Et=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Je=function(je,It){var Ne=je.problemset,Ee=je.exercise,ve=je.globalSetting,di=je.loading,en=je.dispatch,De=je.onRef,ht=De===void 0?function(){}:De,we=je.editData,un=je.cancelAdd,fi=un===void 0?function(){}:un,gi=je.editKey,q=je.setEditKey,C=q===void 0?function(){}:q,L=je.setIsClaer,V=L===void 0?function(){}:L,ae=je.addCallback,Q=ae===void 0?function(gt){}:ae,Ae=je.reload,nt=Ae===void 0?function(){}:Ae,xt=Object(N.a)(je,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),Dt=Object(i.useState)([]),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(!1),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(!0),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)(1),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(!1),Tn=Object(o.a)(hn,2),ln=Tn[0],Mn=Tn[1],Vn=Object(i.useState)([]),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(H.i)(),vn=Object(i.useRef)(null),Ln=Object(i.useState)(""),Cn=Object(o.a)(Ln,2),Qn=Cn[0],_n=Cn[1],Gn=Object(i.useState)([]),qn=Object(o.a)(Gn,2),In=qn[0],Dn=qn[1],kn=Object(i.useRef)(!1),An=function(it){Hn([].concat(Object(F.a)(Pn),[Object(v.a)({},it)]))};Object(i.useEffect)(function(){var gt;if(kn.current)return;if(!(we!=null&&we.question_title)){cn(!0),_n("");return}_n(we==null?void 0:we.question_title),Mn(!(we!=null&&we.repeat_answer)),Yn(we==null?void 0:we.difficulty),Lt(we.tag_discipline_ids);var it=we==null||((gt=we.sub_exercise_questions)===null||gt===void 0)?void 0:gt.map(function(Ve){var qe,We,dt;return Object(v.a)(Object(v.a)({},Ve),{},{id:Ve.question_id,name:Ve.question_title,open:!1,score:Ve.question_score,qusList:Ve==null||((qe=Ve.question_choices)===null||qe===void 0)?void 0:qe.map(function(Ze){return Ze.choice_text}),activeQusEditor:null,qusAnswer:(We=[Ve==null||((dt=Ve.question_choices)===null||dt===void 0)?void 0:dt.findIndex(function(Ze){return Ze.standard_boolean})])===null||We===void 0?void 0:We.filter(function(Ze){return Ze!==-1})})});Dn(it)},[we,jn]),Object(i.useEffect)(function(){jn&&gt();function gt(){return it.apply(this,arguments)}function it(){return it=Object(oe.a)(r.a.mark(function Ve(){var qe,We,dt;return r.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(I.I)({sub_discipline_id:(qe=Ee.editData)===null||qe===void 0||((We=qe.exercise)===null||We===void 0)?void 0:We.sub_discipline_id});case 2:dt=wt.sent,Hn(dt.tag_disciplines);case 4:case"end":return wt.stop()}},Ve)})),it.apply(this,arguments)}},[jn]),Object(i.useEffect)(function(){var gt,it=Ee!=null&&(gt=Ee.tagDisciplineData)!==null&&gt!==void 0&&gt.tag_disciplines&&Array.isArray(Ee.tagDisciplineData.tag_disciplines)?Ee.tagDisciplineData.tag_disciplines:[];Hn(it)},[Ee.tagDisciplineData]),Object(i.useImperativeHandle)(It,function(){return{onSave:Mt,isEdit:jn}});var sn=function(it){(it==null?void 0:it.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),cn(!1),C(-1),kn.current=!1,nt())},Mt=function(){var gt=Object(oe.a)(r.a.mark(function it(){var Ve,qe,We,dt,Ze,wt,kt,Tt;return r.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(Qn){St.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),St.abrupt("return",!1);case 3:if(!(In.length===0)){St.next=6;break}return y.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),St.abrupt("return",!1);case 6:Ve=0;case 7:if(!(Ve<In.length)){St.next=25;break}if(We=In[Ve],We!=null&&We.name){St.next=12;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Ve+1,"\u5C0F\u9898\u9898\u5E72")),St.abrupt("return",!1);case 12:if(We!=null&&We.score){St.next=15;break}return y.b.info("\u7B2C".concat(Ve+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),St.abrupt("return",!1);case 15:if(dt=We==null||((qe=We.qusList)===null||qe===void 0)?void 0:qe.findIndex(function(Pt){return!Pt}),!(dt>-1)){St.next=19;break}return y.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Ve+1,"\u5C0F\u9898").concat(Et[dt],"\u9009\u9879\u7684\u5185\u5BB9")),St.abrupt("return",!1);case 19:if(We!=null&&We.qusAnswer.length){St.next=22;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Ve+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),St.abrupt("return",!1);case 22:Ve++,St.next=7;break;case 25:if(Ze=In.map(function(Pt){var bn;return{id:Pt.id>1?Pt.id:null,question_title:Pt.name,question_type:1,question_choices:Pt.qusList,question_score:Pt.score,standard_answers:[((bn=Pt.qusAnswer)===null||bn===void 0?void 0:bn[0])+1]}}),kn.current=!0,!we.question_id){St.next=36;break}if(!((we==null?void 0:we.is_my)===1)){St.next=32;break}W.a.confirm({title:"\u63D0\u793A",content:"\u6B64\u9898\u76EE\u5DF2\u5B58\u5728\u4E8E\u8BD5\u9898\u5E93\uFF0C\u662F\u5426\u5C06\u4FEE\u6539\u540E\u7684\u9898\u76EE\u8986\u76D6\u8BD5\u9898\u5E93\u7684\u539F\u9898\uFF1F",okText:"\u8986\u76D6\u539F\u9898",cancelText:"\u4E0D\u8986\u76D6",keyboard:!1,onOk:function(){var Pt=Object(oe.a)(r.a.mark(function on(){var vi,Jn;return r.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:Qn,question_type:7,sub_questions:Ze,tag_discipline_ids:vt,sub_discipline_id:(vi=Ee.editData)===null||vi===void 0||((Jn=vi.exercise)===null||Jn===void 0)?void 0:Jn.sub_discipline_id,difficulty:xn,is_cover:1,repeat_answer:!ln}});case 2:wt=Yt.sent,sn(wt);case 4:case"end":return Yt.stop()}},on)}));function bn(){return Pt.apply(this,arguments)}return bn}(),onCancel:function(){var Pt=Object(oe.a)(r.a.mark(function on(){var vi,Jn;return r.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:Qn,question_type:7,sub_questions:Ze,tag_discipline_ids:vt,sub_discipline_id:(vi=Ee.editData)===null||vi===void 0||((Jn=vi.exercise)===null||Jn===void 0)?void 0:Jn.sub_discipline_id,difficulty:xn,repeat_answer:!ln}});case 2:wt=Yt.sent,sn(wt);case 4:case"end":return Yt.stop()}},on)}));function bn(){return Pt.apply(this,arguments)}return bn}()}),St.next=36;break;case 32:return St.next=34,en({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:Qn,question_type:7,sub_questions:Ze,tag_discipline_ids:vt,sub_discipline_id:(kt=Ee.editData)===null||kt===void 0||((Tt=kt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,difficulty:xn,repeat_answer:!ln}});case 34:wt=St.sent,sn(wt);case 36:case"end":return St.stop()}},it)}));return function(){return gt.apply(this,arguments)}}(),zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(gt){var it,Ve;return(Ee==null||((it=Ee.editData)===null||it===void 0||((Ve=it.exercise)===null||Ve===void 0))?void 0:Ve.exercise_status)===1?gt:gt.id!=="del"&&gt.id!=="add"}),Vt=function(){var gt=Object(oe.a)(r.a.mark(function it(Ve){return r.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:if(!(gi!==-1)){We.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),We.abrupt("return");case 3:We.t0=Ve.id,We.next=We.t0==="del"?6:We.t0==="up"||We.t0==="down"?8:We.t0==="edit"?12:We.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Ze(){return r.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(I.n)({id:we.question_id});case 2:en({type:"exercise/editExercise",payload:Object(v.a)({},tn)});case 3:case"end":return kt.stop()}},Ze)}))()}}),We.abrupt("break",17);case 8:return We.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:Ve.id}});case 10:return en({type:"exercise/editExercise",payload:Object(v.a)({},tn)}),We.abrupt("break",17);case 12:return C(we.dragKey),cn(!0),We.abrupt("break",17);case 15:return Q({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:0}),We.abrupt("break",17);case 17:case"end":return We.stop()}},it)}));return function(Ve){return gt.apply(this,arguments)}}(),Bt=function(){var it;return t.a.createElement("aside",{ref:vn},t.a.createElement("div",{className:he.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",we.question_score,"\u5206\uFF09")),we!=null&&we.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,"."),t.a.createElement(xe.a,{value:we.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",we==null?void 0:we.sub_q_count,"\u5C0F\u9898\uFF0C",we.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:we.question_title})),t.a.createElement("div",{style:{display:qt?"block":"none"},className:he.a.questionChoices},we==null||((it=we.sub_exercise_questions)===null||it===void 0)?void 0:it.map(function(Ve,qe){var We;return t.a.createElement("div",{key:qe},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},we.key,".",qe+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(xe.a,{value:Ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ve.question_score,"\u5206\uFF09")),Ve==null||((We=Ve.question_choices)===null||We===void 0)?void 0:We.map(function(dt,Ze){return t.a.createElement(k.a,{key:Ze},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:Ze,checked:Ve.standard_answer.includes(Ze+1),disabled:!0},Et[Ze],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:dt.choice_text}))))}))})),t.a.createElement("div",{className:he.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Nt(!qt)},style:{}},qt?"\u6536\u8D77":"\u5C55\u5F00"),!we.hideAction&&zt.map(function(Ve,qe){return Ve.id==="up"&&we.key===1||Ve.id==="down"&&we.key===we.len?null:t.a.createElement(h.a,{key:qe,placement:"bottom",title:Ve.name},t.a.createElement("span",{onClick:function(){return Vt(Ve)},className:Ve.icon}))})))},Zt=function(){var it,Ve;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:he.a.wrap,style:{padding:0}},t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Qn,onChange:function(We){return _n(We)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",In==null?void 0:In.length),In==null?void 0:In.map(function(qe,We){var dt;return t.a.createElement("div",{className:he.a.fold,key:qe.id},t.a.createElement("div",{onClick:function(){return pn("open",We)},className:he.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:qe.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",We+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(wt){wt.stopPropagation(),pn("delete",We)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:qe.open?"block":"none"}},t.a.createElement(x.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:qe==null?void 0:qe.name,onChange:function(wt){return pn("value",We,wt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),qe==null||((dt=qe.qusList)===null||dt===void 0)?void 0:dt.map(function(Ze,wt){var kt,Tt;return t.a.createElement("div",{className:he.a.choiceWrap,key:wt},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(qe!=null&&(kt=qe.qusAnswer)!==null&&kt!==void 0&&kt.includes(wt)?he.a.activeAnswer:""),onClick:function(){return pn("answer",We,wt)}},Et[wt])),t.a.createElement("div",{className:he.a.editorWrap},(qe==null?void 0:qe.activeQusEditor)===wt?t.a.createElement(x.a,{id:"single-question-option-".concat(wt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Ze,onChange:function(St){return pn("details",We,St)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return pn("edit",We,wt)}},t.a.createElement(xe.a,{value:Ze}))),wt>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return pn("deleteQus",We,wt)}})),wt<7&&wt===(qe==null||((Tt=qe.qusList)===null||Tt===void 0)?void 0:Tt.length)-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return pn("addQus",We)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:qe.score,max:1e4,min:0,onChange:function(wt){return pn("score",We,wt)}})," ","\u5206")))}),In.length<20&&t.a.createElement(m.a,{type:"primary",onClick:yn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:xn,onChange:function(We){Yn(We.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:we==null?void 0:we.tag_discipline_ids,value:vt,onChange:Lt,subId:(it=Ee.editData)===null||it===void 0||((Ve=it.exercise)===null||Ve===void 0)?void 0:Ve.sub_discipline_id,knowledgeOptions:Pn,onAddKnowledgeFinish:An}))),t.a.createElement("aside",{className:"tr"},(gi!==-1||we.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){fi(),cn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Mt()}},"\u4FDD\u5B58")))},yn=function(){var it={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};Dn(In.concat(it))},pn=function(it,Ve,qe){var We=Object(Ot.cloneDeep)(In);if(it==="open"&&(We[Ve].open=!We[Ve].open),it==="delete"&&We.splice(Ve,1),it==="value"&&(We[Ve].name=qe),it==="answer"&&(We[Ve].qusAnswer=[qe]),it==="edit"&&(We[Ve].activeQusEditor=qe),it==="details"&&(We[Ve].qusList[We[Ve].activeQusEditor]=qe),it==="addQus"&&(We[Ve].qusList=We[Ve].qusList.concat("")),it==="deleteQus"){var dt;We[Ve].qusList=We[Ve].qusList.filter(function(Ze,wt){return wt!==qe}),We[Ve].qusAnswer=(dt=We[Ve].qusAnswer)===null||dt===void 0?void 0:dt.filter(function(Ze){return Ze!==qe})}it==="analysis"&&(We[Ve].analysis=qe),it==="score"&&(We[Ve].score=qe),Dn(We)};return t.a.createElement("section",{className:he.a.wrap},!jn&&Bt(),jn&&Zt())},mt=Object(G.a)(function(ct){var je=ct.problemset,It=ct.loading,Ne=ct.globalSetting,Ee=ct.exercise;return{problemset:je,globalSetting:Ne,exercise:Ee,loading:It.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Je)),Be=z("ngQI"),Ie=z("loLm"),ke=z.n(Ie),me=z("ErOA"),ye=z("vCeJ"),Re=z("Nog9"),ce=z.n(Re),Me=z("hQp1"),tt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],bt=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.cancelAdd,en=di===void 0?function(){}:di,De=je.editKey,ht=je.setEditKey,we=ht===void 0?function(){}:ht,un=je.reload,fi=un===void 0?function(){}:un,gi=je.addCallback,q=gi===void 0?function(Ve){}:gi,C=Object(i.useState)([]),L=Object(o.a)(C,2),V=L[0],ae=L[1],Q=Object(i.useState)(),Ae=Object(o.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(i.useState)([]),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(""),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)([]),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(!1),Tn=Object(o.a)(hn,2),ln=Tn[0],Mn=Tn[1],Vn=Object(i.useState)(1),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(!1),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useState)(""),_n=Object(o.a)(Qn,2),Gn=_n[0],qn=_n[1],In=Object(H.i)(),Dn=Object(i.useRef)(null),kn=Object(i.useRef)(!1),An=Object(i.useState)([]),sn=Object(o.a)(An,2),Mt=sn[0],zt=sn[1],Vt=function(qe){zt([].concat(Object(F.a)(Mt),[Object(v.a)({},qe)]))};Object(i.useEffect)(function(){ae(["","","",""])},[]),Object(i.useEffect)(function(){if(kn.current)return;if(!(ve!=null&&ve.question_choices)){Mn(!0),cn(""),Nt(5),ae(["","","",""]),Lt([]);return}cn(ve==null?void 0:ve.question_title),Nt(ve==null?void 0:ve.question_score),Cn(!(ve!=null&&ve.repeat_answer)),qn(ve==null?void 0:ve.analysis),Hn(ve==null?void 0:ve.difficulty),ae(ve==null?void 0:ve.question_choices.map(function(qe){return qe.choice_text}));var Ve=[];ve==null||ve.standard_answer.map(function(qe,We){Ve.push(qe-1)}),Yn(ve.tag_discipline_ids),Lt(Ve)},[ve,ln]),Object(i.useEffect)(function(){ln&&Ve();function Ve(){return qe.apply(this,arguments)}function qe(){return qe=Object(oe.a)(r.a.mark(function We(){var dt,Ze,wt;return r.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(I.I)({sub_discipline_id:(dt=Ne.editData)===null||dt===void 0||((Ze=dt.exercise)===null||Ze===void 0)?void 0:Ze.sub_discipline_id});case 2:wt=Tt.sent,zt(wt.tag_disciplines);case 4:case"end":return Tt.stop()}},We)})),qe.apply(this,arguments)}},[ln]),Object(i.useEffect)(function(){var Ve,qe=Ne!=null&&(Ve=Ne.tagDisciplineData)!==null&&Ve!==void 0&&Ve.tag_disciplines&&Array.isArray(Ne.tagDisciplineData.tag_disciplines)?Ne.tagDisciplineData.tag_disciplines:[];zt(qe)},[Ne.tagDisciplineData]),Object(i.useImperativeHandle)(It,function(){return{onSave:Zt,isEdit:ln}});var Bt=function(qe){(qe==null?void 0:qe.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Mn(!1),we(-1),kn.current=!1,fi())},Zt=function(){var Ve=Object(oe.a)(r.a.mark(function qe(){var We,dt,Ze,wt,kt,Tt,Ht;return r.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if(jn){Pt.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Pt.abrupt("return",!1);case 3:if(We=V.findIndex(function(bn){return!bn}),!(We>-1)){Pt.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(tt[We]," \u9009\u9879\u7684\u5185\u5BB9")),Pt.abrupt("return",!1);case 7:if(vt.length){Pt.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Pt.abrupt("return",!1);case 10:if(!(vt.length<1)){Pt.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Pt.abrupt("return",!1);case 13:if(dt=V.map(function(bn,on){return{choice_text:bn,is_answer:vt.includes(on)?1:0}}),kn.current=!0,!ve.question_id){Pt.next=22;break}return Pt.next=18,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:In.id,question_id:ve.question_id,name:jn,item_type:vt.length>1?Me.a.Multiple:Me.a.Single,question_score:qt,choices:dt,tag_discipline_ids:xn,sub_discipline_id:(wt=Ne.editData)===null||wt===void 0||((kt=wt.exercise)===null||kt===void 0)?void 0:kt.sub_discipline_id,difficulty:Pn,repeat_answer:!Ln,analysis:Gn}});case 18:Ze=Pt.sent,Bt(Ze),Pt.next=26;break;case 22:return Pt.next=24,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:In.id,name:jn,item_type:vt.length>1?Me.a.Multiple:Me.a.Single,question_score:qt,choices:dt,tag_discipline_ids:xn,sub_discipline_id:(Tt=Ne.editData)===null||Tt===void 0||((Ht=Tt.exercise)===null||Ht===void 0)?void 0:Ht.sub_discipline_id,difficulty:Pn,repeat_answer:!Ln,analysis:Gn}});case 24:Ze=Pt.sent,Bt(Ze);case 26:case"end":return Pt.stop()}},qe)}));return function(){return Ve.apply(this,arguments)}}(),yn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],pn=function(){var Ve=Object(oe.a)(r.a.mark(function qe(We){return r.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:if(!(De!==-1)){Ze.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ze.abrupt("return");case 3:Ze.t0=We.id,Ze.next=Ze.t0==="del"?6:Ze.t0==="edit"?8:Ze.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function kt(){return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(ye.g)({exam_id:In.id,question_id:ve.question_id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},In)});case 3:case"end":return Ht.stop()}},kt)}))()}}),Ze.abrupt("break",13);case 8:return we(ve.dragKey),Mn(!0),Ze.abrupt("break",13);case 11:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:0}),Ze.abrupt("break",13);case 13:case"end":return Ze.stop()}},qe)}));return function(We){return Ve.apply(this,arguments)}}(),gt=function(){var qe;return t.a.createElement("aside",{ref:Dn},t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u5355\u9009\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},ve==null||((qe=ve.question_choices)===null||qe===void 0)?void 0:qe.map(function(We,dt){return t.a.createElement(k.a,{key:dt},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:dt,checked:ve.standard_answer.includes(dt+1),disabled:!0},tt[dt],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:We.choice_text}))))})),t.a.createElement("div",{className:ce.a.action},!ve.hideAction&&yn.map(function(We,dt){return t.a.createElement(h.a,{key:dt,placement:"bottom",title:We.name},t.a.createElement("span",{onClick:function(){return pn(We)},className:We.icon}))})))},it=function(){var qe,We;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:jn,onChange:function(Ze){return cn(Ze)}}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),V.map(function(dt,Ze){return t.a.createElement("div",{className:ce.a.choiceWrap,key:Ze},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ce.a.answer," ").concat(vt.includes(Ze)?ce.a.activeAnswer:""),onClick:function(){vt.includes(Ze)?Lt(function(kt){return kt.filter(function(Tt){return Tt!==Ze})}):Lt(function(kt){return[].concat(Object(F.a)(kt),[Ze])})}},tt[Ze])),t.a.createElement("div",{className:ce.a.editorWrap},nt===Ze?t.a.createElement(x.a,{id:"single-question-option-".concat(Ze),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:dt,onChange:function(kt){V[Ze]=kt,ae(V)}}):t.a.createElement("div",{className:ce.a.htmlWrap,onClick:function(){return xt(Ze)}},t.a.createElement(xe.a,{value:dt}))),t.a.createElement(t.a.Fragment,null,Ze>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ce.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return ae(V.filter(function(kt,Tt){return Tt!==Ze}))}})),Ze<7&&Ze===V.length-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ce.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return ae([].concat(Object(F.a)(V),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gn,onChange:function(Ze){return qn(Ze)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:qt,max:1e4,min:0,onChange:function(Ze){Nt(Ze)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Pn,onChange:function(Ze){Hn(Ze.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:xn,onChange:Yn,subId:(qe=Ne.editData)===null||qe===void 0||((We=qe.exercise)===null||We===void 0)?void 0:We.sub_discipline_id,knowledgeOptions:Mt,onAddKnowledgeFinish:Vt})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Ln,onChange:function(Ze){Cn(Ze)}}))),t.a.createElement("aside",{className:"tr"},(De!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){en(),Mn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Zt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ce.a.wrap},!ln&&gt(),ln&&it())},Kt=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(bt)),Gt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],$t=Object(i.forwardRef)(function(ct,je){var It=ct.newExercisePaper,Ne=ct.dispatch,Ee=ct.editData,ve=ct.cancelAdd,di=ve===void 0?function(){}:ve,en=ct.editKey,De=ct.setEditKey,ht=De===void 0?function(){}:De,we=ct.addCallback,un=we===void 0?function(gt){}:we,fi=ct.reload,gi=fi===void 0?function(){}:fi,q=Object(i.useState)([]),C=Object(o.a)(q,2),L=C[0],V=C[1],ae=Object(i.useState)(),Q=Object(o.a)(ae,2),Ae=Q[0],nt=Q[1],xt=Object(i.useState)([]),Dt=Object(o.a)(xt,2),ot=Dt[0],vt=Dt[1],Lt=Object(i.useState)(""),wn=Object(o.a)(Lt,2),Xn=wn[0],jn=wn[1],cn=Object(i.useState)(),jt=Object(o.a)(cn,2),nn=jt[0],qt=jt[1],Nt=Object(i.useState)(!1),$n=Object(o.a)(Nt,2),Un=$n[0],xn=$n[1],Yn=Object(i.useState)([]),hn=Object(o.a)(Yn,2),Tn=hn[0],ln=hn[1],Mn=Object(i.useState)(1),Vn=Object(o.a)(Mn,2),ni=Vn[0],Pn=Vn[1],Hn=Object(i.useState)(!1),tn=Object(o.a)(Hn,2),vn=tn[0],Ln=tn[1],Cn=Object(i.useState)(""),Qn=Object(o.a)(Cn,2),_n=Qn[0],Gn=Qn[1],qn=Object(i.useState)([]),In=Object(o.a)(qn,2),Dn=In[0],kn=In[1],An=Object(i.useRef)(!1),sn=function(it){kn([].concat(Object(F.a)(Dn),[Object(v.a)({},it)]))},Mt=Object(H.i)();Object(i.useEffect)(function(){V(["","","",""])},[]),Object(i.useEffect)(function(){if(An.current)return;if(!(Ee!=null&&Ee.question_choices)){xn(!0),jn(""),qt(5),V(["","","",""]),vt([]);return}jn(Ee==null?void 0:Ee.question_title),qt(Ee==null?void 0:Ee.question_score),Ln(!(Ee!=null&&Ee.repeat_answer)),Pn(Ee==null?void 0:Ee.difficulty),V(Ee==null?void 0:Ee.question_choices.map(function(it){return it.choice_text}));var gt=[];Ee==null||Ee.standard_answer.map(function(it,Ve){gt.push(it-1)}),vt(gt),ln(Ee.tag_discipline_ids),Gn(Ee==null?void 0:Ee.analysis)},[Ee,Un]),Object(i.useEffect)(function(){Un&&gt();function gt(){return it.apply(this,arguments)}function it(){return it=Object(oe.a)(r.a.mark(function Ve(){var qe,We,dt;return r.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:return wt.next=2,Object(I.I)({sub_discipline_id:(qe=It.editData)===null||qe===void 0||((We=qe.exercise)===null||We===void 0)?void 0:We.sub_discipline_id});case 2:dt=wt.sent,kn(dt.tag_disciplines);case 4:case"end":return wt.stop()}},Ve)})),it.apply(this,arguments)}},[Un]),Object(i.useImperativeHandle)(je,function(){return{onSave:Vt,isEdit:Un}}),Object(i.useEffect)(function(){var gt,it=It!=null&&(gt=It.tagDisciplineData)!==null&&gt!==void 0&&gt.tag_disciplines&&Array.isArray(It.tagDisciplineData.tag_disciplines)?It.tagDisciplineData.tag_disciplines:[];kn(it)},[It.tagDisciplineData]);var zt=function(it){(it==null?void 0:it.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),xn(!1),ht(-1),An.current=!1,gi())},Vt=function(){var gt=Object(oe.a)(r.a.mark(function it(){var Ve,qe,We,dt,Ze,wt,kt;return r.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:if(Xn){Ht.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ht.abrupt("return",!1);case 3:if(Ve=L.findIndex(function(St){return!St}),!(Ve>-1)){Ht.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Gt[Ve]," \u9009\u9879\u7684\u5185\u5BB9")),Ht.abrupt("return",!1);case 7:if(ot.length){Ht.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ht.abrupt("return",!1);case 10:if(!(ot.length<1)){Ht.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ht.abrupt("return",!1);case 13:if(qe=L.map(function(St,Pt){return{choice_text:St,is_answer:ot.includes(Pt)?1:0}}),An.current=!0,!Ee.question_id){Ht.next=22;break}return Ht.next=18,Ne({type:"newExercisePaper/editExerciseQuestion",payload:{id:Mt.id,question_id:Ee.question_id,name:Xn,item_type:ot.length>1?Me.a.Multiple:Me.a.Single,question_score:nn,choices:qe,tag_discipline_ids:Tn,sub_discipline_id:(dt=It.editData)===null||dt===void 0||((Ze=dt.exercise)===null||Ze===void 0)?void 0:Ze.sub_discipline_id,difficulty:ni,repeat_answer:!vn,analysis:_n}});case 18:We=Ht.sent,zt(We),Ht.next=26;break;case 22:return Ht.next=24,Ne({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:Ee==null?void 0:Ee.insert_id,id:Mt.id,name:Xn,item_type:ot.length>1?Me.a.Multiple:Me.a.Single,question_score:nn,choices:qe,tag_discipline_ids:Tn,sub_discipline_id:(wt=It.editData)===null||wt===void 0||((kt=wt.exercise)===null||kt===void 0)?void 0:kt.sub_discipline_id,difficulty:ni,repeat_answer:!vn,analysis:_n}});case 24:We=Ht.sent,zt(We);case 26:case"end":return Ht.stop()}},it)}));return function(){return gt.apply(this,arguments)}}(),Bt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u591A\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Zt=function(){var gt=Object(oe.a)(r.a.mark(function it(Ve){return r.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:if(!(en!==-1)){We.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),We.abrupt("return");case 3:We.t0=Ve.id,We.next=We.t0==="del"?6:We.t0==="edit"?8:We.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Ze(){return r.a.wrap(function(kt){for(;;)switch(kt.prev=kt.next){case 0:return kt.next=2,Object(ye.g)({question_id:Ee.question_id,exam_id:Mt.id});case 2:Ne({type:"newExercisePaper/editExercise",payload:Object(v.a)({},Mt)});case 3:case"end":return kt.stop()}},Ze)}))()}}),We.abrupt("break",13);case 8:return ht(Ee.dragKey),xn(!0),We.abrupt("break",13);case 11:return un({key:Ee.key,insert_id:Ee==null?void 0:Ee.question_id,question_type:1}),We.abrupt("break",13);case 13:case"end":return We.stop()}},it)}));return function(Ve){return gt.apply(this,arguments)}}(),yn=function(){var it;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(Ee!=null&&Ee.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ee.key,"\u3001\u591A\u9009\u9898"),"\uFF08",Ee.question_score,"\u5206\uFF09")),Ee!=null&&Ee.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ee.key,"."),t.a.createElement(xe.a,{value:Ee.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ee.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ee.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},Ee==null||((it=Ee.question_choices)===null||it===void 0)?void 0:it.map(function(Ve,qe){return t.a.createElement(k.a,{key:qe},t.a.createElement(O.a,null,t.a.createElement(E.a,{key:qe,checked:Ee.standard_answer.includes(qe+1),disabled:!0},Gt[qe],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Ve.choice_text}))))})),t.a.createElement("div",{className:ce.a.action},!Ee.hideAction&&Bt.map(function(Ve,qe){return t.a.createElement(h.a,{key:qe,placement:"bottom",title:Ve.name},t.a.createElement("span",{onClick:function(){return Zt(Ve)},className:Ve.icon}))})))},pn=function(){var it,Ve;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xn,onChange:function(We){return jn(We)}}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),L.map(function(qe,We){var dt,Ze;return t.a.createElement("div",{className:ce.a.choiceWrap,key:We},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ce.a.answer," ").concat(ot.includes(We)?ce.a.activeAnswer:""),onClick:function(){ot.includes(We)?vt(ot.filter(function(kt){return kt!==We})):vt([].concat(Object(F.a)(ot),[We]))}},Gt[We])),t.a.createElement("div",{className:ce.a.editorWrap},Ae===We?t.a.createElement(x.a,{id:"single-question-option-".concat(We),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:qe,onChange:function(kt){L[We]=kt,V(L)}}):t.a.createElement("div",{className:ce.a.htmlWrap,onClick:function(){return nt(We)}},t.a.createElement(xe.a,{value:qe}))),((dt=It.editData)===null||dt===void 0||((Ze=dt.exercise)===null||Ze===void 0)?void 0:Ze.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,We>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ce.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return V(L.filter(function(kt,Tt){return Tt!==We}))}})),We<7&&We===L.length-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ce.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return V([].concat(Object(F.a)(L),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:_n,onChange:function(We){return Gn(We)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:nn,max:1e4,min:0,onChange:function(We){qt(We)}}),"\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:ni,onChange:function(We){Pn(We.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:Tn,selectvalues:Ee==null?void 0:Ee.tag_discipline_ids,onChange:ln,subId:(it=It.editData)===null||it===void 0||((Ve=it.exercise)===null||Ve===void 0)?void 0:Ve.sub_discipline_id,knowledgeOptions:Dn,onAddKnowledgeFinish:sn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:vn,onChange:function(We){Ln(We)}}))),t.a.createElement("aside",{className:"tr"},(en!==-1||Ee.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){di(),xn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Vt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ce.a.wrap},!Un&&yn(),Un&&pn())}),ei=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})($t),gn=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],an=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.editKey,en=je.setEditKey,De=en===void 0?function(){}:en,ht=je.cancelAdd,we=ht===void 0?function(){}:ht,un=je.reload,fi=un===void 0?function(){}:un,gi=je.addCallback,q=gi===void 0?function(){}:gi,C=Object(i.useState)(),L=Object(o.a)(C,2),V=L[0],ae=L[1],Q=Object(i.useState)(""),Ae=Object(o.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(i.useState)(!1),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)([]),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)([]),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(1),Tn=Object(o.a)(hn,2),ln=Tn[0],Mn=Tn[1],Vn=Object(i.useState)(!1),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(""),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useRef)(!1),_n=function(zt){Yn([].concat(Object(F.a)(xn),[Object(v.a)({},zt)]))},Gn=Object(H.i)();Object(i.useEffect)(function(){if(Qn.current)return;if(!(ve!=null&&ve.question_choices)){Lt(!0),xt(""),cn(2),ae("");return}Hn(!(ve!=null&&ve.repeat_answer)),xt(ve==null?void 0:ve.question_title),cn(ve==null?void 0:ve.question_score),Mn(ve==null?void 0:ve.difficulty),ae(ve.standard_answer[0]+""),Nt(ve.tag_discipline_ids),Cn(ve==null?void 0:ve.analysis)},[ve,vt]),Object(i.useEffect)(function(){vt&&Mt();function Mt(){return zt.apply(this,arguments)}function zt(){return zt=Object(oe.a)(r.a.mark(function Vt(){var Bt,Zt,yn;return r.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(I.I)({sub_discipline_id:(Bt=Ne.editData)===null||Bt===void 0||((Zt=Bt.exercise)===null||Zt===void 0)?void 0:Zt.sub_discipline_id});case 2:yn=gt.sent,Yn(yn.tag_disciplines);case 4:case"end":return gt.stop()}},Vt)})),zt.apply(this,arguments)}},[vt]),Object(i.useImperativeHandle)(It,function(){return{onSave:In,isEdit:vt}}),Object(i.useEffect)(function(){var Mt,zt=Ne!=null&&(Mt=Ne.tagDisciplineData)!==null&&Mt!==void 0&&Mt.tag_disciplines&&Array.isArray(Ne.tagDisciplineData.tag_disciplines)?Ne.tagDisciplineData.tag_disciplines:[];Yn(zt)},[Ne.tagDisciplineData]);var qn=function(zt){(zt==null?void 0:zt.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Lt(!1),De(-1),Qn.current=!1,fi())},In=function(){var Mt=Object(oe.a)(r.a.mark(function zt(){var Vt,Bt,Zt,yn,pn,gt;return r.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:if(nt){Ve.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Ve.abrupt("return",!1);case 3:if(V){Ve.next=6;break}return y.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Ve.abrupt("return",!1);case 6:if(Vt=[{choice_text:"\u6B63\u786E",is_answer:V==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:V==="2"?1:0}],Qn.current=!0,!ve.question_id){Ve.next=15;break}return Ve.next=11,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:Gn.id,question_id:ve.question_id,name:nt,item_type:Me.a.Judge,question_score:jn,choices:Vt,tag_discipline_ids:qt,sub_discipline_id:(Zt=Ne.editData)===null||Zt===void 0||((yn=Zt.exercise)===null||yn===void 0)?void 0:yn.sub_discipline_id,difficulty:ln,repeat_answer:!Pn,analysis:Ln}});case 11:Bt=Ve.sent,qn(Bt),Ve.next=19;break;case 15:return Ve.next=17,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{id:Gn.id,insert_id:ve==null?void 0:ve.insert_id,name:nt,item_type:Me.a.Judge,question_score:jn,choices:Vt,tag_discipline_ids:qt,sub_discipline_id:(pn=Ne.editData)===null||pn===void 0||((gt=pn.exercise)===null||gt===void 0)?void 0:gt.sub_discipline_id,difficulty:ln,repeat_answer:!Pn,analysis:Ln}});case 17:Bt=Ve.sent,qn(Bt);case 19:return Ve.abrupt("return",{name:nt,choices:Vt});case 20:case"end":return Ve.stop()}},zt)}));return function(){return Mt.apply(this,arguments)}}(),Dn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5224\u65AD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],kn=function(){var Mt=Object(oe.a)(r.a.mark(function zt(Vt){return r.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:if(!(di!==-1)){Zt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Zt.abrupt("return");case 3:Zt.t0=Vt.id,Zt.next=Zt.t0==="del"?6:Zt.t0==="edit"?8:Zt.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function pn(){return r.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:return it.next=2,Object(ye.g)({question_id:ve.question_id,exam_id:Gn.id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},Gn)});case 3:case"end":return it.stop()}},pn)}))()}}),Zt.abrupt("break",13);case 8:return De(ve.dragKey),Lt(!0),Zt.abrupt("break",13);case 11:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:2}),Zt.abrupt("break",13);case 13:case"end":return Zt.stop()}},zt)}));return function(Vt){return Mt.apply(this,arguments)}}(),An=function(){var zt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},ve==null||((zt=ve.question_choices)===null||zt===void 0)?void 0:zt.map(function(Vt,Bt){return t.a.createElement(u.a,{key:Bt,checked:ve.standard_answer.includes(Bt+1),disabled:!0},gn[Bt],"."," ",t.a.createElement("span",{className:"c-black font14"},Vt.choice_text))})),t.a.createElement("div",{className:ce.a.action},!ve.hideAction&&Dn.map(function(Vt,Bt){return t.a.createElement(h.a,{key:Bt,placement:"bottom",title:Vt.name},t.a.createElement("span",{onClick:function(){return kn(Vt)},className:Vt.icon}))})))},sn=function(){var zt,Vt;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:nt,onChange:function(Zt){return xt(Zt)}}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(u.a.Group,{buttonStyle:"solid",value:V,onChange:function(Zt){return ae(Zt.target.value)}},t.a.createElement(u.a.Button,{value:"1",className:"".concat(ce.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(u.a.Button,{value:"2",className:ce.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ln,onChange:function(Zt){return Cn(Zt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:jn,max:1e4,min:0,onChange:function(Zt){cn(Zt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:ln,onChange:function(Zt){Mn(Zt.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:qt,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Nt,subId:(zt=Ne.editData)===null||zt===void 0||((Vt=zt.exercise)===null||Vt===void 0)?void 0:Vt.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:_n})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Pn,onChange:function(Zt){Hn(Zt)}}))),t.a.createElement("aside",{className:"tr"},(di!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){we(),Lt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){In()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ce.a.wrap},!vt&&An(),vt&&sn())},dn=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(an)),zn=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.editKey,en=je.setEditKey,De=en===void 0?function(){}:en,ht=je.cancelAdd,we=ht===void 0?function(){}:ht,un=je.addCallback,fi=un===void 0?function(){}:un,gi=je.reload,q=gi===void 0?function(){}:gi,C=Object(i.useState)(""),L=Object(o.a)(C,2),V=L[0],ae=L[1],Q=Object(i.useState)(""),Ae=Object(o.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(i.useState)([]),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(""),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)(!1),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(),Tn=Object(o.a)(hn,2),ln=Tn[0],Mn=Tn[1],Vn=Object(i.useState)(0),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)(!1),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useState)(!1),_n=Object(o.a)(Qn,2),Gn=_n[0],qn=_n[1],In=Object(i.useState)([]),Dn=Object(o.a)(In,2),kn=Dn[0],An=Dn[1],sn=Object(i.useState)(1),Mt=Object(o.a)(sn,2),zt=Mt[0],Vt=Mt[1],Bt=Object(i.useState)(!1),Zt=Object(o.a)(Bt,2),yn=Zt[0],pn=Zt[1],gt=Object(i.useRef)(!1),it=Object(H.i)(),Ve=Object(i.useState)([]),qe=Object(o.a)(Ve,2),We=qe[0],dt=qe[1],Ze=function(Sn){dt([].concat(Object(F.a)(We),[Object(v.a)({},Sn)]))};Object(i.useEffect)(function(){if(gt.current)return;if(!(ve!=null&&ve.question_title)){Cn(!0),ae(""),Nt(!1),Mn(2),Lt([]),cn(""),Yn(!1);return}ae(ve==null?void 0:ve.question_title),Nt(ve==null?void 0:ve.is_ordered),Vt(ve==null?void 0:ve.difficulty),pn(!(ve!=null&&ve.repeat_answer)),Mn(ve==null?void 0:ve.question_score);var Yt=ve==null?void 0:ve.standard_answer.map(function(Sn){return Sn.answer_text});Lt(Object(F.a)(Yt)),An(ve.tag_discipline_ids),xt(ve==null?void 0:ve.analysis)},[ve,Ln]),Object(i.useEffect)(function(){Yn(!1),Ln&&Yt();function Yt(){return Sn.apply(this,arguments)}function Sn(){return Sn=Object(oe.a)(r.a.mark(function Kn(){var ii,On,Li;return r.a.wrap(function(bi){for(;;)switch(bi.prev=bi.next){case 0:return bi.next=2,Object(I.I)({sub_discipline_id:(ii=Ne.editData)===null||ii===void 0||((On=ii.exercise)===null||On===void 0)?void 0:On.sub_discipline_id});case 2:Li=bi.sent,dt(Li.tag_disciplines);case 4:case"end":return bi.stop()}},Kn)})),Sn.apply(this,arguments)}},[Ln]),Object(i.useImperativeHandle)(It,function(){return{onSave:kt,isEdit:Ln}}),Object(i.useEffect)(function(){var Yt,Sn=Ne!=null&&(Yt=Ne.tagDisciplineData)!==null&&Yt!==void 0&&Yt.tag_disciplines&&Array.isArray(Ne.tagDisciplineData.tag_disciplines)?Ne.tagDisciplineData.tag_disciplines:[];dt(Sn)},[Ne.tagDisciplineData]);var wt=function(Sn){(Sn==null?void 0:Sn.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Cn(!1),De(-1),gt.current=!1,q())},kt=function(){var Yt=Object(oe.a)(r.a.mark(function Sn(){var Kn,ii,On,Li,ji,bi,si;return r.a.wrap(function(yi){for(;;)switch(yi.prev=yi.next){case 0:if(Kn=[],ii=!1,qn(!0),vt.forEach(function(xi,Ui){Kn.push({position:Ui+1,answer_text:[]}),xi.forEach(function(Vi,Fi){Kn[Ui].answer_text.push(Vi),(!Vi||!Object(re.db)(Vi,1e4))&&(cn("".concat(Ui,"-").concat(Fi)),y.b.info(Vi?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),ii=!0)})}),!ii){yi.next=7;break}return qn(!1),yi.abrupt("return",!1);case 7:if(gt.current=!0,!ve.question_id){yi.next=15;break}return yi.next=11,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:it.id,question_id:ve.question_id,name:V,item_type:3,question_score:ln,is_ordered:qt,standard_answers:Kn,tag_discipline_ids:kn,sub_discipline_id:(Li=Ne.editData)===null||Li===void 0||((ji=Li.exercise)===null||ji===void 0)?void 0:ji.sub_discipline_id,difficulty:zt,repeat_answer:!yn,analysis:nt}});case 11:On=yi.sent,wt(On),yi.next=19;break;case 15:return yi.next=17,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:it.id,name:V,item_type:3,question_score:ln,is_ordered:qt,standard_answers:Kn,tag_discipline_ids:kn,sub_discipline_id:(bi=Ne.editData)===null||bi===void 0||((si=bi.exercise)===null||si===void 0)?void 0:si.sub_discipline_id,difficulty:zt,repeat_answer:!yn,analysis:nt}});case 17:On=yi.sent,wt(On);case 19:return qn(!1),yi.abrupt("return",{name:V,analysis:nt,standard_answers:Kn,is_ordered:qt});case 21:case"end":return yi.stop()}},Sn)}));return function(){return Yt.apply(this,arguments)}}(),Tt=function(Sn,Kn,ii){var On=vt.slice();if(Kn&&On.splice(Sn,Kn),ii&&xn||!ve.question_id)for(var Li=0;Li<ii;Li++)On.splice(Sn+Li,0,[""]);Hn(On==null?void 0:On.length),Yn(!0),Lt(On)},Ht=function(Sn,Kn,ii){cn("");var On=vt.slice();On[Sn][Kn]=ii,Lt(On)},St=function(Sn){var Kn=vt.slice();Kn[Sn]=[].concat(Object(F.a)(Kn[Sn]),[""]),Lt(Kn)},Pt=function(Sn,Kn){var ii=vt.slice();if(!ii[Sn][Kn]){ii[Sn]=ii[Sn].filter(function(On,Li){return Li!==Kn}),Lt(ii);return}W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:ce.a.modal,onOk:function(){ii[Sn]=ii[Sn].filter(function(Li,ji){return ji!==Kn}),Lt(ii)}})},bn=function(Sn){W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:ce.a.modal,onOk:function(){var ii=0;ae(V.replace(/\▁/g,function(On){return ii++,ii-1===Sn?"":On})),setTimeout(function(){var On=vt.slice();On=vt.filter(function(Li,ji){return Sn!==ji}),Lt(On)},500)}})},on=function(){var Sn,Kn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),t.a.createElement("div",null,t.a.createElement(B.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:V,onChange:function(On){return ae(On)},showNullButton:!0,deleteEmptyDisabled:Gn,onPlaceholderChange:Tt})),t.a.createElement("div",{className:"mt20"},vt.map(function(ii,On){return t.a.createElement(Y.a,{key:On,answers:ii,index:On,is_md:!0,exerciseIsPublish:!1,activeOptionErrorIndex:jn,onAnswerChange:Ht,addChildAnswer:St,deleteChildAnswer:Pt,deleteChildAnswermain:bn})})),t.a.createElement("div",{className:"mt20"},vt.length>1&&t.a.createElement("span",null,t.a.createElement(E.a,{checked:qt,onChange:function(On){return Nt(On.target.checked)},className:"".concat(ce.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ce.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:nt,onChange:function(On){return xt(On)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:ln,max:1e4,min:0,onChange:function(On){Mn(On)}})," ","\u5206 \xA0"," ",!!ln&&!!Pn&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(ln/Pn).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:zt,onChange:function(On){Vt(On.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:kn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:An,subId:(Sn=Ne.editData)===null||Sn===void 0||((Kn=Sn.exercise)===null||Kn===void 0)?void 0:Kn.sub_discipline_id,knowledgeOptions:We,onAddKnowledgeFinish:Ze})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:yn,onChange:function(On){pn(On)}}))),t.a.createElement("aside",{className:"tr"},(di!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){we(),Cn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){kt()}},"\u4FDD\u5B58")))},vi=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u586B\u7A7A\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Jn=function(){var Yt=Object(oe.a)(r.a.mark(function Sn(Kn){return r.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:if(!(di!==-1)){On.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),On.abrupt("return");case 3:On.t0=Kn.id,On.next=On.t0==="del"?6:On.t0==="edit"?8:On.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function ji(){return r.a.wrap(function(si){for(;;)switch(si.prev=si.next){case 0:return si.next=2,Object(ye.g)({question_id:ve.question_id,exam_id:it.id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},it)});case 3:case"end":return si.stop()}},ji)}))()}}),On.abrupt("break",13);case 8:return De(ve.dragKey),Cn(!0),On.abrupt("break",13);case 11:return fi({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:3}),On.abrupt("break",13);case 13:case"end":return On.stop()}},Sn)}));return function(Kn){return Yt.apply(this,arguments)}}(),Zn=function(){var Sn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},ve==null||((Sn=ve.standard_answer)===null||Sn===void 0)?void 0:Sn.map(function(Kn,ii){return t.a.createElement(k.a,{key:ii,align:"middle"},t.a.createElement(O.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",Kn.choice_id,"\uFF09\uFF1A"),t.a.createElement(O.a,{flex:"1"},t.a.createElement(k.a,{align:"middle",gutter:[1,1]},Kn.answer_text.map(function(On,Li){return t.a.createElement(O.a,{span:24,key:Li},t.a.createElement(S.a,{key:ii,checked:ve.standard_answer.includes(ii),disabled:!0,value:On}))}))))})),t.a.createElement("div",{className:ce.a.action},!ve.hideAction&&vi.map(function(Kn,ii){return Kn.id==="up"&&ve.key===1||Kn.id==="down"&&ve.key===ve.len?null:t.a.createElement(h.a,{key:ii,placement:"bottom",title:Kn.name},t.a.createElement("span",{onClick:function(){return Jn(Kn)},className:Kn.icon}))})))};return t.a.createElement("section",{className:ce.a.wrap},!Ln&&Zn(),Ln&&on())},pi=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(zn)),mi=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.cancelAdd,en=di===void 0?function(){}:di,De=je.editKey,ht=je.setEditKey,we=ht===void 0?function(){}:ht,un=je.reload,fi=un===void 0?function(){}:un,gi=je.addCallback,q=gi===void 0?function(){}:gi,C=Object(i.useState)(""),L=Object(o.a)(C,2),V=L[0],ae=L[1],Q=Object(i.useState)(""),Ae=Object(o.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(i.useState)(""),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(!1),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)([]),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(i.useState)(1),Tn=Object(o.a)(hn,2),ln=Tn[0],Mn=Tn[1],Vn=Object(i.useState)(!1),ni=Object(o.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(i.useState)([[],[]]),vn=Object(o.a)(tn,2),Ln=vn[0],Cn=vn[1],Qn=Object(i.useRef)(!1),_n=Object(H.i)(),Gn=Object(i.useState)([]),qn=Object(o.a)(Gn,2),In=qn[0],Dn=qn[1],kn=function(yn){Dn([].concat(Object(F.a)(In),[Object(v.a)({},yn)]))};Object(i.useEffect)(function(){var Zt;if(Qn.current)return;if(!(ve!=null&&ve.question_title)){Nt(!0),ae(""),Lt(""),cn(10);return}Hn(!(ve!=null&&ve.repeat_answer)),ae(ve==null?void 0:ve.question_title),Lt(ve==null||((Zt=ve.standard_answer)===null||Zt===void 0)?void 0:Zt[0]),cn(ve==null?void 0:ve.question_score),Yn(ve.tag_discipline_ids),Mn(ve==null?void 0:ve.difficulty),xt(ve==null?void 0:ve.analysis),Cn([ve==null?void 0:ve.normal_keywords,ve==null?void 0:ve.main_keywords])},[Ne.editData,qt]),Object(i.useEffect)(function(){var Zt,yn=Ne!=null&&(Zt=Ne.tagDisciplineData)!==null&&Zt!==void 0&&Zt.tag_disciplines&&Array.isArray(Ne.tagDisciplineData.tag_disciplines)?Ne.tagDisciplineData.tag_disciplines:[];Dn(yn)},[Ne.tagDisciplineData]),Object(i.useEffect)(function(){qt&&Zt();function Zt(){return yn.apply(this,arguments)}function yn(){return yn=Object(oe.a)(r.a.mark(function pn(){var gt,it,Ve;return r.a.wrap(function(We){for(;;)switch(We.prev=We.next){case 0:return We.next=2,Object(I.I)({sub_discipline_id:(gt=Ne.editData)===null||gt===void 0||((it=gt.exercise)===null||it===void 0)?void 0:it.sub_discipline_id});case 2:Ve=We.sent,Dn(Ve.tag_disciplines);case 4:case"end":return We.stop()}},pn)})),yn.apply(this,arguments)}},[qt]),Object(i.useImperativeHandle)(It,function(){return{onSave:sn,isEdit:qt}});var An=function(yn){(yn==null?void 0:yn.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Nt(!1),we(-1),Qn.current=!1,fi())},sn=function(){var Zt=Object(oe.a)(r.a.mark(function yn(){var pn,gt,it,Ve,qe,We,dt;return r.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(V){wt.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),wt.abrupt("return",!1);case 3:if(pn=Ln[0],gt=Ln[1],Qn.current=!0,!ve.question_id){wt.next=13;break}return wt.next=9,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:_n.id,question_id:ve.question_id,name:V,item_type:4,question_score:jn,answer_texts:[vt],tag_discipline_ids:xn,sub_discipline_id:(Ve=Ne.editData)===null||Ve===void 0||((qe=Ve.exercise)===null||qe===void 0)?void 0:qe.sub_discipline_id,difficulty:ln,repeat_answer:!Pn,analysis:nt,normal_keywords:pn,main_keywords:gt}});case 9:it=wt.sent,An(it),wt.next=17;break;case 13:return wt.next=15,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:_n.id,name:V,item_type:4,question_score:jn,answer_texts:[vt],tag_discipline_ids:xn,sub_discipline_id:(We=Ne.editData)===null||We===void 0||((dt=We.exercise)===null||dt===void 0)?void 0:dt.sub_discipline_id,difficulty:ln,repeat_answer:!Pn,analysis:nt,normal_keywords:pn,main_keywords:gt}});case 15:it=wt.sent,An(it);case 17:return wt.abrupt("return",{name:V,answer_texts:[vt],analysis:nt,normal_keywords:pn,main_keywords:gt});case 18:case"end":return wt.stop()}},yn)}));return function(){return Zt.apply(this,arguments)}}(),Mt=function(){var yn,pn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:V,onChange:function(it){return ae(it)}}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(x.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:vt,onChange:function(it){return Lt(it)}}),t.a.createElement(Xt.a,{value:Ln,onChange:Cn}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(x.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:nt,onChange:function(it){return xt(it)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:jn,max:1e4,min:0,onChange:function(it){cn(it)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:ln,onChange:function(it){Mn(it.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{value:xn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Yn,subId:(yn=Ne.editData)===null||yn===void 0||((pn=yn.exercise)===null||pn===void 0)?void 0:pn.sub_discipline_id,knowledgeOptions:In,onAddKnowledgeFinish:kn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(b.a,{checked:Pn,onChange:function(it){Hn(it)}}))),t.a.createElement("aside",{className:"tr"},(De!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){en(),Nt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){sn()}},"\u4FDD\u5B58")))},zt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7B80\u7B54\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Vt=function(){var Zt=Object(oe.a)(r.a.mark(function yn(pn){return r.a.wrap(function(it){for(;;)switch(it.prev=it.next){case 0:if(!(De!==-1)){it.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),it.abrupt("return");case 3:it.t0=pn.id,it.next=it.t0==="del"?6:it.t0==="up"||it.t0==="down"?8:it.t0==="edit"?12:it.t0==="add"?15:17;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function qe(){return r.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.next=2,Object(ye.g)({question_id:ve.question_id,exam_id:_n.id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},_n)});case 3:case"end":return dt.stop()}},qe)}))()}}),it.abrupt("break",17);case 8:return it.next=10,Ee({type:"newExercisePaper/exeriseMoveUpDown",payload:{id:ve.question_id,opr:pn.id}});case 10:return Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},_n)}),it.abrupt("break",17);case 12:return we(ve.dragKey),Nt(!0),it.abrupt("break",17);case 15:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:4}),it.abrupt("break",17);case 17:case"end":return it.stop()}},yn)}));return function(pn){return Zt.apply(this,arguments)}}(),Bt=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(xe.a,{value:vt||""})),t.a.createElement("div",{className:ce.a.action},!ve.hideAction&&zt.map(function(yn,pn){return t.a.createElement(h.a,{key:pn,placement:"bottom",title:yn.name},t.a.createElement("span",{onClick:function(){return Vt(yn)},className:yn.icon}))})))};return t.a.createElement("section",{className:ce.a.wrap},!qt&&Bt(),qt&&Mt())},ri=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(mi)),_i=function(je,It){var Ne=je.dispatch,Ee=je.editData,ve=je.cancelAdd,di=ve===void 0?function(){}:ve,en=je.editKey,De=je.setEditKey,ht=De===void 0?function(){}:De,we=je.reload,un=we===void 0?function(){}:we,fi=Object(i.useState)(""),gi=Object(o.a)(fi,2),q=gi[0],C=gi[1],L=Object(i.useState)(""),V=Object(o.a)(L,2),ae=V[0],Q=V[1],Ae=Object(i.useState)(""),nt=Object(o.a)(Ae,2),xt=nt[0],Dt=nt[1],ot=Object(i.useState)([]),vt=Object(o.a)(ot,2),Lt=vt[0],wn=vt[1],Xn=Object(i.useState)(),jn=Object(o.a)(Xn,2),cn=jn[0],jt=jn[1],nn=Object(i.useState)(!1),qt=Object(o.a)(nn,2),Nt=qt[0],$n=qt[1],Un=Object(i.useState)([]),xn=Object(o.a)(Un,2),Yn=xn[0],hn=xn[1],Tn=Object(i.useState)(!1),ln=Object(o.a)(Tn,2),Mn=ln[0],Vn=ln[1],ni=Object(i.useState)(!1),Pn=Object(o.a)(ni,2),Hn=Pn[0],tn=Pn[1],vn=Object(H.i)(),Ln=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Dn;if(Ln.current)return;Ee.edit&&(Vn(!0),Q(""),C(""),hn([])),C(Ee.shixun_name),Q(Ee.question_title);var kn=[];(Dn=Ee.shixun)===null||Dn===void 0||Dn.map(function(An){kn.push(An.challenge_score)}),hn(kn)},[Ee]),Object(i.useEffect)(function(){$n(!1)},[Mn]),Object(i.useImperativeHandle)(It,function(){return{onSave:Qn,isEdit:Mn}});var Cn=function(kn){(kn==null?void 0:kn.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),Vn(!1),ht(-1),Ln.current=!1,un())},Qn=function(){var Dn=Object(oe.a)(r.a.mark(function kn(){var An,sn,Mt;return r.a.wrap(function(Vt){for(;;)switch(Vt.prev=Vt.next){case 0:if(An=[],sn=!1,!sn){Vt.next=4;break}return Vt.abrupt("return",!1);case 4:if(Ln.current=!0,tn(!0),!Ee.question_id){Vt.next=12;break}return Vt.next=9,Ne({type:"newExercisePaper/editExerciseQuestion",payload:{id:vn.id,question_id:Ee.question_id,name:ae,shixun_name:q,shixun_id:Ee.shixun_id,item_type:5,question_scores:Yn}});case 9:Mt=Vt.sent,Vt.next=15;break;case 12:return Vt.next=14,Ne({type:"newExercisePaper/addExerciseQuestion",payload:{id:vn.id,insert_id:Ee==null?void 0:Ee.insert_id,name:ae,shixun_name:q,shixun_id:Ee.shixun_id,item_type:5,question_scores:Yn,is_copy:Ee.is_copy}});case 14:Mt=Vt.sent;case 15:return Cn(Mt),tn(!1),Vt.abrupt("return",{name:ae,analysis:xt,standard_answers:An,is_ordered:cn});case 18:case"end":return Vt.stop()}},kn)}));return function(){return Dn.apply(this,arguments)}}(),_n=function(){var kn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(S.a,{defaultValue:q,onChange:function(sn){C(sn.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(x.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:ae,onChange:function(sn){Q(sn)}})),t.a.createElement("div",{className:"mt20"},(kn=Ee.shixun)===null||kn===void 0?void 0:kn.map(function(An,sn){return t.a.createElement(k.a,{gutter:[20,20]},t.a.createElement(O.a,{flex:"1"},sn+1,".",An.challenge_name),t.a.createElement(O.a,null,t.a.createElement(U.a,{defaultValue:Yn[sn],onChange:function(zt){Yn[sn]=zt,hn(Yn)}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Lt.length>1&&t.a.createElement("span",null,t.a.createElement(E.a,{checked:cn,onChange:function(sn){return jt(sn.target.checked)},className:"".concat(ce.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ce.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(en!==-1||!(Ee!=null&&Ee.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){di(),Vn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:Hn,className:"ml20",type:"primary",onClick:function(){Qn()}},"\u4FDD\u5B58")))},Gn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],qn=function(){var Dn=Object(oe.a)(r.a.mark(function kn(An){return r.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:if(!(en!==-1)){Mt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Mt.abrupt("return");case 3:Mt.t0=An.id,Mt.next=Mt.t0==="del"?6:Mt.t0==="edit"?8:Mt.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Vt(){return r.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(ye.g)({question_id:Ee.question_id,exam_id:vn.id});case 2:Ne({type:"newExercisePaper/editExercise",payload:Object(v.a)({},vn)});case 3:case"end":return Zt.stop()}},Vt)}))()}}),Mt.abrupt("break",13);case 8:return ht(Ee.dragKey),Vn(!0),Mt.abrupt("break",13);case 11:return Ne({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:Ee.key,insert_id:Ee==null?void 0:Ee.question_id,question_type:5}}}),Mt.abrupt("break",13);case 13:case"end":return Mt.stop()}},kn)}));return function(An){return Dn.apply(this,arguments)}}(),In=function(){var kn,An;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(Ee!=null&&Ee.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ee.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",Ee.question_score,"\u5206\uFF09")),Ee!=null&&Ee.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ee.key,"."),t.a.createElement(xe.a,{value:Ee.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ee.question_score,"\u5206\uFF09"),!!((kn=Ee.schools)!==null&&kn!==void 0&&kn.length)&&t.a.createElement(h.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ee.shixun_name})),t.a.createElement("div",{className:"mt30"}),(An=Ee.shixun)===null||An===void 0?void 0:An.map(function(sn,Mt){return t.a.createElement("div",{key:Mt},"\u7B2C",Mt+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},sn.challenge_name)," ",t.a.createElement("span",{className:"ml10"},sn.challenge_score," \u5206"))}),t.a.createElement("div",{className:ce.a.action},t.a.createElement(at.a,{target:"_blank",to:"/shixuns/".concat(Ee.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!Ee.hideAction&&Gn.map(function(sn,Mt){return t.a.createElement(h.a,{key:Mt,placement:"bottom",title:sn.name},t.a.createElement("span",{onClick:function(){return qn(sn)},className:sn.icon}))})))};return t.a.createElement("section",{className:ce.a.wrap},!Mn&&In(),Mn&&_n())},Si=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(_i)),At=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Wn=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.editKey,en=je.addCallback,De=en===void 0?function(){}:en,ht=Object(i.useState)([]),we=Object(o.a)(ht,2),un=we[0],fi=we[1],gi=Object(i.useState)(),q=Object(o.a)(gi,2),C=q[0],L=q[1],V=Object(i.useState)([]),ae=Object(o.a)(V,2),Q=ae[0],Ae=ae[1],nt=Object(i.useState)(""),xt=Object(o.a)(nt,2),Dt=xt[0],ot=xt[1],vt=Object(i.useState)(5),Lt=Object(o.a)(vt,2),wn=Lt[0],Xn=Lt[1],jn=Object(i.useState)(!1),cn=Object(o.a)(jn,2),jt=cn[0],nn=cn[1],qt=Object(H.i)();Object(i.useEffect)(function(){fi(["","","",""])},[]),Object(i.useEffect)(function(){if(!(ve!=null&&ve.question_choices)){nn(!0),ot(""),Xn(5),fi(["","","",""]),Ae([]);return}ot(ve==null?void 0:ve.question_title),Xn(ve==null?void 0:ve.question_score),fi(ve==null?void 0:ve.question_choices.map(function(Tn){return Tn.choice_text}));var hn=[];ve==null||ve.standard_answer.map(function(Tn,ln){hn.push(Tn-1)}),Ae(hn)},[ve]),Object(i.useImperativeHandle)(It,function(){return{onSave:Nt,isEdit:jt}});var Nt=function(){var hn=Object(oe.a)(r.a.mark(function Tn(){var ln,Mn,Vn;return r.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(Dt){Pn.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Pn.abrupt("return",!1);case 3:if(ln=un.findIndex(function(Hn){return!Hn}),!(ln>-1)){Pn.next=7;break}return y.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(At[ln]," \u9009\u9879\u7684\u5185\u5BB9")),Pn.abrupt("return",!1);case 7:if(Q.length){Pn.next=10;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Pn.abrupt("return",!1);case 10:if(!(Q.length<1)){Pn.next=13;break}return y.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Pn.abrupt("return",!1);case 13:if(Mn=un.map(function(Hn,tn){return{choice_text:Hn,is_answer:Q.includes(tn)?tn+1:0}}),!ve.question_id){Pn.next=20;break}return Pn.next=17,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:ve.question_id,question_title:Dt,question_type:1,question_score:wn,question_choices:Mn.map(function(Hn){return Hn.choice_text}),standard_answers:Mn.filter(function(Hn){return Hn.is_answer}).map(function(Hn){return Hn.is_answer})}});case 17:Vn=Pn.sent,Pn.next=23;break;case 20:return Pn.next=22,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,categoryId:qt.categoryId,question_title:Dt,question_type:1,question_score:"5.0",question_choices:Mn.map(function(Hn){return Hn.choice_text}),standard_answers:Mn.filter(function(Hn){return Hn.is_answer}).map(function(Hn){return Hn.is_answer})}});case 22:Vn=Pn.sent;case 23:Vn.status===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),nn(!1),Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},qt)}));case 24:case"end":return Pn.stop()}},Tn)}));return function(){return hn.apply(this,arguments)}}(),$n=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u7F16\u7A0B\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],Un=function(){var hn=Object(oe.a)(r.a.mark(function Tn(ln){return r.a.wrap(function(Vn){for(;;)switch(Vn.prev=Vn.next){case 0:if(!(di!==-1)){Vn.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Vn.abrupt("return");case 3:Vn.t0=ln.id,Vn.next=Vn.t0==="del"?6:Vn.t0==="edit"?8:Vn.t0==="add"?10:12;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function Pn(){return r.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(ye.g)({exam_id:qt.id,question_id:ve.question_id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},qt)});case 3:case"end":return tn.stop()}},Pn)}))()}}),Vn.abrupt("break",12);case 8:return G.d.push("/problems/".concat(ve==null?void 0:ve.hack_identifier,"/edit?type=exercises&express_id=").concat(qt.id,"&question_id=").concat(ve==null?void 0:ve.question_id,"&score=").concat(ve==null?void 0:ve.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Vn.abrupt("break",12);case 10:return De({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:6}),Vn.abrupt("break",12);case 12:case"end":return Vn.stop()}},Tn)}));return function(ln){return hn.apply(this,arguments)}}(),xn=function(){var hn=Object(oe.a)(r.a.mark(function Tn(ln){var Mn;return r.a.wrap(function(ni){for(;;)switch(ni.prev=ni.next){case 0:return ln.preventDefault(),ni.next=3,Object(I.X)({id:ve==null?void 0:ve.hack_identifier});case 3:Mn=ni.sent,Mn.status===0&&Object(re.S)("/myproblems/".concat(Mn==null?void 0:Mn.identifier));case 5:case"end":return ni.stop()}},Tn)}));return function(ln){return hn.apply(this,arguments)}}(),Yn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ce.a.questionChoices},t.a.createElement(xe.a,{value:ve.description||""})),t.a.createElement("div",{className:ce.a.action},!ve.hideAction&&$n.map(function(Tn,ln){return t.a.createElement(h.a,{key:ln,placement:"bottom",title:Tn.name},t.a.createElement("span",{onClick:function(){return Un(Tn)},className:Tn.icon}))})))};return t.a.createElement("section",{className:ce.a.wrap},Yn())},hi=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Wn)),ti=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Oi=function(je,It){var Ne=je.newExercisePaper,Ee=je.dispatch,ve=je.editData,di=je.cancelAdd,en=di===void 0?function(){}:di,De=je.editKey,ht=je.setEditKey,we=ht===void 0?function(){}:ht,un=je.addCallback,fi=un===void 0?function(sn){}:un,gi=je.reload,q=gi===void 0?function(){}:gi,C=Object(i.useState)([]),L=Object(o.a)(C,2),V=L[0],ae=L[1],Q=Object(i.useState)(!1),Ae=Object(o.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(i.useState)(!0),ot=Object(o.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(i.useState)(1),Xn=Object(o.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(i.useState)(!1),nn=Object(o.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(i.useState)([]),Un=Object(o.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(H.i)(),Tn=Object(i.useRef)(null),ln=Object(i.useState)(""),Mn=Object(o.a)(ln,2),Vn=Mn[0],ni=Mn[1],Pn=Object(i.useState)([]),Hn=Object(o.a)(Pn,2),tn=Hn[0],vn=Hn[1],Ln=Object(i.useRef)(!1),Cn=function(Mt){Yn([].concat(Object(F.a)(xn),[Object(v.a)({},Mt)]))};Object(i.useEffect)(function(){var sn;if(Ln.current)return;if(!(ve!=null&&ve.question_title)){xt(!0),ni("");return}ni(ve==null?void 0:ve.question_title),Nt(!(ve!=null&&ve.repeat_answer)),cn(ve==null?void 0:ve.difficulty),ae(ve.tag_discipline_ids);var Mt=ve==null||((sn=ve.sub_exercise_questions)===null||sn===void 0)?void 0:sn.map(function(zt){return Object(v.a)(Object(v.a)({},zt),{},{id:zt.question_id,name:zt.question_title,open:!1,question_score:zt.question_score,choices:zt==null?void 0:zt.question_choices.map(function(Vt){return{choice_text:Vt.choice_text,is_answer:Vt.standard_boolean?1:0}}),activeQusEditor:null})});vn(Mt)},[ve,nt]),Object(i.useEffect)(function(){nt&&sn();function sn(){return Mt.apply(this,arguments)}function Mt(){return Mt=Object(oe.a)(r.a.mark(function zt(){var Vt,Bt,Zt;return r.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:return pn.next=2,Object(I.I)({sub_discipline_id:(Vt=Ne.editData)===null||Vt===void 0||((Bt=Vt.exercise)===null||Bt===void 0)?void 0:Bt.sub_discipline_id});case 2:Zt=pn.sent,Yn(Zt.tag_disciplines);case 4:case"end":return pn.stop()}},zt)})),Mt.apply(this,arguments)}},[nt]),Object(i.useEffect)(function(){var sn,Mt=Ne!=null&&(sn=Ne.tagDisciplineData)!==null&&sn!==void 0&&sn.tag_disciplines&&Array.isArray(Ne.tagDisciplineData.tag_disciplines)?Ne.tagDisciplineData.tag_disciplines:[];Yn(Mt)},[Ne.tagDisciplineData]),Object(i.useImperativeHandle)(It,function(){return{onSave:_n,isEdit:nt}});var Qn=function(Mt){(Mt==null?void 0:Mt.status)===0&&(y.b.success("\u4FDD\u5B58\u6210\u529F"),xt(!1),we(-1),Ln.current=!1,q())},_n=function(){var sn=Object(oe.a)(r.a.mark(function Mt(){var zt,Vt,Bt,Zt,yn,pn,gt,it,Ve,qe,We;return r.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:if(Vn){Ze.next=3;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Ze.abrupt("return",!1);case 3:if(!(tn.length===0)){Ze.next=6;break}return y.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),Ze.abrupt("return",!1);case 6:zt=0;case 7:if(!(zt<tn.length)){Ze.next=25;break}if(Bt=tn[zt],Bt!=null&&Bt.name){Ze.next=12;break}return y.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(zt+1,"\u5C0F\u9898\u9898\u5E72")),Ze.abrupt("return",!1);case 12:if(Bt!=null&&Bt.question_score){Ze.next=15;break}return y.b.info("\u7B2C".concat(zt+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),Ze.abrupt("return",!1);case 15:if(Zt=Bt==null||((Vt=Bt.choices)===null||Vt===void 0)?void 0:Vt.findIndex(function(wt){return!wt}),!(Zt>-1)){Ze.next=19;break}return y.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(zt+1,"\u5C0F\u9898").concat(ti[Zt],"\u9009\u9879\u7684\u5185\u5BB9")),Ze.abrupt("return",!1);case 19:if(!(Bt.choices.findIndex(function(wt){return wt.is_answer===1})===-1)){Ze.next=22;break}return y.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(zt+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),Ze.abrupt("return",!1);case 22:zt++,Ze.next=7;break;case 25:if(yn=tn.map(function(wt){return{id:wt.id>1?wt.id:null,name:wt.name,item_type:Me.a.Single,choices:wt.choices,question_score:wt.question_score}}),Ln.current=!0,!ve.question_id){Ze.next=34;break}return Ze.next=30,Ee({type:"newExercisePaper/editExerciseQuestion",payload:{id:hn.id,question_id:ve.question_id,name:Vn,item_type:Me.a.Combine,sub_item_banks:yn,tag_discipline_ids:V,sub_discipline_id:(gt=Ne.editData)===null||gt===void 0||((it=gt.exercise)===null||it===void 0)?void 0:it.sub_discipline_id,difficulty:jn,repeat_answer:!qt}});case 30:pn=Ze.sent,Qn(pn),Ze.next=38;break;case 34:return Ze.next=36,Ee({type:"newExercisePaper/addExerciseQuestion",payload:{id:hn.id,insert_id:ve==null?void 0:ve.insert_id,name:Vn,item_type:Me.a.Combine,tag_discipline_ids:V,sub_discipline_id:(Ve=Ne.editData)===null||Ve===void 0||((qe=Ve.exercise)===null||qe===void 0)?void 0:qe.sub_discipline_id,difficulty:jn,repeat_answer:!qt,sub_item_banks:yn}});case 36:pn=Ze.sent,((We=pn)===null||We===void 0?void 0:We.status)===0&&(we(-1),y.b.success("\u4FDD\u5B58\u6210\u529F"),xt(!1),Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},hn)}));case 38:case"end":return Ze.stop()}},Mt)}));return function(){return sn.apply(this,arguments)}}(),Gn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],qn=function(){var sn=Object(oe.a)(r.a.mark(function Mt(zt){return r.a.wrap(function(Bt){for(;;)switch(Bt.prev=Bt.next){case 0:if(!(De!==-1)){Bt.next=3;break}return y.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Bt.abrupt("return");case 3:Bt.t0=zt.id,Bt.next=Bt.t0==="del"?6:Bt.t0==="edit"?8:Bt.t0==="add"?11:13;break;case 6:return W.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u8BD5\u9898\u5417\uFF1F",onOk:function(){return Object(oe.a)(r.a.mark(function yn(){return r.a.wrap(function(gt){for(;;)switch(gt.prev=gt.next){case 0:return gt.next=2,Object(ye.g)({question_id:ve.question_id,exam_id:hn.id});case 2:Ee({type:"newExercisePaper/editExercise",payload:Object(v.a)({},hn)});case 3:case"end":return gt.stop()}},yn)}))()}}),Bt.abrupt("break",13);case 8:return we(ve.dragKey),xt(!0),Bt.abrupt("break",13);case 11:return fi({key:ve.key,insert_id:ve==null?void 0:ve.question_id,item_type:Me.a.Single}),Bt.abrupt("break",13);case 13:case"end":return Bt.stop()}},Mt)}));return function(zt){return sn.apply(this,arguments)}}(),In=function(){var Mt;return t.a.createElement("aside",{ref:Tn},t.a.createElement("div",{className:ce.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",ve==null?void 0:ve.sub_q_count,"\u5C0F\u9898\uFF0C",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{style:{display:vt?"block":"none"},className:ce.a.questionChoices},ve==null||((Mt=ve.sub_exercise_questions)===null||Mt===void 0)?void 0:Mt.map(function(zt,Vt){var Bt;return t.a.createElement("div",{key:Vt},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,".",Vt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(xe.a,{value:zt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",zt.question_score,"\u5206\uFF09")),zt==null||((Bt=zt.question_choices)===null||Bt===void 0)?void 0:Bt.map(function(Zt,yn){return t.a.createElement(k.a,{key:yn},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:yn,checked:Zt.standard_boolean,disabled:!0},ti[yn],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Zt.choice_text}))))}))})),t.a.createElement("div",{className:ce.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Lt(!vt)},style:{}},vt?"\u6536\u8D77":"\u5C55\u5F00"),!ve.hideAction&&Gn.map(function(zt,Vt){return t.a.createElement(h.a,{key:Vt,placement:"bottom",title:zt.name},t.a.createElement("span",{onClick:function(){return qn(zt)},className:zt.icon}))})))},Dn=function(){var Mt,zt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ce.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:ce.a.wrap,style:{padding:0}},t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(x.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vn,onChange:function(Bt){return ni(Bt)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",tn==null?void 0:tn.length),tn==null?void 0:tn.map(function(Vt,Bt){var Zt;return t.a.createElement("div",{className:ce.a.fold,key:Vt.id},t.a.createElement("div",{onClick:function(){return An("open",Bt)},className:ce.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Vt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",Bt+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(pn){pn.stopPropagation(),An("delete",Bt)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:Vt.open?"block":"none"}},t.a.createElement(x.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Vt==null?void 0:Vt.name,onChange:function(pn){return An("value",Bt,pn)}}),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:ce.a.required},"*"),t.a.createElement("span",{className:ce.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Vt==null||((Zt=Vt.choices)===null||Zt===void 0)?void 0:Zt.map(function(yn,pn){var gt;return t.a.createElement("div",{className:ce.a.choiceWrap,key:pn},t.a.createElement(h.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ce.a.answer," ").concat(yn.is_answer===1?ce.a.activeAnswer:""),onClick:function(){return An("answer",Bt,pn)}},ti[pn])),t.a.createElement("div",{className:ce.a.editorWrap},(Vt==null?void 0:Vt.activeQusEditor)===pn?t.a.createElement(x.a,{id:"single-question-option-".concat(pn),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:yn.choice_text,onChange:function(Ve){return An("details",Bt,Ve)}}):t.a.createElement("div",{className:ce.a.htmlWrap,onClick:function(){return An("edit",Bt,pn)}},t.a.createElement(xe.a,{value:yn.choice_text}))),pn>1&&t.a.createElement(h.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ce.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return An("deleteQus",Bt,pn)}})),pn<7&&pn===(Vt==null||((gt=Vt.choices)===null||gt===void 0)?void 0:gt.length)-1&&t.a.createElement(h.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ce.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return An("addQus",Bt)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(U.a,{value:Vt.question_score,max:1e4,min:0,onChange:function(pn){return An("score",Bt,pn)}}),"\u5206")))}),tn.length<20&&t.a.createElement(m.a,{type:"primary",onClick:kn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:ce.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:jn,onChange:function(Bt){cn(Bt.target.value)}},t.a.createElement(u.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(u.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(u.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ce.a.titleWrap},t.a.createElement("span",{className:"".concat(ce.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ce.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Pe.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:V,onChange:ae,subId:(Mt=Ne.editData)===null||Mt===void 0||((zt=Mt.exercise)===null||zt===void 0)?void 0:zt.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:Cn}))),t.a.createElement("aside",{className:"tr"},(De!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){en(),xt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){_n()}},"\u4FDD\u5B58")))},kn=function(){var Mt={id:Math.random(),item_type:"SINGLE",open:!1,name:"",choices:Array.from({length:4},function(){return{choice_text:"",is_answer:0}}),activeQusEditor:null,analysis:""};vn(tn.concat(Mt))},An=function(Mt,zt,Vt){var Bt=Object(Ot.cloneDeep)(tn);Mt==="open"&&(Bt[zt].open=!Bt[zt].open),Mt==="delete"&&Bt.splice(zt,1),Mt==="value"&&(Bt[zt].name=Vt),Mt==="answer"&&Bt[zt].choices.forEach(function(Zt,yn){Zt.is_answer=Vt===yn?1:0}),Mt==="edit"&&(Bt[zt].activeQusEditor=Vt),Mt==="details"&&(Bt[zt].choices[Bt[zt].activeQusEditor].choice_text=Vt),Mt==="addQus"&&(Bt[zt].choices=Bt[zt].choices.concat({choice_text:"",is_answer:0})),Mt==="deleteQus"&&(Bt[zt].choices=Bt[zt].choices.filter(function(Zt,yn){return yn!==Vt})),Mt==="analysis"&&(Bt[zt].analysis=Vt),Mt==="score"&&(Bt[zt].question_score=Vt),vn(Bt)};return t.a.createElement("section",{className:ce.a.wrap},!nt&&In(),nt&&Dn())},Ai=Object(G.a)(function(ct){var je=ct.newExercisePaper;return{newExercisePaper:je}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Oi)),Ni=function(je){var It=je.data,Ne=je.isDragDisabled,Ee=Ne===void 0?!1:Ne,ve=je.editorProps,di=ve===void 0?{}:ve,en=je.onDragEnd,De=en===void 0?function(){}:en,ht=je.dispatch,we=je.markBtnVisible,un=we===void 0?!1:we,fi=je.batchScore,gi=fi===void 0?[]:fi,q=je.reload,C=q===void 0?function(){}:q,L=je.inNewPaperLibrary,V=L===void 0?!1:L,ae=Object(i.useRef)(),Q=Object(H.i)(),Ae=function(){var jt,nn,qt,Nt,$n,Un,xn,Yn,hn,Tn,ln,Mn,Vn,ni,Pn,Hn,tn=[{name:"\u5355\u9009\u9898",type:0,count:It==null||((jt=It.exercise_types)===null||jt===void 0)?void 0:jt.q_singles,score:It==null||((nn=It.exercise_types)===null||nn===void 0)?void 0:nn.q_singles_scores,items:[]},{name:"\u591A\u9009\u9898",type:1,count:It==null||((qt=It.exercise_types)===null||qt===void 0)?void 0:qt.q_doubles,score:It==null||((Nt=It.exercise_types)===null||Nt===void 0)?void 0:Nt.q_doubles_scores,items:[]},{name:"\u5224\u65AD\u9898",type:2,count:It==null||(($n=It.exercise_types)===null||$n===void 0)?void 0:$n.q_judges,score:It==null||((Un=It.exercise_types)===null||Un===void 0)?void 0:Un.q_judges_scores,items:[]},{name:"\u586B\u7A7A\u9898",type:3,count:It==null||((xn=It.exercise_types)===null||xn===void 0)?void 0:xn.q_nulls,score:It==null||((Yn=It.exercise_types)===null||Yn===void 0)?void 0:Yn.q_nulls_scores,items:[]},{name:"\u7B80\u7B54\u9898",type:4,count:It==null||((hn=It.exercise_types)===null||hn===void 0)?void 0:hn.q_mains,score:It==null||((Tn=It.exercise_types)===null||Tn===void 0)?void 0:Tn.q_mains_scores,items:[]},{name:"\u5B9E\u8BAD\u9898",type:5,count:It==null||((ln=It.exercise_types)===null||ln===void 0)?void 0:ln.q_shixuns,score:It==null||((Mn=It.exercise_types)===null||Mn===void 0)?void 0:Mn.q_shixuns_scores,items:[]},{name:"\u7F16\u7A0B\u9898",type:6,count:It==null||((Vn=It.exercise_types)===null||Vn===void 0)?void 0:Vn.q_pros,score:It==null||((ni=It.exercise_types)===null||ni===void 0)?void 0:ni.q_pros_scores,items:[]},{name:"\u7EC4\u5408\u9898",type:7,count:It==null||((Pn=It.exercise_types)===null||Pn===void 0)?void 0:Pn.q_combinations,score:It==null||((Hn=It.exercise_types)===null||Hn===void 0)?void 0:Hn.q_combination_scores,items:[]}];return tn},nt=function(jt,nn,qt){var Nt=Array.from(jt),$n=Nt.splice(nn,1),Un=Object(o.a)($n,1),xn=Un[0];return Nt.splice(qt,0,xn),Nt},xt=function(jt,nn,qt){if(!jt.destination)return;var Nt=nt(nn,jt.source.index,jt.destination.index);V?De(jt,Nt,qt):De(Nt,qt)},Dt=function(jt){ht({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:jt}})},ot=function(jt,nn){if(nn===0)return V?t.a.createElement(Kt,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(Ft,Object(f.a)({reload:C,editData:jt},jt));if(nn===1)return V?t.a.createElement(ei,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(Ue,Object(f.a)({reload:C,editData:jt},jt));if(nn===2)return V?t.a.createElement(dn,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(_e,Object(f.a)({reload:C,editData:jt},jt));if(nn===3)return V?t.a.createElement(pi,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(ge,Object(f.a)({reload:C,editData:jt},jt));if(nn===4)return V?t.a.createElement(ri,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(En,Object(f.a)({reload:C,editData:jt},jt));if(nn===5)return V?t.a.createElement(Si,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(yt,Object(f.a)({reload:C,editData:jt},jt));if(nn===6)return V?t.a.createElement(hi,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(Xe,Object(f.a)({editData:jt},jt));if(nn===7)return V?t.a.createElement(Ai,Object(f.a)({reload:C,editData:jt},jt)):t.a.createElement(mt,Object(f.a)({reload:C,editData:jt},jt))},vt=function(jt,nn,qt){return t.a.createElement(Be.a,{onDragEnd:function($n){return xt($n,jt,nn)}},t.a.createElement(Be.c,{droppableId:"droppable"},function(Nt,$n){return t.a.createElement("div",Object(f.a)({ref:Nt.innerRef},Nt.droppableProps,{style:{width:"100%"}}),jt==null?void 0:jt.map(function(Un,xn){var Yn,hn=Object(v.a)(Object(v.a)({},Un),{},{key:xn+1,hideAction:!0,isPreview:!0,dragKey:nn+"-"+xn},di);return t.a.createElement(Be.b,{key:hn==null?void 0:hn.question_id,draggableId:hn==null||((Yn=hn.question_id)===null||Yn===void 0)?void 0:Yn.toString(),index:xn,isDragDisabled:Ee},function(Tn,ln){return t.a.createElement("aside",Object(f.a)({ref:Tn.innerRef},Tn.draggableProps,Tn.dragHandleProps),t.a.createElement("div",{className:ke.a.posWarp,id:hn.dragKey},ot(hn,nn),un&&t.a.createElement(k.a,{className:ke.a.markWrongBtnWrapper},t.a.createElement(m.a,{onClick:function(){return Dt({value:hn,type:nn})}},hn!=null&&hn.is_wrong?"\u53D6\u6D88\u6807\u8BB0\u9519\u9898":"\u6807\u8BB0\u9519\u9898")),t.a.createElement($.a,null),!Ee&&t.a.createElement("div",{className:ke.a.pos},t.a.createElement("div",{className:ke.a.tips},"\u62D6\u52A8\u53EF\u4EE5\u6539\u53D8\u8BD5\u9898\u663E\u793A\u987A\u5E8F"))))})}))}))},Lt=function(jt){var nn=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],qt=["","\u5341","\u767E","\u5343","\u4E07"];jt=parseInt(jt);var Nt=function(Yn){for(var hn=Yn.toString().split("").reverse(),Tn="",ln=0;ln<hn.length;ln++)Tn=(ln==0&&hn[ln]==0||ln>0&&hn[ln]==0&&hn[ln-1]==0?"":nn[hn[ln]]+(hn[ln]==0?qt[0]:qt[ln]))+Tn;return Tn},$n=Math.floor(jt/1e4),Un=jt%1e4;return Un.toString().length<4&&(Un="0"+Un),$n?Nt($n)+"\u4E07"+Nt(Un):Nt(jt)},wn=function(jt){var nn={\u5355\u9009\u9898:2,\u591A\u9009\u9898:5,\u586B\u7A7A\u9898:2,\u5224\u65AD\u9898:2,\u7B80\u7B54\u9898:10,\u7F16\u7A0B\u9898:10,\u5B9E\u8BAD\u9898:5,\u7EC4\u5408\u9898:10};return nn[jt]||0},Xn=function(jt,nn){ae.current=wn(nn),W.a.confirm({centered:!0,title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u6570",content:t.a.createElement("div",{className:""},t.a.createElement("span",null,nn==="\u7EC4\u5408\u9898"?"\u7EC4\u5408\u9898\u4E2D\u7684\u6BCF\u5C0F\u9898":nn,"\uFF1A"),t.a.createElement(U.a,{min:1,defaultValue:ae.current,onChange:function(Nt){ae.current=Nt}}),t.a.createElement("span",{className:"ml5"},"\u5206/\u9898"),t.a.createElement("br",null),nn==="\u586B\u7A7A\u9898"&&t.a.createElement("div",{style:{color:"rgb(255, 0, 0)"}},"\u6BCF\u7A7A\u5206\u503C\u6309\u6BCF\u9898\u5206\u503C\u53D6\u5E73\u5747\u5206\u8BA1\u7B97")),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var qt=Object(oe.a)(r.a.mark(function $n(){var Un,xn;return r.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:if(!V){hn.next=6;break}return hn.next=3,Object(ye.t)(Q.id,{question_type:jt,score:ae.current});case 3:return Un=hn.sent,Un.status===0&&C(),hn.abrupt("return");case 6:return hn.next=8,Object(me.a)("/api/exercises/".concat(Q.categoryId,"/batch_set_score.json"),{method:"post",body:{question_type:jt,score:ae.current}});case 8:xn=hn.sent,xn.status!==-1&&C();case 10:case"end":return hn.stop()}},$n)}));function Nt(){return qt.apply(this,arguments)}return Nt}()})},jn=function(){var jt,nn=Ae();It==null||((jt=It.exercise_questions)===null||jt===void 0)||jt.forEach(function(Nt,$n){if(Nt.question_type===0){var Un,xn;(Un=nn[Nt.question_type])===null||Un===void 0||((xn=Un.items)===null||xn===void 0)||xn.push(Nt)}if(Nt.question_type===1){var Yn,hn;(Yn=nn[Nt.question_type])===null||Yn===void 0||((hn=Yn.items)===null||hn===void 0)||hn.push(Nt)}if(Nt.question_type===2){var Tn,ln;(Tn=nn[Nt.question_type])===null||Tn===void 0||((ln=Tn.items)===null||ln===void 0)||ln.push(Nt)}if(Nt.question_type===3){var Mn,Vn;(Mn=nn[Nt.question_type])===null||Mn===void 0||((Vn=Mn.items)===null||Vn===void 0)||Vn.push(Nt)}if(Nt.question_type===4){var ni,Pn;(ni=nn[Nt.question_type])===null||ni===void 0||((Pn=ni.items)===null||Pn===void 0)||Pn.push(Nt)}if(Nt.question_type===5){var Hn,tn;(Hn=nn[Nt.question_type])===null||Hn===void 0||((tn=Hn.items)===null||tn===void 0)||tn.push(Nt)}if(Nt.question_type===6){var vn,Ln;(vn=nn[Nt.question_type])===null||vn===void 0||((Ln=vn.items)===null||Ln===void 0)||Ln.push(Nt)}if(Nt.question_type===7){var Cn,Qn;(Cn=nn[Nt.question_type])===null||Cn===void 0||((Qn=Cn.items)===null||Qn===void 0)||Qn.push(Nt)}});var qt=It==null?void 0:It.map(function(Nt,$n){return t.a.createElement(t.a.Fragment,{key:$n},t.a.createElement("div",{className:"pl20"},t.a.createElement("span",{className:"font16 c-light-primary"},Lt($n+1),"\u3001",Nt.name),t.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",Nt.count,"\u9898",(Nt==null?void 0:Nt.question_type)===7?"\uFF0C\u5305\u542B".concat(Nt.sub_count,"\u5C0F\u9898"):"","\uFF1B\u5171",Nt.score,"\u5206\uFF09"),(gi==null?void 0:gi.includes(Nt==null?void 0:Nt.name))&&t.a.createElement(m.a,{onClick:function(){return Xn(Nt==null?void 0:Nt.question_type,Nt==null?void 0:Nt.name)},style:{float:"right"},type:"primary",ghost:!0},"\u6279\u91CF\u8BBE\u7F6E\u5F97\u5206")),vt(Nt.items,Nt==null?void 0:Nt.question_type,Nt==null?void 0:Nt.name))});return qt};return t.a.createElement("div",null," ",jn()," ")},wi=st.a=Object(G.a)()(Ni)},LdHM:function(Wt,st,z){"use strict";z.d(st,"b",function(){return h}),z.d(st,"a",function(){return S});var oe=z("1OyB"),Z=z("vuIU"),U=z("Ji7U"),ee=z("LK+K"),W=z("q1tI"),M=z("rePB"),$=z("Ff2n"),X=z("ODXe"),k=z("4IlW"),D=z("bX4T"),m=z("YrtM"),v=z("TSYQ"),f=z.n(v),o=z("+nKL"),l=z("8OUc"),r=function(B,Y){var re=B.prefixCls,de=B.id,he=B.flattenOptions,xe=B.childrenAsData,Pe=B.values,Ce=B.searchValue,Oe=B.multiple,be=B.defaultActiveFirstOption,ge=B.height,te=B.itemHeight,fe=B.notFoundContent,_e=B.open,Le=B.menuItemSelectedIcon,$e=B.virtual,Ue=B.onSelect,at=B.onToggleOpen,ft=B.onActiveValue,Ct=B.onScroll,yt=B.onMouseEnter,_t="".concat(re,"-item"),lt=Object(m.a)(function(){return he},[_e,he],function(mt,Be){return Be[0]&&mt[1]!==Be[1]}),Ft=W.useRef(null),Xt=function(Be){Be.preventDefault()},Jt=function(Be){Ft.current&&Ft.current.scrollTo({index:Be})},rn=function(Be){for(var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ke=lt.length,me=0;me<ke;me+=1){var ye=(Be+me*Ie+ke)%ke,Re=lt[ye],ce=Re.group,Me=Re.data;if(!ce&&!Me.disabled)return ye}return-1},En=W.useState(function(){return rn(0)}),mn=Object(X.a)(En,2),Ye=mn[0],Xe=mn[1],Ot=function(Be){Xe(Be);var Ie=lt[Be];if(!Ie){ft(null,-1);return}ft(Ie.data.value,Be)};W.useEffect(function(){Ot(be!==!1?rn(0):-1)},[lt.length,Ce]),W.useEffect(function(){var mt=setTimeout(function(){if(!Oe&&_e&&Pe.size===1){var Be=Array.from(Pe)[0],Ie=lt.findIndex(function(ke){var me=ke.data;return me.value===Be});Ot(Ie),Jt(Ie)}});return function(){return clearTimeout(mt)}},[_e]);var Et=function(Be){Be!==void 0&&Ue(Be,{selected:!Pe.has(Be)}),Oe||at(!1)};if(W.useImperativeHandle(Y,function(){return{onKeyDown:function(Be){var Ie=Be.which;switch(Ie){case k.a.UP:case k.a.DOWN:{var ke=0;if(Ie===k.a.UP?ke=-1:Ie===k.a.DOWN&&(ke=1),ke!==0){var me=rn(Ye+ke,ke);Jt(me),Ot(me)}break}case k.a.ENTER:{var ye=lt[Ye];ye&&!ye.data.disabled?Et(ye.data.value):Et(void 0),_e&&Be.preventDefault();break}case k.a.ESC:at(!1)}},onKeyUp:function(){},scrollTo:function(Be){Jt(Be)}}}),lt.length===0)return W.createElement("div",{role:"listbox",id:"".concat(de,"_list"),className:"".concat(_t,"-empty"),onMouseDown:Xt},fe);function Je(mt){var Be=lt[mt];if(!Be)return null;var Ie=Be.data||{},ke=Ie.value,me=Ie.label,ye=Ie.children,Re=Object(D.a)(Ie,!0),ce=xe?ye:me;return Be?W.createElement("div",Object.assign({"aria-label":typeof ce=="string"?ce:null},Re,{key:mt,role:"option",id:"".concat(de,"_list_").concat(mt),"aria-selected":Pe.has(ke)}),ke):null}return W.createElement(W.Fragment,null,W.createElement("div",{role:"listbox",id:"".concat(de,"_list"),style:{height:0,width:0,overflow:"hidden"}},Je(Ye-1),Je(Ye),Je(Ye+1)),W.createElement(o.a,{itemKey:"key",ref:Ft,data:lt,height:ge,itemHeight:te,fullHeight:!1,onMouseDown:Xt,onScroll:Ct,virtual:$e,onMouseEnter:yt},function(mt,Be){var Ie,ke=mt.group,me=mt.groupOption,ye=mt.data,Re=ye.label,ce=ye.key;if(ke)return W.createElement("div",{className:f()(_t,"".concat(_t,"-group"))},Re!==void 0?Re:ce);var Me=ye.disabled,tt=ye.value,bt=ye.title,Kt=ye.children,Gt=ye.style,$t=ye.className,ei=Object($.a)(ye,["disabled","value","title","children","style","className"]),gn=Pe.has(tt),an="".concat(_t,"-option"),dn=f()(_t,an,$t,(Ie={},Object(M.a)(Ie,"".concat(an,"-grouped"),me),Object(M.a)(Ie,"".concat(an,"-active"),Ye===Be&&!Me),Object(M.a)(Ie,"".concat(an,"-disabled"),Me),Object(M.a)(Ie,"".concat(an,"-selected"),gn),Ie)),zn=xe?Kt:Re,pi=!Le||typeof Le=="function"||gn;return W.createElement("div",Object.assign({},ei,{"aria-selected":gn,className:dn,title:bt,onMouseMove:function(){if(Ye===Be||Me)return;Ot(Be)},onClick:function(){Me||Et(tt)},style:Gt}),W.createElement("div",{className:"".concat(an,"-content")},zn||tt),W.isValidElement(Le)||gn,pi&&W.createElement(l.a,{className:"".concat(_t,"-option-state"),customizeIcon:Le,customizeIconProps:{isSelected:gn}},gn?"\u2713":null))}))},i=W.forwardRef(r);i.displayName="OptionList";var t=i,c=function(){return null};c.isSelectOption=!0;var h=c,A=function(){return null};A.isSelectOptGroup=!0;var S=A,w=z("VTBJ"),O=z("Zm9Q");function R(x){var B=x.key,Y=x.props,re=Y.children,de=Y.value,he=Object($.a)(Y,["children","value"]);return Object(w.a)({key:B,value:de!==void 0?de:B,children:re},he)}function b(x){var B=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(x).map(function(Y,re){if(!W.isValidElement(Y)||!Y.type)return null;var de=Y.type.isSelectOptGroup,he=Y.key,xe=Y.props,Pe=xe.children,Ce=Object($.a)(xe,["children"]);return B||!de?R(Y):Object(w.a)(Object(w.a)({key:"__RC_SELECT_GRP__".concat(he===null?re:he,"__"),label:he},Ce),{},{options:b(Pe)})}).filter(function(Y){return Y})}var _=z("2Qr1"),u=z("qNPg"),d=z("U8pU"),E=z("Kwbf"),g=z("WKfj");function y(x){var B=x.mode,Y=x.options,re=x.children,de=x.backfill,he=x.allowClear,xe=x.placeholder,Pe=x.getInputElement,Ce=x.showSearch,Oe=x.onSearch,be=x.defaultOpen,ge=x.autoFocus,te=x.labelInValue,fe=x.value,_e=x.inputValue,Le=x.optionLabelProp,$e=B==="multiple"||B==="tags",Ue=Ce!==void 0?Ce:$e||B==="combobox",at=Y||b(re);if(Object(E.a)(B!=="tags"||at.every(function(_t){return!_t.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),B==="tags"||B==="combobox"){var ft=at.some(function(_t){return _t.options?_t.options.some(function(lt){return typeof("value"in lt?lt.value:lt.key)=="number"}):typeof("value"in _t?_t.value:_t.key)=="number"});Object(E.a)(!ft,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(E.a)(B!=="combobox"||!Le,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(E.a)(B==="combobox"||!de,"`backfill` only works with `combobox` mode."),Object(E.a)(B==="combobox"||!Pe,"`getInputElement` only work with `combobox` mode."),Object(E.b)(B!=="combobox"||!Pe||!he||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Oe&&!Ue&&B!=="combobox"&&B!=="tags"&&Object(E.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(E.b)(!be||ge,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var Ct=Object(g.d)(fe);Object(E.a)(!te||Ct.every(function(_t){return Object(d.a)(_t)==="object"&&("key"in _t||"value"in _t)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(E.a)(!$e||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(re){var yt=null;Object(O.a)(re).some(function(_t){if(!W.isValidElement(_t)||!_t.type)return!1;var lt=_t.type;if(lt.isSelectOption)return!1;if(lt.isSelectOptGroup){var Ft=Object(O.a)(_t.props.children).every(function(Xt){return!W.isValidElement(Xt)||!_t.type||Xt.type.isSelectOption?!0:(yt=Xt.type,!1)});return!Ft}return yt=lt,!0}),yt&&Object(E.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(yt.displayName||yt.name||yt,"`.")),Object(E.a)(_e===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=y,N=Object(u.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:b,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:F,fillOptionsWithMissingValue:_.a}),H=function(x){Object(U.a)(Y,x);var B=Object(ee.a)(Y);function Y(){var re;return Object(oe.a)(this,Y),re=B.apply(this,arguments),re.selectRef=W.createRef(),re.focus=function(){re.selectRef.current.focus()},re.blur=function(){re.selectRef.current.blur()},re}return Object(Z.a)(Y,[{key:"render",value:function(){return W.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),Y}(W.Component);H.Option=h,H.OptGroup=S;var G=H,I=st.c=G},M8RZ:function(Wt,st,z){"use strict";z.d(st,"a",function(){return k});var oe=z("fWQN"),Z=z("mtLc"),U=z("yKVA"),ee=z("879j"),W=z("q1tI"),M=z.n(W),$=z("i8i4"),X=z.n($),k=function(D){Object(U.a)(v,D);var m=Object(ee.a)(v);function v(f){var o;Object(oe.a)(this,v),o=m.call(this,f);var l=window.document;return o.node=l.createElement("div"),l.body.appendChild(o.node),o}return Object(Z.a)(v,[{key:"render",value:function(){var o=this.props.children;return Object($.createPortal)(o,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),v}(M.a.Component)},NLgs:function(Wt,st,z){"use strict";z.d(st,"e",function(){return h}),z.d(st,"f",function(){return A}),z.d(st,"d",function(){return w}),z.d(st,"c",function(){return O}),z.d(st,"a",function(){return R}),z.d(st,"b",function(){return b});var oe=z("miYZ"),Z=z("tsqr"),U=z("9og8"),ee=z("2qtc"),W=z("kLXV"),M=z("WmNS"),$=z.n(M),X=z("q1tI"),k=z.n(X),D=z("9kvl"),m=z("xKgJ"),v=z("1vsH"),f=z("RCxd"),o=z("yTi+"),l=z.n(o),r=z("1ZF9"),i=z.n(r),t=z("NoGO"),c=z.n(t),h=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(A(u)&&S(d))},A=function(u){return Object(m.p)()?!0:(u({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},S=function(){var u,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,E=Object(D.c)()._store.getState(),g=E.user;return(u=g.userInfo)!==null&&u!==void 0&&u.profile_completed?!0:(W.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:d?"\u6309\u7167\u6709\u5173\u653F\u7B56\u89C4\u5B9A\uFF0C\u7279\u6B8A\u5B9E\u9A8C\u9700\u8981\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u624D\u80FD\u4F7F\u7528\uFF0C\u8BF7\u5148\u7ED1\u5B9A\u624B\u673A\u53F7\u7801":"\u60A8\u9700\u8981\u53BB\u5B8C\u5584\u60A8\u7684\u4E2A\u4EBA\u8D44\u6599\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD",okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){D.d.push("/account/profile/edit")}}),!1)},w=function(){var u,d=Object(D.c)()._store.getState(),E=d.user;return(u=E.userInfo)!==null&&u!==void 0&&u.professional_certification?!0:(W.a.confirm({title:"\u63D0\u793A",centered:!0,content:k.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(v.S)("/account/certification")}}),!1)},O=function(){return Object(m.a)()?!0:(W.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:k.a.createElement("div",{className:"tc",style:{marginLeft:-38}},k.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),k.a.createElement("img",{src:c.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},R=function(u,d){return u?!0:(W.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:k.a.createElement("div",null,k.a.createElement("p",null,d||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),k.a.createElement("div",{style:{marginLeft:"110px"}},k.a.createElement("img",{src:i.a,width:200}),k.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(v.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},b=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",E=Object(D.c)()._store.getState(),g=E.shixunsDetail.detail;return(g==null?void 0:g.public)===2||(g==null?void 0:g.public)===1||(g==null?void 0:g.shixun_status)===3?(W.a.info({centered:!0,icon:k.a.createElement(f.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:k.a.createElement("div",{className:"tc",style:{marginLeft:-38}},k.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},k.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(g==null?void 0:g.public)===2?"\u5DF2\u516C\u5F00":(g==null?void 0:g.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",d,"\u3002"),k.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),k.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:l.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(g==null?void 0:g.shixun_status)===2?(W.a.confirm({centered:!0,icon:k.a.createElement(f.a,null),title:"\u63D0\u793A",content:k.a.createElement("div",null,k.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",d,"\u3002"),k.a.createElement("br",null),k.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){W.a.confirm({width:440,centered:!0,icon:k.a.createElement(f.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var F=Object(U.a)($.a.mark(function H(){var G;return $.a.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,u({type:"shixunsDetail/cancelRelease",payload:{id:g==null?void 0:g.identifier}});case 2:G=x.sent,G.status!==401&&(Z.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),u({type:"shixunsDetail/getShixunsDetail",payload:{id:g==null?void 0:g.identifier}}),u({type:"practiceSetting/getCommonData",payload:{id:g==null?void 0:g.identifier}}));case 4:case"end":return x.stop()}},H)}));function N(){return F.apply(this,arguments)}return N}()})}}),!0):!1}},NoGO:function(Wt,st,z){Wt.exports=z.p+"static/newqrcode.d852fdfc.png"},Nog9:function(Wt,st,z){Wt.exports={flex_box_center:"flex_box_center___FKAcC",flex_space_between:"flex_space_between___1W0sn",flex_box_vertical_center:"flex_box_vertical_center___1ZtTo",flex_box_center_end:"flex_box_center_end___3Rjsx",flex_box_column:"flex_box_column___3qWVQ",wrap:"wrap___K2ugW",modal:"modal___3Jrop",titleWrap:"titleWrap___2PdmB",required:"required___XbmpK",title:"title___1w-JF",colorGray:"colorGray___2hKRg",choiceWrap:"choiceWrap___3oJpR",answer:"answer___1Kugg",activeAnswer:"activeAnswer___3MPrD",deleteIcon:"deleteIcon___2j8_2",addIcon:"addIcon___2lm8T",editorWrap:"editorWrap___1f48O",htmlWrap:"htmlWrap___2gSXb",radio:"radio___1S16G",color333:"color333___3rZXR",color999:"color999___2xzRf",questionType:"questionType___2l_WF",questionChoices:"questionChoices___hYMa9",action:"action___1DPov",difficult:"difficult___1CZwg",fold:"fold___2FQQU",head:"head___2Es3Y"}},NvD2:function(Wt,st,z){"use strict";z.d(st,"a",function(){return M});var oe=z("Kwbf");function Z($,X){var k=new Set;return $.forEach(function(D){X.has(D)||k.add(D)}),k}function U($){var X=$||{},k=X.disabled,D=X.disableCheckbox,m=X.checkable;return!!(k||D)||m===!1}function ee($,X,k,D){for(var m=new Set($),v=new Set,f=0;f<=k;f+=1){var o=X.get(f)||new Set;o.forEach(function(t){var c=t.key,h=t.node,A=t.children,S=A===void 0?[]:A;m.has(c)&&!D(h)&&S.filter(function(w){return!D(w.node)}).forEach(function(w){m.add(w.key)})})}for(var l=new Set,r=k;r>=0;r-=1){var i=X.get(r)||new Set;i.forEach(function(t){var c=t.parent,h=t.node;if(D(h)||!t.parent||l.has(t.parent.key))return;if(D(t.parent.node)){l.add(c.key);return}var A=!0,S=!1;(c.children||[]).filter(function(w){return!D(w.node)}).forEach(function(w){var O=w.key,R=m.has(O);A&&!R&&(A=!1),!S&&(R||v.has(O))&&(S=!0)}),A&&m.add(c.key),S&&v.add(c.key),l.add(c.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(Z(v,m))}}function W($,X,k,D,m){for(var v=new Set($),f=new Set(X),o=0;o<=D;o+=1){var l=k.get(o)||new Set;l.forEach(function(c){var h=c.key,A=c.node,S=c.children,w=S===void 0?[]:S;!v.has(h)&&!f.has(h)&&!m(A)&&w.filter(function(O){return!m(O.node)}).forEach(function(O){v.delete(O.key)})})}f=new Set;for(var r=new Set,i=D;i>=0;i-=1){var t=k.get(i)||new Set;t.forEach(function(c){var h=c.parent,A=c.node;if(m(A)||!c.parent||r.has(c.parent.key))return;if(m(c.parent.node)){r.add(h.key);return}var S=!0,w=!1;(h.children||[]).filter(function(O){return!m(O.node)}).forEach(function(O){var R=O.key,b=v.has(R);S&&!b&&(S=!1),!w&&(b||f.has(R))&&(w=!0)}),S||v.delete(h.key),w&&f.add(h.key),r.add(h.key)})}return{checkedKeys:Array.from(v),halfCheckedKeys:Array.from(Z(f,v))}}function M($,X,k,D){var m=[],v;D?v=D:v=U;var f=new Set($.filter(function(i){var t=!!k[i];return t||m.push(i),t})),o=new Map,l=0;Object.keys(k).forEach(function(i){var t=k[i],c=t.level,h=o.get(c);h||(h=new Set,o.set(c,h)),h.add(t),l=Math.max(l,c)}),Object(oe.a)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var r;return X===!0?r=ee(f,o,l,v):r=W(f,X.halfCheckedKeys,o,l,v),r}},O2Wb:function(Wt,st,z){Wt.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OZM5:function(Wt,st,z){"use strict";z.d(st,"b",function(){return D}),z.d(st,"a",function(){return m}),z.d(st,"k",function(){return v}),z.d(st,"h",function(){return f}),z.d(st,"i",function(){return o}),z.d(st,"g",function(){return l}),z.d(st,"c",function(){return r}),z.d(st,"d",function(){return i}),z.d(st,"j",function(){return h}),z.d(st,"e",function(){return A}),z.d(st,"f",function(){return S});var oe=z("KQm4"),Z=z("U8pU"),U=z("Ff2n"),ee=z("q1tI"),W=z.n(ee),M=z("Kwbf"),$=z("WaYH"),X=.25,k=2;function D(w,O){var R=w.slice(),b=R.indexOf(O);return b>=0&&R.splice(b,1),R}function m(w,O){var R=w.slice();return R.indexOf(O)===-1&&R.push(O),R}function v(w){return w.split("-")}function f(w,O){return"".concat(w,"-").concat(O)}function o(w){return w&&w.type&&w.type.isTreeNode}function l(w,O){var R=[w],b=O[w];function _(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];u.forEach(function(d){var E=d.key,g=d.children;R.push(E),_(g)})}return _(b.children),R}function r(w,O){var R=w.clientY,b=O.selectHandle.getBoundingClientRect(),_=b.top,u=b.bottom,d=b.height,E=Math.max(d*X,k);return R<=_+E?-1:R>=u-E?1:0}function i(w,O){if(!w)return;var R=O.multiple;return R?w.slice():w.length?[w[0]]:w}var t=function(O){return O};function c(w,O){if(!w)return[];var R=O||{},b=R.processProps,_=b===void 0?t:b,u=Array.isArray(w)?w:[w];return u.map(function(d){var E=d.children,g=Object(U.a)(d,["children"]),y=c(E,O);return W.a.createElement($.a,Object.assign({},_(g)),y)})}function h(w){if(!w)return null;var O;if(Array.isArray(w))O={checkedKeys:w,halfCheckedKeys:void 0};else if(Object(Z.a)(w)==="object")O={checkedKeys:w.checked||void 0,halfCheckedKeys:w.halfChecked||void 0};else return Object(M.a)(!1,"`checkedKeys` is not an array or an object"),null;return O}function A(w,O){var R=new Set;function b(_){if(R.has(_))return;var u=O[_];if(!u)return;R.add(_);var d=u.parent,E=u.node;if(E.disabled)return;d&&b(d.key)}return(w||[]).forEach(function(_){b(_)}),Object(oe.a)(R)}function S(w){var O={};return Object.keys(w).forEach(function(R){(R.startsWith("data-")||R.startsWith("aria-"))&&(O[R]=w[R])}),O}},Ot1p:function(Wt,st,z){"use strict";var oe=z("2qtc"),Z=z("kLXV"),U=z("rAM+"),ee=z("miYZ"),W=z("tsqr"),M=z("9og8"),$=z("tJVT"),X=z("jrin"),k=z("WmNS"),D=z.n(k),m=z("q1tI"),v=z.n(m),f=z("VrN/"),o=z.n(f),l=z("bdgK"),r=z("p77/"),i=z("Bd2K"),t=z("ELLl"),c=z("19Vz"),h=z("lZu9"),A=z("+NIl"),S=z("kSUc"),w=z("9Bee"),O=function(Me){var tt=Me.value,bt=tt===void 0?"":tt,Kt=Me.className,Gt=Me.showTextOnly,$t=Me.showLines,ei=Me.style,gn=ei===void 0?{}:ei,an=Object(m.useMemo)(function(){return""},[bt]);return v.a.createElement(v.a.Fragment,null,v.a.createElement("div",{dangerouslySetInnerHTML:{__html:an}}))},R=z("0Owb"),b=z("dejd"),_=z("C+DQ"),u=z("1vsH"),d=z("m3rI"),E=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function g(Me){var tt=Me.onActionCallback,bt=Me.title,Kt=Me.icon,Gt=Me.actionName,$t=Me.className,ei=$t===void 0?"":$t,gn=Me.children;function an(){tt(Gt)}return v.a.createElement("a",{title:bt,className:ei,onClick:an},v.a.createElement("i",{className:"md-iconfont ".concat(Kt)}),gn)}var y=function(Me){var tt=Me.watch,bt=Me.showNullButton,Kt=Me.onActionCallback,Gt=Me.fullScreen,$t=Me.insertTemp,ei=Me.hidetoolBar,gn=Me.uuid,an=Me.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(u.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(u.F)("_educoder_session"),"&key=").concat(gn,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var dn=[].concat(E,[{title:"".concat(tt?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(tt?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return v.a.createElement("ul",{className:"markdown-toolbar-container"},!ei&&dn.map(function(zn,pi){return v.a.createElement("li",{key:pi},zn.actionName?v.a.createElement(g,Object(R.a)({},zn,{onActionCallback:Kt})):v.a.createElement("span",{className:"v-line"}))}),bt?v.a.createElement("li",null,v.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Kt},v.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,$t&&v.a.createElement("li",null,v.a.createElement(g,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat($t),onActionCallback:Kt},v.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),v.a.createElement("li",{className:"btn-full-screen"},v.a.createElement(g,{icon:"".concat(Gt?"icon-shrink":"icon-enlarge"),title:Gt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Kt})))},F=z("M8RZ"),N=z("+L6B"),H=z("2/Rp"),G=z("y8nQ"),I=z("Vl3Y"),x=z("5NDa"),B=z("5rEg"),Y={labelCol:{span:4},wrapperCol:{span:20}},re=function(Me){var tt=Me.callback,bt=Me.onCancel;function Kt(Gt){tt(Gt)}return v.a.createElement(I.a,Object(R.a)({},Y,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Kt}),v.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},v.a.createElement(B.a,null)),v.a.createElement(I.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},v.a.createElement(B.a,null)),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(H.a,{type:"ghost",onClick:bt},"\u53D6\u6D88")))},de=z("7ahc"),he=z("HmJG"),xe=z("BjJ7"),Pe=I.a.useForm,Ce={width:280,marginRight:10},Oe={labelCol:{span:5},wrapperCol:{span:19}},be=function(Me){var tt=Me.callback,bt=Me.onCancel,Kt=Pe(),Gt=Object($.a)(Kt,1),$t=Gt[0];function ei(dn){tt(dn)}function gn(dn,zn){if(dn.status===-1){W.b.error(dn.message);return}$t.setFieldsValue({src:"/api/attachments/".concat(dn.id),type:zn.type})}function an(dn){var zn=dn.target.files[0];te(zn,gn)}return v.a.createElement(I.a,Object(R.a)({form:$t},Oe,{className:"upload-image-panel",onFinish:ei}),v.a.createElement(I.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},v.a.createElement("div",{className:"flex-container"},v.a.createElement(I.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},v.a.createElement(B.a,{style:Ce})),v.a.createElement(ge,{onFileChange:an}))),v.a.createElement(I.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},v.a.createElement(B.a,{style:{width:264}})),v.a.createElement(I.a.Item,{style:{textAlign:"right"}},v.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(H.a,{type:"ghost",onClick:bt},"\u53D6\u6D88")))};function ge(Me){var tt=Me.onFileChange;return v.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",v.a.createElement("input",{type:"file",onChange:tt}))}function te(Me,tt){if(!Me)throw new String("\u6CA1\u6709\u6587\u4EF6");var bt=new FormData;bt.append("editormd-image-file",Me),bt.append("file_param_name","editormd-image-file"),bt.append("byxhr","true");var Kt=new window.XMLHttpRequest;Kt.withCredentials=!0,Kt.addEventListener("load",function(Gt){tt(JSON.parse(Gt.target.responseText),Me)},!1),Kt.addEventListener("error",function(Gt){console.error(Gt)},!1),Kt.open("POST","".concat(xe.a,"/api/attachments.json")),Kt.send(bt)}var fe=z("giR+"),_e=z("fyUT"),Le=z("7Kak"),$e=z("9yH6"),Ue=$e.a.Group,at={margin:"0 8px"},ft=function(Me){var tt=Me.callback,bt=Me.onCancel;function Kt(Gt){tt(Gt)}return v.a.createElement(I.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Kt},v.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},v.a.createElement("span",{style:at},"\u5355\u5143\u683C\u6570\uFF1A"),v.a.createElement("span",{style:at},"\u884C\u6570"),v.a.createElement(I.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},v.a.createElement(_e.a,null)),v.a.createElement("span",{style:at},"\u5217\u6570"),v.a.createElement(I.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},v.a.createElement(_e.a,null))),v.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},v.a.createElement("span",{style:at},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),v.a.createElement(I.a.Item,{name:"align"},v.a.createElement(Ue,null,v.a.createElement($e.a,{value:"default"},v.a.createElement("i",{className:"fa fa-align-justify"})),v.a.createElement($e.a,{value:"left"},v.a.createElement("i",{className:"fa fa-align-left"})),v.a.createElement($e.a,{value:"center"},v.a.createElement("i",{className:"fa fa-align-center"})),v.a.createElement($e.a,{value:"right"},v.a.createElement("i",{className:"fa fa-align-right"}))))),v.a.createElement("div",{className:"flex-container flex-end"},v.a.createElement(H.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),v.a.createElement(H.a,{type:"ghost",onClick:bt},"\u53D6\u6D88")))},Ct=z("ErOA"),yt=z("7Cbv"),_t="link",lt="upload-image",Ft="code-block",Xt="add-table",Jt="------------",rn={default:Jt,left:":".concat(Jt),center:":".concat(Jt,":"),right:"".concat(Jt,":")},En=z("9VGf"),mn,Ye;function Xe(){}var Ot=0,Et=1e4,Je="\u2581",mt=`
**\u6A21\u677F\u6807\u9898**
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function Be(Me){return/^\d+$/.test(Me)?"".concat(Me,"px"):Me}var Ie=navigator.platform.toUpperCase().indexOf("MAC")>=0,ke=Ie?"Cmd":"Ctrl",me=["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"],ye=(mn={},Object(X.a)(mn,ke+"-B","bold"),Object(X.a)(mn,ke+"-I","italic"),mn),Re=(Ye={},Object(X.a)(Ye,_t,"\u6DFB\u52A0\u94FE\u63A5"),Object(X.a)(Ye,Ft,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(X.a)(Ye,lt,"\u6DFB\u52A0\u6587\u4EF6"),Object(X.a)(Ye,Xt,"\u6DFB\u52A0\u8868\u683C"),Ye),ce=st.a=function(Me){var tt=Me.defaultValue,bt=tt===void 0?"":tt,Kt=Me.onChange,Gt=Me.width,$t=Gt===void 0?"100%":Gt,ei=Me.height,gn=ei===void 0?400:ei,an=Me.miniToolbar,dn=an===void 0?!1:an,zn=Me.isFocus,pi=zn===void 0?!1:zn,mi=Me.watch,ri=Me.insertTemp,_i=Me.mode,Si=_i===void 0?"markdown":_i,At=Me.id,Wn=At===void 0?"markdown-editor-id":At,hi=Me.showResizeBar,ti=hi===void 0?!1:hi,Oi=Me.noStorage,Ai=Oi===void 0?!1:Oi,Ni=Me.showNullButton,wi=Ni===void 0?!1:Ni,ct=Me.hidetoolBar,je=ct===void 0?!1:ct,It=Me.fullScreen,Ne=It===void 0?!1:It,Ee=Me.onBlur,ve=Me.onCMBeforeChange,di=Me.onFullScreen,en=Me.className,De=en===void 0?"":en,ht=Me.disablePaste,we=ht===void 0?!1:ht,un=Me.placeholder,fi=un===void 0?"":un,gi=Me.values,q=gi===void 0?"":gi,C=Object(m.useState)(null),L=Object($.a)(C,2),V=L[0],ae=L[1],Q=Object(m.useState)(bt),Ae=Object($.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(m.useState)(mi),ot=Object($.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=Object(m.useState)(Ne),Xn=Object($.a)(wn,2),jn=Xn[0],cn=Xn[1],jt=Object(m.useState)(""),nn=Object($.a)(jt,2),qt=nn[0],Nt=nn[1],$n=Object(m.useState)(0),Un=Object($.a)($n,2),xn=Un[0],Yn=Un[1],hn=Object(m.useState)(gn),Tn=Object($.a)(hn,2),ln=Tn[0],Mn=Tn[1],Vn=Object(m.useState)(!1),ni=Object($.a)(Vn,2),Pn=ni[0],Hn=ni[1],tn=Object(m.useRef)(Object(yt.a)()),vn=Object(m.useRef)(!1),Ln=Object(m.useRef)(),Cn=Object(m.useRef)(),Qn=Object(m.useRef)(),_n=Object(m.useRef)(),Gn=Object(m.useRef)(),qn=function(){var gt=Object(M.a)(D.a.mark(function it(){var Ve,qe;return D.a.wrap(function(dt){for(;;)switch(dt.prev=dt.next){case 0:return dt.next=2,Object(Ct.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:tn.current}});case 2:qe=dt.sent,qe!=null&&(Ve=qe.attachments)!==null&&Ve!==void 0&&Ve.length&&(console.log("cm:",V,Cn),qe.attachments.map(function(Ze){Ze.content_type.indexOf("image")>-1?V.replaceSelection("![,](/api/attachments/".concat(Ze.id,"?type=").concat(Ze.content_type,")")):Ze.content_type.indexOf("video")>-1?V.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ze.content_type.indexOf("pdf")>-1?V.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Ze.id,"?type=").concat(Ze.content_type,'&disposition=inline" target="_blank">').concat(Ze.name,"</a>")):V.replaceSelection("[".concat(Ze.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Ze.id,"?type=").concat(Ze.content_type,")"))}));case 4:case"end":return dt.stop()}},it)}));return function(){return gt.apply(this,arguments)}}();Object(m.useEffect)(function(){xt(q),V==null||V.setValue(q)},[q]),Object(m.useEffect)(function(){di==null||di(jn)},[jn]),Object(m.useEffect)(function(){if(Cn.current){var gt=o.a.fromTextArea(Cn.current,{mode:Si,lineNumbers:!dn,lineWrapping:!0,value:bt,autoCloseTags:!0,autoCloseBrackets:!0});pi&&gt.focus();function it(Ve,qe){if(we){qe.preventDefault();return}var We=qe.clipboardData;if(We){var dt=We.types.toString(),Ze=We.items;if(dt==="Files"||We.types.indexOf("Files")>-1){if(qe.preventDefault(),Si=="stex")return;try{var wt,kt=Ze[1];((wt=Ze[0])===null||wt===void 0?void 0:wt.kind)==="file"&&(kt=Ze[0]);var Tt=kt.getAsFile(),Ht=Tt.name.split(".").pop();te(Tt,function(St){if(St.id){var Pt,bn,on;(Tt==null||((Pt=Tt.type)===null||Pt===void 0)?void 0:Pt.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(St.id,"?type=").concat(St.content_type,")")):(Tt==null||((bn=Tt.type)===null||bn===void 0)?void 0:bn.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(St.id,'"></video>')):(Tt==null||((on=Tt.type)===null||on===void 0)?void 0:on.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(St.id,"?type=").concat(Tt.type,'&disposition=inline" target="_blank">').concat(Tt.name,"</a>")):me.includes(Ht)?gt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(St.id,'?type=office&disposition=inline" target="_blank">').concat(Tt.name,"</a>")):gt.replaceSelection("[".concat(Tt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(St.id,"?type=").concat(St.content_type,")"))}else(St==null?void 0:St.status)===401&&(document.location.href="/user/login")})}catch(St){W.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return gt.on("paste",it),gt.on("dragleave",function(Ve,qe){Qn.current.classList.remove("mouse-hover-md")}),gt.on("dragover",function(Ve,qe){Qn.current.classList.add("mouse-hover-md")}),gt.on("drop",function(Ve,qe){Qn.current.classList.add("mouse-hover-md");var We;if(We=qe.dataTransfer.files,We.length>0){qe.preventDefault(),qe.stopPropagation();for(var dt=function(kt){var Tt=We[kt],Ht=Tt.name.split(".").pop();te(Tt,function(St){if(St.id){var Pt,bn,on;(Tt==null||((Pt=Tt.type)===null||Pt===void 0)?void 0:Pt.indexOf("image"))>-1?gt.replaceSelection("![,](/api/attachments/".concat(St.id,"?type=").concat(St.content_type,")")):(Tt==null||((bn=Tt.type)===null||bn===void 0)?void 0:bn.indexOf("video"))>-1?gt.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(St.id,'"></video>')):(Tt==null||((on=Tt.type)===null||on===void 0)?void 0:on.indexOf("pdf"))>-1?gt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(St.id,"?type=").concat(Tt.type,'&disposition=inline" target="_blank">').concat(Tt.name,"</a>")):me.includes(Ht)?gt.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(St.id,'?type=office&disposition=inline" target="_blank">').concat(Tt.name,"</a>")):gt.replaceSelection("[".concat(Tt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(St.id,"?type=").concat(St.content_type,")"))}else(St==null?void 0:St.status)===401&&(document.location.href="/user/login")})},Ze=0;Ze<We.length;Ze++)dt(Ze)}}),ae(gt),function(){gt.off("paste",it)}}},[]);var In=Object(m.useCallback)(function(){if(Qn.current)try{}catch(gt){console.log(gt,"---- to set md editor body height")}},[ln,Qn,jn]);Object(m.useEffect)(function(){function gt(){var Ve=new l.default(function(qe){var We=Object(U.a)(qe),dt;try{for(We.s();!(dt=We.n()).done;){var Ze=dt.value;(Ze.target.offsetHeight>0||Ze.target.offsetWidth>0)&&(In(),V.setSize("100%","100%"),V.refresh())}}catch(wt){We.e(wt)}finally{We.f()}});return Ve.observe(Cn.current.parentElement),Ve}if(V){var it=gt();return function(){it.unobserve(Cn.current.parentElement)}}},[V,In]),Object(m.useEffect)(function(){if(V){for(var gt=[],it=function(){var Ze=qe[Ve];We=Object($.a)(Ze,2);var wt=We[0],kt=We[1],Tt=Object(X.a)({},wt,function(){Dn(kt)});gt.push(Tt),V.addKeyMap(Tt)},Ve=0,qe=Object.entries(ye);Ve<qe.length;Ve++){var We;it()}return Ln.current=setInterval(function(){vn.current&&qn()},4e3),function(){clearInterval(Ln.current);var dt=Object(U.a)(gt),Ze;try{for(dt.s();!(Ze=dt.n()).done;){var wt=Ze.value;V.removeKeyMap(wt)}}catch(kt){dt.e(kt)}finally{dt.f()}}}},[V]),Object(m.useEffect)(function(){Ne!==jn&&cn(Ne)},[Ne]),Object(En.a)(function(){if(!Ai&&xn>0){var gt=new Date().getTime(),it=window.sessionStorage.getItem(Wn);gt>=xn+Et&&(!it||it!==nt)&&(window.sessionStorage.setItem(Wn,nt),Hn(!0))}},Et),Object(m.useEffect)(function(){Lt(mi)},[V,mi]),Object(m.useEffect)(function(){V&&(pi&&V.focus())},[V,pi]),Object(m.useEffect)(function(){if(vt&&V){var gt=V.getScrollerElement();function it(Ve){var qe=Ve.target;if(Gn.current){var We=qe.scrollTop/qe.scrollHeight;Gn.current.scrollTop=Gn.current.scrollHeight*We}}return gt.addEventListener("scroll",it),function(){gt.removeEventListener("scroll",it)}}},[V,vt]),Object(m.useEffect)(function(){if(V&&ve){function gt(it,Ve){ve(it,Ve)}return V.on("beforeChange",gt),function(){V.off("beforeChange",gt)}}},[V,ve]),Object(m.useEffect)(function(){if(V&&Ee){function gt(){Ee(V.getValue())}return V.on("blur",gt),function(){V.off("blur",gt)}}},[V,Ee]),Object(m.useEffect)(function(){if(V){function gt(it){var Ve=it.getValue();xt(Ve),Yn(new Date().getTime()),it.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Kt&&Kt(Ve)}return V.on("change",gt),function(){V.off("change",gt)}}},[V,Kt]),Object(m.useEffect)(function(){V&&(bt==null?(V.setValue(""),xt("")):bt!==V.getValue()&&(V.setValue(bt),xt(bt),V.setCursor(V.lineCount(),0)))},[V,bt]);var Dn=Object(m.useCallback)(function(gt){var it=V.getCursor(),Ve=V.getSelection(),qe=Ve.split(`
`);switch(gt){case"bold":return V.replaceSelection("**"+Ve+"**"),Ve===""&&V.setCursor(it.line,it.ch+2),V.focus();case"italic":return V.replaceSelection("*"+Ve+"*"),Ve===""&&V.setCursor(it.line,it.ch+1),V.focus();case"code":return V.replaceSelection("`"+Ve+"`"),Ve===""&&V.setCursor(it.line,it.ch+1),V.focus();case"inline-latex":return V.replaceSelection("`$$"+Ve+"$$`"),Ve===""&&V.setCursor(it.line,it.ch+3),V.focus();case"latex":return V.replaceSelection("```latex\n"+Ve+"\n```"),V.setCursor(it.line+1,Ve.length+1),V.focus();case"line-break":return V.replaceSelection(`<br/>
`),V.focus();case"list-ul":return Ve===""?V.replaceSelection("- "+Ve):V.replaceSelection(qe.map(function(We){return We===""?"":"- ".concat(We)}).join(`
`)),V.focus();case"list-ol":return Ve===""?V.replaceSelection("1. "+Ve):V.replaceSelection(qe.map(function(We,dt){return We===""?"":"".concat(dt+1,". ").concat(We)}).join(`
`)),V.focus();case"add-null-ch":return Ve===""&&V.setCursor(it.line,it.ch+1),V.replaceSelection(Je),V.focus();case"inster-template-1":return Ve===""&&V.setCursor(it.line,it.ch),V.replaceSelection(mt),V.focus();case"eraser":return V.setValue(""),V.focus();case"trigger-watch":return Lt(!vt),V.focus();case"trigger-full-screen":return cn(!jn),V.focus();case _t:Nt(_t);return;case Ft:Nt(Ft);return;case lt:Nt(lt);return;case Xt:Nt(Xt);return;default:throw new Error}},[V,vt,jn]),kn=Object(m.useCallback)(function(gt){Nt("");switch(qt){case _t:var it=gt.title,Ve=gt.link;return V.replaceSelection("[".concat(it,"](").concat(Ve,")")),V.focus();case Ft:var qe=gt.language,We=gt.content;return V.replaceSelection(["```"+qe,We,"```"].join(`
`)),V.focus();case lt:var dt=gt.src,Ze=gt.alt;return Ze?V.replaceSelection("![ ".concat(Ze," ]( ").concat(dt,' "').concat(Ze,'" )')):V.replaceSelection("![,](".concat(dt,")")),V.focus();case Xt:for(var wt=gt.row,kt=gt.col,Tt=gt.align,Ht=`
`,St=0;St<wt;St++){for(var Pt=[],bn=[],on=0;on<kt;on++)St===1&&bn.push(rn[Tt]),Pt.push(" ");St===1&&(Ht+="| ".concat(bn.join(" | "),` |
`)),Ht+="| ".concat(Pt.join(kt===1?"":" | "),` |
`)}return V.replaceSelection(Ht+`
`),V.focus();default:throw new Error}},[V,qt]),An=Object(m.useMemo)(function(){switch(qt){case _t:return v.a.createElement(re,{callback:kn,onCancel:sn});case Ft:return v.a.createElement(de.b,{callback:kn,onCancel:sn});case lt:return v.a.createElement(be,{callback:kn,onCancel:sn});case Xt:return v.a.createElement(ft,{callback:kn,onCancel:sn});default:return null}},[qt]);function sn(){Nt("")}Object(m.useEffect)(function(){if(_n.current){var gt=_n.current,it=!1,Ve=0;function qe(Ze){it=!0,Ve=Ze.pageY}function We(){it=!1}function dt(Ze){if(it){var wt=Ze.pageY-Ve;wt<0&&(wt=0),wt>300&&(wt=300);var kt=gn+wt+"px";Mn(kt)}}return gt.addEventListener("mousedown",qe),document.addEventListener("mousemove",dt),document.addEventListener("mouseup",We),function(){gt.removeEventListener("mousedown",qe),document.removeEventListener("mousemove",dt),document.removeEventListener("mouseup",We)}}},[V,_n]),Object(m.useEffect)(function(){Mn(gn)},[gn]);var Mt=Be($t),zt=635,Vt={width:Mt,height:zt},Bt=Object(m.useMemo)(function(){if(xn){var gt=new Date(xn),it=gt.getHours(),Ve=gt.getMinutes(),qe=gt.getSeconds();return it=it<10?"0"+it:it,Ve=Ve<10?"0"+Ve:Ve,qe=qe<10?"0"+qe:qe,"".concat(it,":").concat(Ve,":").concat(qe)}return 0},[xn]);function Zt(){window.sessionStorage.removeItem(Wn),Hn(!1),Yn(0)}function yn(){Hn(!1),Yn(0),V.setValue(window.sessionStorage.getItem(Wn))}function pn(gt,it){var Ve=V.getValue();Ve=Ve.replace(gt,it),xt(Ve),V==null||V.setValue(Ve)}return v.a.createElement(m.Fragment,null,v.a.createElement("div",{className:"markdown-editor-wrapper",ref:Qn},v.a.createElement("div",{className:"markdown-editor-container ".concat(De," ").concat(vt?"on-preview":""," ").concat(dn?"mini":""," ").concat(jn?"full-screen":""),style:Vt},v.a.createElement(y,{insertTemp:ri,watch:vt,fullScreen:jn,showNullButton:wi,onActionCallback:Dn,hidetoolBar:je,uuid:tn.current,setOpenPhones:function(){vn.current=!0}}),v.a.createElement("div",{className:"markdown-editor-body"},v.a.createElement("div",{className:"codemirror-container"},v.a.createElement("textarea",{ref:Cn,placeholder:fi})),vt?v.a.createElement("div",{ref:Gn,className:"preview-container"},Si==="stex"&&v.a.createElement(O,{value:nt}),Si!=="stex"&&v.a.createElement(w.a,{edit:!0,value:nt,replaces:pn})):null))),ti?v.a.createElement("a",{ref:_n,className:"editor-resize"}):null,v.a.createElement(F.a,null,Re[qt]?v.a.createElement(Z.a,{centered:!0,title:Re[qt],visible:!0,onCancel:sn,footer:null,className:"markdown-popup-form"},An):null))}},Pxm8:function(Wt,st,z){Wt.exports={flex_box_center:"flex_box_center___3O17H",flex_space_between:"flex_space_between___1PCIj",flex_box_vertical_center:"flex_box_vertical_center___3W4zT",flex_box_center_end:"flex_box_center_end___3TSxu",flex_box_column:"flex_box_column___3pTiU",bg:"bg___3XbLP",title:"title___3HsI1",titleLeft:"titleLeft___3MQGG",titleRight:"titleRight___2RPg2",formWrap:"formWrap___3LmMJ"}},RxwV:function(Wt,st,z){"use strict";var oe=z("q1tI"),Z=z("uciX"),U=z("2W6z"),ee=z.n(U),W=z("4IlW"),M=z("uK0f"),$=z.n(M);function X(Ce,Oe){if(Ce===Oe)return!0;if(!Ce||!Oe)return!1;var be=Ce.length;if(Oe.length!==be)return!1;for(var ge=0;ge<be;ge++)if(Ce[ge]!==Oe[ge])return!1;return!0}function k(Ce){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(be){return typeof be}:k=function(be){return be&&typeof Symbol=="function"&&be.constructor===Symbol&&be!==Symbol.prototype?"symbol":typeof be},k(Ce)}function D(Ce,Oe){if(!(Ce instanceof Oe))throw new TypeError("Cannot call a class as a function")}function m(Ce,Oe){for(var be=0;be<Oe.length;be++){var ge=Oe[be];ge.enumerable=ge.enumerable||!1,ge.configurable=!0,"value"in ge&&(ge.writable=!0),Object.defineProperty(Ce,ge.key,ge)}}function v(Ce,Oe,be){return Oe&&m(Ce.prototype,Oe),be&&m(Ce,be),Ce}function f(Ce,Oe){if(typeof Oe!="function"&&Oe!==null)throw new TypeError("Super expression must either be null or a function");Ce.prototype=Object.create(Oe&&Oe.prototype,{constructor:{value:Ce,writable:!0,configurable:!0}}),Oe&&o(Ce,Oe)}function o(Ce,Oe){return o=Object.setPrototypeOf||function(ge,te){return ge.__proto__=te,ge},o(Ce,Oe)}function l(Ce){var Oe=t();return function(){var be=c(Ce),ge;if(Oe){var te=c(this).constructor;ge=Reflect.construct(be,arguments,te)}else ge=be.apply(this,arguments);return r(this,ge)}}function r(Ce,Oe){return Oe&&(k(Oe)==="object"||typeof Oe=="function")?Oe:i(Ce)}function i(Ce){if(Ce===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ce}function t(){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(Ce){return!1}}function c(Ce){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(be){return be.__proto__||Object.getPrototypeOf(be)},c(Ce)}var h=function(){var Ce=function(Oe){f(ge,Oe);var be=l(ge);function ge(){var te;return D(this,ge),te=be.apply(this,arguments),te.menuItems={},te.saveMenuItem=function(fe){return function(_e){te.menuItems[fe]=_e}},te}return v(ge,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(fe){!fe.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(fe){var _e=this.props,Le=_e.fieldNames,$e=_e.defaultFieldNames;return Le[fe]||$e[fe]}},{key:"getOption",value:function(fe,_e){var Le=this.props,$e=Le.prefixCls,Ue=Le.expandTrigger,at=Le.expandIcon,ft=Le.loadingIcon,Ct=this.props.onSelect.bind(this,fe,_e),yt=this.props.onItemDoubleClick.bind(this,fe,_e),_t={onClick:Ct,onDoubleClick:yt},lt="".concat($e,"-menu-item"),Ft=null,Xt=fe[this.getFieldName("children")]&&fe[this.getFieldName("children")].length>0;(Xt||fe.isLeaf===!1)&&(lt+=" ".concat($e,"-menu-item-expand"),fe.loading||(Ft=oe.createElement("span",{className:"".concat($e,"-menu-item-expand-icon")},at))),Ue==="hover"&&(Xt||fe.isLeaf===!1)&&(_t={onMouseEnter:this.delayOnSelect.bind(this,Ct),onMouseLeave:this.delayOnSelect.bind(this),onClick:Ct}),this.isActiveOption(fe,_e)&&(lt+=" ".concat($e,"-menu-item-active"),_t.ref=this.saveMenuItem(_e)),fe.disabled&&(lt+=" ".concat($e,"-menu-item-disabled"));var Jt=null;fe.loading&&(lt+=" ".concat($e,"-menu-item-loading"),Jt=ft||null);var rn="";return"title"in fe?rn=fe.title:typeof fe[this.getFieldName("label")]=="string"&&(rn=fe[this.getFieldName("label")]),oe.createElement("li",Object.assign({key:fe[this.getFieldName("value")],className:lt,title:rn},_t,{role:"menuitem",onMouseDown:function(mn){return mn.preventDefault()}}),fe[this.getFieldName("label")],Ft,Jt)}},{key:"getActiveOptions",value:function(fe){var _e=this,Le=this.props.options,$e=fe||this.props.activeValue;return $()(Le,function(Ue,at){return Ue[_e.getFieldName("value")]===$e[at]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var fe=this,_e=this.props.options,Le=this.getActiveOptions().map(function($e){return $e[fe.getFieldName("children")]}).filter(function($e){return!!$e});return Le.unshift(_e),Le}},{key:"delayOnSelect",value:function(fe){for(var _e=this,Le=arguments.length,$e=new Array(Le>1?Le-1:0),Ue=1;Ue<Le;Ue++)$e[Ue-1]=arguments[Ue];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof fe=="function"&&(this.delayTimer=window.setTimeout(function(){fe($e),_e.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var fe=this.getShowOptions().length,_e=0;_e<fe;_e++){var Le=this.menuItems[_e];Le&&Le.parentElement&&(Le.parentElement.scrollTop=Le.offsetTop)}}},{key:"isActiveOption",value:function(fe,_e){var Le=this.props.activeValue,$e=Le===void 0?[]:Le;return $e[_e]===fe[this.getFieldName("value")]}},{key:"render",value:function(){var fe=this,_e=this.props,Le=_e.prefixCls,$e=_e.dropdownMenuColumnStyle;return oe.createElement("div",null,this.getShowOptions().map(function(Ue,at){return oe.createElement("ul",{className:"".concat(Le,"-menu"),key:at,style:$e},Ue.map(function(ft){return fe.getOption(ft,at)}))}))}}]),ge}(oe.Component);return Ce.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},Ce}(),A=h,S={bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:1,adjustY:1}},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:1,adjustY:1}}},w=S;function O(Ce){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O=function(be){return typeof be}:O=function(be){return be&&typeof Symbol=="function"&&be.constructor===Symbol&&be!==Symbol.prototype?"symbol":typeof be},O(Ce)}function R(Ce,Oe){if(Ce==null)return{};var be=b(Ce,Oe),ge,te;if(Object.getOwnPropertySymbols){var fe=Object.getOwnPropertySymbols(Ce);for(te=0;te<fe.length;te++){if(ge=fe[te],Oe.indexOf(ge)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(Ce,ge))continue;be[ge]=Ce[ge]}}return be}function b(Ce,Oe){if(Ce==null)return{};var be={},ge=Object.keys(Ce),te,fe;for(fe=0;fe<ge.length;fe++){if(te=ge[fe],Oe.indexOf(te)>=0)continue;be[te]=Ce[te]}return be}function _(Ce){return g(Ce)||E(Ce)||d(Ce)||u()}function u(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(Ce,Oe){if(!Ce)return;if(typeof Ce=="string")return y(Ce,Oe);var be=Object.prototype.toString.call(Ce).slice(8,-1);if(be==="Object"&&Ce.constructor&&(be=Ce.constructor.name),be==="Map"||be==="Set")return Array.from(Ce);if(be==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(be))return y(Ce,Oe)}function E(Ce){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(Ce))return Array.from(Ce)}function g(Ce){if(Array.isArray(Ce))return y(Ce)}function y(Ce,Oe){(Oe==null||Oe>Ce.length)&&(Oe=Ce.length);for(var be=0,ge=new Array(Oe);be<Oe;be++)ge[be]=Ce[be];return ge}function F(Ce,Oe){if(!(Ce instanceof Oe))throw new TypeError("Cannot call a class as a function")}function N(Ce,Oe){for(var be=0;be<Oe.length;be++){var ge=Oe[be];ge.enumerable=ge.enumerable||!1,ge.configurable=!0,"value"in ge&&(ge.writable=!0),Object.defineProperty(Ce,ge.key,ge)}}function H(Ce,Oe,be){return Oe&&N(Ce.prototype,Oe),be&&N(Ce,be),Ce}function G(Ce,Oe){if(typeof Oe!="function"&&Oe!==null)throw new TypeError("Super expression must either be null or a function");Ce.prototype=Object.create(Oe&&Oe.prototype,{constructor:{value:Ce,writable:!0,configurable:!0}}),Oe&&I(Ce,Oe)}function I(Ce,Oe){return I=Object.setPrototypeOf||function(ge,te){return ge.__proto__=te,ge},I(Ce,Oe)}function x(Ce){var Oe=re();return function(){var be=de(Ce),ge;if(Oe){var te=de(this).constructor;ge=Reflect.construct(be,arguments,te)}else ge=be.apply(this,arguments);return B(this,ge)}}function B(Ce,Oe){return Oe&&(O(Oe)==="object"||typeof Oe=="function")?Oe:Y(Ce)}function Y(Ce){if(Ce===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return Ce}function re(){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(Ce){return!1}}function de(Ce){return de=Object.setPrototypeOf?Object.getPrototypeOf:function(be){return be.__proto__||Object.getPrototypeOf(be)},de(Ce)}var he=function(){var Ce=function(Oe){G(ge,Oe);var be=x(ge);function ge(te){var fe;F(this,ge),fe=be.call(this,te),fe.setPopupVisible=function(Le){var $e=fe.state.value;"popupVisible"in fe.props||fe.setState({popupVisible:Le}),Le&&!fe.state.popupVisible&&fe.setState({activeValue:$e}),fe.props.onPopupVisibleChange(Le)},fe.handleChange=function(Le,$e,Ue){var at=$e.visible;(Ue.type!=="keydown"||Ue.keyCode===W.a.ENTER)&&(fe.props.onChange(Le.map(function(ft){return ft[fe.getFieldName("value")]}),Le),fe.setPopupVisible(at))},fe.handlePopupVisibleChange=function(Le){fe.setPopupVisible(Le)},fe.handleMenuSelect=function(Le,$e,Ue){var at=fe.trigger.getRootDomNode();at&&at.focus&&at.focus();var ft=fe.props,Ct=ft.changeOnSelect,yt=ft.loadData,_t=ft.expandTrigger;if(!Le||Le.disabled)return;var lt=fe.state.activeValue;lt=lt.slice(0,$e+1),lt[$e]=Le[fe.getFieldName("value")];var Ft=fe.getActiveOptions(lt);if(Le.isLeaf===!1&&!Le[fe.getFieldName("children")]&&yt){Ct&&fe.handleChange(Ft,{visible:!0},Ue),fe.setState({activeValue:lt}),yt(Ft);return}var Xt={};!Le[fe.getFieldName("children")]||!Le[fe.getFieldName("children")].length?(fe.handleChange(Ft,{visible:!1},Ue),Xt.value=lt):Ct&&(Ue.type==="click"||Ue.type==="keydown")&&(_t==="hover"?fe.handleChange(Ft,{visible:!1},Ue):fe.handleChange(Ft,{visible:!0},Ue),Xt.value=lt),Xt.activeValue=lt,("value"in fe.props||Ue.type==="keydown"&&Ue.keyCode!==W.a.ENTER)&&delete Xt.value,fe.setState(Xt)},fe.handleItemDoubleClick=function(){var Le=fe.props.changeOnSelect;Le&&fe.setPopupVisible(!1)},fe.handleKeyDown=function(Le){var $e=fe.props.children;if($e&&$e.props.onKeyDown){$e.props.onKeyDown(Le);return}var Ue=_(fe.state.activeValue),at=Ue.length-1<0?0:Ue.length-1,ft=fe.getCurrentLevelOptions(),Ct=ft.map(function(Ft){return Ft[fe.getFieldName("value")]}).indexOf(Ue[at]);if(Le.keyCode!==W.a.DOWN&&Le.keyCode!==W.a.UP&&Le.keyCode!==W.a.LEFT&&Le.keyCode!==W.a.RIGHT&&Le.keyCode!==W.a.ENTER&&Le.keyCode!==W.a.SPACE&&Le.keyCode!==W.a.BACKSPACE&&Le.keyCode!==W.a.ESC&&Le.keyCode!==W.a.TAB)return;if(!fe.state.popupVisible&&Le.keyCode!==W.a.BACKSPACE&&Le.keyCode!==W.a.LEFT&&Le.keyCode!==W.a.RIGHT&&Le.keyCode!==W.a.ESC&&Le.keyCode!==W.a.TAB){fe.setPopupVisible(!0);return}if(Le.keyCode===W.a.DOWN||Le.keyCode===W.a.UP){Le.preventDefault();var yt=Ct;yt!==-1?Le.keyCode===W.a.DOWN?(yt+=1,yt=yt>=ft.length?0:yt):(yt-=1,yt=yt<0?ft.length-1:yt):yt=0,Ue[at]=ft[yt][fe.getFieldName("value")]}else if(Le.keyCode===W.a.LEFT||Le.keyCode===W.a.BACKSPACE)Le.preventDefault(),Ue.splice(Ue.length-1,1);else if(Le.keyCode===W.a.RIGHT)Le.preventDefault(),ft[Ct]&&ft[Ct][fe.getFieldName("children")]&&Ue.push(ft[Ct][fe.getFieldName("children")][0][fe.getFieldName("value")]);else if(Le.keyCode===W.a.ESC||Le.keyCode===W.a.TAB){fe.setPopupVisible(!1);return}(!Ue||Ue.length===0)&&fe.setPopupVisible(!1);var _t=fe.getActiveOptions(Ue),lt=_t[_t.length-1];fe.handleMenuSelect(lt,_t.length-1,Le),fe.props.onKeyDown&&fe.props.onKeyDown(Le)},fe.saveTrigger=function(Le){fe.trigger=Le};var _e=[];return"value"in te?_e=te.value||[]:"defaultValue"in te&&(_e=te.defaultValue||[]),ee()(!("filedNames"in te),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),fe.state={popupVisible:te.popupVisible,activeValue:_e,value:_e,prevProps:te},fe.defaultFieldNames={label:"label",value:"value",children:"children"},fe}return H(ge,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(fe){var _e=this.defaultFieldNames,Le=this.props,$e=Le.fieldNames,Ue=Le.filedNames;return"filedNames"in this.props?Ue[fe]||_e[fe]:$e[fe]||_e[fe]}},{key:"getFieldNames",value:function(){var fe=this.props,_e=fe.fieldNames,Le=fe.filedNames;return"filedNames"in this.props?Le:_e}},{key:"getCurrentLevelOptions",value:function(){var fe=this,_e=this.props.options,Le=_e===void 0?[]:_e,$e=this.state.activeValue,Ue=$e===void 0?[]:$e,at=$()(Le,function(ft,Ct){return ft[fe.getFieldName("value")]===Ue[Ct]},{childrenKeyName:this.getFieldName("children")});return at[at.length-2]?at[at.length-2][this.getFieldName("children")]:_(Le).filter(function(ft){return!ft.disabled})}},{key:"getActiveOptions",value:function(fe){var _e=this;return $()(this.props.options||[],function(Le,$e){return Le[_e.getFieldName("value")]===fe[$e]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var fe=this.props,_e=fe.prefixCls,Le=fe.transitionName,$e=fe.popupClassName,Ue=fe.options,at=Ue===void 0?[]:Ue,ft=fe.disabled,Ct=fe.builtinPlacements,yt=fe.popupPlacement,_t=fe.children,lt=fe.dropdownRender,Ft=R(fe,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),Xt=oe.createElement("div",null),Jt="";at&&at.length>0?Xt=oe.createElement(A,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Jt=" ".concat(_e,"-menus-empty");var rn=Xt;return lt&&(rn=lt(Xt)),oe.createElement(Z.a,Object.assign({ref:this.saveTrigger},Ft,{popupPlacement:yt,builtinPlacements:Ct,popupTransitionName:Le,action:ft?[]:["click"],popupVisible:ft?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(_e,"-menus"),popupClassName:$e+Jt,popup:rn}),oe.cloneElement(_t,{onKeyDown:this.handleKeyDown,tabIndex:ft?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(fe,_e){var Le=_e.prevProps,$e=Le===void 0?{}:Le,Ue={prevProps:fe};return"value"in fe&&!X($e.value,fe.value)&&(Ue.value=fe.value||[],"loadData"in fe||(Ue.activeValue=fe.value||[])),"popupVisible"in fe&&(Ue.popupVisible=fe.popupVisible),Ue}}]),ge}(oe.Component);return Ce.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:w,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},Ce}(),xe=he,Pe=st.a=xe},"SA+Z":function(Wt,st,z){var oe=z("wTVA"),Z=z("EbDI"),U=z("ZhPi"),ee=z("wkBT");function W(M){return oe(M)||Z(M)||U(M)||ee()}Wt.exports=W,Wt.exports.__esModule=!0,Wt.exports.default=Wt.exports},SJMd:function(Wt,st){/**
* @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 z,oe,Z,U=!1,ee,W;window.PR_SHOULD_USE_CONTINUATION=!0;var M,$;(function(){var X=window,k=["break,continue,do,else,for,if,return,while"],D=[k,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],m=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],v=[m,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],f=[m,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],o=[m,"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"],l="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",r=[m,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",t=[k,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],c=[k,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],h=[k,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[v,o,f,r,i,t,c,h],S=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,w="str",O="kwd",R="com",b="typ",_="lit",u="pun",d="pln",E="tag",g="dec",y="src",F="atn",N="atv",H="nocode",G="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function I(Ue){for(var at=0,ft=!1,Ct=!1,yt=0,_t=Ue.length;yt<_t;++yt){var lt=Ue[yt];if(lt.ignoreCase)Ct=!0;else if(/[a-z]/i.test(lt.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ft=!0,Ct=!1;break}}var Ft={b:8,t:9,n:10,v:11,f:12,r:13};function Xt(Ye){var Xe=Ye.charCodeAt(0);if(Xe!==92)return Xe;var Ot=Ye.charAt(1);return Xe=Ft[Ot],Xe||("0"<=Ot&&Ot<="7"?parseInt(Ye.substring(1),8):Ot==="u"||Ot==="x"?parseInt(Ye.substring(2),16):Ye.charCodeAt(1))}function Jt(Ye){if(Ye<32)return(Ye<16?"\\x0":"\\x")+Ye.toString(16);var Xe=String.fromCharCode(Ye);return Xe==="\\"||Xe==="-"||Xe==="]"||Xe==="^"?"\\"+Xe:Xe}function rn(Ye){var Xe=Ye.substring(1,Ye.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")),Ot=[],Et=Xe[0]==="^",Je=["["];Et&&Je.push("^");for(var mt=Et?1:0,Be=Xe.length;mt<Be;++mt){var Ie=Xe[mt];if(/\\[bdsw]/i.test(Ie))Je.push(Ie);else{var ke=Xt(Ie),me;mt+2<Be&&Xe[mt+1]==="-"?(me=Xt(Xe[mt+2]),mt+=2):me=ke,Ot.push([ke,me]),me<65||ke>122||(me<65||ke>90||Ot.push([Math.max(65,ke)|32,Math.min(me,90)|32]),me<97||ke>122||Ot.push([Math.max(97,ke)&~32,Math.min(me,122)&~32]))}}Ot.sort(function(Me,tt){return Me[0]-tt[0]||tt[1]-Me[1]});for(var ye=[],Re=[],mt=0;mt<Ot.length;++mt){var ce=Ot[mt];ce[0]<=Re[1]+1?Re[1]=Math.max(Re[1],ce[1]):ye.push(Re=ce)}for(var mt=0;mt<ye.length;++mt){var ce=ye[mt];Je.push(Jt(ce[0])),ce[1]>ce[0]&&(ce[1]+1>ce[0]&&Je.push("-"),Je.push(Jt(ce[1])))}return Je.push("]"),Je.join("")}function En(Ye){for(var Xe=Ye.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")),Ot=Xe.length,Et=[],Je=0,mt=0;Je<Ot;++Je){var Be=Xe[Je];if(Be==="(")++mt;else if(Be.charAt(0)==="\\"){var Ie=+Be.substring(1);Ie&&(Ie<=mt?Et[Ie]=-1:Xe[Je]=Jt(Ie))}}for(var Je=1;Je<Et.length;++Je)Et[Je]===-1&&(Et[Je]=++at);for(var Je=0,mt=0;Je<Ot;++Je){var Be=Xe[Je];if(Be==="(")++mt,Et[mt]||(Xe[Je]="(?:");else if(Be.charAt(0)==="\\"){var Ie=+Be.substring(1);Ie&&Ie<=mt&&(Xe[Je]="\\"+Et[Ie])}}for(var Je=0;Je<Ot;++Je)Xe[Je]==="^"&&Xe[Je+1]!=="^"&&(Xe[Je]="");if(Ye.ignoreCase&&ft)for(var Je=0;Je<Ot;++Je){var Be=Xe[Je],ke=Be.charAt(0);Be.length>=2&&ke==="["?Xe[Je]=rn(Be):ke!=="\\"&&(Xe[Je]=Be.replace(/[a-zA-Z]/g,function(Re){var ce=Re.charCodeAt(0);return"["+String.fromCharCode(ce&~32,ce|32)+"]"}))}return Xe.join("")}for(var mn=[],yt=0,_t=Ue.length;yt<_t;++yt){var lt=Ue[yt];if(lt.global||lt.multiline)throw new Error(""+lt);mn.push("(?:"+En(lt)+")")}return new RegExp(mn.join("|"),Ct?"gi":"g")}function x(Ue,at){var ft=/(?:^|\s)nocode(?:\s|$)/,Ct=[],yt=0,_t=[],lt=0;function Ft(Xt){var Jt=Xt.nodeType;if(Jt==1){if(ft.test(Xt.className))return;for(var rn=Xt.firstChild;rn;rn=rn.nextSibling)Ft(rn);var En=Xt.nodeName.toLowerCase();(En==="br"||En==="li")&&(Ct[lt]=`
`,_t[lt<<1]=yt++,_t[lt++<<1|1]=Xt)}else if(Jt==3||Jt==4){var mn=Xt.nodeValue;mn.length&&(at?mn=mn.replace(/\r\n?/g,`
`):mn=mn.replace(/[ \t\r\n]+/g," "),Ct[lt]=mn,_t[lt<<1]=yt,yt+=mn.length,_t[lt++<<1|1]=Xt)}}return Ft(Ue),{sourceCode:Ct.join("").replace(/\n$/,""),spans:_t}}function B(Ue,at,ft,Ct,yt){if(!ft)return;var _t={sourceNode:Ue,pre:1,langExtension:null,numberLines:null,sourceCode:ft,spans:null,basePos:at,decorations:null};Ct(_t),yt.push.apply(yt,_t.decorations)}var Y=/\S/;function re(Ue){for(var at=void 0,ft=Ue.firstChild;ft;ft=ft.nextSibling){var Ct=ft.nodeType;at=Ct===1?at?Ue:ft:Ct===3&&Y.test(ft.nodeValue)?Ue:at}return at===Ue?void 0:at}function de(Ue,at){var ft={},Ct;(function(){for(var lt=Ue.concat(at),Ft=[],Xt={},Jt=0,rn=lt.length;Jt<rn;++Jt){var En=lt[Jt],mn=En[3];if(mn)for(var Ye=mn.length;--Ye>=0;)ft[mn.charAt(Ye)]=En;var Xe=En[1],Ot=""+Xe;Xt.hasOwnProperty(Ot)||(Ft.push(Xe),Xt[Ot]=null)}Ft.push(/[\0-\uffff]/),Ct=I(Ft)})();var yt=at.length,_t=function(lt){for(var Ft=lt.sourceCode,Xt=lt.basePos,Jt=lt.sourceNode,rn=[Xt,d],En=0,mn=Ft.match(Ct)||[],Ye={},Xe=0,Ot=mn.length;Xe<Ot;++Xe){var Et=mn[Xe],Je=Ye[Et],mt=void 0,Be;if(typeof Je=="string")Be=!1;else{var Ie=ft[Et.charAt(0)];if(Ie)mt=Et.match(Ie[1]),Je=Ie[0];else{for(var ke=0;ke<yt;++ke)if(Ie=at[ke],mt=Et.match(Ie[1]),mt){Je=Ie[0];break}mt||(Je=d)}Be=Je.length>=5&&Je.substring(0,5)==="lang-",Be&&!(mt&&typeof mt[1]=="string")&&(Be=!1,Je=y),Be||(Ye[Et]=Je)}var me=En;if(En+=Et.length,!Be)rn.push(Xt+me,Je);else{var ye=mt[1],Re=Et.indexOf(ye),ce=Re+ye.length;mt[2]&&(ce=Et.length-mt[2].length,Re=ce-ye.length);var Me=Je.substring(5);B(Jt,Xt+me,Et.substring(0,Re),_t,rn),B(Jt,Xt+me+Re,ye,ge(Me,ye),rn),B(Jt,Xt+me+ce,Et.substring(ce),_t,rn)}}lt.decorations=rn};return _t}function he(Ue){var at=[],ft=[];Ue.tripleQuotedStrings?at.push([w,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ue.multiLineStrings?at.push([w,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):at.push([w,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ue.verbatimStrings&&ft.push([w,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Ct=Ue.hashComments;Ct&&(Ue.cStyleComments?(Ct>1?at.push([R,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):at.push([R,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ft.push([w,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):at.push([R,/^#[^\r\n]*/,null,"#"])),Ue.cStyleComments&&(ft.push([R,/^\/\/[^\r\n]*/,null]),ft.push([R,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var yt=Ue.regexLiterals;if(yt){var _t=yt>1?"":`
\r`,lt=_t?".":"[\\S\\s]",Ft="/(?=[^/*"+_t+"])(?:[^/\\x5B\\x5C"+_t+"]|\\x5C"+lt+"|\\x5B(?:[^\\x5C\\x5D"+_t+"]|\\x5C"+lt+")*(?:\\x5D|$))+/";ft.push(["lang-regex",RegExp("^"+G+"("+Ft+")")])}var Xt=Ue.types;Xt&&ft.push([b,Xt]);var Jt=(""+Ue.keywords).replace(/^ | $/g,"");Jt.length&&ft.push([O,new RegExp("^(?:"+Jt.replace(/[\s,]+/g,"|")+")\\b"),null]),at.push([d,/^\s+/,null,` \r
\xA0`]);var rn="^.[^\\s\\w.$@'\"`/\\\\]*";return Ue.regexLiterals&&(rn+="(?!s*/)"),ft.push([_,/^@[a-z_$][a-z_$@0-9]*/i,null],[b,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[a-z_$][a-z_$@0-9]*/i,null],[_,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[u,new RegExp(rn),null]),de(at,ft)}var xe=he({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Pe(Ue,at,ft){for(var Ct=/(?:^|\s)nocode(?:\s|$)/,yt=/\r\n?|\n/,_t=Ue.ownerDocument,lt=_t.createElement("li");Ue.firstChild;)lt.appendChild(Ue.firstChild);var Ft=[lt];function Xt(Xe){var Ot=Xe.nodeType;if(Ot==1&&!Ct.test(Xe.className))if(Xe.nodeName==="br")Jt(Xe),Xe.parentNode&&Xe.parentNode.removeChild(Xe);else for(var Et=Xe.firstChild;Et;Et=Et.nextSibling)Xt(Et);else if((Ot==3||Ot==4)&&ft){var Je=Xe.nodeValue,mt=Je.match(yt);if(mt){var Be=Je.substring(0,mt.index);Xe.nodeValue=Be;var Ie=Je.substring(mt.index+mt[0].length);if(Ie){var ke=Xe.parentNode;ke.insertBefore(_t.createTextNode(Ie),Xe.nextSibling)}Jt(Xe),Be||Xe.parentNode.removeChild(Xe)}}}function Jt(Xe){for(;!Xe.nextSibling;)if(Xe=Xe.parentNode,!Xe)return;function Ot(mt,Be){var Ie=Be?mt.cloneNode(!1):mt,ke=mt.parentNode;if(ke){var me=Ot(ke,1),ye=mt.nextSibling;me.appendChild(Ie);for(var Re=ye;Re;Re=ye)ye=Re.nextSibling,me.appendChild(Re)}return Ie}for(var Et=Ot(Xe.nextSibling,0),Je;(Je=Et.parentNode)&&Je.nodeType===1;)Et=Je;Ft.push(Et)}for(var rn=0;rn<Ft.length;++rn)Xt(Ft[rn]);at===(at|0)&&Ft[0].setAttribute("value",at);var En=_t.createElement("ol");En.className="linenums";for(var mn=Math.max(0,at-1|0)||0,rn=0,Ye=Ft.length;rn<Ye;++rn)lt=Ft[rn],lt.className="L"+(rn+mn)%10,lt.firstChild||lt.appendChild(_t.createTextNode("\xA0")),En.appendChild(lt);Ue.appendChild(En)}function Ce(Ue){var at=/\bMSIE\s(\d+)/.exec(navigator.userAgent);at=at&&+at[1]<=8;var ft=/\n/g,Ct=Ue.sourceCode,yt=Ct.length,_t=0,lt=Ue.spans,Ft=lt.length,Xt=0,Jt=Ue.decorations,rn=Jt.length,En=0;Jt[rn]=yt;var mn,Ye;for(Ye=mn=0;Ye<rn;)Jt[Ye]!==Jt[Ye+2]?(Jt[mn++]=Jt[Ye++],Jt[mn++]=Jt[Ye++]):Ye+=2;for(rn=mn,Ye=mn=0;Ye<rn;){for(var Xe=Jt[Ye],Ot=Jt[Ye+1],Et=Ye+2;Et+2<=rn&&Jt[Et+1]===Ot;)Et+=2;Jt[mn++]=Xe,Jt[mn++]=Ot,Ye=Et}rn=Jt.length=mn;var Je=Ue.sourceNode,mt="";Je&&(mt=Je.style.display,Je.style.display="none");try{for(var Be=null;Xt<Ft;){var Ie=lt[Xt],ke=lt[Xt+2]||yt,me=Jt[En+2]||yt,Et=Math.min(ke,me),ye=lt[Xt+1],Re;if(ye.nodeType!==1&&(Re=Ct.substring(_t,Et))){at&&(Re=Re.replace(ft,"\r")),ye.nodeValue=Re;var ce=ye.ownerDocument,Me=ce.createElement("span");Me.className=Jt[En+1];var tt=ye.parentNode;tt.replaceChild(Me,ye),Me.appendChild(ye),_t<ke&&(lt[Xt+1]=ye=ce.createTextNode(Ct.substring(Et,ke)),tt.insertBefore(ye,Me.nextSibling))}_t=Et,_t>=ke&&(Xt+=2),_t>=me&&(En+=2)}}finally{Je&&(Je.style.display=mt)}}var Oe={};function be(Ue,at){for(var ft=at.length;--ft>=0;){var Ct=at[ft];Oe.hasOwnProperty(Ct)?X.console&&console.warn("cannot override language handler %s",Ct):Oe[Ct]=Ue}}function ge(Ue,at){return Ue&&Oe.hasOwnProperty(Ue)||(Ue=/^\s*</.test(at)?"default-markup":"default-code"),Oe[Ue]}be(xe,["default-code"]),be(de([],[[d,/^[^<?]+/],[g,/^<!\w[^>]*(?:>|$)/],[R,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[u,/^(?:<[%?]|[%?]>)/],["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"]),be(de([[d,/^[\s]+/,null,` \r
`],[N,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[F,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[u,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),be(de([],[[N,/^[\s\S]+/]]),["uq.val"]),be(he({keywords:v,hashComments:!0,cStyleComments:!0,types:S}),["c","cc","cpp","cxx","cyc","m"]),be(he({keywords:"null,true,false"}),["json"]),be(he({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:S}),["cs"]),be(he({keywords:f,cStyleComments:!0}),["java"]),be(he({keywords:h,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),be(he({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),be(he({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),be(he({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),be(he({keywords:r,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),be(he({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),be(de([],[[w,/^[\s\S]+/]]),["regex"]);function te(Ue){var at=Ue.langExtension;try{var ft=x(Ue.sourceNode,Ue.pre),Ct=ft.sourceCode;Ue.sourceCode=Ct,Ue.spans=ft.spans,Ue.basePos=0,ge(at,Ct)(Ue),Ce(Ue)}catch(yt){X.console&&console.log(yt&&yt.stack||yt)}}function fe(Ue,at,ft){var Ct=ft||!1,yt=at||null,_t=document.createElement("div");_t.innerHTML="<pre>"+Ue+"</pre>",_t=_t.firstChild,Ct&&Pe(_t,Ct,!0);var lt={langExtension:yt,numberLines:Ct,sourceNode:_t,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return te(lt),_t.innerHTML}function _e(Ue,at){var ft=at||document.body,Ct=ft.ownerDocument||document;function yt(Ie){return ft.getElementsByTagName(Ie)}for(var _t=[yt("pre"),yt("code"),yt("xmp")],lt=[],Ft=0;Ft<_t.length;++Ft)for(var Xt=0,Jt=_t[Ft].length;Xt<Jt;++Xt)lt.push(_t[Ft][Xt]);_t=null;var rn=Date;rn.now||(rn={now:function(){return+new Date}});var En=0,mn=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ye=/\bprettyprint\b/,Xe=/\bprettyprinted\b/,Ot=/pre|xmp/i,Et=/^code$/i,Je=/^(?:pre|code|xmp)$/i,mt={};function Be(){for(var Ie=X.PR_SHOULD_USE_CONTINUATION?rn.now()+250:Infinity;En<lt.length&&rn.now()<Ie;En++){for(var ke=lt[En],me=mt,ye=ke;ye=ye.previousSibling;){var Re=ye.nodeType,ce=(Re===7||Re===8)&&ye.nodeValue;if(ce?!/^\??prettify\b/.test(ce):Re!==3||/\S/.test(ye.nodeValue))break;if(ce){me={},ce.replace(/\b(\w+)=([\w:.%+-]+)/g,function(mi,ri,_i){me[ri]=_i});break}}var Me=ke.className;if((me!==mt||Ye.test(Me))&&!Xe.test(Me)){for(var tt=!1,bt=ke.parentNode;bt;bt=bt.parentNode){var Kt=bt.tagName;if(Je.test(Kt)&&bt.className&&Ye.test(bt.className)){tt=!0;break}}if(!tt){ke.className+=" prettyprinted";var Gt=me.lang;if(!Gt){Gt=Me.match(mn);var $t;!Gt&&($t=re(ke))&&Et.test($t.tagName)&&(Gt=$t.className.match(mn)),Gt&&(Gt=Gt[1])}var ei;if(Ot.test(ke.tagName))ei=1;else{var gn=ke.currentStyle,an=Ct.defaultView,dn=gn?gn.whiteSpace:an&&an.getComputedStyle?an.getComputedStyle(ke,null).getPropertyValue("white-space"):0;ei=dn&&dn.substring(0,3)==="pre"}var zn=me.linenums;(zn=zn==="true"||+zn)||(zn=Me.match(/\blinenums\b(?::(\d+))?/),zn=zn?zn[1]&&zn[1].length?+zn[1]:!0:!1),zn&&Pe(ke,zn,ei);var pi={langExtension:Gt,sourceNode:ke,numberLines:zn,pre:ei,sourceCode:null,basePos:null,spans:null,decorations:null};te(pi)}}}En<lt.length?X.setTimeout(Be,250):typeof Ue=="function"&&Ue()}Be()}var Le=X.PR={createSimpleLexer:de,registerLangHandler:be,sourceDecorator:he,PR_ATTRIB_NAME:F,PR_ATTRIB_VALUE:N,PR_COMMENT:R,PR_DECLARATION:g,PR_KEYWORD:O,PR_LITERAL:_,PR_NOCODE:H,PR_PLAIN:d,PR_PUNCTUATION:u,PR_SOURCE:y,PR_STRING:w,PR_TAG:E,PR_TYPE:b,prettyPrintOne:U?X.prettyPrintOne=fe:M=fe,prettyPrint:$=U?X.prettyPrint=_e:$=_e},$e=X.define;typeof $e=="function"&&$e.amd&&$e("google-code-prettify",[],function(){return Le})})()},T1X5:function(Wt,st){Wt.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGwAAABsCAYAAACPZlfNAAALdklEQVR4Xu2dC2wc1RVAzx1nDXFiO4SEhqxtxS0JHzX94TS0FEKLALX8WkKbqrRVKQrh15Zfq0IqIaSGSOXb8ktANFJbKqUFWigEAUohfFRQDC1KxS8UR/7wDbZ3TRxix3urN951No7Xnt15M7Mbz0hRImXevffds/PmzXv33StU0KWqTlcfh6mwkCHmq8M8B5oUZosyS6EeOCD7x/Rsl/kjkFJhu8AHGWiXDNuoYqsoW5K1vCkimUpxg5SzoW+r1gylOUGErygci9IC1Fi2uR+hVeA5VZ6tquOpuSL9lnVYE1d2wNo+0jnVylLNcKYKx6EcaK23XgQJH4vyjDg8OCDc3zxd3vXSLKx7ygJYW5seOGUmZ6GcJ8IShaqwHDCeHoEhVTYh3LO7mweam+XjqO2KFNjWPp09VblUlQuAmVE7YwL93SKs2SncMr9WPojK1kiAdWzXpCa40oHlCtOi6nwpegV2ZOBuGeSGxlnSVYoMP21CBfZmnx5SneFagXPzZnJ+7I+y7S6FdQMO1xxWK++HZUgowNzpeIoVKqwCDgqrcyHp6RFlZbKetWF8HgQOrD2liwTuAHdKvj9frVVTuHDuNGkNspOBAWtt1cShC1ilcLlqecz6gnSkkS3CkMBN77zBypYWGQxCXyDAuvq1KTPIeuCYIIyuAJnPOwmWJWuk3bat1oF1pfWMjLKuAqbptn05Wl63I5ybrJOHbCqyCqw9ratEucqMDjaNrGBZqsLqpjpZaasPVhyrqlVdKe5Wcafr8TXKA6KsS9azXESG/DrHN7CODp0qdaxXON2vMftze4F/aJpljY2y008/fQFr69EZCYeH3ZX0+JrQA2ZHYDDDac0HSe+ENxe4oWRg2SfriRhWca53t3HSnFTqk1YSMPedleZv8TBYHKzc3WZ4TNbxrVLeaSUB6+zV38cTjNJgjUBT1jXMkB8XK6VoYNmp+9XFKorv39cDKlxX7JS/KGDZj+K/x99Z1n5+6gjfLObj2jOw7HLTv+MVDGuwcoK6nQSf97qM5QmYWcj9xHyensRrg9YpjRL4/HtbOd7LgrEnYF1p/U1G+XnQVk9m+Y5wfbJOfjGRDyYEZvazHOFfk2WLZCKHBfX/Zmsmo3ypqV42j6djXGBmp7gzzQuTYPMxKA7Fym1tqGPxeDvX4wLr7NULVdzd4vgKyQOiXNQwQ+4spK4gMBMwc0CG1/bDGIyQXF+ymp5dDkcUCuwpCKwzpXcqbrxgfIXsAYU1TfVy4VhqxwRm4gZJ8L/9IBQtZFdbU7eLQT41VtzjmMDaU3qzwKXW1MeCivaAwi1N9XLZ6Ib7AHPDpzO0hRmR+/L78Ict8J93IT1QdN+sN6irhs/NgR8uhM8eYl28J4EmwninQ/PosPB9gHWmdZUqoS3u/uUVuPEFKMcDWg5wxWL4zlGefGz9JhGuaxgVD7IXsOwpEhMvHsrBBPNknf9IecLKed9Au+vUyJ607t3dJPNPzewFrCOl3wPutf5TKSDwio3wdF7k3imfhMNnugGZkV2q8Ho3PPbWHhOOb4IbT4zMpHMa6+XPOe17A+vVjQhfC8u0E+/d884ysH69JCzNE+v51aY90Mw7beM5E7cJ5A7ln40zZOTnMgLMnHxMDNEZ5mG6RSbcNHv9tAV+sDCQLpck9I9b4Hd5UfKbIwrgM4cKB6toyJ0EHQHWkdJLgFtL6l2JjfKB/WwRfP/TJQoKoNmf/gu/zVuGjQqY6ZrjcEmyVm43/x4B1pnSxxVOCqDvBUXGwLx5W+CJhno5eQSYe1q/jw/DPgAeA/MGDOHjqloONtkN3CesI6XfAB7x2NzabV6B3fca3LoZ+ndbU+0KmpaAn7TA0iP2lVtOQ2LWulMb62WDC6wzrdfp8CGGUC+vwL56L3wU0ArI9Gp4cowZYLkBE2F1Q51cPfyEpXUTyvGh0gK8ArvgUXgxoGwZX5gDa79eAU+Y8HRjnSyR7K5yXwAZZibk7xXYjkHY2Abmb5uXGRJPnAfTqisAGPQ31FErnWldoMrrNh3hVZZXYF7l2byv3IZEd4YoHC4dfbqUDPfZ7KxXWTEwr57K3udwtnT06i8RVhfZ1MrtMbAi3ahcJe1pXSPKiiKbWrk9BlacG1VYa95hG1QZY55UnLBS7vYK7JXtwxuc/ZYnHTWJ4U3Ko2ZVxKTDvMMelY60bs7mISzF577aeAV25l/h7Y98qSrYeO50ePDblQHMzevYmVITDjAvGHeMLzUGVpzXBbZJR0p7gBnFNbVzt1dgr+aGRMtLUzVThofEI8cYEh9/C1ZuGu7n7BrYsMxOn31K6TXAdkTx0WwM9wrMZydLaj6UgTtegje64UefgaPnlCTGdqN+A8z8biPJAFrOwGx72pK8oRiYJU+GJMYFFg+JIXnbghp3SOyO6sCD1yFxxwBs3BbA4m91dvE3YcGV4YjoqYhp/YpH4aWAtlfMZGJNJMsGxRMentZXwIdzFBuYxbszhBbuh3MFLE25IQKtwSxNmRCBs8cIEQjB/UWrcJem4sXfvf32Qhdc8jjcdjIsThbt00AbuIu/8fZK5QDDbK/EG5gVBMxsYMYhApUDzA0RqIQgnEBfDKOEl/E7bDgIx9hb7mFuMTA3qH44zM04o9wDSWNgbsRUXiBpmYdq2wZmhr1C16sfwu0vwsVHw5EHF74vgin/nlDtcjgMEeb5sPw1zFJ/DKEePxp9GMIdFiM4bhTVCUyvT9gR4zxhx4T4Ub3PcSMDrKtPL85kuK3UX1wp7fyccTaHGE5uBhP5ZPMqx1nimAf6ojgy+/J7cP6G0rMILJ4Lt51iExeUG7CCR2bd6X3Ih9KNTj95OmZOhce+u38Do9ChdBdYyGkfcq4uJRPO9ARc9kU4Y8F+DgwKp30IO7GKXVfbkVZmQ+L4iVWyH9Ghpi6y42Z7UsoJ2ISpi0y3o0gOZs/d/iWVCzDPycFMl+P0e/7B+5XgOf2eO/mIE1z69bff9sUluMw+ZXdKnELWr+NLal90ClmjJU7SXJKvbTQqLUmzO2OM06DbAFCUjJLToBstcaGBonxt42Z/hQay77K4lIcNFBPIsFLKI6cjLpYTBjGub7RRLMeYGpejChyY3XJUxty44Ftg0OwXfMsbGs/IKHFJRXvsgiupmLMxLlpqkVbQRUtzpsZlgf1Dk7DKAme/z+LC2z6YhV54210g7tCpUkdc2r5IcJGUts/Z2NajMxIODyscW6Tdk/J2A2sww2nNB0lvqQ7wXTQj+6StVzi9VCMmQzszDGqaZY2NstNPf30DM8qfVJ0yP8VdKkRUP8GPC4JvayYYyXqWi8iQX21WgI2a8pvs3Fbl+u1khO1VhdVNo0pK+bHHumO70mo+rk1VlVBKWvnpfMBtux3h3GSdPGRTj3VgectY64FjbBpbQbKedxIsS9ZIXrEtO9YHAsyYZhaMD13AKoXLJ0uVdbNFInDTO2+wsqVFLOdPHQYeGLCR91pKFwlu8e4WO7+xspXSqnDRRKXp/VofODBjoNm57kqxQoVVUeW18uuocdr3iLIyWc/a8UrS29IfCrCcsSawpzrDtYI7/T/AVicikrNLYd2AwzWFqpoHYVeowHIdMHGPmuBKB5aHWX7YhgNNRG4G7pZBbhirMLYNHePJiARYziA3LFy5VJULKuAzoFuENTuFW0bXVg4aUr78SIHlDMmemjkL5TwRloRZh3OCX/OQKpsQ7tndzQP55XnDhFR2wPINMidBq5WlmuFMFY4Lu2qgqYYnyjPi8OCAcH+uWGhUgEbrLYsnrJAz3OwGaU5AOQ6HL2cLItRYdl6/m8AfnlPl2ao6njKlCy3rsCaurIGN7qX7edDHYSosZIj56jDPgSaF2aLM0uH8+6YaWG4GugsYEOhVYbvABxlolwzbqGKrKFuStbwZxnTcFrH/A8wNv8JI/KKJAAAAAElFTkSuQmCC"},TXwP:function(Wt,st,z){var oe,Z;(function(){var U;(function(){"use strict";var W=[,,function(k){function D(f){this.__parent=f,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=[]}D.prototype.clone_empty=function(){var f=new D(this.__parent);return f.set_indent(this.__indent_count,this.__alignment_count),f},D.prototype.item=function(f){return f<0?this.__items[this.__items.length+f]:this.__items[f]},D.prototype.has_match=function(f){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(f))return!0;return!1},D.prototype.set_indent=function(f,o){this.is_empty()&&(this.__indent_count=f||0,this.__alignment_count=o||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var f=this.__parent.current_line;return f.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),f.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),f.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,f.__items[0]===" "&&(f.__items.splice(0,1),f.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(f){this.__items.push(f);var o=f.lastIndexOf(`
`);o!==-1?this.__character_count=f.length-o:this.__character_count+=f.length},D.prototype.pop=function(){var f=null;return this.is_empty()||(f=this.__items.pop(),this.__character_count-=f.length),f},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var f="";return this.is_empty()?this.__parent.indent_empty_lines&&(f=this.__parent.get_indent_string(this.__indent_count)):(f=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),f+=this.__items.join("")),f};function m(f,o){this.__cache=[""],this.__indent_size=f.indent_size,this.__indent_string=f.indent_char,f.indent_with_tabs||(this.__indent_string=new Array(f.indent_size+1).join(f.indent_char)),o=o||"",f.indent_level>0&&(o=new Array(f.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}m.prototype.get_indent_size=function(f,o){var l=this.__base_string_length;return o=o||0,f<0&&(l=0),l+=f*this.__indent_size,l+=o,l},m.prototype.get_indent_string=function(f,o){var l=this.__base_string;return o=o||0,f<0&&(f=0,l=""),o+=f*this.__indent_size,this.__ensure_cache(o),l+=this.__cache[o],l},m.prototype.__ensure_cache=function(f){for(;f>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var f=this.__cache.length,o=0,l="";this.__indent_size&&f>=this.__indent_size&&(o=Math.floor(f/this.__indent_size),f-=o*this.__indent_size,l=new Array(o+1).join(this.__indent_string)),f&&(l+=new Array(f+1).join(" ")),this.__cache.push(l)};function v(f,o){this.__indent_cache=new m(f,o),this.raw=!1,this._end_with_newline=f.end_with_newline,this.indent_size=f.indent_size,this.wrap_line_length=f.wrap_line_length,this.indent_empty_lines=f.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}v.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},v.prototype.get_line_number=function(){return this.__lines.length},v.prototype.get_indent_string=function(f,o){return this.__indent_cache.get_indent_string(f,o)},v.prototype.get_indent_size=function(f,o){return this.__indent_cache.get_indent_size(f,o)},v.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},v.prototype.add_new_line=function(f){return this.is_empty()||!f&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},v.prototype.get_code=function(f){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 l=this.__lines.join(`
`);return f!==`
`&&(l=l.replace(/[\n]/g,f)),l},v.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},v.prototype.set_indent=function(f,o){return f=f||0,o=o||0,this.next_line.set_indent(f,o),this.__lines.length>1?(this.current_line.set_indent(f,o),!0):(this.current_line.set_indent(),!1)},v.prototype.add_raw_token=function(f){for(var o=0;o<f.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(f.whitespace_before),this.current_line.push(f.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},v.prototype.add_token=function(f){this.__add_space_before_token(),this.current_line.push(f),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},v.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(" "))},v.prototype.remove_indent=function(f){for(var o=this.__lines.length;f<o;)this.__lines[f]._remove_indent(),f++;this.current_line._remove_wrap_indent()},v.prototype.trim=function(f){for(f=f===void 0?!1:f,this.current_line.trim();f&&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},v.prototype.just_added_newline=function(){return this.current_line.is_empty()},v.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},v.prototype.ensure_empty_line_above=function(f,o){for(var l=this.__lines.length-2;l>=0;){var r=this.__lines[l];if(r.is_empty())break;if(r.item(0).indexOf(f)!==0&&r.item(-1)!==o){this.__lines.splice(l+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},k.exports.Output=v},,,,function(k){function D(f,o){this.raw_options=m(f,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"])}D.prototype._get_array=function(f,o){var l=this.raw_options[f],r=o||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(r=l.concat()):typeof l=="string"&&(r=l.split(/[^a-zA-Z0-9_\/\-]+/)),r},D.prototype._get_boolean=function(f,o){var l=this.raw_options[f],r=l===void 0?!!o:!!l;return r},D.prototype._get_characters=function(f,o){var l=this.raw_options[f],r=o||"";return typeof l=="string"&&(r=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),r},D.prototype._get_number=function(f,o){var l=this.raw_options[f];o=parseInt(o,10),isNaN(o)&&(o=0);var r=parseInt(l,10);return isNaN(r)&&(r=o),r},D.prototype._get_selection=function(f,o,l){var r=this._get_selection_list(f,o,l);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+f+`' can only be one of the following values:
`+o+`
You passed in: '`+this.raw_options[f]+"'");return r[0]},D.prototype._get_selection_list=function(f,o,l){if(!o||o.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[o[0]],!this._is_valid_selection(l,o))throw new Error("Invalid Default Value!");var r=this._get_array(f,l);if(!this._is_valid_selection(r,o))throw new Error("Invalid Option Value: The option '"+f+`' can contain only the following values:
`+o+`
You passed in: '`+this.raw_options[f]+"'");return r},D.prototype._is_valid_selection=function(f,o){return f.length&&o.length&&!f.some(function(l){return o.indexOf(l)===-1})};function m(f,o){var l={};f=v(f);var r;for(r in f)r!==o&&(l[r]=f[r]);if(o&&f[o])for(r in f[o])l[r]=f[o][r];return l}function v(f){var o={},l;for(l in f){var r=l.replace(/-/g,"_");o[r]=f[l]}return o}k.exports.Options=D,k.exports.normalizeOpts=v,k.exports.mergeOpts=m},,function(k){var D=RegExp.prototype.hasOwnProperty("sticky");function m(v){this.__input=v||"",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 v=null;return this.hasNext()&&(v=this.__input.charAt(this.__position),this.__position+=1),v},m.prototype.peek=function(v){var f=null;return v=v||0,v+=this.__position,v>=0&&v<this.__input_length&&(f=this.__input.charAt(v)),f},m.prototype.__match=function(v,f){v.lastIndex=f;var o=v.exec(this.__input);return o&&!(D&&v.sticky)&&(o.index!==f&&(o=null)),o},m.prototype.test=function(v,f){return f=f||0,f+=this.__position,f>=0&&f<this.__input_length?!!this.__match(v,f):!1},m.prototype.testChar=function(v,f){var o=this.peek(f);return v.lastIndex=0,o!==null&&v.test(o)},m.prototype.match=function(v){var f=this.__match(v,this.__position);return f?this.__position+=f[0].length:f=null,f},m.prototype.read=function(v,f,o){var l="",r;return v&&(r=this.match(v),r&&(l+=r[0])),f&&(r||!v)&&(l+=this.readUntil(f,o)),l},m.prototype.readUntil=function(v,f){var o="",l=this.__position;v.lastIndex=this.__position;var r=v.exec(this.__input);return r?(l=r.index,f&&(l+=r[0].length)):l=this.__input_length,o=this.__input.substring(this.__position,l),this.__position=l,o},m.prototype.readUntilAfter=function(v){return this.readUntil(v,!0)},m.prototype.get_regexp=function(v,f){var o=null,l="g";return f&&D&&(l="y"),typeof v=="string"&&v!==""?o=new RegExp(v,l):v&&(o=new RegExp(v.source,l)),o},m.prototype.get_literal_regexp=function(v){return RegExp(v.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(v){var f=this.__position,o=this.readUntilAfter(v);return this.__position=f,o},m.prototype.lookBack=function(v){var f=this.__position-1;return f>=v.length&&this.__input.substring(f-v.length,f).toLowerCase()===v},k.exports.InputScanner=m},,,,,function(k){function D(m,v){m=typeof m=="string"?m:m.source,v=typeof v=="string"?v:v.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+v,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+v,"g")}D.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var v={};this.__directive_pattern.lastIndex=0;for(var f=this.__directive_pattern.exec(m);f;)v[f[1]]=f[2],f=this.__directive_pattern.exec(m);return v},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},k.exports.Directives=D},,function(k,D,m){var v=m(16).Beautifier,f=m(17).Options;function o(l,r){var i=new v(l,r);return i.beautify()}k.exports=o,k.exports.defaultOptions=function(){return new f}},function(k,D,m){var v=m(17).Options,f=m(2).Output,o=m(8).InputScanner,l=m(13).Directives,r=new l(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,c=/\s/,h=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,S=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function w(O,R){this._source_text=O||"",this._options=new v(R),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}w.prototype.eatString=function(O){var R="";for(this._ch=this._input.next();this._ch;){if(R+=this._ch,this._ch==="\\")R+=this._input.next();else if(O.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return R},w.prototype.eatWhitespace=function(O){for(var R=c.test(this._input.peek()),b=0;c.test(this._input.peek());)this._ch=this._input.next(),O&&this._ch===`
`&&((b===0||b<this._options.max_preserve_newlines)&&(b++,this._output.add_new_line(!0)));return R},w.prototype.foundNestedPseudoClass=function(){for(var O=0,R=1,b=this._input.peek(R);b;){if(b==="{")return!0;if(b==="(")O+=1;else if(b===")"){if(O===0)return!1;O-=1}else if(b===";"||b==="}")return!1;R++,b=this._input.peek(R)}return!1},w.prototype.print_string=function(O){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(O)},w.prototype.preserveSingleSpace=function(O){O&&(this._output.space_before_token=!0)},w.prototype.indent=function(){this._indentLevel++},w.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,R=this._options.eol;R==="auto"&&(R=`
`,O&&i.test(O||"")&&(R=O.match(i)[0])),O=O.replace(t,`
`);var b=O.match(/^[\t ]*/)[0];this._output=new f(this._options,b),this._input=new o(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var _=0,u=!1,d=!1,E=!1,g=!1,y=!1,F=!1,N=this._ch,H=!1,G,I,x;G=this._input.read(h),I=G!=="",x=N,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),N=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var B=this._input.read(A),Y=r.get_directives(B);Y&&Y.ignore==="start"&&(B+=r.readIgnored(this._input)),this.print_string(B),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(S)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(I),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var re=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);re.match(/[ :]$/)&&(re=this.eatString(": ").replace(/\s$/,""),this.print_string(re),this._output.space_before_token=!0),re=re.replace(/\s$/,""),re==="extend"?g=!0:re==="import"&&(y=!0),re in this.NESTED_AT_RULE?(this._nestedLevel+=1,re in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!u&&_===0&&re.indexOf(":")!==-1&&(d=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(I),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")d&&(d=!1,this.outdent()),E?(E=!1,u=this._indentLevel>=this._nestedLevel):u=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&u&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(x==="("?this._output.space_before_token=!1:x!==","&&this.indent(),this.print_string(this._ch)),this.eatWhitespace(!0),this._output.add_new_line();else if(this._ch==="}")this.outdent(),this._output.add_new_line(),x==="{"&&this._output.trim(!0),y=!1,g=!1,d&&(this.outdent(),d=!1),this.print_string(this._ch),u=!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 de=0;de<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;de++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[de])){H=!0;break}(u||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&_===0?(this.print_string(":"),d||(d=!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 he=x==='"'||x==="'";this.preserveSingleSpace(he||I),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")H=!1,_===0?(d&&(this.outdent(),d=!1),g=!1,y=!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(),_++,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(")")),_&&(_--,this.outdent()));else{var xe=!1;this._input.lookBack("with")&&(xe=!0),this.preserveSingleSpace(I||xe),this.print_string(this._ch),d&&x==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),F=!0):(this.eatWhitespace(),_++,this.indent())}else if(this._ch===")")_&&(_--,this.outdent()),F&&this._input.peek()===";"&&this._options.selector_separator_newline&&(F=!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&&(!d||F)&&_===0&&!y&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!d&&_===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&&c.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(I),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),c.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 Pe=x==='"'||x==="'";this.preserveSingleSpace(Pe||I),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&H&&this._output.add_new_line()}var Ce=this._output.get_code(R);return Ce},k.exports.Beautifier=w},function(k,D,m){var v=m(6).Options;function f(o){v.call(this,o,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var l=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||l;var r=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<r.length;i++)r[i]!=="expand"?this.brace_style="collapse":this.brace_style=r[i]}f.prototype=new v,k.exports.Options=f}],M={};function $(k){var D=M[k];if(D!==void 0)return D.exports;var m=M[k]={exports:{}};return W[k](m,m.exports,$),m.exports}var X=$(15);U=X})();var ee=U;!(oe=[],Z=function(){return{css_beautify:ee}}.apply(st,oe),Z!==void 0&&(Wt.exports=Z))})()},VYcG:function(Wt,st,z){"use strict";z.r(st),z.d(st,"useCourseOptions",function(){return I});var oe=z("T2oS"),Z=z("W9HT"),U=z("+L6B"),ee=z("2/Rp"),W=z("7Kak"),M=z("9yH6"),$=z("giR+"),X=z("fyUT"),k=z("5NDa"),D=z("5rEg"),m=z("6UJt"),v=z("DFOY"),f=z("14J3"),o=z("BMrR"),l=z("jCWc"),r=z("kPKH"),i=z("sPJy"),t=z("bE4q"),c=z("k1fw"),h=z("rAM+"),A=z("y8nQ"),S=z("Vl3Y"),w=z("9og8"),O=z("tJVT"),R=z("WmNS"),b=z.n(R),_=z("q1tI"),u=z.n(_),d=z("Ty5D"),E=z("55Ip"),g=z("9kvl"),y=z("Pxm8"),F=z.n(y),N=z("vCeJ"),H=z("6fQ5"),G=z("ZWs3"),I=function(){var Y=Object(_.useState)([]),re=Object(O.a)(Y,2),de=re[0],he=re[1];return Object(_.useEffect)(function(){var xe=function(){var Pe=Object(w.a)(b.a.mark(function Ce(){var Oe;return b.a.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return ge.next=2,Object(N.k)({source:"new_question"});case 2:Oe=ge.sent,Oe!=null&&Oe.disciplines&&he(Object(H.a)(Oe==null?void 0:Oe.disciplines));case 4:case"end":return ge.stop()}},Ce)}));return function(){return Pe.apply(this,arguments)}}();xe()},[]),de},x=function(Y){var re=Y.user,de=Object(d.i)(),he=I(),xe=S.a.useForm(),Pe=Object(O.a)(xe,1),Ce=Pe[0],Oe=Object(_.useState)(),be=Object(O.a)(Oe,2),ge=be[0],te=be[1],fe=Object(_.useState)(!1),_e=Object(O.a)(fe,2),Le=_e[0],$e=_e[1];return Object(_.useEffect)(function(){if(de.id){var Ue=function(){var at=Object(w.a)(b.a.mark(function ft(){var Ct,yt,_t,lt,Ft,Xt,Jt,rn,En,mn,Ye,Xe,Ot;return b.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:return $e(!0),Je.next=3,Object(N.l)({id:de.id});case 3:_t=Je.sent,$e(!1),lt=_t==null||((Ct=_t.exercise)===null||Ct===void 0)?void 0:Ct.sub_discipline_id,Ft=[],Xt=Object(h.a)(he);try{for(Xt.s();!(Jt=Xt.n()).done;){rn=Jt.value,En=Object(h.a)(rn.children);try{for(En.s();!(mn=En.n()).done;)Ye=mn.value,Ye.value===lt&&(Ft=[rn.value,Ye.value])}catch(mt){En.e(mt)}finally{En.f()}}}catch(mt){Xt.e(mt)}finally{Xt.f()}Xe=_t==null||((yt=_t.exercise)===null||yt===void 0)?void 0:yt.time,Ot=Object(c.a)(Object(c.a)({},_t.exercise),{},{sub_discipline_id:Ft,time:Xe===-1?null:Xe}),te(Ot);case 12:case"end":return Je.stop()}},ft)}));return function(){return at.apply(this,arguments)}}();if(!he.length)return;Ue()}else te({})},[he]),u.a.createElement("section",{className:"edu-container"},u.a.createElement("section",{className:"animated fadeIn"},u.a.createElement("aside",{className:"mt10"},u.a.createElement(t.a,{separator:">"},u.a.createElement(t.a.Item,null,u.a.createElement(E.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),u.a.createElement(t.a.Item,null,"\u65B0\u5EFA\u8BD5\u5377"))),u.a.createElement("aside",{className:"".concat(F.a.title," mt20")},u.a.createElement(o.a,null,u.a.createElement(r.a,{flex:"1"},u.a.createElement("strong",{className:"font20 ml5"},"\u65B0\u5EFA\u8BD5\u5377"))))),u.a.createElement(Z.a,{spinning:Le,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},u.a.createElement("section",{className:[F.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},ge&&u.a.createElement(S.a,{layout:"vertical",form:Ce,className:F.a.formWrap,initialValues:ge},u.a.createElement(S.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"sub_discipline_id",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},u.a.createElement(v.a,{placeholder:"\u8BF7\u9009\u62E9...",options:he})),u.a.createElement(S.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},u.a.createElement(D.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),u.a.createElement(S.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F",style:{width:"300px"}},u.a.createElement("div",{style:{display:"flex"}},u.a.createElement(X.a,{min:1,max:9999,maxLength:60,placeholder:"\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"}),u.a.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"32px"}},"\u5206\u949F"))),u.a.createElement(S.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},u.a.createElement(M.a.Group,null,u.a.createElement(M.a.Button,{value:1},"\u7B80\u5355"),u.a.createElement(M.a.Button,{value:2},"\u9002\u4E2D"),u.a.createElement(M.a.Button,{value:3},"\u56F0\u96BE"))),u.a.createElement(S.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},u.a.createElement(D.a.TextArea,{rows:6,maxLength:65535,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u523665535\u4E2A\u5B57\u7B26"})))),u.a.createElement("div",{className:["mt20","pb20","pt20"].join(" ")},u.a.createElement(ee.a,{style:{marginRight:"5px"},onClick:function(){g.d.push("/paperlibrary")}},"\u53D6\u6D88"),u.a.createElement(G.a,{onClick:Object(w.a)(b.a.mark(function Ue(){var at,ft,Ct,yt;return b.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return lt.next=2,Ce.validateFields();case 2:if(at=Ce.getFieldsValue(),at.sub_discipline_id=at.sub_discipline_id[1],!de.id){lt.next=10;break}return lt.next=7,Object(N.z)(Object(c.a)({id:de.id},at));case 7:return ft=lt.sent,ft.status===0&&g.d.push("/paperlibrary/edit/".concat(de.id,"?fromadd=1")),lt.abrupt("return");case 10:return lt.next=12,Object(N.e)(at);case 12:Ct=lt.sent,Ct.status===0&&g.d.push("/paperlibrary/edit/".concat(Ct==null||((yt=Ct.data)===null||yt===void 0)?void 0:yt.exam_id,"?fromadd=1"));case 14:case"end":return lt.stop()}},Ue)})),type:"primary",style:{marginLeft:"5px"}},"\u786E\u5B9A"))))};st.default=Object(g.a)(function(B){var Y=B.user;return{user:Y}})(x)},"VrN/":function(Wt,st,z){(function(oe,Z){Wt.exports=Z()})(this,function(){"use strict";var oe=navigator.userAgent,Z=navigator.platform,U=/gecko\/\d/i.test(oe),ee=/MSIE \d/.test(oe),W=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(oe),M=/Edge\/(\d+)/.exec(oe),$=ee||W||M,X=$&&(ee?document.documentMode||6:+(M||W)[1]),k=!M&&/WebKit\//.test(oe),D=k&&/Qt\/\d+\.\d+/.test(oe),m=!M&&/Chrome\//.test(oe),v=/Opera\//.test(oe),f=/Apple Computer/.test(navigator.vendor),o=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(oe),l=/PhantomJS/.test(oe),r=!M&&/AppleWebKit/.test(oe)&&/Mobile\/\w+/.test(oe),i=/Android/.test(oe),t=r||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(oe),c=r||/Mac/.test(Z),h=/\bCrOS\b/.test(oe),A=/win/i.test(Z),S=v&&oe.match(/Version\/(\d*\.\d*)/);S&&(S=Number(S[1])),S&&S>=15&&(v=!1,k=!0);var w=c&&(D||v&&(S==null||S<12.11)),O=U||$&&X>=9;function R(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var b=function(e,n){var s=e.className,a=R(n).exec(s);if(a){var p=s.slice(a.index+a[0].length);e.className=s.slice(0,a.index)+(p?a[1]+p:"")}};function _(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function u(e,n){return _(e).appendChild(n)}function d(e,n,s,a){var p=document.createElement(e);if(s&&(p.className=s),a&&(p.style.cssText=a),typeof n=="string")p.appendChild(document.createTextNode(n));else if(n)for(var j=0;j<n.length;++j)p.appendChild(n[j]);return p}function E(e,n,s,a){var p=d(e,n,s,a);return p.setAttribute("role","presentation"),p}var g;document.createRange?g=function(e,n,s,a){var p=document.createRange();return p.setEnd(a||e,s),p.setStart(e,n),p}:g=function(e,n,s){var a=document.body.createTextRange();try{a.moveToElementText(e.parentNode)}catch(p){return a}return a.collapse(!0),a.moveEnd("character",s),a.moveStart("character",n),a};function y(e,n){if(n.nodeType==3&&(n=n.parentNode),e.contains)return e.contains(n);do if(n.nodeType==11&&(n=n.host),n==e)return!0;while(n=n.parentNode)}function F(){var e;try{e=document.activeElement}catch(n){e=document.body||null}for(;e&&e.shadowRoot&&e.shadowRoot.activeElement;)e=e.shadowRoot.activeElement;return e}function N(e,n){var s=e.className;R(n).test(s)||(e.className+=(s?" ":"")+n)}function H(e,n){for(var s=e.split(" "),a=0;a<s.length;a++)s[a]&&!R(s[a]).test(n)&&(n+=" "+s[a]);return n}var G=function(e){e.select()};r?G=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:$&&(G=function(e){try{e.select()}catch(n){}});function I(e){var n=Array.prototype.slice.call(arguments,1);return function(){return e.apply(null,n)}}function x(e,n,s){n||(n={});for(var a in e)e.hasOwnProperty(a)&&(s!==!1||!n.hasOwnProperty(a))&&(n[a]=e[a]);return n}function B(e,n,s,a,p){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var j=a||0,J=p||0;;){var ie=e.indexOf(" ",j);if(ie<0||ie>=n)return J+(n-j);J+=ie-j,J+=s-J%s,j=ie+1}}var Y=function(){this.id=null,this.f=null,this.time=0,this.handler=I(this.onTimeout,this)};Y.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Y.prototype.set=function(e,n){this.f=n;var s=+new Date+e;(!this.id||s<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=s)};function re(e,n){for(var s=0;s<e.length;++s)if(e[s]==n)return s;return-1}var de=50,he={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},Pe={origin:"*mouse"},Ce={origin:"+move"};function Oe(e,n,s){for(var a=0,p=0;;){var j=e.indexOf(" ",a);j==-1&&(j=e.length);var J=j-a;if(j==e.length||p+J>=n)return a+Math.min(J,n-p);if(p+=j-a,p+=s-p%s,a=j+1,p>=n)return a}}var be=[""];function ge(e){for(;be.length<=e;)be.push(te(be)+" ");return be[e]}function te(e){return e[e.length-1]}function fe(e,n){for(var s=[],a=0;a<e.length;a++)s[a]=n(e[a],a);return s}function _e(e,n,s){for(var a=0,p=s(n);a<e.length&&s(e[a])<=p;)a++;e.splice(a,0,n)}function Le(){}function $e(e,n){var s;return Object.create?s=Object.create(e):(Le.prototype=e,s=new Le),n&&x(n,s),s}var Ue=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function at(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ue.test(e))}function ft(e,n){return n?n.source.indexOf("\\w")>-1&&at(e)?!0:n.test(e):at(e)}function Ct(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var yt=/[\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 _t(e){return e.charCodeAt(0)>=768&&yt.test(e)}function lt(e,n,s){for(;(s<0?n>0:n<e.length)&&_t(e.charAt(n));)n+=s;return n}function Ft(e,n,s){for(var a=n>s?-1:1;;){if(n==s)return n;var p=(n+s)/2,j=a<0?Math.ceil(p):Math.floor(p);if(j==n)return e(j)?n:s;e(j)?s=j:n=j+a}}function Xt(e,n,s,a){if(!e)return a(n,s,"ltr",0);for(var p=!1,j=0;j<e.length;++j){var J=e[j];(J.from<s&&J.to>n||n==s&&J.to==n)&&(a(Math.max(J.from,n),Math.min(J.to,s),J.level==1?"rtl":"ltr",j),p=!0)}p||a(n,s,"ltr")}var Jt=null;function rn(e,n,s){var a;Jt=null;for(var p=0;p<e.length;++p){var j=e[p];if(j.from<n&&j.to>n)return p;j.to==n&&(j.from!=j.to&&s=="before"?a=p:Jt=p),j.from==n&&(j.from!=j.to&&s!="before"?a=p:Jt=p)}return a!=null?a:Jt}var En=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function s(pe){return pe<=247?e.charAt(pe):1424<=pe&&pe<=1524?"R":1536<=pe&&pe<=1785?n.charAt(pe-1536):1774<=pe&&pe<=2220?"r":8192<=pe&&pe<=8203?"w":pe==8204?"b":"L"}var a=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,p=/[stwN]/,j=/[LRr]/,J=/[Lb1n]/,ie=/[1n]/;function se(pe,Fe,ze){this.level=pe,this.from=Fe,this.to=ze}return function(pe,Fe){var ze=Fe=="ltr"?"L":"R";if(pe.length==0||Fe=="ltr"&&!a.test(pe))return!1;for(var pt=pe.length,ut=[],Ut=0;Ut<pt;++Ut)ut.push(s(pe.charCodeAt(Ut)));for(var Qt=0,fn=ze;Qt<pt;++Qt){var Fn=ut[Qt];Fn=="m"?ut[Qt]=fn:fn=Fn}for(var oi=0,Bn=ze;oi<pt;++oi){var ci=ut[oi];ci=="1"&&Bn=="r"?ut[oi]="n":j.test(ci)&&(Bn=ci,ci=="r"&&(ut[oi]="R"))}for(var Ri=1,Ci=ut[0];Ri<pt-1;++Ri){var Di=ut[Ri];Di=="+"&&Ci=="1"&&ut[Ri+1]=="1"?ut[Ri]="1":Di==","&&Ci==ut[Ri+1]&&(Ci=="1"||Ci=="n")&&(ut[Ri]=Ci),Ci=Di}for(var Wi=0;Wi<pt;++Wi){var ir=ut[Wi];if(ir==",")ut[Wi]="N";else if(ir=="%"){var zi=void 0;for(zi=Wi+1;zi<pt&&ut[zi]=="%";++zi);for(var Er=Wi&&ut[Wi-1]=="!"||zi<pt&&ut[zi]=="1"?"1":"N",gr=Wi;gr<zi;++gr)ut[gr]=Er;Wi=zi-1}}for(var Qi=0,vr=ze;Qi<pt;++Qi){var sr=ut[Qi];vr=="L"&&sr=="1"?ut[Qi]="L":j.test(sr)&&(vr=sr)}for(var Zi=0;Zi<pt;++Zi)if(p.test(ut[Zi])){var qi=void 0;for(qi=Zi+1;qi<pt&&p.test(ut[qi]);++qi);for(var Xi=(Zi?ut[Zi-1]:ze)=="L",_r=(qi<pt?ut[qi]:ze)=="L",_o=Xi==_r?Xi?"L":"R":ze,Ca=Zi;Ca<qi;++Ca)ut[Ca]=_o;Zi=qi-1}for(var dr=[],Hr,rr=0;rr<pt;)if(J.test(ut[rr])){var nu=rr;for(++rr;rr<pt&&J.test(ut[rr]);++rr);dr.push(new se(0,nu,rr))}else{var Qr=rr,Ga=dr.length,za=Fe=="rtl"?1:0;for(++rr;rr<pt&&ut[rr]!="L";++rr);for(var hr=Qr;hr<rr;)if(ie.test(ut[hr])){Qr<hr&&(dr.splice(Ga,0,new se(1,Qr,hr)),Ga+=za);var yo=hr;for(++hr;hr<rr&&ie.test(ut[hr]);++hr);dr.splice(Ga,0,new se(2,yo,hr)),Ga+=za,Qr=hr}else++hr;Qr<rr&&dr.splice(Ga,0,new se(1,Qr,rr))}return Fe=="ltr"&&(dr[0].level==1&&(Hr=pe.match(/^\s+/))&&(dr[0].from=Hr[0].length,dr.unshift(new se(0,0,Hr[0].length))),te(dr).level==1&&(Hr=pe.match(/\s+$/))&&(te(dr).to-=Hr[0].length,dr.push(new se(0,pt-Hr[0].length,pt)))),Fe=="rtl"?dr.reverse():dr}}();function mn(e,n){var s=e.order;return s==null&&(s=e.order=En(e.text,n)),s}var Ye=[],Xe=function(e,n,s){if(e.addEventListener)e.addEventListener(n,s,!1);else if(e.attachEvent)e.attachEvent("on"+n,s);else{var a=e._handlers||(e._handlers={});a[n]=(a[n]||Ye).concat(s)}};function Ot(e,n){return e._handlers&&e._handlers[n]||Ye}function Et(e,n,s){if(e.removeEventListener)e.removeEventListener(n,s,!1);else if(e.detachEvent)e.detachEvent("on"+n,s);else{var a=e._handlers,p=a&&a[n];if(p){var j=re(p,s);j>-1&&(a[n]=p.slice(0,j).concat(p.slice(j+1)))}}}function Je(e,n){var s=Ot(e,n);if(!s.length)return;for(var a=Array.prototype.slice.call(arguments,2),p=0;p<s.length;++p)s[p].apply(null,a)}function mt(e,n,s){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),Je(e,s||n.type,e,n),Re(n)||n.codemirrorIgnore}function Be(e){var n=e._handlers&&e._handlers.cursorActivity;if(!n)return;for(var s=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),a=0;a<n.length;++a)re(s,n[a])==-1&&s.push(n[a])}function Ie(e,n){return Ot(e,n).length>0}function ke(e){e.prototype.on=function(n,s){Xe(this,n,s)},e.prototype.off=function(n,s){Et(this,n,s)}}function me(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ye(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function Re(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ce(e){me(e),ye(e)}function Me(e){return e.target||e.srcElement}function tt(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),c&&e.ctrlKey&&n==1&&(n=3),n}var bt=function(){if($&&X<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),Kt;function Gt(e){if(Kt==null){var n=d("span","\u200B");u(e,d("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Kt=n.offsetWidth<=1&&n.offsetHeight>2&&!($&&X<8))}var s=Kt?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return s.setAttribute("cm-text",""),s}var $t;function ei(e){if($t!=null)return $t;var n=u(e,document.createTextNode("A\u062EA")),s=g(n,0,1).getBoundingClientRect(),a=g(n,1,2).getBoundingClientRect();return _(e),!s||s.left==s.right?!1:$t=a.right-s.right<3}var gn=`
b`.split(/\n/).length!=3?function(e){for(var n=0,s=[],a=e.length;n<=a;){var p=e.indexOf(`
`,n);p==-1&&(p=e.length);var j=e.slice(n,e.charAt(p-1)=="\r"?p-1:p),J=j.indexOf("\r");J!=-1?(s.push(j.slice(0,J)),n+=J+1):(s.push(j),n=p+1)}return s}:function(e){return e.split(/\r\n?|\n/)},an=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(n){return!1}}:function(e){var n;try{n=e.ownerDocument.selection.createRange()}catch(s){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},dn=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),zn=null;function pi(e){if(zn!=null)return zn;var n=u(e,d("span","x")),s=n.getBoundingClientRect(),a=g(n,0,1).getBoundingClientRect();return zn=Math.abs(s.left-a.left)>1}var mi={},ri={};function _i(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),mi[e]=n}function Si(e,n){ri[e]=n}function At(e){if(typeof e=="string"&&ri.hasOwnProperty(e))e=ri[e];else if(e&&typeof e.name=="string"&&ri.hasOwnProperty(e.name)){var n=ri[e.name];typeof n=="string"&&(n={name:n}),e=$e(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return At("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return At("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Wn(e,n){n=At(n);var s=mi[n.name];if(!s)return Wn(e,"text/plain");var a=s(e,n);if(hi.hasOwnProperty(n.name)){var p=hi[n.name];for(var j in p){if(!p.hasOwnProperty(j))continue;a.hasOwnProperty(j)&&(a["_"+j]=a[j]),a[j]=p[j]}}if(a.name=n.name,n.helperType&&(a.helperType=n.helperType),n.modeProps)for(var J in n.modeProps)a[J]=n.modeProps[J];return a}var hi={};function ti(e,n){var s=hi.hasOwnProperty(e)?hi[e]:hi[e]={};x(n,s)}function Oi(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var s={};for(var a in n){var p=n[a];p instanceof Array&&(p=p.concat([])),s[a]=p}return s}function Ai(e,n){for(var s;e.innerMode&&!(s=e.innerMode(n),!s||s.mode==e);)n=s.state,e=s.mode;return s||{mode:e,state:n}}function Ni(e,n,s){return e.startState?e.startState(n,s):!0}var wi=function(e,n,s){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=s};wi.prototype.eol=function(){return this.pos>=this.string.length},wi.prototype.sol=function(){return this.pos==this.lineStart},wi.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},wi.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},wi.prototype.eat=function(e){var n=this.string.charAt(this.pos),s;if(typeof e=="string"?s=n==e:s=n&&(e.test?e.test(n):e(n)),s)return++this.pos,n},wi.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},wi.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},wi.prototype.skipToEnd=function(){this.pos=this.string.length},wi.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},wi.prototype.backUp=function(e){this.pos-=e},wi.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=B(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},wi.prototype.indentation=function(){return B(this.string,null,this.tabSize)-(this.lineStart?B(this.string,this.lineStart,this.tabSize):0)},wi.prototype.match=function(e,n,s){if(typeof e=="string"){var a=function(J){return s?J.toLowerCase():J},p=this.string.substr(this.pos,e.length);if(a(p)==a(e))return n!==!1&&(this.pos+=e.length),!0}else{var j=this.string.slice(this.pos).match(e);return j&&j.index>0?null:(j&&n!==!1&&(this.pos+=j[0].length),j)}},wi.prototype.current=function(){return this.string.slice(this.start,this.pos)},wi.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},wi.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},wi.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ct(e,n){if(n-=e.first,n<0||n>=e.size)throw new Error("There is no line "+(n+e.first)+" in the document.");for(var s=e;!s.lines;)for(var a=0;;++a){var p=s.children[a],j=p.chunkSize();if(n<j){s=p;break}n-=j}return s.lines[n]}function je(e,n,s){var a=[],p=n.line;return e.iter(n.line,s.line+1,function(j){var J=j.text;p==s.line&&(J=J.slice(0,s.ch)),p==n.line&&(J=J.slice(n.ch)),a.push(J),++p}),a}function It(e,n,s){var a=[];return e.iter(n,s,function(p){a.push(p.text)}),a}function Ne(e,n){var s=n-e.height;if(s)for(var a=e;a;a=a.parent)a.height+=s}function Ee(e){if(e.parent==null)return null;for(var n=e.parent,s=re(n.lines,e),a=n.parent;a;n=a,a=a.parent)for(var p=0;!(a.children[p]==n);++p)s+=a.children[p].chunkSize();return s+n.first}function ve(e,n){var s=e.first;e:do{for(var a=0;a<e.children.length;++a){var p=e.children[a],j=p.height;if(n<j){e=p;continue e}n-=j,s+=p.chunkSize()}return s}while(!e.lines);for(var J=0;J<e.lines.length;++J){var ie=e.lines[J],se=ie.height;if(n<se)break;n-=se}return s+J}function di(e,n){return n>=e.first&&n<e.first+e.size}function en(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function De(e,n,s){if(s===void 0&&(s=null),!(this instanceof De))return new De(e,n,s);this.line=e,this.ch=n,this.sticky=s}function ht(e,n){return e.line-n.line||e.ch-n.ch}function we(e,n){return e.sticky==n.sticky&&ht(e,n)==0}function un(e){return De(e.line,e.ch)}function fi(e,n){return ht(e,n)<0?n:e}function gi(e,n){return ht(e,n)<0?e:n}function q(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function C(e,n){if(n.line<e.first)return De(e.first,0);var s=e.first+e.size-1;return n.line>s?De(s,ct(e,s).text.length):L(n,ct(e,n.line).text.length)}function L(e,n){var s=e.ch;return s==null||s>n?De(e.line,n):s<0?De(e.line,0):e}function V(e,n){for(var s=[],a=0;a<n.length;a++)s[a]=C(e,n[a]);return s}var ae=function(e,n){this.state=e,this.lookAhead=n},Q=function(e,n,s,a){this.state=n,this.doc=e,this.line=s,this.maxLookAhead=a||0,this.baseTokens=null,this.baseTokenPos=1};Q.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Q.prototype.baseToken=function(e){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=e;)this.baseTokenPos+=2;var n=this.baseTokens[this.baseTokenPos+1];return{type:n&&n.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-e}},Q.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Q.fromSaved=function(e,n,s){return n instanceof ae?new Q(e,Oi(e.mode,n.state),s,n.lookAhead):new Q(e,Oi(e.mode,n),s)},Q.prototype.save=function(e){var n=e!==!1?Oi(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new ae(n,this.maxLookAhead):n};function Ae(e,n,s,a){var p=[e.state.modeGen],j={};jn(e,n.text,e.doc.mode,s,function(pe,Fe){return p.push(pe,Fe)},j,a);for(var J=s.state,ie=function(pe){s.baseTokens=p;var Fe=e.state.overlays[pe],ze=1,pt=0;s.state=!0,jn(e,n.text,Fe.mode,s,function(ut,Ut){for(var Qt=ze;pt<ut;){var fn=p[ze];fn>ut&&p.splice(ze,1,ut,p[ze+1],fn),ze+=2,pt=Math.min(ut,fn)}if(!Ut)return;if(Fe.opaque)p.splice(Qt,ze-Qt,ut,"overlay "+Ut),ze=Qt+2;else for(;Qt<ze;Qt+=2){var Fn=p[Qt+1];p[Qt+1]=(Fn?Fn+" ":"")+"overlay "+Ut}},j),s.state=J,s.baseTokens=null,s.baseTokenPos=1},se=0;se<e.state.overlays.length;++se)ie(se);return{styles:p,classes:j.bgClass||j.textClass?j:null}}function nt(e,n,s){if(!n.styles||n.styles[0]!=e.state.modeGen){var a=xt(e,Ee(n)),p=n.text.length>e.options.maxHighlightLength&&Oi(e.doc.mode,a.state),j=Ae(e,n,a);p&&(a.state=p),n.stateAfter=a.save(!p),n.styles=j.styles,j.classes?n.styleClasses=j.classes:n.styleClasses&&(n.styleClasses=null),s===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function xt(e,n,s){var a=e.doc,p=e.display;if(!a.mode.startState)return new Q(a,!0,n);var j=cn(e,n,s),J=j>a.first&&ct(a,j-1).stateAfter,ie=J?Q.fromSaved(a,J,j):new Q(a,Ni(a.mode),j);return a.iter(j,n,function(se){Dt(e,se.text,ie);var pe=ie.line;se.stateAfter=pe==n-1||pe%5==0||pe>=p.viewFrom&&pe<p.viewTo?ie.save():null,ie.nextLine()}),s&&(a.modeFrontier=ie.line),ie}function Dt(e,n,s,a){var p=e.doc.mode,j=new wi(n,e.options.tabSize,s);for(j.start=j.pos=a||0,n==""&&ot(p,s.state);!j.eol();)vt(p,j,s.state),j.start=j.pos}function ot(e,n){if(e.blankLine)return e.blankLine(n);if(!e.innerMode)return;var s=Ai(e,n);if(s.mode.blankLine)return s.mode.blankLine(s.state)}function vt(e,n,s,a){for(var p=0;p<10;p++){a&&(a[0]=Ai(e,s).mode);var j=e.token(n,s);if(n.pos>n.start)return j}throw new Error("Mode "+e.name+" failed to advance stream.")}var Lt=function(e,n,s){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=s};function wn(e,n,s,a){var p=e.doc,j=p.mode,J;n=C(p,n);var ie=ct(p,n.line),se=xt(e,n.line,s),pe=new wi(ie.text,e.options.tabSize,se),Fe;for(a&&(Fe=[]);(a||pe.pos<n.ch)&&!pe.eol();)pe.start=pe.pos,J=vt(j,pe,se.state),a&&Fe.push(new Lt(pe,J,Oi(p.mode,se.state)));return a?Fe:new Lt(pe,J,se.state)}function Xn(e,n){if(e)for(;;){var s=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!s)break;e=e.slice(0,s.index)+e.slice(s.index+s[0].length);var a=s[1]?"bgClass":"textClass";n[a]==null?n[a]=s[2]:new RegExp("(?:^|\\s)"+s[2]+"(?:$|\\s)").test(n[a])||(n[a]+=" "+s[2])}return e}function jn(e,n,s,a,p,j,J){var ie=s.flattenSpans;ie==null&&(ie=e.options.flattenSpans);var se=0,pe=null,Fe=new wi(n,e.options.tabSize,a),ze,pt=e.options.addModeClass&&[null];for(n==""&&Xn(ot(s,a.state),j);!Fe.eol();){if(Fe.pos>e.options.maxHighlightLength?(ie=!1,J&&Dt(e,n,a,Fe.pos),Fe.pos=n.length,ze=null):ze=Xn(vt(s,Fe,a.state,pt),j),pt){var ut=pt[0].name;ut&&(ze="m-"+(ze?ut+" "+ze:ut))}if(!ie||pe!=ze){for(;se<Fe.start;)se=Math.min(Fe.start,se+5e3),p(se,pe);pe=ze}Fe.start=Fe.pos}for(;se<Fe.pos;){var Ut=Math.min(Fe.pos,se+5e3);p(Ut,pe),se=Ut}}function cn(e,n,s){for(var a,p,j=e.doc,J=s?-1:n-(e.doc.mode.innerMode?1e3:100),ie=n;ie>J;--ie){if(ie<=j.first)return j.first;var se=ct(j,ie-1),pe=se.stateAfter;if(pe&&(!s||ie+(pe instanceof ae?pe.lookAhead:0)<=j.modeFrontier))return ie;var Fe=B(se.text,null,e.options.tabSize);(p==null||a>Fe)&&(p=ie-1,a=Fe)}return p}function jt(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),e.highlightFrontier<n-10)return;for(var s=e.first,a=n-1;a>s;a--){var p=ct(e,a).stateAfter;if(p&&(!(p instanceof ae)||a+p.lookAhead<n)){s=a+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,s)}var nn=!1,qt=!1;function Nt(){nn=!0}function $n(){qt=!0}function Un(e,n,s){this.marker=e,this.from=n,this.to=s}function xn(e,n){if(e)for(var s=0;s<e.length;++s){var a=e[s];if(a.marker==n)return a}}function Yn(e,n){for(var s,a=0;a<e.length;++a)e[a]!=n&&(s||(s=[])).push(e[a]);return s}function hn(e,n){e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],n.marker.attachLine(e)}function Tn(e,n,s){var a;if(e)for(var p=0;p<e.length;++p){var j=e[p],J=j.marker,ie=j.from==null||(J.inclusiveLeft?j.from<=n:j.from<n);if(ie||j.from==n&&J.type=="bookmark"&&(!s||!j.marker.insertLeft)){var se=j.to==null||(J.inclusiveRight?j.to>=n:j.to>n);(a||(a=[])).push(new Un(J,j.from,se?null:j.to))}}return a}function ln(e,n,s){var a;if(e)for(var p=0;p<e.length;++p){var j=e[p],J=j.marker,ie=j.to==null||(J.inclusiveRight?j.to>=n:j.to>n);if(ie||j.from==n&&J.type=="bookmark"&&(!s||j.marker.insertLeft)){var se=j.from==null||(J.inclusiveLeft?j.from<=n:j.from<n);(a||(a=[])).push(new Un(J,se?null:j.from-n,j.to==null?null:j.to-n))}}return a}function Mn(e,n){if(n.full)return null;var s=di(e,n.from.line)&&ct(e,n.from.line).markedSpans,a=di(e,n.to.line)&&ct(e,n.to.line).markedSpans;if(!s&&!a)return null;var p=n.from.ch,j=n.to.ch,J=ht(n.from,n.to)==0,ie=Tn(s,p,J),se=ln(a,j,J),pe=n.text.length==1,Fe=te(n.text).length+(pe?p:0);if(ie)for(var ze=0;ze<ie.length;++ze){var pt=ie[ze];if(pt.to==null){var ut=xn(se,pt.marker);ut?pe&&(pt.to=ut.to==null?null:ut.to+Fe):pt.to=p}}if(se)for(var Ut=0;Ut<se.length;++Ut){var Qt=se[Ut];if(Qt.to!=null&&(Qt.to+=Fe),Qt.from==null){var fn=xn(ie,Qt.marker);fn||(Qt.from=Fe,pe&&(ie||(ie=[])).push(Qt))}else Qt.from+=Fe,pe&&(ie||(ie=[])).push(Qt)}ie&&(ie=Vn(ie)),se&&se!=ie&&(se=Vn(se));var Fn=[ie];if(!pe){var oi=n.text.length-2,Bn;if(oi>0&&ie)for(var ci=0;ci<ie.length;++ci)ie[ci].to==null&&(Bn||(Bn=[])).push(new Un(ie[ci].marker,null,null));for(var Ri=0;Ri<oi;++Ri)Fn.push(Bn);Fn.push(se)}return Fn}function Vn(e){for(var n=0;n<e.length;++n){var s=e[n];s.from!=null&&s.from==s.to&&s.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function ni(e,n,s){var a=null;if(e.iter(n.line,s.line+1,function(ut){if(ut.markedSpans)for(var Ut=0;Ut<ut.markedSpans.length;++Ut){var Qt=ut.markedSpans[Ut].marker;Qt.readOnly&&(!a||re(a,Qt)==-1)&&(a||(a=[])).push(Qt)}}),!a)return null;for(var p=[{from:n,to:s}],j=0;j<a.length;++j)for(var J=a[j],ie=J.find(0),se=0;se<p.length;++se){var pe=p[se];if(ht(pe.to,ie.from)<0||ht(pe.from,ie.to)>0)continue;var Fe=[se,1],ze=ht(pe.from,ie.from),pt=ht(pe.to,ie.to);(ze<0||!J.inclusiveLeft&&!ze)&&Fe.push({from:pe.from,to:ie.from}),(pt>0||!J.inclusiveRight&&!pt)&&Fe.push({from:ie.to,to:pe.to}),p.splice.apply(p,Fe),se+=Fe.length-3}return p}function Pn(e){var n=e.markedSpans;if(!n)return;for(var s=0;s<n.length;++s)n[s].marker.detachLine(e);e.markedSpans=null}function Hn(e,n){if(!n)return;for(var s=0;s<n.length;++s)n[s].marker.attachLine(e);e.markedSpans=n}function tn(e){return e.inclusiveLeft?-1:0}function vn(e){return e.inclusiveRight?1:0}function Ln(e,n){var s=e.lines.length-n.lines.length;if(s!=0)return s;var a=e.find(),p=n.find(),j=ht(a.from,p.from)||tn(e)-tn(n);if(j)return-j;var J=ht(a.to,p.to)||vn(e)-vn(n);return J||n.id-e.id}function Cn(e,n){var s=qt&&e.markedSpans,a;if(s)for(var p=void 0,j=0;j<s.length;++j)p=s[j],p.marker.collapsed&&(n?p.from:p.to)==null&&(!a||Ln(a,p.marker)<0)&&(a=p.marker);return a}function Qn(e){return Cn(e,!0)}function _n(e){return Cn(e,!1)}function Gn(e,n){var s=qt&&e.markedSpans,a;if(s)for(var p=0;p<s.length;++p){var j=s[p];j.marker.collapsed&&(j.from==null||j.from<n)&&(j.to==null||j.to>n)&&(!a||Ln(a,j.marker)<0)&&(a=j.marker)}return a}function qn(e,n,s,a,p){var j=ct(e,n),J=qt&&j.markedSpans;if(J)for(var ie=0;ie<J.length;++ie){var se=J[ie];if(!se.marker.collapsed)continue;var pe=se.marker.find(0),Fe=ht(pe.from,s)||tn(se.marker)-tn(p),ze=ht(pe.to,a)||vn(se.marker)-vn(p);if(Fe>=0&&ze<=0||Fe<=0&&ze>=0)continue;if(Fe<=0&&(se.marker.inclusiveRight&&p.inclusiveLeft?ht(pe.to,s)>=0:ht(pe.to,s)>0)||Fe>=0&&(se.marker.inclusiveRight&&p.inclusiveLeft?ht(pe.from,a)<=0:ht(pe.from,a)<0))return!0}}function In(e){for(var n;n=Qn(e);)e=n.find(-1,!0).line;return e}function Dn(e){for(var n;n=_n(e);)e=n.find(1,!0).line;return e}function kn(e){for(var n,s;n=_n(e);)e=n.find(1,!0).line,(s||(s=[])).push(e);return s}function An(e,n){var s=ct(e,n),a=In(s);return s==a?n:Ee(a)}function sn(e,n){if(n>e.lastLine())return n;var s=ct(e,n),a;if(!Mt(e,s))return n;for(;a=_n(s);)s=a.find(1,!0).line;return Ee(s)+1}function Mt(e,n){var s=qt&&n.markedSpans;if(s)for(var a=void 0,p=0;p<s.length;++p){if(a=s[p],!a.marker.collapsed)continue;if(a.from==null)return!0;if(a.marker.widgetNode)continue;if(a.from==0&&a.marker.inclusiveLeft&&zt(e,n,a))return!0}}function zt(e,n,s){if(s.to==null){var a=s.marker.find(1,!0);return zt(e,a.line,xn(a.line.markedSpans,s.marker))}if(s.marker.inclusiveRight&&s.to==n.text.length)return!0;for(var p=void 0,j=0;j<n.markedSpans.length;++j)if(p=n.markedSpans[j],p.marker.collapsed&&!p.marker.widgetNode&&p.from==s.to&&(p.to==null||p.to!=s.from)&&(p.marker.inclusiveLeft||s.marker.inclusiveRight)&&zt(e,n,p))return!0}function Vt(e){e=In(e);for(var n=0,s=e.parent,a=0;a<s.lines.length;++a){var p=s.lines[a];if(p==e)break;n+=p.height}for(var j=s.parent;j;s=j,j=s.parent)for(var J=0;J<j.children.length;++J){var ie=j.children[J];if(ie==s)break;n+=ie.height}return n}function Bt(e){if(e.height==0)return 0;for(var n=e.text.length,s,a=e;s=Qn(a);){var p=s.find(0,!0);a=p.from.line,n+=p.from.ch-p.to.ch}for(a=e;s=_n(a);){var j=s.find(0,!0);n-=a.text.length-j.from.ch,a=j.to.line,n+=a.text.length-j.to.ch}return n}function Zt(e){var n=e.display,s=e.doc;n.maxLine=ct(s,s.first),n.maxLineLength=Bt(n.maxLine),n.maxLineChanged=!0,s.iter(function(a){var p=Bt(a);p>n.maxLineLength&&(n.maxLineLength=p,n.maxLine=a)})}var yn=function(e,n,s){this.text=e,Hn(this,n),this.height=s?s(this):1};yn.prototype.lineNo=function(){return Ee(this)},ke(yn);function pn(e,n,s,a){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Pn(e),Hn(e,s);var p=a?a(e):1;p!=e.height&&Ne(e,p)}function gt(e){e.parent=null,Pn(e)}var it={},Ve={};function qe(e,n){if(!e||/^\s*$/.test(e))return null;var s=n.addModeClass?Ve:it;return s[e]||(s[e]=e.replace(/\S+/g,"cm-$&"))}function We(e,n){var s=E("span",null,null,k?"padding-right: .1px":null),a={pre:E("pre",[s],"CodeMirror-line"),content:s,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var p=0;p<=(n.rest?n.rest.length:0);p++){var j=p?n.rest[p-1]:n.line,J=void 0;a.pos=0,a.addToken=Ze,ei(e.display.measure)&&(J=mn(j,e.doc.direction))&&(a.addToken=kt(a.addToken,J)),a.map=[];var ie=n!=e.display.externalMeasured&&Ee(j);Ht(j,a,nt(e,j,ie)),j.styleClasses&&(j.styleClasses.bgClass&&(a.bgClass=H(j.styleClasses.bgClass,a.bgClass||"")),j.styleClasses.textClass&&(a.textClass=H(j.styleClasses.textClass,a.textClass||""))),a.map.length==0&&a.map.push(0,0,a.content.appendChild(Gt(e.display.measure))),p==0?(n.measure.map=a.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(a.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(k){var se=a.content.lastChild;(/\bcm-tab\b/.test(se.className)||se.querySelector&&se.querySelector(".cm-tab"))&&(a.content.className="cm-tab-wrap-hack")}return Je(e,"renderLine",e,n.line,a.pre),a.pre.className&&(a.textClass=H(a.pre.className,a.textClass||"")),a}function dt(e){var n=d("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function Ze(e,n,s,a,p,j,J){if(!n)return;var ie=e.splitSpaces?wt(n,e.trailingSpace):n,se=e.cm.state.specialChars,pe=!1,Fe;if(!se.test(n))e.col+=n.length,Fe=document.createTextNode(ie),e.map.push(e.pos,e.pos+n.length,Fe),$&&X<9&&(pe=!0),e.pos+=n.length;else{Fe=document.createDocumentFragment();for(var ze=0;;){se.lastIndex=ze;var pt=se.exec(n),ut=pt?pt.index-ze:n.length-ze;if(ut){var Ut=document.createTextNode(ie.slice(ze,ze+ut));$&&X<9?Fe.appendChild(d("span",[Ut])):Fe.appendChild(Ut),e.map.push(e.pos,e.pos+ut,Ut),e.col+=ut,e.pos+=ut}if(!pt)break;ze+=ut+1;var Qt=void 0;if(pt[0]==" "){var fn=e.cm.options.tabSize,Fn=fn-e.col%fn;Qt=Fe.appendChild(d("span",ge(Fn),"cm-tab")),Qt.setAttribute("role","presentation"),Qt.setAttribute("cm-text"," "),e.col+=Fn}else pt[0]=="\r"||pt[0]==`
`?(Qt=Fe.appendChild(d("span",pt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Qt.setAttribute("cm-text",pt[0]),e.col+=1):(Qt=e.cm.options.specialCharPlaceholder(pt[0]),Qt.setAttribute("cm-text",pt[0]),$&&X<9?Fe.appendChild(d("span",[Qt])):Fe.appendChild(Qt),e.col+=1);e.map.push(e.pos,e.pos+1,Qt),e.pos++}}if(e.trailingSpace=ie.charCodeAt(n.length-1)==32,s||a||p||pe||j||J){var oi=s||"";a&&(oi+=a),p&&(oi+=p);var Bn=d("span",[Fe],oi,j);if(J)for(var ci in J)J.hasOwnProperty(ci)&&ci!="style"&&ci!="class"&&Bn.setAttribute(ci,J[ci]);return e.content.appendChild(Bn)}e.content.appendChild(Fe)}function wt(e,n){if(e.length>1&&!/ /.test(e))return e;for(var s=n,a="",p=0;p<e.length;p++){var j=e.charAt(p);j==" "&&s&&(p==e.length-1||e.charCodeAt(p+1)==32)&&(j="\xA0"),a+=j,s=j==" "}return a}function kt(e,n){return function(s,a,p,j,J,ie,se){p=p?p+" cm-force-border":"cm-force-border";for(var pe=s.pos,Fe=pe+a.length;;){for(var ze=void 0,pt=0;pt<n.length&&!(ze=n[pt],ze.to>pe&&ze.from<=pe);pt++);if(ze.to>=Fe)return e(s,a,p,j,J,ie,se);e(s,a.slice(0,ze.to-pe),p,j,null,ie,se),j=null,a=a.slice(ze.to-pe),pe=ze.to}}}function Tt(e,n,s,a){var p=!a&&s.widgetNode;p&&e.map.push(e.pos,e.pos+n,p),!a&&e.cm.display.input.needsContentAttribute&&(p||(p=e.content.appendChild(document.createElement("span"))),p.setAttribute("cm-marker",s.id)),p&&(e.cm.display.input.setUneditable(p),e.content.appendChild(p)),e.pos+=n,e.trailingSpace=!1}function Ht(e,n,s){var a=e.markedSpans,p=e.text,j=0;if(!a){for(var J=1;J<s.length;J+=2)n.addToken(n,p.slice(j,j=s[J]),qe(s[J+1],n.cm.options));return}for(var ie=p.length,se=0,pe=1,Fe="",ze,pt,ut=0,Ut,Qt,fn,Fn,oi;;){if(ut==se){Ut=Qt=fn=pt="",oi=null,Fn=null,ut=Infinity;for(var Bn=[],ci=void 0,Ri=0;Ri<a.length;++Ri){var Ci=a[Ri],Di=Ci.marker;if(Di.type=="bookmark"&&Ci.from==se&&Di.widgetNode)Bn.push(Di);else if(Ci.from<=se&&(Ci.to==null||Ci.to>se||Di.collapsed&&Ci.to==se&&Ci.from==se)){if(Ci.to!=null&&Ci.to!=se&&ut>Ci.to&&(ut=Ci.to,Qt=""),Di.className&&(Ut+=" "+Di.className),Di.css&&(pt=(pt?pt+";":"")+Di.css),Di.startStyle&&Ci.from==se&&(fn+=" "+Di.startStyle),Di.endStyle&&Ci.to==ut&&(ci||(ci=[])).push(Di.endStyle,Ci.to),Di.title&&((oi||(oi={})).title=Di.title),Di.attributes)for(var Wi in Di.attributes)(oi||(oi={}))[Wi]=Di.attributes[Wi];Di.collapsed&&(!Fn||Ln(Fn.marker,Di)<0)&&(Fn=Ci)}else Ci.from>se&&ut>Ci.from&&(ut=Ci.from)}if(ci)for(var ir=0;ir<ci.length;ir+=2)ci[ir+1]==ut&&(Qt+=" "+ci[ir]);if(!Fn||Fn.from==se)for(var zi=0;zi<Bn.length;++zi)Tt(n,0,Bn[zi]);if(Fn&&(Fn.from||0)==se){if(Tt(n,(Fn.to==null?ie+1:Fn.to)-se,Fn.marker,Fn.from==null),Fn.to==null)return;Fn.to==se&&(Fn=!1)}}if(se>=ie)break;for(var Er=Math.min(ie,ut);;){if(Fe){var gr=se+Fe.length;if(!Fn){var Qi=gr>Er?Fe.slice(0,Er-se):Fe;n.addToken(n,Qi,ze?ze+Ut:Ut,fn,se+Qi.length==ut?Qt:"",pt,oi)}if(gr>=Er){Fe=Fe.slice(Er-se),se=Er;break}se=gr,fn=""}Fe=p.slice(j,j=s[pe++]),ze=qe(s[pe++],n.cm.options)}}}function St(e,n,s){this.line=n,this.rest=kn(n),this.size=this.rest?Ee(te(this.rest))-s+1:1,this.node=this.text=null,this.hidden=Mt(e,n)}function Pt(e,n,s){for(var a=[],p,j=n;j<s;j=p){var J=new St(e.doc,ct(e.doc,j),j);p=j+J.size,a.push(J)}return a}var bn=null;function on(e){bn?bn.ops.push(e):e.ownsGroup=bn={ops:[e],delayedCallbacks:[]}}function vi(e){var n=e.delayedCallbacks,s=0;do{for(;s<n.length;s++)n[s].call(null);for(var a=0;a<e.ops.length;a++){var p=e.ops[a];if(p.cursorActivityHandlers)for(;p.cursorActivityCalled<p.cursorActivityHandlers.length;)p.cursorActivityHandlers[p.cursorActivityCalled++].call(null,p.cm)}}while(s<n.length)}function Jn(e,n){var s=e.ownsGroup;if(!s)return;try{vi(s)}finally{bn=null,n(s)}}var Zn=null;function Yt(e,n){var s=Ot(e,n);if(!s.length)return;var a=Array.prototype.slice.call(arguments,2),p;bn?p=bn.delayedCallbacks:Zn?p=Zn:(p=Zn=[],setTimeout(Sn,0));for(var j=function(ie){p.push(function(){return s[ie].apply(null,a)})},J=0;J<s.length;++J)j(J)}function Sn(){var e=Zn;Zn=null;for(var n=0;n<e.length;++n)e[n]()}function Kn(e,n,s,a){for(var p=0;p<n.changes.length;p++){var j=n.changes[p];j=="text"?ji(e,n):j=="gutter"?si(e,n,s,a):j=="class"?bi(e,n):j=="widget"&&Ei(e,n,a)}n.changes=null}function ii(e){return e.node==e.text&&(e.node=d("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),$&&X<8&&(e.node.style.zIndex=2)),e.node}function On(e,n){var s=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(s&&(s+=" CodeMirror-linebackground"),n.background)s?n.background.className=s:(n.background.parentNode.removeChild(n.background),n.background=null);else if(s){var a=ii(n);n.background=a.insertBefore(d("div",null,s),a.firstChild),e.display.input.setUneditable(n.background)}}function Li(e,n){var s=e.display.externalMeasured;return s&&s.line==n.line?(e.display.externalMeasured=null,n.measure=s.measure,s.built):We(e,n)}function ji(e,n){var s=n.text.className,a=Li(e,n);n.text==n.node&&(n.node=a.pre),n.text.parentNode.replaceChild(a.pre,n.text),n.text=a.pre,a.bgClass!=n.bgClass||a.textClass!=n.textClass?(n.bgClass=a.bgClass,n.textClass=a.textClass,bi(e,n)):s&&(n.text.className=s)}function bi(e,n){On(e,n),n.line.wrapClass?ii(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var s=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=s||""}function si(e,n,s,a){if(n.gutter&&(n.node.removeChild(n.gutter),n.gutter=null),n.gutterBackground&&(n.node.removeChild(n.gutterBackground),n.gutterBackground=null),n.line.gutterClass){var p=ii(n);n.gutterBackground=d("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?a.fixedPos:-a.gutterTotalWidth)+"px; width: "+a.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),p.insertBefore(n.gutterBackground,n.text)}var j=n.line.gutterMarkers;if(e.options.lineNumbers||j){var J=ii(n),ie=n.gutter=d("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?a.fixedPos:-a.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ie),J.insertBefore(ie,n.text),n.line.gutterClass&&(ie.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!j||!j["CodeMirror-linenumbers"])&&(n.lineNumber=ie.appendChild(d("div",en(e.options,s),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+a.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),j)for(var se=0;se<e.display.gutterSpecs.length;++se){var pe=e.display.gutterSpecs[se].className,Fe=j.hasOwnProperty(pe)&&j[pe];Fe&&ie.appendChild(d("div",[Fe],"CodeMirror-gutter-elt","left: "+a.gutterLeft[pe]+"px; width: "+a.gutterWidth[pe]+"px"))}}}function Ei(e,n,s){n.alignable&&(n.alignable=null);for(var a=R("CodeMirror-linewidget"),p=n.node.firstChild,j=void 0;p;p=j)j=p.nextSibling,a.test(p.className)&&n.node.removeChild(p);xi(e,n,s)}function yi(e,n,s,a){var p=Li(e,n);return n.text=n.node=p.pre,p.bgClass&&(n.bgClass=p.bgClass),p.textClass&&(n.textClass=p.textClass),bi(e,n),si(e,n,s,a),xi(e,n,a),n.node}function xi(e,n,s){if(Ui(e,n.line,n,s,!0),n.rest)for(var a=0;a<n.rest.length;a++)Ui(e,n.rest[a],n,s,!1)}function Ui(e,n,s,a,p){if(!n.widgets)return;for(var j=ii(s),J=0,ie=n.widgets;J<ie.length;++J){var se=ie[J],pe=d("div",[se.node],"CodeMirror-linewidget"+(se.className?" "+se.className:""));se.handleMouseEvents||pe.setAttribute("cm-ignore-events","true"),Vi(se,pe,s,a),e.display.input.setUneditable(pe),p&&se.above?j.insertBefore(pe,s.gutter||s.text):j.appendChild(pe),Yt(se,"redraw")}}function Vi(e,n,s,a){if(e.noHScroll){(s.alignable||(s.alignable=[])).push(n);var p=a.wrapperWidth;n.style.left=a.fixedPos+"px",e.coverGutter||(p-=a.gutterTotalWidth,n.style.paddingLeft=a.gutterTotalWidth+"px"),n.style.width=p+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-a.gutterTotalWidth+"px"))}function Fi(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!y(document.body,e.node)){var s="position: relative;";e.coverGutter&&(s+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(s+="width: "+n.display.wrapper.clientWidth+"px;"),u(n.display.measure,d("div",[e.node],null,s))}return e.height=e.node.parentNode.offsetHeight}function Ii(e,n){for(var s=Me(n);s!=e.wrapper;s=s.parentNode)if(!s||s.nodeType==1&&s.getAttribute("cm-ignore-events")=="true"||s.parentNode==e.sizer&&s!=e.mover)return!0}function Tr(e){return e.lineSpace.offsetTop}function Ki(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Sr(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=u(e.measure,d("pre","x","CodeMirror-line-like")),s=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,a={left:parseInt(s.paddingLeft),right:parseInt(s.paddingRight)};return!isNaN(a.left)&&!isNaN(a.right)&&(e.cachedPaddingH=a),a}function Ji(e){return de-e.display.nativeBarWidth}function er(e){return e.display.scroller.clientWidth-Ji(e)-e.display.barWidth}function yr(e){return e.display.scroller.clientHeight-Ji(e)-e.display.barHeight}function Or(e,n,s){var a=e.options.lineWrapping,p=a&&er(e);if(!n.measure.heights||a&&n.measure.width!=p){var j=n.measure.heights=[];if(a){n.measure.width=p;for(var J=n.text.firstChild.getClientRects(),ie=0;ie<J.length-1;ie++){var se=J[ie],pe=J[ie+1];Math.abs(se.bottom-pe.bottom)>2&&j.push((se.bottom+pe.top)/2-s.top)}}j.push(s.bottom-s.top)}}function Va(e,n,s){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};for(var a=0;a<e.rest.length;a++)if(e.rest[a]==n)return{map:e.measure.maps[a],cache:e.measure.caches[a]};for(var p=0;p<e.rest.length;p++)if(Ee(e.rest[p])>s)return{map:e.measure.maps[p],cache:e.measure.caches[p],before:!0}}function fr(e,n){n=In(n);var s=Ee(n),a=e.display.externalMeasured=new St(e.doc,n,s);a.lineN=s;var p=a.built=We(e,a);return a.text=p.pre,u(e.display.lineMeasure,p.pre),a}function Xa(e,n,s,a){return ar(e,kr(e,n),s,a)}function Kr(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[zr(e,n)];var s=e.display.externalMeasured;if(s&&n>=s.lineN&&n<s.lineN+s.size)return s}function kr(e,n){var s=Ee(n),a=Kr(e,s);a&&!a.text?a=null:a&&a.changes&&(Kn(e,a,s,Do(e)),e.curOp.forceUpdate=!0),a||(a=fr(e,n));var p=Va(a,n,s);return{line:n,view:a,rect:null,map:p.map,cache:p.cache,before:p.before,hasHeights:!1}}function ar(e,n,s,a,p){n.before&&(s=-1);var j=s+(a||""),J;return n.cache.hasOwnProperty(j)?J=n.cache[j]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Or(e,n.view,n.rect),n.hasHeights=!0),J=xo(e,n,s,a),J.bogus||(n.cache[j]=J)),{left:J.left,right:J.right,top:p?J.rtop:J.top,bottom:p?J.rbottom:J.bottom}}var qr={left:0,right:0,top:0,bottom:0};function bo(e,n,s){for(var a,p,j,J,ie,se,pe=0;pe<e.length;pe+=3)if(ie=e[pe],se=e[pe+1],n<ie?(p=0,j=1,J="left"):n<se?(p=n-ie,j=p+1):(pe==e.length-3||n==se&&e[pe+3]>n)&&(j=se-ie,p=j-1,n>=se&&(J="right")),p!=null){if(a=e[pe+2],ie==se&&s==(a.insertLeft?"left":"right")&&(J=s),s=="left"&&p==0)for(;pe&&e[pe-2]==e[pe-3]&&e[pe-1].insertLeft;)a=e[(pe-=3)+2],J="left";if(s=="right"&&p==se-ie)for(;pe<e.length-3&&e[pe+3]==e[pe+4]&&!e[pe+5].insertLeft;)a=e[(pe+=3)+2],J="right";break}return{node:a,start:p,end:j,collapse:J,coverStart:ie,coverEnd:se}}function Eo(e,n){var s=qr;if(n=="left")for(var a=0;a<e.length&&!((s=e[a]).left!=s.right);a++);else for(var p=e.length-1;p>=0&&!((s=e[p]).left!=s.right);p--);return s}function xo(e,n,s,a){var p=bo(n.map,s,a),j=p.node,J=p.start,ie=p.end,se=p.collapse,pe;if(j.nodeType==3){for(var Fe=0;Fe<4;Fe++){for(;J&&_t(n.line.text.charAt(p.coverStart+J));)--J;for(;p.coverStart+ie<p.coverEnd&&_t(n.line.text.charAt(p.coverStart+ie));)++ie;if($&&X<9&&J==0&&ie==p.coverEnd-p.coverStart?pe=j.parentNode.getBoundingClientRect():pe=Eo(g(j,J,ie).getClientRects(),a),pe.left||pe.right||J==0)break;ie=J,J=J-1,se="right"}$&&X<11&&(pe=cs(e.display.measure,pe))}else{J>0&&(se=a="right");var ze;e.options.lineWrapping&&(ze=j.getClientRects()).length>1?pe=ze[a=="right"?ze.length-1:0]:pe=j.getBoundingClientRect()}if($&&X<9&&!J&&(!pe||!pe.left&&!pe.right)){var pt=j.parentNode.getClientRects()[0];pt?pe={left:pt.left,right:pt.left+Zr(e.display),top:pt.top,bottom:pt.bottom}:pe=qr}for(var ut=pe.top-n.rect.top,Ut=pe.bottom-n.rect.top,Qt=(ut+Ut)/2,fn=n.view.measure.heights,Fn=0;Fn<fn.length-1&&!(Qt<fn[Fn]);Fn++);var oi=Fn?fn[Fn-1]:0,Bn=fn[Fn],ci={left:(se=="right"?pe.right:pe.left)-n.rect.left,right:(se=="left"?pe.left:pe.right)-n.rect.left,top:oi,bottom:Bn};return!pe.left&&!pe.right&&(ci.bogus=!0),e.options.singleCursorHeightPerLine||(ci.rtop=ut,ci.rbottom=Ut),ci}function cs(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!pi(e))return n;var s=screen.logicalXDPI/screen.deviceXDPI,a=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*s,right:n.right*s,top:n.top*a,bottom:n.bottom*a}}function hs(e){if(e.measure&&(e.measure.cache={},e.measure.heights=null,e.rest))for(var n=0;n<e.rest.length;n++)e.measure.caches[n]={}}function Co(e){e.display.externalMeasure=null,_(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)hs(e.display.view[n])}function wa(e){Co(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function fs(){return m&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ps(){return m&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function wo(e){var n=0;if(e.widgets)for(var s=0;s<e.widgets.length;++s)e.widgets[s].above&&(n+=Fi(e.widgets[s]));return n}function $a(e,n,s,a,p){if(!p){var j=wo(n);s.top+=j,s.bottom+=j}if(a=="line")return s;a||(a="local");var J=Vt(n);if(a=="local"?J+=Tr(e.display):J-=e.display.viewOffset,a=="page"||a=="window"){var ie=e.display.lineSpace.getBoundingClientRect();J+=ie.top+(a=="window"?0:ps());var se=ie.left+(a=="window"?0:fs());s.left+=se,s.right+=se}return s.top+=J,s.bottom+=J,s}function To(e,n,s){if(s=="div")return n;var a=n.left,p=n.top;if(s=="page")a-=fs(),p-=ps();else if(s=="local"||!s){var j=e.display.sizer.getBoundingClientRect();a+=j.left,p+=j.top}var J=e.display.lineSpace.getBoundingClientRect();return{left:a-J.left,top:p-J.top}}function So(e,n,s,a,p){return a||(a=ct(e.doc,n.line)),$a(e,a,Xa(e,a,n.ch,p),s)}function xr(e,n,s,a,p,j){a=a||ct(e.doc,n.line),p||(p=kr(e,a));function J(Ut,Qt){var fn=ar(e,p,Ut,Qt?"right":"left",j);return Qt?fn.left=fn.right:fn.right=fn.left,$a(e,a,fn,s)}var ie=mn(a,e.doc.direction),se=n.ch,pe=n.sticky;if(se>=a.text.length?(se=a.text.length,pe="before"):se<=0&&(se=0,pe="after"),!ie)return J(pe=="before"?se-1:se,pe=="before");function Fe(Ut,Qt,fn){var Fn=ie[Qt],oi=Fn.level==1;return J(fn?Ut-1:Ut,oi!=fn)}var ze=rn(ie,se,pe),pt=Jt,ut=Fe(se,ze,pe=="before");return pt!=null&&(ut.other=Fe(se,pt,pe!="before")),ut}function ms(e,n){var s=0;n=C(e.doc,n),e.options.lineWrapping||(s=Zr(e.display)*n.ch);var a=ct(e.doc,n.line),p=Vt(a)+Tr(e.display);return{left:s,right:s,top:p,bottom:p+a.height}}function Oo(e,n,s,a,p){var j=De(e,n,s);return j.xRel=p,a&&(j.outside=a),j}function Ro(e,n,s){var a=e.doc;if(s+=e.display.viewOffset,s<0)return Oo(a.first,0,null,-1,-1);var p=ve(a,s),j=a.first+a.size-1;if(p>j)return Oo(a.first+a.size-1,ct(a,j).text.length,null,1,1);n<0&&(n=0);for(var J=ct(a,p);;){var ie=El(e,J,p,n,s),se=Gn(J,ie.ch+(ie.xRel>0||ie.outside>0?1:0));if(!se)return ie;var pe=se.find(1);if(pe.line==p)return pe;J=ct(a,p=pe.line)}}function gs(e,n,s,a){a-=wo(n);var p=n.text.length,j=Ft(function(J){return ar(e,s,J-1).bottom<=a},p,0);return p=Ft(function(J){return ar(e,s,J).top>a},j,p),{begin:j,end:p}}function vs(e,n,s,a){s||(s=kr(e,n));var p=$a(e,n,ar(e,s,a),"line").top;return gs(e,n,s,p)}function Ao(e,n,s,a){return e.bottom<=s?!1:e.top>s?!0:(a?e.left:e.right)>n}function El(e,n,s,a,p){p-=Vt(n);var j=kr(e,n),J=wo(n),ie=0,se=n.text.length,pe=!0,Fe=mn(n,e.doc.direction);if(Fe){var ze=(e.options.lineWrapping?Ya:Ta)(e,n,s,j,Fe,a,p);pe=ze.level!=1,ie=pe?ze.from:ze.to-1,se=pe?ze.to:ze.from-1}var pt=null,ut=null,Ut=Ft(function(Ri){var Ci=ar(e,j,Ri);return Ci.top+=J,Ci.bottom+=J,Ao(Ci,a,p,!1)?(Ci.top<=p&&Ci.left<=a&&(pt=Ri,ut=Ci),!0):!1},ie,se),Qt,fn,Fn=!1;if(ut){var oi=a-ut.left<ut.right-a,Bn=oi==pe;Ut=pt+(Bn?0:1),fn=Bn?"after":"before",Qt=oi?ut.left:ut.right}else{!pe&&(Ut==se||Ut==ie)&&Ut++,fn=Ut==0?"after":Ut==n.text.length?"before":ar(e,j,Ut-(pe?1:0)).bottom+J<=p==pe?"after":"before";var ci=xr(e,De(s,Ut,fn),"line",n,j);Qt=ci.left,Fn=p<ci.top?-1:p>=ci.bottom?1:0}return Ut=lt(n.text,Ut,1),Oo(s,Ut,fn,Fn,a-Qt)}function Ta(e,n,s,a,p,j,J){var ie=Ft(function(ze){var pt=p[ze],ut=pt.level!=1;return Ao(xr(e,De(s,ut?pt.to:pt.from,ut?"before":"after"),"line",n,a),j,J,!0)},0,p.length-1),se=p[ie];if(ie>0){var pe=se.level!=1,Fe=xr(e,De(s,pe?se.from:se.to,pe?"after":"before"),"line",n,a);Ao(Fe,j,J,!0)&&Fe.top>J&&(se=p[ie-1])}return se}function Ya(e,n,s,a,p,j,J){var ie=gs(e,n,a,J),se=ie.begin,pe=ie.end;/\s/.test(n.text.charAt(pe-1))&&pe--;for(var Fe=null,ze=null,pt=0;pt<p.length;pt++){var ut=p[pt];if(ut.from>=pe||ut.to<=se)continue;var Ut=ut.level!=1,Qt=ar(e,a,Ut?Math.min(pe,ut.to)-1:Math.max(se,ut.from)).right,fn=Qt<j?j-Qt+1e9:Qt-j;(!Fe||ze>fn)&&(Fe=ut,ze=fn)}return Fe||(Fe=p[p.length-1]),Fe.from<se&&(Fe={from:se,to:Fe.to,level:Fe.level}),Fe.to>pe&&(Fe={from:Fe.from,to:pe,level:Fe.level}),Fe}var Rr;function Jr(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Rr==null){Rr=d("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)Rr.appendChild(document.createTextNode("x")),Rr.appendChild(d("br"));Rr.appendChild(document.createTextNode("x"))}u(e.measure,Rr);var s=Rr.offsetHeight/50;return s>3&&(e.cachedTextHeight=s),_(e.measure),s||1}function Zr(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=d("span","xxxxxxxxxx"),s=d("pre",[n],"CodeMirror-line-like");u(e.measure,s);var a=n.getBoundingClientRect(),p=(a.right-a.left)/10;return p>2&&(e.cachedCharWidth=p),p||10}function Do(e){for(var n=e.display,s={},a={},p=n.gutters.clientLeft,j=n.gutters.firstChild,J=0;j;j=j.nextSibling,++J){var ie=e.display.gutterSpecs[J].className;s[ie]=j.offsetLeft+j.clientLeft+p,a[ie]=j.clientWidth}return{fixedPos:Po(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:s,gutterWidth:a,wrapperWidth:n.wrapper.clientWidth}}function Po(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function _s(e){var n=Jr(e.display),s=e.options.lineWrapping,a=s&&Math.max(5,e.display.scroller.clientWidth/Zr(e.display)-3);return function(p){if(Mt(e.doc,p))return 0;var j=0;if(p.widgets)for(var J=0;J<p.widgets.length;J++)p.widgets[J].height&&(j+=p.widgets[J].height);return s?j+(Math.ceil(p.text.length/a)||1)*n:j+n}}function Lo(e){var n=e.doc,s=_s(e);n.iter(function(a){var p=s(a);p!=a.height&&Ne(a,p)})}function Gr(e,n,s,a){var p=e.display;if(!s&&Me(n).getAttribute("cm-not-content")=="true")return null;var j,J,ie=p.lineSpace.getBoundingClientRect();try{j=n.clientX-ie.left,J=n.clientY-ie.top}catch(ze){return null}var se=Ro(e,j,J),pe;if(a&&se.xRel>0&&(pe=ct(e.doc,se.line).text).length==se.ch){var Fe=B(pe,pe.length,e.options.tabSize)-pe.length;se=De(se.line,Math.max(0,Math.round((j-Sr(e.display).left)/Zr(e.display))-Fe))}return se}function zr(e,n){if(n>=e.display.viewTo)return null;if(n-=e.display.viewFrom,n<0)return null;for(var s=e.display.view,a=0;a<s.length;a++)if(n-=s[a].size,n<0)return a}function lr(e,n,s,a){n==null&&(n=e.doc.first),s==null&&(s=e.doc.first+e.doc.size),a||(a=0);var p=e.display;if(a&&s<p.viewTo&&(p.updateLineNumbers==null||p.updateLineNumbers>n)&&(p.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=p.viewTo)qt&&An(e.doc,n)<p.viewTo&&Nr(e);else if(s<=p.viewFrom)qt&&sn(e.doc,s+a)>p.viewFrom?Nr(e):(p.viewFrom+=a,p.viewTo+=a);else if(n<=p.viewFrom&&s>=p.viewTo)Nr(e);else if(n<=p.viewFrom){var j=ea(e,s,s+a,1);j?(p.view=p.view.slice(j.index),p.viewFrom=j.lineN,p.viewTo+=a):Nr(e)}else if(s>=p.viewTo){var J=ea(e,n,n,-1);J?(p.view=p.view.slice(0,J.index),p.viewTo=J.lineN):Nr(e)}else{var ie=ea(e,n,n,-1),se=ea(e,s,s+a,1);ie&&se?(p.view=p.view.slice(0,ie.index).concat(Pt(e,ie.lineN,se.lineN)).concat(p.view.slice(se.index)),p.viewTo+=a):Nr(e)}var pe=p.externalMeasured;pe&&(s<pe.lineN?pe.lineN+=a:n<pe.lineN+pe.size&&(p.externalMeasured=null))}function Mr(e,n,s){e.curOp.viewChanged=!0;var a=e.display,p=e.display.externalMeasured;if(p&&n>=p.lineN&&n<p.lineN+p.size&&(a.externalMeasured=null),n<a.viewFrom||n>=a.viewTo)return;var j=a.view[zr(e,n)];if(j.node==null)return;var J=j.changes||(j.changes=[]);re(J,s)==-1&&J.push(s)}function Nr(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ea(e,n,s,a){var p=zr(e,n),j,J=e.display.view;if(!qt||s==e.doc.first+e.doc.size)return{index:p,lineN:s};for(var ie=e.display.viewFrom,se=0;se<p;se++)ie+=J[se].size;if(ie!=n){if(a>0){if(p==J.length-1)return null;j=ie+J[p].size-n,p++}else j=ie-n;n+=j,s+=j}for(;An(e.doc,s)!=s;){if(p==(a<0?0:J.length-1))return null;s+=a*J[p-(a<0?1:0)].size,p+=a}return{index:p,lineN:s}}function xl(e,n,s){var a=e.display,p=a.view;p.length==0||n>=a.viewTo||s<=a.viewFrom?(a.view=Pt(e,n,s),a.viewFrom=n):(a.viewFrom>n?a.view=Pt(e,n,a.viewFrom).concat(a.view):a.viewFrom<n&&(a.view=a.view.slice(zr(e,n))),a.viewFrom=n,a.viewTo<s?a.view=a.view.concat(Pt(e,a.viewTo,s)):a.viewTo>s&&(a.view=a.view.slice(0,zr(e,s)))),a.viewTo=s}function Io(e){for(var n=e.display.view,s=0,a=0;a<n.length;a++){var p=n[a];!p.hidden&&(!p.node||p.changes)&&++s}return s}function ta(e){e.display.input.showSelection(e.display.input.prepareSelection())}function ko(e,n){n===void 0&&(n=!0);for(var s=e.doc,a={},p=a.cursors=document.createDocumentFragment(),j=a.selection=document.createDocumentFragment(),J=0;J<s.sel.ranges.length;J++){if(!n&&J==s.sel.primIndex)continue;var ie=s.sel.ranges[J];if(ie.from().line>=e.display.viewTo||ie.to().line<e.display.viewFrom)continue;var se=ie.empty();(se||e.options.showCursorWhenSelecting)&&ys(e,ie.head,p),se||bs(e,ie,j)}return a}function ys(e,n,s){var a=xr(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),p=s.appendChild(d("div","\xA0","CodeMirror-cursor"));if(p.style.left=a.left+"px",p.style.top=a.top+"px",p.style.height=Math.max(0,a.bottom-a.top)*e.options.cursorHeight+"px",a.other){var j=s.appendChild(d("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));j.style.display="",j.style.left=a.other.left+"px",j.style.top=a.other.top+"px",j.style.height=(a.other.bottom-a.other.top)*.85+"px"}}function Qa(e,n){return e.top-n.top||e.left-n.left}function bs(e,n,s){var a=e.display,p=e.doc,j=document.createDocumentFragment(),J=Sr(e.display),ie=J.left,se=Math.max(a.sizerWidth,er(e)-a.sizer.offsetLeft)-J.right,pe=p.direction=="ltr";function Fe(Bn,ci,Ri,Ci){ci<0&&(ci=0),ci=Math.round(ci),Ci=Math.round(Ci),j.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+Bn+`px;
top: `+ci+"px; width: "+(Ri==null?se-Bn:Ri)+`px;
height: `+(Ci-ci)+"px"))}function ze(Bn,ci,Ri){var Ci=ct(p,Bn),Di=Ci.text.length,Wi,ir;function zi(Qi,vr){return So(e,De(Bn,Qi),"div",Ci,vr)}function Er(Qi,vr,sr){var Zi=vs(e,Ci,null,Qi),qi=vr=="ltr"==(sr=="after")?"left":"right",Xi=sr=="after"?Zi.begin:Zi.end-(/\s/.test(Ci.text.charAt(Zi.end-1))?2:1);return zi(Xi,qi)[qi]}var gr=mn(Ci,p.direction);return Xt(gr,ci||0,Ri==null?Di:Ri,function(Qi,vr,sr,Zi){var qi=sr=="ltr",Xi=zi(Qi,qi?"left":"right"),_r=zi(vr-1,qi?"right":"left"),_o=ci==null&&Qi==0,Ca=Ri==null&&vr==Di,dr=Zi==0,Hr=!gr||Zi==gr.length-1;if(_r.top-Xi.top<=3){var rr=(pe?_o:Ca)&&dr,nu=(pe?Ca:_o)&&Hr,Qr=rr?ie:(qi?Xi:_r).left,Ga=nu?se:(qi?_r:Xi).right;Fe(Qr,Xi.top,Ga-Qr,Xi.bottom)}else{var za,hr,yo,iu;qi?(za=pe&&_o&&dr?ie:Xi.left,hr=pe?se:Er(Qi,sr,"before"),yo=pe?ie:Er(vr,sr,"after"),iu=pe&&Ca&&Hr?se:_r.right):(za=pe?Er(Qi,sr,"before"):ie,hr=!pe&&_o&&dr?se:Xi.right,yo=!pe&&Ca&&Hr?ie:_r.left,iu=pe?Er(vr,sr,"after"):se),Fe(za,Xi.top,hr-za,Xi.bottom),Xi.bottom<_r.top&&Fe(ie,Xi.bottom,null,_r.top),Fe(yo,_r.top,iu-yo,_r.bottom)}(!Wi||Qa(Xi,Wi)<0)&&(Wi=Xi),Qa(_r,Wi)<0&&(Wi=_r),(!ir||Qa(Xi,ir)<0)&&(ir=Xi),Qa(_r,ir)<0&&(ir=_r)}),{start:Wi,end:ir}}var pt=n.from(),ut=n.to();if(pt.line==ut.line)ze(pt.line,pt.ch,ut.ch);else{var Ut=ct(p,pt.line),Qt=ct(p,ut.line),fn=In(Ut)==In(Qt),Fn=ze(pt.line,pt.ch,fn?Ut.text.length+1:null).end,oi=ze(ut.line,fn?0:null,ut.ch).start;fn&&(Fn.top<oi.top-2?(Fe(Fn.right,Fn.top,null,Fn.bottom),Fe(ie,oi.top,oi.left,oi.bottom)):Fe(Fn.right,Fn.top,oi.left-Fn.right,Fn.bottom)),Fn.bottom<oi.top&&Fe(ie,Fn.bottom,null,oi.top)}s.appendChild(j)}function Mo(e){if(!e.state.focused)return;var n=e.display;clearInterval(n.blinker);var s=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||na(e),n.cursorDiv.style.visibility=(s=!s)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}function No(e){e.state.focused||(e.display.input.focus(),Uo(e))}function Es(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,na(e))},100)}function Uo(e,n){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(Je(e,"focus",e,n),e.state.focused=!0,N(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),k&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),Mo(e)}function na(e,n){if(e.state.delayingBlurEvent)return;e.state.focused&&(Je(e,"blur",e,n),e.state.focused=!1,b(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function qa(e){for(var n=e.display,s=n.lineDiv.offsetTop,a=0;a<n.view.length;a++){var p=n.view[a],j=e.options.lineWrapping,J=void 0,ie=0;if(p.hidden)continue;if($&&X<8){var se=p.node.offsetTop+p.node.offsetHeight;J=se-s,s=se}else{var pe=p.node.getBoundingClientRect();J=pe.bottom-pe.top,!j&&p.text.firstChild&&(ie=p.text.firstChild.getBoundingClientRect().right-pe.left-1)}var Fe=p.line.height-J;if((Fe>.005||Fe<-.005)&&(Ne(p.line,J),Ar(p.line),p.rest))for(var ze=0;ze<p.rest.length;ze++)Ar(p.rest[ze]);if(ie>e.display.sizerWidth){var pt=Math.ceil(ie/Zr(e.display));pt>e.display.maxLineLength&&(e.display.maxLineLength=pt,e.display.maxLine=p.line,e.display.maxLineChanged=!0)}}}function Ar(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var s=e.widgets[n],a=s.node.parentNode;a&&(s.height=a.offsetHeight)}}function Ja(e,n,s){var a=s&&s.top!=null?Math.max(0,s.top):e.scroller.scrollTop;a=Math.floor(a-Tr(e));var p=s&&s.bottom!=null?s.bottom:a+e.wrapper.clientHeight,j=ve(n,a),J=ve(n,p);if(s&&s.ensure){var ie=s.ensure.from.line,se=s.ensure.to.line;ie<j?(j=ie,J=ve(n,Vt(ct(n,ie))+e.wrapper.clientHeight)):Math.min(se,n.lastLine())>=J&&(j=ve(n,Vt(ct(n,se))-e.wrapper.clientHeight),J=se)}return{from:j,to:Math.max(J,j+1)}}function xs(e,n){if(mt(e,"scrollCursorIntoView"))return;var s=e.display,a=s.sizer.getBoundingClientRect(),p=null;if(n.top+a.top<0?p=!0:n.bottom+a.top>(window.innerHeight||document.documentElement.clientHeight)&&(p=!1),p!=null&&!l){var j=d("div","\u200B",null,`position: absolute;
top: `+(n.top-s.viewOffset-Tr(e.display))+`px;
height: `+(n.bottom-n.top+Ji(e)+s.barHeight)+`px;
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(j),j.scrollIntoView(p),e.display.lineSpace.removeChild(j)}}function Fo(e,n,s,a){a==null&&(a=0);var p;!e.options.lineWrapping&&n==s&&(n=n.ch?De(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n,s=n.sticky=="before"?De(n.line,n.ch+1,"before"):n);for(var j=0;j<5;j++){var J=!1,ie=xr(e,n),se=!s||s==n?ie:xr(e,s);p={left:Math.min(ie.left,se.left),top:Math.min(ie.top,se.top)-a,right:Math.max(ie.left,se.left),bottom:Math.max(ie.bottom,se.bottom)+a};var pe=Za(e,p),Fe=e.doc.scrollTop,ze=e.doc.scrollLeft;if(pe.scrollTop!=null&&(aa(e,pe.scrollTop),Math.abs(e.doc.scrollTop-Fe)>1&&(J=!0)),pe.scrollLeft!=null&&(Dr(e,pe.scrollLeft),Math.abs(e.doc.scrollLeft-ze)>1&&(J=!0)),!J)break}return p}function Cl(e,n){var s=Za(e,n);s.scrollTop!=null&&aa(e,s.scrollTop),s.scrollLeft!=null&&Dr(e,s.scrollLeft)}function Za(e,n){var s=e.display,a=Jr(e.display);n.top<0&&(n.top=0);var p=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:s.scroller.scrollTop,j=yr(e),J={};n.bottom-n.top>j&&(n.bottom=n.top+j);var ie=e.doc.height+Ki(s),se=n.top<a,pe=n.bottom>ie-a;if(n.top<p)J.scrollTop=se?0:n.top;else if(n.bottom>p+j){var Fe=Math.min(n.top,(pe?ie:n.bottom)-j);Fe!=p&&(J.scrollTop=Fe)}var ze=e.options.fixedGutter?0:s.gutters.offsetWidth,pt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:s.scroller.scrollLeft-ze,ut=er(e)-s.gutters.offsetWidth,Ut=n.right-n.left>ut;return Ut&&(n.right=n.left+ut),n.left<10?J.scrollLeft=0:n.left<pt?J.scrollLeft=Math.max(0,n.left+ze-(Ut?0:10)):n.right>ut+pt-3&&(J.scrollLeft=n.right+(Ut?0:10)-ut),J}function eo(e,n){if(n==null)return;to(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n}function ia(e){to(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function ra(e,n,s){(n!=null||s!=null)&&to(e),n!=null&&(e.curOp.scrollLeft=n),s!=null&&(e.curOp.scrollTop=s)}function Cs(e,n){to(e),e.curOp.scrollToPos=n}function to(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var s=ms(e,n.from),a=ms(e,n.to);ws(e,s,a,n.margin)}}function ws(e,n,s,a){var p=Za(e,{left:Math.min(n.left,s.left),top:Math.min(n.top,s.top)-a,right:Math.max(n.right,s.right),bottom:Math.max(n.bottom,s.bottom)+a});ra(e,p.scrollLeft,p.scrollTop)}function aa(e,n){if(Math.abs(e.doc.scrollTop-n)<2)return;U||Wo(e,{top:n}),Ts(e,n,!0),U&&Wo(e),tr(e,100)}function Ts(e,n,s){if(n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),e.display.scroller.scrollTop==n&&!s)return;e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n)}function Dr(e,n,s,a){if(n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(s?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!a)return;e.doc.scrollLeft=n,Is(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n)}function oa(e){var n=e.display,s=n.gutters.offsetWidth,a=Math.round(e.doc.height+Ki(e.display));return{clientHeight:n.scroller.clientHeight,viewHeight:n.wrapper.clientHeight,scrollWidth:n.scroller.scrollWidth,clientWidth:n.scroller.clientWidth,viewWidth:n.wrapper.clientWidth,barLeft:e.options.fixedGutter?s:0,docHeight:a,scrollHeight:a+Ji(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:s}}var Pr=function(e,n,s){this.cm=s;var a=this.vert=d("div",[d("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),p=this.horiz=d("div",[d("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");a.tabIndex=p.tabIndex=-1,e(a),e(p),Xe(a,"scroll",function(){a.clientHeight&&n(a.scrollTop,"vertical")}),Xe(p,"scroll",function(){p.clientWidth&&n(p.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,$&&X<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Pr.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,s=e.scrollHeight>e.clientHeight+1,a=e.nativeBarWidth;if(s){this.vert.style.display="block",this.vert.style.bottom=n?a+"px":"0";var p=e.viewHeight-(n?a:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+p)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=s?a+"px":"0",this.horiz.style.left=e.barLeft+"px";var j=e.viewWidth-e.barLeft-(s?a:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+j)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(a==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:s?a:0,bottom:n?a:0}},Pr.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Pr.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Pr.prototype.zeroWidthHack=function(){var e=c&&!o?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Y,this.disableVert=new Y},Pr.prototype.enableZeroWidthBar=function(e,n,s){e.style.pointerEvents="auto";function a(){var p=e.getBoundingClientRect(),j=s=="vert"?document.elementFromPoint(p.right-1,(p.top+p.bottom)/2):document.elementFromPoint((p.right+p.left)/2,p.bottom-1);j!=e?e.style.pointerEvents="none":n.set(1e3,a)}n.set(1e3,a)},Pr.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sa=function(){};Sa.prototype.update=function(){return{bottom:0,right:0}},Sa.prototype.setScrollLeft=function(){},Sa.prototype.setScrollTop=function(){},Sa.prototype.clear=function(){};function Ur(e,n){n||(n=oa(e));var s=e.display.barWidth,a=e.display.barHeight;Ss(e,n);for(var p=0;p<4&&s!=e.display.barWidth||a!=e.display.barHeight;p++)s!=e.display.barWidth&&e.options.lineWrapping&&qa(e),Ss(e,oa(e)),s=e.display.barWidth,a=e.display.barHeight}function Ss(e,n){var s=e.display,a=s.scrollbars.update(n);s.sizer.style.paddingRight=(s.barWidth=a.right)+"px",s.sizer.style.paddingBottom=(s.barHeight=a.bottom)+"px",s.heightForcer.style.borderBottom=a.bottom+"px solid transparent",a.right&&a.bottom?(s.scrollbarFiller.style.display="block",s.scrollbarFiller.style.height=a.bottom+"px",s.scrollbarFiller.style.width=a.right+"px"):s.scrollbarFiller.style.display="",a.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(s.gutterFiller.style.display="block",s.gutterFiller.style.height=a.bottom+"px",s.gutterFiller.style.width=n.gutterWidth+"px"):s.gutterFiller.style.display=""}var Os={native:Pr,null:Sa};function Rs(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&b(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Os[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),Xe(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,s){s=="horizontal"?Dr(e,n):aa(e,n)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var As=0;function Vr(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:++As},on(e.curOp)}function Xr(e){var n=e.curOp;n&&Jn(n,function(s){for(var a=0;a<s.ops.length;a++)s.ops[a].cm.curOp=null;wl(s)})}function wl(e){for(var n=e.ops,s=0;s<n.length;s++)sa(n[s]);for(var a=0;a<n.length;a++)la(n[a]);for(var p=0;p<n.length;p++)Bo(n[p]);for(var j=0;j<n.length;j++)Tl(n[j]);for(var J=0;J<n.length;J++)Ds(n[J])}function sa(e){var n=e.cm,s=n.display;Sl(n),e.updateMaxLine&&Zt(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<s.viewFrom||e.scrollToPos.to.line>=s.viewTo)||s.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new Oa(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function la(e){e.updatedDisplay=e.mustUpdate&&no(e.cm,e.update)}function Bo(e){var n=e.cm,s=n.display;e.updatedDisplay&&qa(n),e.barMeasure=oa(n),s.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Xa(n,s.maxLine,s.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(s.scroller.clientWidth,s.sizer.offsetLeft+e.adjustWidthTo+Ji(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,s.sizer.offsetLeft+e.adjustWidthTo-er(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=s.input.prepareSelection())}function Tl(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&Dr(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var s=e.focus&&e.focus==F();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,s),(e.updatedDisplay||e.startHeight!=n.doc.height)&&Ur(n,e.barMeasure),e.updatedDisplay&&$r(n,e.barMeasure),e.selectionChanged&&Mo(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),s&&No(e.cm)}function Ds(e){var n=e.cm,s=n.display,a=n.doc;if(e.updatedDisplay&&Ls(n,e.update),s.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(s.wheelStartX=s.wheelStartY=null),e.scrollTop!=null&&Ts(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Dr(n,e.scrollLeft,!0,!0),e.scrollToPos){var p=Fo(n,C(a,e.scrollToPos.from),C(a,e.scrollToPos.to),e.scrollToPos.margin);xs(n,p)}var j=e.maybeHiddenMarkers,J=e.maybeUnhiddenMarkers;if(j)for(var ie=0;ie<j.length;++ie)j[ie].lines.length||Je(j[ie],"hide");if(J)for(var se=0;se<J.length;++se)J[se].lines.length&&Je(J[se],"unhide");s.wrapper.offsetHeight&&(a.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&Je(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function cr(e,n){if(e.curOp)return n();Vr(e);try{return n()}finally{Xr(e)}}function Gi(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Vr(e);try{return n.apply(e,arguments)}finally{Xr(e)}}}function or(e){return function(){if(this.curOp)return e.apply(this,arguments);Vr(this);try{return e.apply(this,arguments)}finally{Xr(this)}}}function Yi(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Vr(n);try{return e.apply(this,arguments)}finally{Xr(n)}}}function tr(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,I(jo,e))}function jo(e){var n=e.doc;if(n.highlightFrontier>=e.display.viewTo)return;var s=+new Date+e.options.workTime,a=xt(e,n.highlightFrontier),p=[];n.iter(a.line,Math.min(n.first+n.size,e.display.viewTo+500),function(j){if(a.line>=e.display.viewFrom){var J=j.styles,ie=j.text.length>e.options.maxHighlightLength?Oi(n.mode,a.state):null,se=Ae(e,j,a,!0);ie&&(a.state=ie),j.styles=se.styles;var pe=j.styleClasses,Fe=se.classes;Fe?j.styleClasses=Fe:pe&&(j.styleClasses=null);for(var ze=!J||J.length!=j.styles.length||pe!=Fe&&(!pe||!Fe||pe.bgClass!=Fe.bgClass||pe.textClass!=Fe.textClass),pt=0;!ze&&pt<J.length;++pt)ze=J[pt]!=j.styles[pt];ze&&p.push(a.line),j.stateAfter=a.save(),a.nextLine()}else j.text.length<=e.options.maxHighlightLength&&Dt(e,j.text,a),j.stateAfter=a.line%5==0?a.save():null,a.nextLine();if(+new Date>s)return tr(e,e.options.workDelay),!0}),n.highlightFrontier=a.line,n.modeFrontier=Math.max(n.modeFrontier,a.line),p.length&&cr(e,function(){for(var j=0;j<p.length;j++)Mr(e,p[j],"text")})}var Oa=function(e,n,s){var a=e.display;this.viewport=n,this.visible=Ja(a,e.doc,n),this.editorIsHidden=!a.wrapper.offsetWidth,this.wrapperHeight=a.wrapper.clientHeight,this.wrapperWidth=a.wrapper.clientWidth,this.oldDisplayWidth=er(e),this.force=s,this.dims=Do(e),this.events=[]};Oa.prototype.signal=function(e,n){Ie(e,n)&&this.events.push(arguments)},Oa.prototype.finish=function(){for(var e=0;e<this.events.length;e++)Je.apply(null,this.events[e])};function Sl(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=Ji(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=Ji(e)+"px",n.scrollbarsClipped=!0)}function Ps(e){if(e.hasFocus())return null;var n=F();if(!n||!y(e.display.lineDiv,n))return null;var s={activeElt:n};if(window.getSelection){var a=window.getSelection();a.anchorNode&&a.extend&&y(e.display.lineDiv,a.anchorNode)&&(s.anchorNode=a.anchorNode,s.anchorOffset=a.anchorOffset,s.focusNode=a.focusNode,s.focusOffset=a.focusOffset)}return s}function Ra(e){if(!e||!e.activeElt||e.activeElt==F())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&y(document.body,e.anchorNode)&&y(document.body,e.focusNode)){var n=window.getSelection(),s=document.createRange();s.setEnd(e.anchorNode,e.anchorOffset),s.collapse(!1),n.removeAllRanges(),n.addRange(s),n.extend(e.focusNode,e.focusOffset)}}function no(e,n){var s=e.display,a=e.doc;if(n.editorIsHidden)return Nr(e),!1;if(!n.force&&n.visible.from>=s.viewFrom&&n.visible.to<=s.viewTo&&(s.updateLineNumbers==null||s.updateLineNumbers>=s.viewTo)&&s.renderedView==s.view&&Io(e)==0)return!1;ks(e)&&(Nr(e),n.dims=Do(e));var p=a.first+a.size,j=Math.max(n.visible.from-e.options.viewportMargin,a.first),J=Math.min(p,n.visible.to+e.options.viewportMargin);s.viewFrom<j&&j-s.viewFrom<20&&(j=Math.max(a.first,s.viewFrom)),s.viewTo>J&&s.viewTo-J<20&&(J=Math.min(p,s.viewTo)),qt&&(j=An(e.doc,j),J=sn(e.doc,J));var ie=j!=s.viewFrom||J!=s.viewTo||s.lastWrapHeight!=n.wrapperHeight||s.lastWrapWidth!=n.wrapperWidth;xl(e,j,J),s.viewOffset=Vt(ct(e.doc,s.viewFrom)),e.display.mover.style.top=s.viewOffset+"px";var se=Io(e);if(!ie&&se==0&&!n.force&&s.renderedView==s.view&&(s.updateLineNumbers==null||s.updateLineNumbers>=s.viewTo))return!1;var pe=Ps(e);return se>4&&(s.lineDiv.style.display="none"),Ol(e,s.updateLineNumbers,n.dims),se>4&&(s.lineDiv.style.display=""),s.renderedView=s.view,Ra(pe),_(s.cursorDiv),_(s.selectionDiv),s.gutters.style.height=s.sizer.style.minHeight=0,ie&&(s.lastWrapHeight=n.wrapperHeight,s.lastWrapWidth=n.wrapperWidth,tr(e,400)),s.updateLineNumbers=null,!0}function Ls(e,n){for(var s=n.viewport,a=!0;;a=!1){if(!a||!e.options.lineWrapping||n.oldDisplayWidth==er(e)){if(s&&s.top!=null&&(s={top:Math.min(e.doc.height+Ki(e.display)-yr(e),s.top)}),n.visible=Ja(e.display,e.doc,s),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else a&&(n.visible=Ja(e.display,e.doc,s));if(!no(e,n))break;qa(e);var p=oa(e);ta(e),Ur(e,p),$r(e,p),n.force=!1}n.signal(e,"update",e),(e.display.viewFrom!=e.display.reportedViewFrom||e.display.viewTo!=e.display.reportedViewTo)&&(n.signal(e,"viewportChange",e,e.display.viewFrom,e.display.viewTo),e.display.reportedViewFrom=e.display.viewFrom,e.display.reportedViewTo=e.display.viewTo)}function Wo(e,n){var s=new Oa(e,n);if(no(e,s)){qa(e),Ls(e,s);var a=oa(e);ta(e),Ur(e,a),$r(e,a),s.finish()}}function Ol(e,n,s){var a=e.display,p=e.options.lineNumbers,j=a.lineDiv,J=j.firstChild;function ie(Ut){var Qt=Ut.nextSibling;return k&&c&&e.display.currentWheelTarget==Ut?Ut.style.display="none":Ut.parentNode.removeChild(Ut),Qt}for(var se=a.view,pe=a.viewFrom,Fe=0;Fe<se.length;Fe++){var ze=se[Fe];if(!ze.hidden)if(!ze.node||ze.node.parentNode!=j){var pt=yi(e,ze,pe,s);j.insertBefore(pt,J)}else{for(;J!=ze.node;)J=ie(J);var ut=p&&n!=null&&n<=pe&&ze.lineNumber;ze.changes&&(re(ze.changes,"gutter")>-1&&(ut=!1),Kn(e,ze,pe,s)),ut&&(_(ze.lineNumber),ze.lineNumber.appendChild(document.createTextNode(en(e.options,pe)))),J=ze.node.nextSibling}pe+=ze.size}for(;J;)J=ie(J)}function Aa(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px"}function $r(e,n){e.display.sizer.style.minHeight=n.docHeight+"px",e.display.heightForcer.style.top=n.docHeight+"px",e.display.gutters.style.height=n.docHeight+e.display.barHeight+Ji(e)+"px"}function Is(e){var n=e.display,s=n.view;if(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))return;for(var a=Po(n)-n.scroller.scrollLeft+e.doc.scrollLeft,p=n.gutters.offsetWidth,j=a+"px",J=0;J<s.length;J++)if(!s[J].hidden){e.options.fixedGutter&&(s[J].gutter&&(s[J].gutter.style.left=j),s[J].gutterBackground&&(s[J].gutterBackground.style.left=j));var ie=s[J].alignable;if(ie)for(var se=0;se<ie.length;se++)ie[se].style.left=j}e.options.fixedGutter&&(n.gutters.style.left=a+p+"px")}function ks(e){if(!e.options.lineNumbers)return!1;var n=e.doc,s=en(e.options,n.first+n.size-1),a=e.display;if(s.length!=a.lineNumChars){var p=a.measure.appendChild(d("div",[d("div",s)],"CodeMirror-linenumber CodeMirror-gutter-elt")),j=p.firstChild.offsetWidth,J=p.offsetWidth-j;return a.lineGutter.style.width="",a.lineNumInnerWidth=Math.max(j,a.lineGutter.offsetWidth-J)+1,a.lineNumWidth=a.lineNumInnerWidth+J,a.lineNumChars=a.lineNumInnerWidth?s.length:-1,a.lineGutter.style.width=a.lineNumWidth+"px",Aa(e.display),!0}return!1}function Ho(e,n){for(var s=[],a=!1,p=0;p<e.length;p++){var j=e[p],J=null;if(typeof j!="string"&&(J=j.style,j=j.className),j=="CodeMirror-linenumbers")if(n)a=!0;else continue;s.push({className:j,style:J})}return n&&!a&&s.push({className:"CodeMirror-linenumbers",style:null}),s}function Ko(e){var n=e.gutters,s=e.gutterSpecs;_(n),e.lineGutter=null;for(var a=0;a<s.length;++a){var p=s[a],j=p.className,J=p.style,ie=n.appendChild(d("div",null,"CodeMirror-gutter "+j));J&&(ie.style.cssText=J),j=="CodeMirror-linenumbers"&&(e.lineGutter=ie,ie.style.width=(e.lineNumWidth||1)+"px")}n.style.display=s.length?"":"none",Aa(e)}function Da(e){Ko(e.display),lr(e),Is(e)}function Rl(e,n,s,a){var p=this;this.input=s,p.scrollbarFiller=d("div",null,"CodeMirror-scrollbar-filler"),p.scrollbarFiller.setAttribute("cm-not-content","true"),p.gutterFiller=d("div",null,"CodeMirror-gutter-filler"),p.gutterFiller.setAttribute("cm-not-content","true"),p.lineDiv=E("div",null,"CodeMirror-code"),p.selectionDiv=d("div",null,null,"position: relative; z-index: 1"),p.cursorDiv=d("div",null,"CodeMirror-cursors"),p.measure=d("div",null,"CodeMirror-measure"),p.lineMeasure=d("div",null,"CodeMirror-measure"),p.lineSpace=E("div",[p.measure,p.lineMeasure,p.selectionDiv,p.cursorDiv,p.lineDiv],null,"position: relative; outline: none");var j=E("div",[p.lineSpace],"CodeMirror-lines");p.mover=d("div",[j],null,"position: relative"),p.sizer=d("div",[p.mover],"CodeMirror-sizer"),p.sizerWidth=null,p.heightForcer=d("div",null,null,"position: absolute; height: "+de+"px; width: 1px;"),p.gutters=d("div",null,"CodeMirror-gutters"),p.lineGutter=null,p.scroller=d("div",[p.sizer,p.heightForcer,p.gutters],"CodeMirror-scroll"),p.scroller.setAttribute("tabIndex","-1"),p.wrapper=d("div",[p.scrollbarFiller,p.gutterFiller,p.scroller],"CodeMirror"),$&&X<8&&(p.gutters.style.zIndex=-1,p.scroller.style.paddingRight=0),!k&&!(U&&t)&&(p.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(p.wrapper):e(p.wrapper)),p.viewFrom=p.viewTo=n.first,p.reportedViewFrom=p.reportedViewTo=n.first,p.view=[],p.renderedView=null,p.externalMeasured=null,p.viewOffset=0,p.lastWrapHeight=p.lastWrapWidth=0,p.updateLineNumbers=null,p.nativeBarWidth=p.barHeight=p.barWidth=0,p.scrollbarsClipped=!1,p.lineNumWidth=p.lineNumInnerWidth=p.lineNumChars=null,p.alignWidgets=!1,p.cachedCharWidth=p.cachedTextHeight=p.cachedPaddingH=null,p.maxLine=null,p.maxLineLength=0,p.maxLineChanged=!1,p.wheelDX=p.wheelDY=p.wheelStartX=p.wheelStartY=null,p.shift=!1,p.selForContextMenu=null,p.activeTouch=null,p.gutterSpecs=Ho(a.gutters,a.lineNumbers),Ko(p),s.init(p)}var ua=0,pr=null;$?pr=-.53:U?pr=15:m?pr=-.7:f&&(pr=-1/3);function Ms(e){var n=e.wheelDeltaX,s=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),s==null&&e.detail&&e.axis==e.VERTICAL_AXIS?s=e.detail:s==null&&(s=e.wheelDelta),{x:n,y:s}}function io(e){var n=Ms(e);return n.x*=pr,n.y*=pr,n}function Ns(e,n){var s=Ms(n),a=s.x,p=s.y,j=e.display,J=j.scroller,ie=J.scrollWidth>J.clientWidth,se=J.scrollHeight>J.clientHeight;if(!(a&&ie||p&&se))return;if(p&&c&&k){e:for(var pe=n.target,Fe=j.view;pe!=J;pe=pe.parentNode)for(var ze=0;ze<Fe.length;ze++)if(Fe[ze].node==pe){e.display.currentWheelTarget=pe;break e}}if(a&&!U&&!v&&pr!=null){p&&se&&aa(e,Math.max(0,J.scrollTop+p*pr)),Dr(e,Math.max(0,J.scrollLeft+a*pr)),(!p||p&&se)&&me(n),j.wheelStartX=null;return}if(p&&pr!=null){var pt=p*pr,ut=e.doc.scrollTop,Ut=ut+j.wrapper.clientHeight;pt<0?ut=Math.max(0,ut+pt-50):Ut=Math.min(e.doc.height,Ut+pt+50),Wo(e,{top:ut,bottom:Ut})}ua<20&&(j.wheelStartX==null?(j.wheelStartX=J.scrollLeft,j.wheelStartY=J.scrollTop,j.wheelDX=a,j.wheelDY=p,setTimeout(function(){if(j.wheelStartX==null)return;var Qt=J.scrollLeft-j.wheelStartX,fn=J.scrollTop-j.wheelStartY,Fn=fn&&j.wheelDY&&fn/j.wheelDY||Qt&&j.wheelDX&&Qt/j.wheelDX;if(j.wheelStartX=j.wheelStartY=null,!Fn)return;pr=(pr*ua+Fn)/(ua+1),++ua},200)):(j.wheelDX+=a,j.wheelDY+=p))}var mr=function(e,n){this.ranges=e,this.primIndex=n};mr.prototype.primary=function(){return this.ranges[this.primIndex]},mr.prototype.equals=function(e){if(e==this)return!0;if(e.primIndex!=this.primIndex||e.ranges.length!=this.ranges.length)return!1;for(var n=0;n<this.ranges.length;n++){var s=this.ranges[n],a=e.ranges[n];if(!we(s.anchor,a.anchor)||!we(s.head,a.head))return!1}return!0},mr.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new Mi(un(this.ranges[n].anchor),un(this.ranges[n].head));return new mr(e,this.primIndex)},mr.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},mr.prototype.contains=function(e,n){n||(n=e);for(var s=0;s<this.ranges.length;s++){var a=this.ranges[s];if(ht(n,a.from())>=0&&ht(e,a.to())<=0)return s}return-1};var Mi=function(e,n){this.anchor=e,this.head=n};Mi.prototype.from=function(){return gi(this.anchor,this.head)},Mi.prototype.to=function(){return fi(this.anchor,this.head)},Mi.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Cr(e,n,s){var a=e&&e.options.selectionsMayTouch,p=n[s];n.sort(function(pt,ut){return ht(pt.from(),ut.from())}),s=re(n,p);for(var j=1;j<n.length;j++){var J=n[j],ie=n[j-1],se=ht(ie.to(),J.from());if(a&&!J.empty()?se>0:se>=0){var pe=gi(ie.from(),J.from()),Fe=fi(ie.to(),J.to()),ze=ie.empty()?J.from()==J.head:ie.from()==ie.head;j<=s&&--s,n.splice(--j,2,new Mi(ze?Fe:pe,ze?pe:Fe))}}return new mr(n,s)}function Fr(e,n){return new mr([new Mi(e,n||e)],0)}function Yr(e){return e.text?De(e.from.line+e.text.length-1,te(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Us(e,n){if(ht(e,n.from)<0)return e;if(ht(e,n.to)<=0)return Yr(n);var s=e.line+n.text.length-(n.to.line-n.from.line)-1,a=e.ch;return e.line==n.to.line&&(a+=Yr(n).ch-n.to.ch),De(s,a)}function Pa(e,n){for(var s=[],a=0;a<e.sel.ranges.length;a++){var p=e.sel.ranges[a];s.push(new Mi(Us(p.anchor,n),Us(p.head,n)))}return Cr(e.cm,s,e.sel.primIndex)}function da(e,n,s){return e.line==n.line?De(s.line,e.ch-n.ch+s.ch):De(s.line+(e.line-n.line),e.ch)}function Al(e,n,s){for(var a=[],p=De(e.first,0),j=p,J=0;J<n.length;J++){var ie=n[J],se=da(ie.from,p,j),pe=da(Yr(ie),p,j);if(p=ie.to,j=pe,s=="around"){var Fe=e.sel.ranges[J],ze=ht(Fe.head,Fe.anchor)<0;a[J]=new Mi(ze?pe:se,ze?se:pe)}else a[J]=new Mi(se,se)}return new mr(a,e.sel.primIndex)}function La(e){e.doc.mode=Wn(e.options,e.doc.modeOption),Ia(e)}function Ia(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,tr(e,100),e.state.modeGen++,e.curOp&&lr(e)}function Fs(e,n){return n.from.ch==0&&n.to.ch==0&&te(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Go(e,n,s,a){function p(oi){return s?s[oi]:null}function j(oi,Bn,ci){pn(oi,Bn,ci,a),Yt(oi,"change",oi,n)}function J(oi,Bn){for(var ci=[],Ri=oi;Ri<Bn;++Ri)ci.push(new yn(pe[Ri],p(Ri),a));return ci}var ie=n.from,se=n.to,pe=n.text,Fe=ct(e,ie.line),ze=ct(e,se.line),pt=te(pe),ut=p(pe.length-1),Ut=se.line-ie.line;if(n.full)e.insert(0,J(0,pe.length)),e.remove(pe.length,e.size-pe.length);else if(Fs(e,n)){var Qt=J(0,pe.length-1);j(ze,ze.text,ut),Ut&&e.remove(ie.line,Ut),Qt.length&&e.insert(ie.line,Qt)}else if(Fe==ze)if(pe.length==1)j(Fe,Fe.text.slice(0,ie.ch)+pt+Fe.text.slice(se.ch),ut);else{var fn=J(1,pe.length-1);fn.push(new yn(pt+Fe.text.slice(se.ch),ut,a)),j(Fe,Fe.text.slice(0,ie.ch)+pe[0],p(0)),e.insert(ie.line+1,fn)}else if(pe.length==1)j(Fe,Fe.text.slice(0,ie.ch)+pe[0]+ze.text.slice(se.ch),p(0)),e.remove(ie.line+1,Ut);else{j(Fe,Fe.text.slice(0,ie.ch)+pe[0],p(0)),j(ze,pt+ze.text.slice(se.ch),ut);var Fn=J(1,pe.length-1);Ut>1&&e.remove(ie.line+1,Ut-1),e.insert(ie.line+1,Fn)}Yt(e,"change",e,n)}function wr(e,n,s){function a(p,j,J){if(p.linked)for(var ie=0;ie<p.linked.length;++ie){var se=p.linked[ie];if(se.doc==j)continue;var pe=J&&se.sharedHist;if(s&&!pe)continue;n(se.doc,pe),a(se.doc,p,pe)}}a(e,null,!0)}function zo(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,Lo(e),La(e),Bs(e),e.options.lineWrapping||Zt(e),e.options.mode=n.modeOption,lr(e)}function Bs(e){(e.doc.direction=="rtl"?N:b)(e.display.lineDiv,"CodeMirror-rtl")}function Dl(e){cr(e,function(){Bs(e),lr(e)})}function ro(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 Vo(e,n){var s={from:un(n.from),to:Yr(n),text:je(e,n.from,n.to)};return Xo(e,s,n.from.line,n.to.line+1),wr(e,function(a){return Xo(a,s,n.from.line,n.to.line+1)},!0),s}function js(e){for(;e.length;){var n=te(e);if(n.ranges)e.pop();else break}}function Pl(e,n){if(n)return js(e.done),te(e.done);if(e.done.length&&!te(e.done).ranges)return te(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),te(e.done)}function Ws(e,n,s,a){var p=e.history;p.undone.length=0;var j=+new Date,J,ie;if((p.lastOp==a||p.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&p.lastModTime>j-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(J=Pl(p,p.lastOp==a)))ie=te(J.changes),ht(n.from,n.to)==0&&ht(n.from,ie.to)==0?ie.to=Yr(n):J.changes.push(Vo(e,n));else{var se=te(p.done);for((!se||!se.ranges)&&oo(e.sel,p.done),J={changes:[Vo(e,n)],generation:p.generation},p.done.push(J);p.done.length>p.undoDepth;)p.done.shift(),p.done[0].ranges||p.done.shift()}p.done.push(s),p.generation=++p.maxGeneration,p.lastModTime=p.lastSelTime=j,p.lastOp=p.lastSelOp=a,p.lastOrigin=p.lastSelOrigin=n.origin,ie||Je(e,"historyAdded")}function Ll(e,n,s,a){var p=n.charAt(0);return p=="*"||p=="+"&&s.ranges.length==a.ranges.length&&s.somethingSelected()==a.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function ao(e,n,s,a){var p=e.history,j=a&&a.origin;s==p.lastSelOp||j&&p.lastSelOrigin==j&&(p.lastModTime==p.lastSelTime&&p.lastOrigin==j||Ll(e,j,te(p.done),n))?p.done[p.done.length-1]=n:oo(n,p.done),p.lastSelTime=+new Date,p.lastSelOrigin=j,p.lastSelOp=s,a&&a.clearRedo!==!1&&js(p.undone)}function oo(e,n){var s=te(n);s&&s.ranges&&s.equals(e)||n.push(e)}function Xo(e,n,s,a){var p=n["spans_"+e.id],j=0;e.iter(Math.max(e.first,s),Math.min(e.first+e.size,a),function(J){J.markedSpans&&((p||(p=n["spans_"+e.id]={}))[j]=J.markedSpans),++j})}function so(e){if(!e)return null;for(var n,s=0;s<e.length;++s)e[s].marker.explicitlyCleared?n||(n=e.slice(0,s)):n&&n.push(e[s]);return n?n.length?n:null:e}function Hs(e,n){var s=n["spans_"+e.id];if(!s)return null;for(var a=[],p=0;p<n.text.length;++p)a.push(so(s[p]));return a}function $o(e,n){var s=Hs(e,n),a=Mn(e,n);if(!s)return a;if(!a)return s;for(var p=0;p<s.length;++p){var j=s[p],J=a[p];if(j&&J){e:for(var ie=0;ie<J.length;++ie){for(var se=J[ie],pe=0;pe<j.length;++pe)if(j[pe].marker==se.marker)continue e;j.push(se)}}else J&&(s[p]=J)}return s}function ca(e,n,s){for(var a=[],p=0;p<e.length;++p){var j=e[p];if(j.ranges){a.push(s?mr.prototype.deepCopy.call(j):j);continue}var J=j.changes,ie=[];a.push({changes:ie});for(var se=0;se<J.length;++se){var pe=J[se],Fe=void 0;if(ie.push({from:pe.from,to:pe.to,text:pe.text}),n)for(var ze in pe)(Fe=ze.match(/^spans_(\d+)$/))&&(re(n,Number(Fe[1]))>-1&&(te(ie)[ze]=pe[ze],delete pe[ze]))}}return a}function lo(e,n,s,a){if(a){var p=e.anchor;if(s){var j=ht(n,p)<0;j!=ht(s,p)<0?(p=n,n=s):j!=ht(n,s)<0&&(n=s)}return new Mi(p,n)}else return new Mi(s||n,n)}function uo(e,n,s,a,p){p==null&&(p=e.cm&&(e.cm.display.shift||e.extend)),nr(e,new mr([lo(e.sel.primary(),n,s,p)],0),a)}function Ks(e,n,s){for(var a=[],p=e.cm&&(e.cm.display.shift||e.extend),j=0;j<e.sel.ranges.length;j++)a[j]=lo(e.sel.ranges[j],n[j],null,p);var J=Cr(e.cm,a,e.sel.primIndex);nr(e,J,s)}function Br(e,n,s,a){var p=e.sel.ranges.slice(0);p[n]=s,nr(e,Cr(e.cm,p,e.sel.primIndex),a)}function Gs(e,n,s,a){nr(e,Fr(n,s),a)}function Il(e,n,s){var a={ranges:n.ranges,update:function(p){this.ranges=[];for(var j=0;j<p.length;j++)this.ranges[j]=new Mi(C(e,p[j].anchor),C(e,p[j].head))},origin:s&&s.origin};return Je(e,"beforeSelectionChange",e,a),e.cm&&Je(e.cm,"beforeSelectionChange",e.cm,a),a.ranges!=n.ranges?Cr(e.cm,a.ranges,a.ranges.length-1):n}function zs(e,n,s){var a=e.history.done,p=te(a);p&&p.ranges?(a[a.length-1]=n,ha(e,n,s)):nr(e,n,s)}function nr(e,n,s){ha(e,n,s),ao(e,e.sel,e.cm?e.cm.curOp.id:NaN,s)}function ha(e,n,s){(Ie(e,"beforeSelectionChange")||e.cm&&Ie(e.cm,"beforeSelectionChange"))&&(n=Il(e,n,s));var a=s&&s.bias||(ht(n.primary().head,e.sel.primary().head)<0?-1:1);Vs(e,$s(e,n,a,!0)),!(s&&s.scroll===!1)&&e.cm&&ia(e.cm)}function Vs(e,n){if(n.equals(e.sel))return;e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,Be(e.cm)),Yt(e,"cursorActivity",e)}function Xs(e){Vs(e,$s(e,e.sel,null,!1))}function $s(e,n,s,a){for(var p,j=0;j<n.ranges.length;j++){var J=n.ranges[j],ie=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[j],se=co(e,J.anchor,ie&&ie.anchor,s,a),pe=co(e,J.head,ie&&ie.head,s,a);(p||se!=J.anchor||pe!=J.head)&&(p||(p=n.ranges.slice(0,j)),p[j]=new Mi(se,pe))}return p?Cr(e.cm,p,n.primIndex):n}function fa(e,n,s,a,p){var j=ct(e,n.line);if(j.markedSpans)for(var J=0;J<j.markedSpans.length;++J){var ie=j.markedSpans[J],se=ie.marker,pe="selectLeft"in se?!se.selectLeft:se.inclusiveLeft,Fe="selectRight"in se?!se.selectRight:se.inclusiveRight;if((ie.from==null||(pe?ie.from<=n.ch:ie.from<n.ch))&&(ie.to==null||(Fe?ie.to>=n.ch:ie.to>n.ch))){if(p&&(Je(se,"beforeCursorEnter"),se.explicitlyCleared))if(j.markedSpans){--J;continue}else break;if(!se.atomic)continue;if(s){var ze=se.find(a<0?1:-1),pt=void 0;if((a<0?Fe:pe)&&(ze=Ys(e,ze,-a,ze&&ze.line==n.line?j:null)),ze&&ze.line==n.line&&(pt=ht(ze,s))&&(a<0?pt<0:pt>0))return fa(e,ze,n,a,p)}var ut=se.find(a<0?-1:1);return(a<0?pe:Fe)&&(ut=Ys(e,ut,a,ut.line==n.line?j:null)),ut?fa(e,ut,n,a,p):null}}return n}function co(e,n,s,a,p){var j=a||1,J=fa(e,n,s,j,p)||!p&&fa(e,n,s,j,!0)||fa(e,n,s,-j,p)||!p&&fa(e,n,s,-j,!0);return J||(e.cantEdit=!0,De(e.first,0))}function Ys(e,n,s,a){return s<0&&n.ch==0?n.line>e.first?C(e,De(n.line-1)):null:s>0&&n.ch==(a||ct(e,n.line)).text.length?n.line<e.first+e.size-1?De(n.line+1,0):null:new De(n.line,n.ch+s)}function Qs(e){e.setSelection(De(e.firstLine(),0),De(e.lastLine()),xe)}function Yo(e,n,s){var a={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return a.canceled=!0}};return s&&(a.update=function(p,j,J,ie){p&&(a.from=C(e,p)),j&&(a.to=C(e,j)),J&&(a.text=J),ie!==void 0&&(a.origin=ie)}),Je(e,"beforeChange",e,a),e.cm&&Je(e.cm,"beforeChange",e.cm,a),a.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:a.from,to:a.to,text:a.text,origin:a.origin}}function pa(e,n,s){if(e.cm){if(!e.cm.curOp)return Gi(e.cm,pa)(e,n,s);if(e.cm.state.suppressEdits)return}if((Ie(e,"beforeChange")||e.cm&&Ie(e.cm,"beforeChange"))&&(n=Yo(e,n,!0),!n))return;var a=nn&&!s&&ni(e,n.from,n.to);if(a)for(var p=a.length-1;p>=0;--p)qs(e,{from:a[p].from,to:a[p].to,text:p?[""]:n.text,origin:n.origin});else qs(e,n)}function qs(e,n){if(n.text.length==1&&n.text[0]==""&&ht(n.from,n.to)==0)return;var s=Pa(e,n);Ws(e,n,s,e.cm?e.cm.curOp.id:NaN),ma(e,n,s,Mn(e,n));var a=[];wr(e,function(p,j){!j&&re(a,p.history)==-1&&(tl(p.history,n),a.push(p.history)),ma(p,n,null,Mn(p,n))})}function ho(e,n,s){var a=e.cm&&e.cm.state.suppressEdits;if(a&&!s)return;for(var p=e.history,j,J=e.sel,ie=n=="undo"?p.done:p.undone,se=n=="undo"?p.undone:p.done,pe=0;pe<ie.length&&!(j=ie[pe],s?j.ranges&&!j.equals(e.sel):!j.ranges);pe++);if(pe==ie.length)return;for(p.lastOrigin=p.lastSelOrigin=null;;)if(j=ie.pop(),j.ranges){if(oo(j,se),s&&!j.equals(e.sel)){nr(e,j,{clearRedo:!1});return}J=j}else if(a){ie.push(j);return}else break;var Fe=[];oo(J,se),se.push({changes:Fe,generation:p.generation}),p.generation=j.generation||++p.maxGeneration;for(var ze=Ie(e,"beforeChange")||e.cm&&Ie(e.cm,"beforeChange"),pt=function(Qt){var fn=j.changes[Qt];if(fn.origin=n,ze&&!Yo(e,fn,!1))return ie.length=0,{};Fe.push(Vo(e,fn));var Fn=Qt?Pa(e,fn):te(ie);ma(e,fn,Fn,$o(e,fn)),!Qt&&e.cm&&e.cm.scrollIntoView({from:fn.from,to:Yr(fn)});var oi=[];wr(e,function(Bn,ci){!ci&&re(oi,Bn.history)==-1&&(tl(Bn.history,fn),oi.push(Bn.history)),ma(Bn,fn,null,$o(Bn,fn))})},ut=j.changes.length-1;ut>=0;--ut){var Ut=pt(ut);if(Ut)return Ut.v}}function Js(e,n){if(n==0)return;if(e.first+=n,e.sel=new mr(fe(e.sel.ranges,function(p){return new Mi(De(p.anchor.line+n,p.anchor.ch),De(p.head.line+n,p.head.ch))}),e.sel.primIndex),e.cm){lr(e.cm,e.first,e.first-n,n);for(var s=e.cm.display,a=s.viewFrom;a<s.viewTo;a++)Mr(e.cm,a,"gutter")}}function ma(e,n,s,a){if(e.cm&&!e.cm.curOp)return Gi(e.cm,ma)(e,n,s,a);if(n.to.line<e.first){Js(e,n.text.length-1-(n.to.line-n.from.line));return}if(n.from.line>e.lastLine())return;if(n.from.line<e.first){var p=n.text.length-1-(e.first-n.from.line);Js(e,p),n={from:De(e.first,0),to:De(n.to.line+p,n.to.ch),text:[te(n.text)],origin:n.origin}}var j=e.lastLine();n.to.line>j&&(n={from:n.from,to:De(j,ct(e,j).text.length),text:[n.text[0]],origin:n.origin}),n.removed=je(e,n.from,n.to),s||(s=Pa(e,n)),e.cm?kl(e.cm,n,a):Go(e,n,a),ha(e,s,xe),e.cantEdit&&co(e,De(e.firstLine(),0))&&(e.cantEdit=!1)}function kl(e,n,s){var a=e.doc,p=e.display,j=n.from,J=n.to,ie=!1,se=j.line;e.options.lineWrapping||(se=Ee(In(ct(a,j.line))),a.iter(se,J.line+1,function(ut){if(ut==p.maxLine)return ie=!0,!0})),a.sel.contains(n.from,n.to)>-1&&Be(e),Go(a,n,s,_s(e)),e.options.lineWrapping||(a.iter(se,j.line+n.text.length,function(ut){var Ut=Bt(ut);Ut>p.maxLineLength&&(p.maxLine=ut,p.maxLineLength=Ut,p.maxLineChanged=!0,ie=!1)}),ie&&(e.curOp.updateMaxLine=!0)),jt(a,j.line),tr(e,400);var pe=n.text.length-(J.line-j.line)-1;n.full?lr(e):j.line==J.line&&n.text.length==1&&!Fs(e.doc,n)?Mr(e,j.line,"text"):lr(e,j.line,J.line+1,pe);var Fe=Ie(e,"changes"),ze=Ie(e,"change");if(ze||Fe){var pt={from:j,to:J,text:n.text,removed:n.removed,origin:n.origin};ze&&Yt(e,"change",e,pt),Fe&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(pt)}e.display.selForContextMenu=null}function ga(e,n,s,a,p){var j;a||(a=s),ht(a,s)<0&&(j=[a,s],s=j[0],a=j[1]),typeof n=="string"&&(n=e.splitLines(n)),pa(e,{from:s,to:a,text:n,origin:p})}function Zs(e,n,s,a){s<e.line?e.line+=a:n<e.line&&(e.line=n,e.ch=0)}function el(e,n,s,a){for(var p=0;p<e.length;++p){var j=e[p],J=!0;if(j.ranges){j.copied||(j=e[p]=j.deepCopy(),j.copied=!0);for(var ie=0;ie<j.ranges.length;ie++)Zs(j.ranges[ie].anchor,n,s,a),Zs(j.ranges[ie].head,n,s,a);continue}for(var se=0;se<j.changes.length;++se){var pe=j.changes[se];if(s<pe.from.line)pe.from=De(pe.from.line+a,pe.from.ch),pe.to=De(pe.to.line+a,pe.to.ch);else if(n<=pe.to.line){J=!1;break}}J||(e.splice(0,p+1),p=0)}}function tl(e,n){var s=n.from.line,a=n.to.line,p=n.text.length-(a-s)-1;el(e.done,s,a,p),el(e.undone,s,a,p)}function ka(e,n,s,a){var p=n,j=n;return typeof n=="number"?j=ct(e,q(e,n)):p=Ee(n),p==null?null:(a(j,p)&&e.cm&&Mr(e.cm,p,s),j)}function jr(e){this.lines=e,this.parent=null;for(var n=0,s=0;s<e.length;++s)e[s].parent=this,n+=e[s].height;this.height=n}jr.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var s=e,a=e+n;s<a;++s){var p=this.lines[s];this.height-=p.height,gt(p),Yt(p,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,s){this.height+=s,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var a=0;a<n.length;++a)n[a].parent=this},iterN:function(e,n,s){for(var a=e+n;e<a;++e)if(s(this.lines[e]))return!0}};function va(e){this.children=e;for(var n=0,s=0,a=0;a<e.length;++a){var p=e[a];n+=p.chunkSize(),s+=p.height,p.parent=this}this.size=n,this.height=s,this.parent=null}va.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var s=0;s<this.children.length;++s){var a=this.children[s],p=a.chunkSize();if(e<p){var j=Math.min(n,p-e),J=a.height;if(a.removeInner(e,j),this.height-=J-a.height,p==j&&(this.children.splice(s--,1),a.parent=null),(n-=j)==0)break;e=0}else e-=p}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof jr))){var ie=[];this.collapse(ie),this.children=[new jr(ie)],this.children[0].parent=this}},collapse:function(e){for(var n=0;n<this.children.length;++n)this.children[n].collapse(e)},insertInner:function(e,n,s){this.size+=n.length,this.height+=s;for(var a=0;a<this.children.length;++a){var p=this.children[a],j=p.chunkSize();if(e<=j){if(p.insertInner(e,n,s),p.lines&&p.lines.length>50){for(var J=p.lines.length%25+25,ie=J;ie<p.lines.length;){var se=new jr(p.lines.slice(ie,ie+=25));p.height-=se.height,this.children.splice(++a,0,se),se.parent=this}p.lines=p.lines.slice(0,J),this.maybeSpill()}break}e-=j}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var n=e.children.splice(e.children.length-5,5),s=new va(n);if(e.parent){e.size-=s.size,e.height-=s.height;var p=re(e.parent.children,e);e.parent.children.splice(p+1,0,s)}else{var a=new va(e.children);a.parent=e,e.children=[a,s],e=a}s.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,n,s){for(var a=0;a<this.children.length;++a){var p=this.children[a],j=p.chunkSize();if(e<j){var J=Math.min(n,j-e);if(p.iterN(e,J,s))return!0;if((n-=J)==0)break;e=0}else e-=j}}};var Ma=function(e,n,s){if(s)for(var a in s)s.hasOwnProperty(a)&&(this[a]=s[a]);this.doc=e,this.node=n};Ma.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,s=this.line,a=Ee(s);if(a==null||!n)return;for(var p=0;p<n.length;++p)n[p]==this&&n.splice(p--,1);n.length||(s.widgets=null);var j=Fi(this);Ne(s,Math.max(0,s.height-j)),e&&(cr(e,function(){nl(e,s,-j),Mr(e,a,"widget")}),Yt(e,"lineWidgetCleared",e,this,a))},Ma.prototype.changed=function(){var e=this,n=this.height,s=this.doc.cm,a=this.line;this.height=null;var p=Fi(this)-n;if(!p)return;Mt(this.doc,a)||Ne(a,a.height+p),s&&cr(s,function(){s.curOp.forceUpdate=!0,nl(s,a,p),Yt(s,"lineWidgetChanged",s,e,Ee(a))})},ke(Ma);function nl(e,n,s){Vt(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&eo(e,s)}function Ml(e,n,s,a){var p=new Ma(e,s,a),j=e.cm;return j&&p.noHScroll&&(j.display.alignWidgets=!0),ka(e,n,"widget",function(J){var ie=J.widgets||(J.widgets=[]);if(p.insertAt==null?ie.push(p):ie.splice(Math.min(ie.length-1,Math.max(0,p.insertAt)),0,p),p.line=J,j&&!Mt(e,J)){var se=Vt(J)<e.scrollTop;Ne(J,J.height+Fi(p)),se&&eo(j,p.height),j.curOp.forceUpdate=!0}return!0}),j&&Yt(j,"lineWidgetAdded",j,p,typeof n=="number"?n:Ee(n)),p}var il=0,br=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++il};br.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,n=e&&!e.curOp;if(n&&Vr(e),Ie(this,"clear")){var s=this.find();s&&Yt(this,"clear",s.from,s.to)}for(var a=null,p=null,j=0;j<this.lines.length;++j){var J=this.lines[j],ie=xn(J.markedSpans,this);e&&!this.collapsed?Mr(e,Ee(J),"text"):e&&(ie.to!=null&&(p=Ee(J)),ie.from!=null&&(a=Ee(J))),J.markedSpans=Yn(J.markedSpans,ie),ie.from==null&&this.collapsed&&!Mt(this.doc,J)&&e&&Ne(J,Jr(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var se=0;se<this.lines.length;++se){var pe=In(this.lines[se]),Fe=Bt(pe);Fe>e.display.maxLineLength&&(e.display.maxLine=pe,e.display.maxLineLength=Fe,e.display.maxLineChanged=!0)}a!=null&&e&&this.collapsed&&lr(e,a,p+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xs(e.doc)),e&&Yt(e,"markerCleared",e,this,a,p),n&&Xr(e),this.parent&&this.parent.clear()},br.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var s,a,p=0;p<this.lines.length;++p){var j=this.lines[p],J=xn(j.markedSpans,this);if(J.from!=null&&(s=De(n?j:Ee(j),J.from),e==-1))return s;if(J.to!=null&&(a=De(n?j:Ee(j),J.to),e==1))return a}return s&&{from:s,to:a}},br.prototype.changed=function(){var e=this,n=this.find(-1,!0),s=this,a=this.doc.cm;if(!n||!a)return;cr(a,function(){var p=n.line,j=Ee(n.line),J=Kr(a,j);if(J&&(hs(J),a.curOp.selectionChanged=a.curOp.forceUpdate=!0),a.curOp.updateMaxLine=!0,!Mt(s.doc,p)&&s.height!=null){var ie=s.height;s.height=null;var se=Fi(s)-ie;se&&Ne(p,p.height+se)}Yt(a,"markerChanged",a,e)})},br.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||re(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},br.prototype.detachLine=function(e){if(this.lines.splice(re(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},ke(br);function _a(e,n,s,a,p){if(a&&a.shared)return Nl(e,n,s,a,p);if(e.cm&&!e.cm.curOp)return Gi(e.cm,_a)(e,n,s,a,p);var j=new br(e,p),J=ht(n,s);if(a&&x(a,j,!1),J>0||J==0&&j.clearWhenEmpty!==!1)return j;if(j.replacedWith&&(j.collapsed=!0,j.widgetNode=E("span",[j.replacedWith],"CodeMirror-widget"),a.handleMouseEvents||j.widgetNode.setAttribute("cm-ignore-events","true"),a.insertLeft&&(j.widgetNode.insertLeft=!0)),j.collapsed){if(qn(e,n.line,n,s,j)||n.line!=s.line&&qn(e,s.line,n,s,j))throw new Error("Inserting collapsed marker partially overlapping an existing one");$n()}j.addToHistory&&Ws(e,{from:n,to:s,origin:"markText"},e.sel,NaN);var ie=n.line,se=e.cm,pe;if(e.iter(ie,s.line+1,function(ze){se&&j.collapsed&&!se.options.lineWrapping&&In(ze)==se.display.maxLine&&(pe=!0),j.collapsed&&ie!=n.line&&Ne(ze,0),hn(ze,new Un(j,ie==n.line?n.ch:null,ie==s.line?s.ch:null)),++ie}),j.collapsed&&e.iter(n.line,s.line+1,function(ze){Mt(e,ze)&&Ne(ze,0)}),j.clearOnEnter&&Xe(j,"beforeCursorEnter",function(){return j.clear()}),j.readOnly&&(Nt(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),j.collapsed&&(j.id=++il,j.atomic=!0),se){if(pe&&(se.curOp.updateMaxLine=!0),j.collapsed)lr(se,n.line,s.line+1);else if(j.className||j.startStyle||j.endStyle||j.css||j.attributes||j.title)for(var Fe=n.line;Fe<=s.line;Fe++)Mr(se,Fe,"text");j.atomic&&Xs(se.doc),Yt(se,"markerAdded",se,j)}return j}var ya=function(e,n){this.markers=e,this.primary=n;for(var s=0;s<e.length;++s)e[s].parent=this};ya.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Yt(this,"clear")},ya.prototype.find=function(e,n){return this.primary.find(e,n)},ke(ya);function Nl(e,n,s,a,p){a=x(a),a.shared=!1;var j=[_a(e,n,s,a,p)],J=j[0],ie=a.widgetNode;return wr(e,function(se){ie&&(a.widgetNode=ie.cloneNode(!0)),j.push(_a(se,C(se,n),C(se,s),a,p));for(var pe=0;pe<se.linked.length;++pe)if(se.linked[pe].isParent)return;J=te(j)}),new ya(j,J)}function rl(e){return e.findMarks(De(e.first,0),e.clipPos(De(e.lastLine())),function(n){return n.parent})}function ru(e,n){for(var s=0;s<n.length;s++){var a=n[s],p=a.find(),j=e.clipPos(p.from),J=e.clipPos(p.to);if(ht(j,J)){var ie=_a(e,j,J,a.primary,a.primary.type);a.markers.push(ie),ie.parent=a}}}function Ul(e){for(var n=function(a){var p=e[a],j=[p.primary.doc];wr(p.primary.doc,function(se){return j.push(se)});for(var J=0;J<p.markers.length;J++){var ie=p.markers[J];re(j,ie.doc)==-1&&(ie.parent=null,p.markers.splice(J--,1))}},s=0;s<e.length;s++)n(s)}var Qo=0,ur=function(e,n,s,a,p){if(!(this instanceof ur))return new ur(e,n,s,a,p);s==null&&(s=0),va.call(this,[new jr([new yn("",null)])]),this.first=s,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=s;var j=De(s,0);this.sel=Fr(j),this.history=new ro(null),this.id=++Qo,this.modeOption=n,this.lineSep=a,this.direction=p=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Go(this,{from:j,to:j,text:e}),nr(this,Fr(j),xe)};ur.prototype=$e(va.prototype,{constructor:ur,iter:function(e,n,s){s?this.iterN(e-this.first,n-e,s):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var s=0,a=0;a<n.length;++a)s+=n[a].height;this.insertInner(e-this.first,n,s)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=It(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Yi(function(e){var n=De(this.first,0),s=this.first+this.size-1;pa(this,{from:n,to:De(s,ct(this,s).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ra(this.cm,0,0),nr(this,Fr(n),xe)}),replaceRange:function(e,n,s,a){n=C(this,n),s=s?C(this,s):n,ga(this,e,n,s,a)},getRange:function(e,n,s){var a=je(this,C(this,e),C(this,n));return s===!1?a:a.join(s||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(di(this,e))return ct(this,e)},getLineNumber:function(e){return Ee(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=ct(this,e)),In(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return C(this,e)},getCursor:function(e){var n=this.sel.primary(),s;return e==null||e=="head"?s=n.head:e=="anchor"?s=n.anchor:e=="end"||e=="to"||e===!1?s=n.to():s=n.from(),s},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Yi(function(e,n,s){Gs(this,C(this,typeof e=="number"?De(e,n||0):e),null,s)}),setSelection:Yi(function(e,n,s){Gs(this,C(this,e),C(this,n||e),s)}),extendSelection:Yi(function(e,n,s){uo(this,C(this,e),n&&C(this,n),s)}),extendSelections:Yi(function(e,n){Ks(this,V(this,e),n)}),extendSelectionsBy:Yi(function(e,n){var s=fe(this.sel.ranges,e);Ks(this,V(this,s),n)}),setSelections:Yi(function(e,n,s){if(!e.length)return;for(var a=[],p=0;p<e.length;p++)a[p]=new Mi(C(this,e[p].anchor),C(this,e[p].head));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),nr(this,Cr(this.cm,a,n),s)}),addSelection:Yi(function(e,n,s){var a=this.sel.ranges.slice(0);a.push(new Mi(C(this,e),C(this,n||e))),nr(this,Cr(this.cm,a,a.length-1),s)}),getSelection:function(e){for(var n=this.sel.ranges,s,a=0;a<n.length;a++){var p=je(this,n[a].from(),n[a].to());s=s?s.concat(p):p}return e===!1?s:s.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],s=this.sel.ranges,a=0;a<s.length;a++){var p=je(this,s[a].from(),s[a].to());e!==!1&&(p=p.join(e||this.lineSeparator())),n[a]=p}return n},replaceSelection:function(e,n,s){for(var a=[],p=0;p<this.sel.ranges.length;p++)a[p]=e;this.replaceSelections(a,n,s||"+input")},replaceSelections:Yi(function(e,n,s){for(var a=[],p=this.sel,j=0;j<p.ranges.length;j++){var J=p.ranges[j];a[j]={from:J.from(),to:J.to(),text:this.splitLines(e[j]),origin:s}}for(var ie=n&&n!="end"&&Al(this,a,n),se=a.length-1;se>=0;se--)pa(this,a[se]);ie?zs(this,ie):this.cm&&ia(this.cm)}),undo:Yi(function(){ho(this,"undo")}),redo:Yi(function(){ho(this,"redo")}),undoSelection:Yi(function(){ho(this,"undo",!0)}),redoSelection:Yi(function(){ho(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,s=0,a=0;a<e.done.length;a++)e.done[a].ranges||++n;for(var p=0;p<e.undone.length;p++)e.undone[p].ranges||++s;return{undo:n,redo:s}},clearHistory:function(){var e=this;this.history=new ro(this.history.maxGeneration),wr(this,function(n){return n.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:ca(this.history.done),undone:ca(this.history.undone)}},setHistory:function(e){var n=this.history=new ro(this.history.maxGeneration);n.done=ca(e.done.slice(0),null,!0),n.undone=ca(e.undone.slice(0),null,!0)},setGutterMarker:Yi(function(e,n,s){return ka(this,e,"gutter",function(a){var p=a.gutterMarkers||(a.gutterMarkers={});return p[n]=s,!s&&Ct(p)&&(a.gutterMarkers=null),!0})}),clearGutter:Yi(function(e){var n=this;this.iter(function(s){s.gutterMarkers&&s.gutterMarkers[e]&&ka(n,s,"gutter",function(){return s.gutterMarkers[e]=null,Ct(s.gutterMarkers)&&(s.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!di(this,e))return null;if(n=e,e=ct(this,e),!e)return null}else if(n=Ee(e),n==null)return null;return{line:n,handle:e,text:e.text,gutterMarkers:e.gutterMarkers,textClass:e.textClass,bgClass:e.bgClass,wrapClass:e.wrapClass,widgets:e.widgets}},addLineClass:Yi(function(e,n,s){return ka(this,e,n=="gutter"?"gutter":"class",function(a){var p=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!a[p])a[p]=s;else{if(R(s).test(a[p]))return!1;a[p]+=" "+s}return!0})}),removeLineClass:Yi(function(e,n,s){return ka(this,e,n=="gutter"?"gutter":"class",function(a){var p=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",j=a[p];if(j)if(s==null)a[p]=null;else{var J=j.match(R(s));if(!J)return!1;var ie=J.index+J[0].length;a[p]=j.slice(0,J.index)+(!J.index||ie==j.length?"":" ")+j.slice(ie)||null}else return!1;return!0})}),addLineWidget:Yi(function(e,n,s){return Ml(this,e,n,s)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,s){return _a(this,C(this,e),C(this,n),s,s&&s.type||"range")},setBookmark:function(e,n){var s={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=C(this,e),_a(this,e,e,s,"bookmark")},findMarksAt:function(e){e=C(this,e);var n=[],s=ct(this,e.line).markedSpans;if(s)for(var a=0;a<s.length;++a){var p=s[a];(p.from==null||p.from<=e.ch)&&(p.to==null||p.to>=e.ch)&&n.push(p.marker.parent||p.marker)}return n},findMarks:function(e,n,s){e=C(this,e),n=C(this,n);var a=[],p=e.line;return this.iter(e.line,n.line+1,function(j){var J=j.markedSpans;if(J)for(var ie=0;ie<J.length;ie++){var se=J[ie];!(se.to!=null&&p==e.line&&e.ch>=se.to||se.from==null&&p!=e.line||se.from!=null&&p==n.line&&se.from>=n.ch)&&(!s||s(se.marker))&&a.push(se.marker.parent||se.marker)}++p}),a},getAllMarks:function(){var e=[];return this.iter(function(n){var s=n.markedSpans;if(s)for(var a=0;a<s.length;++a)s[a].from!=null&&e.push(s[a].marker)}),e},posFromIndex:function(e){var n,s=this.first,a=this.lineSeparator().length;return this.iter(function(p){var j=p.text.length+a;if(j>e)return n=e,!0;e-=j,++s}),C(this,De(s,n))},indexFromPos:function(e){e=C(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var s=this.lineSeparator().length;return this.iter(this.first,e.line,function(a){n+=a.text.length+s}),n},copy:function(e){var n=new ur(It(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return n.scrollTop=this.scrollTop,n.scrollLeft=this.scrollLeft,n.sel=this.sel,n.extend=!1,e&&(n.history.undoDepth=this.history.undoDepth,n.setHistory(this.getHistory())),n},linkedDoc:function(e){e||(e={});var n=this.first,s=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<s&&(s=e.to);var a=new ur(It(this,n,s),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(a.history=this.history),(this.linked||(this.linked=[])).push({doc:a,sharedHist:e.sharedHist}),a.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],ru(a,rl(this)),a},unlinkDoc:function(e){if(e instanceof Hi&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var s=this.linked[n];if(s.doc!=e)continue;this.linked.splice(n,1),e.unlinkDoc(this),Ul(rl(this));break}if(e.history==this.history){var a=[e.id];wr(e,function(p){return a.push(p.id)},!0),e.history=new ro(null),e.history.done=ca(this.history.done,a),e.history.undone=ca(this.history.undone,a)}},iterLinkedDocs:function(e){wr(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):gn(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Yi(function(e){if(e!="rtl"&&(e="ltr"),e==this.direction)return;this.direction=e,this.iter(function(n){return n.order=null}),this.cm&&Dl(this.cm)})}),ur.prototype.eachLine=ur.prototype.iter;var al=0;function Fl(e){var n=this;if(qo(n),mt(n,e)||Ii(n.display,e))return;me(e),$&&(al=+new Date);var s=Gr(n,e,!0),a=e.dataTransfer.files;if(!s||n.isReadOnly())return;if(a&&a.length&&window.FileReader&&window.File)for(var p=a.length,j=Array(p),J=0,ie=function(){++J==p&&Gi(n,function(){s=C(n.doc,s);var ut={from:s,to:s,text:n.doc.splitLines(j.filter(function(Ut){return Ut!=null}).join(n.doc.lineSeparator())),origin:"paste"};pa(n.doc,ut),zs(n.doc,Fr(C(n.doc,s),C(n.doc,Yr(ut))))})()},se=function(ut,Ut){if(n.options.allowDropFileTypes&&re(n.options.allowDropFileTypes,ut.type)==-1){ie();return}var Qt=new FileReader;Qt.onerror=function(){return ie()},Qt.onload=function(){var fn=Qt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(fn)){ie();return}j[Ut]=fn,ie()},Qt.readAsText(ut)},pe=0;pe<a.length;pe++)se(a[pe],pe);else{if(n.state.draggingText&&n.doc.sel.contains(s)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var Fe=e.dataTransfer.getData("Text");if(Fe){var ze;if(n.state.draggingText&&!n.state.draggingText.copy&&(ze=n.listSelections()),ha(n.doc,Fr(s,s)),ze)for(var pt=0;pt<ze.length;++pt)ga(n.doc,"",ze[pt].anchor,ze[pt].head,"drag");n.replaceSelection(Fe,"around","paste"),n.display.input.focus()}}catch(ut){}}}function ol(e,n){if($&&(!e.state.draggingText||+new Date-al<100)){ce(n);return}if(mt(e,n)||Ii(e.display,n))return;if(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!f){var s=d("img",null,null,"position: fixed; left: 0; top: 0;");s.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",v&&(s.width=s.height=1,e.display.wrapper.appendChild(s),s._top=s.offsetTop),n.dataTransfer.setDragImage(s,0,0),v&&s.parentNode.removeChild(s)}}function Bl(e,n){var s=Gr(e,n);if(!s)return;var a=document.createDocumentFragment();ys(e,s,a),e.display.dragCursor||(e.display.dragCursor=d("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),u(e.display.dragCursor,a)}function qo(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function sl(e){if(!document.getElementsByClassName)return;for(var n=document.getElementsByClassName("CodeMirror"),s=[],a=0;a<n.length;a++){var p=n[a].CodeMirror;p&&s.push(p)}s.length&&s[0].operation(function(){for(var j=0;j<s.length;j++)e(s[j])})}var Jo=!1;function au(){if(Jo)return;Zo(),Jo=!0}function Zo(){var e;Xe(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,sl(jl)},100))}),Xe(window,"blur",function(){return sl(na)})}function jl(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var Wr={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"},Na=0;Na<10;Na++)Wr[Na+48]=Wr[Na+96]=String(Na);for(var fo=65;fo<=90;fo++)Wr[fo]=String.fromCharCode(fo);for(var Ua=1;Ua<=12;Ua++)Wr[Ua+111]=Wr[Ua+63235]="F"+Ua;var Lr={};Lr.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"},Lr.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"},Lr.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"},Lr.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"]},Lr.default=c?Lr.macDefault:Lr.pcDefault;function Wl(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var s,a,p,j,J=0;J<n.length-1;J++){var ie=n[J];if(/^(cmd|meta|m)$/i.test(ie))j=!0;else if(/^a(lt)?$/i.test(ie))s=!0;else if(/^(c|ctrl|control)$/i.test(ie))a=!0;else if(/^s(hift)?$/i.test(ie))p=!0;else throw new Error("Unrecognized modifier name: "+ie)}return s&&(e="Alt-"+e),a&&(e="Ctrl-"+e),j&&(e="Cmd-"+e),p&&(e="Shift-"+e),e}function ll(e){var n={};for(var s in e)if(e.hasOwnProperty(s)){var a=e[s];if(/^(name|fallthrough|(de|at)tach)$/.test(s))continue;if(a=="..."){delete e[s];continue}for(var p=fe(s.split(" "),Wl),j=0;j<p.length;j++){var J=void 0,ie=void 0;j==p.length-1?(ie=p.join(" "),J=a):(ie=p.slice(0,j+1).join(" "),J="...");var se=n[ie];if(!se)n[ie]=J;else if(se!=J)throw new Error("Inconsistent bindings for "+ie)}delete e[s]}for(var pe in n)e[pe]=n[pe];return e}function Ir(e,n,s,a){n=Ba(n);var p=n.call?n.call(e,a):n[e];if(p===!1)return"nothing";if(p==="...")return"multi";if(p!=null&&s(p))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return Ir(e,n.fallthrough,s,a);for(var j=0;j<n.fallthrough.length;j++){var J=Ir(e,n.fallthrough[j],s,a);if(J)return J}}}function Fa(e){var n=typeof e=="string"?e:Wr[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function ul(e,n,s){var a=e;return n.altKey&&a!="Alt"&&(e="Alt-"+e),(w?n.metaKey:n.ctrlKey)&&a!="Ctrl"&&(e="Ctrl-"+e),(w?n.ctrlKey:n.metaKey)&&a!="Mod"&&(e="Cmd-"+e),!s&&n.shiftKey&&a!="Shift"&&(e="Shift-"+e),e}function po(e,n){if(v&&e.keyCode==34&&e.char)return!1;var s=Wr[e.keyCode];return s==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(s=e.code),ul(s,e,n))}function Ba(e){return typeof e=="string"?Lr[e]:e}function ba(e,n){for(var s=e.doc.sel.ranges,a=[],p=0;p<s.length;p++){for(var j=n(s[p]);a.length&&ht(j.from,te(a).to)<=0;){var J=a.pop();if(ht(J.from,j.from)<0){j.from=J.from;break}}a.push(j)}cr(e,function(){for(var ie=a.length-1;ie>=0;ie--)ga(e.doc,"",a[ie].from,a[ie].to,"+delete");ia(e)})}function es(e,n,s){var a=lt(e.text,n+s,s);return a<0||a>e.text.length?null:a}function ts(e,n,s){var a=es(e,n.ch,s);return a==null?null:new De(n.line,a,s<0?"after":"before")}function ns(e,n,s,a,p){if(e){n.doc.direction=="rtl"&&(p=-p);var j=mn(s,n.doc.direction);if(j){var J=p<0?te(j):j[0],ie=p<0==(J.level==1),se=ie?"after":"before",pe;if(J.level>0||n.doc.direction=="rtl"){var Fe=kr(n,s);pe=p<0?s.text.length-1:0;var ze=ar(n,Fe,pe).top;pe=Ft(function(pt){return ar(n,Fe,pt).top==ze},p<0==(J.level==1)?J.from:J.to-1,pe),se=="before"&&(pe=es(s,pe,1))}else pe=p<0?J.to:J.from;return new De(a,pe,se)}}return new De(a,p<0?s.text.length:0,p<0?"before":"after")}function is(e,n,s,a){var p=mn(n,e.doc.direction);if(!p)return ts(n,s,a);s.ch>=n.text.length?(s.ch=n.text.length,s.sticky="before"):s.ch<=0&&(s.ch=0,s.sticky="after");var j=rn(p,s.ch,s.sticky),J=p[j];if(e.doc.direction=="ltr"&&J.level%2==0&&(a>0?J.to>s.ch:J.from<s.ch))return ts(n,s,a);var ie=function(Fn,oi){return es(n,Fn instanceof De?Fn.ch:Fn,oi)},se,pe=function(Fn){return e.options.lineWrapping?(se=se||kr(e,n),vs(e,n,se,Fn)):{begin:0,end:n.text.length}},Fe=pe(s.sticky=="before"?ie(s,-1):s.ch);if(e.doc.direction=="rtl"||J.level==1){var ze=J.level==1==a<0,pt=ie(s,ze?1:-1);if(pt!=null&&(ze?pt<=J.to&&pt<=Fe.end:pt>=J.from&&pt>=Fe.begin)){var ut=ze?"before":"after";return new De(s.line,pt,ut)}}var Ut=function(Fn,oi,Bn){for(var ci=function(Wi,ir){return ir?new De(s.line,ie(Wi,1),"before"):new De(s.line,Wi,"after")};Fn>=0&&Fn<p.length;Fn+=oi){var Ri=p[Fn],Ci=oi>0==(Ri.level!=1),Di=Ci?Bn.begin:ie(Bn.end,-1);if(Ri.from<=Di&&Di<Ri.to)return ci(Di,Ci);if(Di=Ci?Ri.from:ie(Ri.to,-1),Bn.begin<=Di&&Di<Bn.end)return ci(Di,Ci)}},Qt=Ut(j+a,a,Fe);if(Qt)return Qt;var fn=a>0?Fe.end:ie(Fe.begin,-1);return fn!=null&&!(a>0&&fn==n.text.length)&&(Qt=Ut(a>0?0:p.length-1,a,pe(fn)),Qt)?Qt:null}var Ea={selectAll:Qs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return ba(e,function(n){if(n.empty()){var s=ct(e.doc,n.head.line).text.length;return n.head.ch==s&&n.head.line<e.lastLine()?{from:n.head,to:De(n.head.line+1,0)}:{from:n.head,to:De(n.head.line,s)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return ba(e,function(n){return{from:De(n.from().line,0),to:C(e.doc,De(n.to().line+1,0))}})},delLineLeft:function(e){return ba(e,function(n){return{from:De(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return ba(e,function(n){var s=e.charCoords(n.head,"div").top+5,a=e.coordsChar({left:0,top:s},"div");return{from:a,to:n.from()}})},delWrappedLineRight:function(e){return ba(e,function(n){var s=e.charCoords(n.head,"div").top+5,a=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:s},"div");return{from:n.from(),to:a}})},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(De(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(De(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return mo(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return dl(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return rs(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var s=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:s},"div")},Ce)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var s=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:s},"div")},Ce)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var s=e.cursorCoords(n.head,"div").top+5,a=e.coordsChar({left:0,top:s},"div");return a.ch<e.getLine(a.line).search(/\S/)?dl(e,n.head):a},Ce)},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 n=[],s=e.listSelections(),a=e.options.tabSize,p=0;p<s.length;p++){var j=s[p].from(),J=B(e.getLine(j.line),j.ch,a);n.push(ge(a-J%a))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return cr(e,function(){for(var n=e.listSelections(),s=[],a=0;a<n.length;a++){if(!n[a].empty())continue;var p=n[a].head,j=ct(e.doc,p.line).text;if(j){if(p.ch==j.length&&(p=new De(p.line,p.ch-1)),p.ch>0)p=new De(p.line,p.ch+1),e.replaceRange(j.charAt(p.ch-1)+j.charAt(p.ch-2),De(p.line,p.ch-2),p,"+transpose");else if(p.line>e.doc.first){var J=ct(e.doc,p.line-1).text;J&&(p=new De(p.line,1),e.replaceRange(j.charAt(0)+e.doc.lineSeparator()+J.charAt(J.length-1),De(p.line-1,J.length-1),p,"+transpose"))}}s.push(new Mi(p,p))}e.setSelections(s)})},newlineAndIndent:function(e){return cr(e,function(){for(var n=e.listSelections(),s=n.length-1;s>=0;s--)e.replaceRange(e.doc.lineSeparator(),n[s].anchor,n[s].head,"+input");n=e.listSelections();for(var a=0;a<n.length;a++)e.indentLine(n[a].from().line,null,!0);ia(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function mo(e,n){var s=ct(e.doc,n),a=In(s);return a!=s&&(n=Ee(a)),ns(!0,e,a,n,1)}function rs(e,n){var s=ct(e.doc,n),a=Dn(s);return a!=s&&(n=Ee(a)),ns(!0,e,s,n,-1)}function dl(e,n){var s=mo(e,n.line),a=ct(e.doc,s.line),p=mn(a,e.doc.direction);if(!p||p[0].level==0){var j=Math.max(s.ch,a.text.search(/\S/)),J=n.line==s.line&&n.ch<=j&&n.ch;return De(s.line,J?0:j,s.sticky)}return s}function go(e,n,s){if(typeof n=="string"&&(n=Ea[n],!n))return!1;e.display.input.ensurePolled();var a=e.display.shift,p=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s&&(e.display.shift=!1),p=n(e)!=he}finally{e.display.shift=a,e.state.suppressEdits=!1}return p}function Hl(e,n,s){for(var a=0;a<e.state.keyMaps.length;a++){var p=Ir(n,e.state.keyMaps[a],s,e);if(p)return p}return e.options.extraKeys&&Ir(n,e.options.extraKeys,s,e)||Ir(n,e.options.keyMap,s,e)}var Kl=new Y;function ja(e,n,s,a){var p=e.state.keySeq;if(p){if(Fa(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:Kl.set(50,function(){e.state.keySeq==p&&(e.state.keySeq=null,e.display.input.reset())}),as(e,p+" "+n,s,a))return!0}return as(e,n,s,a)}function as(e,n,s,a){var p=Hl(e,n,a);return p=="multi"&&(e.state.keySeq=n),p=="handled"&&Yt(e,"keyHandled",e,n,s),(p=="handled"||p=="multi")&&(me(s),Mo(e)),!!p}function cl(e,n){var s=po(n,!0);return s?n.shiftKey&&!e.state.keySeq?ja(e,"Shift-"+s,n,function(a){return go(e,a,!0)})||ja(e,s,n,function(a){if(typeof a=="string"?/^go[A-Z]/.test(a):a.motion)return go(e,a)}):ja(e,s,n,function(a){return go(e,a)}):!1}function Gl(e,n,s){return ja(e,"'"+s+"'",n,function(a){return go(e,a,!0)})}var os=null;function hl(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(n.curOp.focus=F(),mt(n,e))return;$&&X<11&&e.keyCode==27&&(e.returnValue=!1);var s=e.keyCode;n.display.shift=s==16||e.shiftKey;var a=cl(n,e);v&&(os=a?s:null,!a&&s==88&&!dn&&(c?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),U&&!c&&!a&&s==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),s==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&zl(n)}function zl(e){var n=e.display.lineDiv;N(n,"CodeMirror-crosshair");function s(a){(a.keyCode==18||!a.altKey)&&(b(n,"CodeMirror-crosshair"),Et(document,"keyup",s),Et(document,"mouseover",s))}Xe(document,"keyup",s),Xe(document,"mouseover",s)}function fl(e){e.keyCode==16&&(this.doc.sel.shift=!1),mt(this,e)}function pl(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(Ii(n.display,e)||mt(n,e)||e.ctrlKey&&!e.altKey||c&&e.metaKey)return;var s=e.keyCode,a=e.charCode;if(v&&s==os){os=null,me(e);return}if(v&&(!e.which||e.which<10)&&cl(n,e))return;var p=String.fromCharCode(a==null?s:a);if(p=="\b")return;if(Gl(n,e,p))return;n.display.input.onKeyPress(e)}var Vl=400,ss=function(e,n,s){this.time=e,this.pos=n,this.button=s};ss.prototype.compare=function(e,n,s){return this.time+Vl>e&&ht(n,this.pos)==0&&s==this.button};var Wa,Ha;function Xl(e,n){var s=+new Date;return Ha&&Ha.compare(s,e,n)?(Wa=Ha=null,"triple"):Wa&&Wa.compare(s,e,n)?(Ha=new ss(s,e,n),Wa=null,"double"):(Wa=new ss(s,e,n),Ha=null,"single")}function ls(e){var n=this,s=n.display;if(mt(n,e)||s.activeTouch&&s.input.supportsTouch())return;if(s.input.ensurePolled(),s.shift=e.shiftKey,Ii(s,e)){k||(s.scroller.draggable=!1,setTimeout(function(){return s.scroller.draggable=!0},100));return}if(ds(n,e))return;var a=Gr(n,e),p=tt(e),j=a?Xl(a,p):"single";if(window.focus(),p==1&&n.state.selectingText&&n.state.selectingText(e),a&&ml(n,p,a,j,e))return;p==1?a?Yl(n,a,j,e):Me(e)==s.scroller&&me(e):p==2?(a&&uo(n.doc,a),setTimeout(function(){return s.input.focus()},20)):p==3&&(O?n.display.input.onContextMenu(e):Es(n))}function ml(e,n,s,a,p){var j="Click";return a=="double"?j="Double"+j:a=="triple"&&(j="Triple"+j),j=(n==1?"Left":n==2?"Middle":"Right")+j,ja(e,ul(j,p),p,function(J){if(typeof J=="string"&&(J=Ea[J]),!J)return!1;var ie=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ie=J(e,s)!=he}finally{e.state.suppressEdits=!1}return ie})}function $l(e,n,s){var a=e.getOption("configureMouse"),p=a?a(e,n,s):{};if(p.unit==null){var j=h?s.shiftKey&&s.metaKey:s.altKey;p.unit=j?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(p.extend==null||e.doc.extend)&&(p.extend=e.doc.extend||s.shiftKey),p.addNew==null&&(p.addNew=c?s.metaKey:s.ctrlKey),p.moveOnDrag==null&&(p.moveOnDrag=!(c?s.altKey:s.ctrlKey)),p}function Yl(e,n,s,a){$?setTimeout(I(No,e),0):e.curOp.focus=F();var p=$l(e,s,a),j=e.doc.sel,J;e.options.dragDrop&&bt&&!e.isReadOnly()&&s=="single"&&(J=j.contains(n))>-1&&(ht((J=j.ranges[J]).from(),n)<0||n.xRel>0)&&(ht(J.to(),n)>0||n.xRel<0)?Ql(e,a,n,p):ql(e,a,n,p)}function Ql(e,n,s,a){var p=e.display,j=!1,J=Gi(e,function(pe){k&&(p.scroller.draggable=!1),e.state.draggingText=!1,Et(p.wrapper.ownerDocument,"mouseup",J),Et(p.wrapper.ownerDocument,"mousemove",ie),Et(p.scroller,"dragstart",se),Et(p.scroller,"drop",J),j||(me(pe),a.addNew||uo(e.doc,s,null,null,a.extend),k&&!f||$&&X==9?setTimeout(function(){p.wrapper.ownerDocument.body.focus({preventScroll:!0}),p.input.focus()},20):p.input.focus())}),ie=function(pe){j=j||Math.abs(n.clientX-pe.clientX)+Math.abs(n.clientY-pe.clientY)>=10},se=function(){return j=!0};k&&(p.scroller.draggable=!0),e.state.draggingText=J,J.copy=!a.moveOnDrag,p.scroller.dragDrop&&p.scroller.dragDrop(),Xe(p.wrapper.ownerDocument,"mouseup",J),Xe(p.wrapper.ownerDocument,"mousemove",ie),Xe(p.scroller,"dragstart",se),Xe(p.scroller,"drop",J),Es(e),setTimeout(function(){return p.input.focus()},20)}function us(e,n,s){if(s=="char")return new Mi(n,n);if(s=="word")return e.findWordAt(n);if(s=="line")return new Mi(De(n.line,0),C(e.doc,De(n.line+1,0)));var a=s(e,n);return new Mi(a.from,a.to)}function ql(e,n,s,a){var p=e.display,j=e.doc;me(n);var J,ie,se=j.sel,pe=se.ranges;if(a.addNew&&!a.extend?(ie=j.sel.contains(s),ie>-1?J=pe[ie]:J=new Mi(s,s)):(J=j.sel.primary(),ie=j.sel.primIndex),a.unit=="rectangle")a.addNew||(J=new Mi(s,s)),s=Gr(e,n,!0,!0),ie=-1;else{var Fe=us(e,s,a.unit);a.extend?J=lo(J,Fe.anchor,Fe.head,a.extend):J=Fe}a.addNew?ie==-1?(ie=pe.length,nr(j,Cr(e,pe.concat([J]),ie),{scroll:!1,origin:"*mouse"})):pe.length>1&&pe[ie].empty()&&a.unit=="char"&&!a.extend?(nr(j,Cr(e,pe.slice(0,ie).concat(pe.slice(ie+1)),0),{scroll:!1,origin:"*mouse"}),se=j.sel):Br(j,ie,J,Pe):(ie=0,nr(j,new mr([J],0),Pe),se=j.sel);var ze=s;function pt(Bn){if(ht(ze,Bn)==0)return;if(ze=Bn,a.unit=="rectangle"){for(var ci=[],Ri=e.options.tabSize,Ci=B(ct(j,s.line).text,s.ch,Ri),Di=B(ct(j,Bn.line).text,Bn.ch,Ri),Wi=Math.min(Ci,Di),ir=Math.max(Ci,Di),zi=Math.min(s.line,Bn.line),Er=Math.min(e.lastLine(),Math.max(s.line,Bn.line));zi<=Er;zi++){var gr=ct(j,zi).text,Qi=Oe(gr,Wi,Ri);Wi==ir?ci.push(new Mi(De(zi,Qi),De(zi,Qi))):gr.length>Qi&&ci.push(new Mi(De(zi,Qi),De(zi,Oe(gr,ir,Ri))))}ci.length||ci.push(new Mi(s,s)),nr(j,Cr(e,se.ranges.slice(0,ie).concat(ci),ie),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Bn)}else{var vr=J,sr=us(e,Bn,a.unit),Zi=vr.anchor,qi;ht(sr.anchor,Zi)>0?(qi=sr.head,Zi=gi(vr.from(),sr.anchor)):(qi=sr.anchor,Zi=fi(vr.to(),sr.head));var Xi=se.ranges.slice(0);Xi[ie]=Jl(e,new Mi(C(j,Zi),qi)),nr(j,Cr(e,Xi,ie),Pe)}}var ut=p.wrapper.getBoundingClientRect(),Ut=0;function Qt(Bn){var ci=++Ut,Ri=Gr(e,Bn,!0,a.unit=="rectangle");if(!Ri)return;if(ht(Ri,ze)!=0){e.curOp.focus=F(),pt(Ri);var Ci=Ja(p,j);(Ri.line>=Ci.to||Ri.line<Ci.from)&&setTimeout(Gi(e,function(){Ut==ci&&Qt(Bn)}),150)}else{var Di=Bn.clientY<ut.top?-20:Bn.clientY>ut.bottom?20:0;Di&&setTimeout(Gi(e,function(){if(Ut!=ci)return;p.scroller.scrollTop+=Di,Qt(Bn)}),50)}}function fn(Bn){e.state.selectingText=!1,Ut=Infinity,Bn&&(me(Bn),p.input.focus()),Et(p.wrapper.ownerDocument,"mousemove",Fn),Et(p.wrapper.ownerDocument,"mouseup",oi),j.history.lastSelOrigin=null}var Fn=Gi(e,function(Bn){Bn.buttons===0||!tt(Bn)?fn(Bn):Qt(Bn)}),oi=Gi(e,fn);e.state.selectingText=oi,Xe(p.wrapper.ownerDocument,"mousemove",Fn),Xe(p.wrapper.ownerDocument,"mouseup",oi)}function Jl(e,n){var s=n.anchor,a=n.head,p=ct(e.doc,s.line);if(ht(s,a)==0&&s.sticky==a.sticky)return n;var j=mn(p);if(!j)return n;var J=rn(j,s.ch,s.sticky),ie=j[J];if(ie.from!=s.ch&&ie.to!=s.ch)return n;var se=J+(ie.from==s.ch==(ie.level!=1)?0:1);if(se==0||se==j.length)return n;var pe;if(a.line!=s.line)pe=(a.line-s.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var Fe=rn(j,a.ch,a.sticky),ze=Fe-J||(a.ch-s.ch)*(ie.level==1?-1:1);Fe==se-1||Fe==se?pe=ze<0:pe=ze>0}var pt=j[se+(pe?-1:0)],ut=pe==(pt.level==1),Ut=ut?pt.from:pt.to,Qt=ut?"after":"before";return s.ch==Ut&&s.sticky==Qt?n:new Mi(new De(s.line,Ut,Qt),a)}function gl(e,n,s,a){var p,j;if(n.touches)p=n.touches[0].clientX,j=n.touches[0].clientY;else try{p=n.clientX,j=n.clientY}catch(pt){return!1}if(p>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;a&&me(n);var J=e.display,ie=J.lineDiv.getBoundingClientRect();if(j>ie.bottom||!Ie(e,s))return Re(n);j-=ie.top-J.viewOffset;for(var se=0;se<e.display.gutterSpecs.length;++se){var pe=J.gutters.childNodes[se];if(pe&&pe.getBoundingClientRect().right>=p){var Fe=ve(e.doc,j),ze=e.display.gutterSpecs[se];return Je(e,s,e,Fe,ze.className,n),Re(n)}}}function ds(e,n){return gl(e,n,"gutterClick",!0)}function vl(e,n){if(Ii(e.display,n)||_l(e,n))return;if(mt(e,n,"contextmenu"))return;O||e.display.input.onContextMenu(n)}function _l(e,n){return Ie(e,"gutterContextMenu")?gl(e,n,"gutterContextMenu",!1):!1}function yl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),wa(e)}var xa={toString:function(){return"CodeMirror.Init"}},vo={},Ka={};function Zl(e){var n=e.optionHandlers;function s(a,p,j,J){e.defaults[a]=p,j&&(n[a]=J?function(ie,se,pe){pe!=xa&&j(ie,se,pe)}:j)}e.defineOption=s,e.Init=xa,s("value","",function(a,p){return a.setValue(p)},!0),s("mode",null,function(a,p){a.doc.modeOption=p,La(a)},!0),s("indentUnit",2,La,!0),s("indentWithTabs",!1),s("smartIndent",!0),s("tabSize",4,function(a){Ia(a),wa(a),lr(a)},!0),s("lineSeparator",null,function(a,p){if(a.doc.lineSep=p,!p)return;var j=[],J=a.doc.first;a.doc.iter(function(se){for(var pe=0;;){var Fe=se.text.indexOf(p,pe);if(Fe==-1)break;pe=Fe+p.length,j.push(De(J,Fe))}J++});for(var ie=j.length-1;ie>=0;ie--)ga(a.doc,p,j[ie],De(j[ie].line,j[ie].ch+p.length))}),s("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(a,p,j){a.state.specialChars=new RegExp(p.source+(p.test(" ")?"":"| "),"g"),j!=xa&&a.refresh()}),s("specialCharPlaceholder",dt,function(a){return a.refresh()},!0),s("electricChars",!0),s("inputStyle",t?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),s("spellcheck",!1,function(a,p){return a.getInputField().spellcheck=p},!0),s("autocorrect",!1,function(a,p){return a.getInputField().autocorrect=p},!0),s("autocapitalize",!1,function(a,p){return a.getInputField().autocapitalize=p},!0),s("rtlMoveVisually",!A),s("wholeLineUpdateBefore",!0),s("theme","default",function(a){yl(a),Da(a)},!0),s("keyMap","default",function(a,p,j){var J=Ba(p),ie=j!=xa&&Ba(j);ie&&ie.detach&&ie.detach(a,J),J.attach&&J.attach(a,ie||null)}),s("extraKeys",null),s("configureMouse",null),s("lineWrapping",!1,tu,!0),s("gutters",[],function(a,p){a.display.gutterSpecs=Ho(p,a.options.lineNumbers),Da(a)},!0),s("fixedGutter",!0,function(a,p){a.display.gutters.style.left=p?Po(a.display)+"px":"0",a.refresh()},!0),s("coverGutterNextToScrollbar",!1,function(a){return Ur(a)},!0),s("scrollbarStyle","native",function(a){Rs(a),Ur(a),a.display.scrollbars.setScrollTop(a.doc.scrollTop),a.display.scrollbars.setScrollLeft(a.doc.scrollLeft)},!0),s("lineNumbers",!1,function(a,p){a.display.gutterSpecs=Ho(a.options.gutters,p),Da(a)},!0),s("firstLineNumber",1,Da,!0),s("lineNumberFormatter",function(a){return a},Da,!0),s("showCursorWhenSelecting",!1,ta,!0),s("resetSelectionOnContextMenu",!0),s("lineWiseCopyCut",!0),s("pasteLinesPerSelection",!0),s("selectionsMayTouch",!1),s("readOnly",!1,function(a,p){p=="nocursor"&&(na(a),a.display.input.blur()),a.display.input.readOnlyChanged(p)}),s("screenReaderLabel",null,function(a,p){p=p===""?null:p,a.display.input.screenReaderLabelChanged(p)}),s("disableInput",!1,function(a,p){p||a.display.input.reset()},!0),s("dragDrop",!0,eu),s("allowDropFileTypes",null),s("cursorBlinkRate",530),s("cursorScrollMargin",0),s("cursorHeight",1,ta,!0),s("singleCursorHeightPerLine",!0,ta,!0),s("workTime",100),s("workDelay",100),s("flattenSpans",!0,Ia,!0),s("addModeClass",!1,Ia,!0),s("pollInterval",100),s("undoDepth",200,function(a,p){return a.doc.history.undoDepth=p}),s("historyEventDelay",1250),s("viewportMargin",10,function(a){return a.refresh()},!0),s("maxHighlightLength",1e4,Ia,!0),s("moveInputWithCursor",!0,function(a,p){p||a.display.input.resetPosition()}),s("tabindex",null,function(a,p){return a.display.input.getField().tabIndex=p||""}),s("autofocus",null),s("direction","ltr",function(a,p){return a.doc.setDirection(p)},!0),s("phrases",null)}function eu(e,n,s){var a=s&&s!=xa;if(!n!=!a){var p=e.display.dragFunctions,j=n?Xe:Et;j(e.display.scroller,"dragstart",p.start),j(e.display.scroller,"dragenter",p.enter),j(e.display.scroller,"dragover",p.over),j(e.display.scroller,"dragleave",p.leave),j(e.display.scroller,"drop",p.drop)}}function tu(e){e.options.lineWrapping?(N(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(b(e.display.wrapper,"CodeMirror-wrap"),Zt(e)),Lo(e),lr(e),wa(e),setTimeout(function(){return Ur(e)},100)}function Hi(e,n){var s=this;if(!(this instanceof Hi))return new Hi(e,n);this.options=n=n?x(n):{},x(vo,n,!1);var a=n.value;typeof a=="string"?a=new ur(a,n.mode,null,n.lineSeparator,n.direction):n.mode&&(a.modeOption=n.mode),this.doc=a;var p=new Hi.inputStyles[n.inputStyle](this),j=this.display=new Rl(e,a,p,n);j.wrapper.CodeMirror=this,yl(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Rs(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Y,keySeq:null,specialChars:null},n.autofocus&&!t&&j.input.focus(),$&&X<11&&setTimeout(function(){return s.display.input.reset(!0)},20),bl(this),au(),Vr(this),this.curOp.forceUpdate=!0,zo(this,a),n.autofocus&&!t||this.hasFocus()?setTimeout(function(){s.hasFocus()&&!s.state.focused&&Uo(s)},20):na(this);for(var J in Ka)Ka.hasOwnProperty(J)&&Ka[J](this,n[J],xa);ks(this),n.finishInit&&n.finishInit(this);for(var ie=0;ie<T.length;++ie)T[ie](this);Xr(this),k&&n.lineWrapping&&getComputedStyle(j.lineDiv).textRendering=="optimizelegibility"&&(j.lineDiv.style.textRendering="auto")}Hi.defaults=vo,Hi.optionHandlers=Ka;function bl(e){var n=e.display;Xe(n.scroller,"mousedown",Gi(e,ls)),$&&X<11?Xe(n.scroller,"dblclick",Gi(e,function(se){if(mt(e,se))return;var pe=Gr(e,se);if(!pe||ds(e,se)||Ii(e.display,se))return;me(se);var Fe=e.findWordAt(pe);uo(e.doc,Fe.anchor,Fe.head)})):Xe(n.scroller,"dblclick",function(se){return mt(e,se)||me(se)}),Xe(n.scroller,"contextmenu",function(se){return vl(e,se)}),Xe(n.input.getField(),"contextmenu",function(se){n.scroller.contains(se.target)||vl(e,se)});var s,a={end:0};function p(){n.activeTouch&&(s=setTimeout(function(){return n.activeTouch=null},1e3),a=n.activeTouch,a.end=+new Date)}function j(se){if(se.touches.length!=1)return!1;var pe=se.touches[0];return pe.radiusX<=1&&pe.radiusY<=1}function J(se,pe){if(pe.left==null)return!0;var Fe=pe.left-se.left,ze=pe.top-se.top;return Fe*Fe+ze*ze>20*20}Xe(n.scroller,"touchstart",function(se){if(!mt(e,se)&&!j(se)&&!ds(e,se)){n.input.ensurePolled(),clearTimeout(s);var pe=+new Date;n.activeTouch={start:pe,moved:!1,prev:pe-a.end<=300?a:null},se.touches.length==1&&(n.activeTouch.left=se.touches[0].pageX,n.activeTouch.top=se.touches[0].pageY)}}),Xe(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),Xe(n.scroller,"touchend",function(se){var pe=n.activeTouch;if(pe&&!Ii(n,se)&&pe.left!=null&&!pe.moved&&new Date-pe.start<300){var Fe=e.coordsChar(n.activeTouch,"page"),ze;!pe.prev||J(pe,pe.prev)?ze=new Mi(Fe,Fe):!pe.prev.prev||J(pe,pe.prev.prev)?ze=e.findWordAt(Fe):ze=new Mi(De(Fe.line,0),C(e.doc,De(Fe.line+1,0))),e.setSelection(ze.anchor,ze.head),e.focus(),me(se)}p()}),Xe(n.scroller,"touchcancel",p),Xe(n.scroller,"scroll",function(){n.scroller.clientHeight&&(aa(e,n.scroller.scrollTop),Dr(e,n.scroller.scrollLeft,!0),Je(e,"scroll",e))}),Xe(n.scroller,"mousewheel",function(se){return Ns(e,se)}),Xe(n.scroller,"DOMMouseScroll",function(se){return Ns(e,se)}),Xe(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(se){mt(e,se)||ce(se)},over:function(se){mt(e,se)||(Bl(e,se),ce(se))},start:function(se){return ol(e,se)},drop:Gi(e,Fl),leave:function(se){mt(e,se)||qo(e)}};var ie=n.input.getField();Xe(ie,"keyup",function(se){return fl.call(e,se)}),Xe(ie,"keydown",Gi(e,hl)),Xe(ie,"keypress",Gi(e,pl)),Xe(ie,"focus",function(se){return Uo(e,se)}),Xe(ie,"blur",function(se){return na(e,se)})}var T=[];Hi.defineInitHook=function(e){return T.push(e)};function P(e,n,s,a){var p=e.doc,j;s==null&&(s="add"),s=="smart"&&(p.mode.indent?j=xt(e,n).state:s="prev");var J=e.options.tabSize,ie=ct(p,n),se=B(ie.text,null,J);ie.stateAfter&&(ie.stateAfter=null);var pe=ie.text.match(/^\s*/)[0],Fe;if(!a&&!/\S/.test(ie.text))Fe=0,s="not";else if(s=="smart"&&(Fe=p.mode.indent(j,ie.text.slice(pe.length),ie.text),Fe==he||Fe>150)){if(!a)return;s="prev"}s=="prev"?n>p.first?Fe=B(ct(p,n-1).text,null,J):Fe=0:s=="add"?Fe=se+e.options.indentUnit:s=="subtract"?Fe=se-e.options.indentUnit:typeof s=="number"&&(Fe=se+s),Fe=Math.max(0,Fe);var ze="",pt=0;if(e.options.indentWithTabs)for(var ut=Math.floor(Fe/J);ut;--ut)pt+=J,ze+=" ";if(pt<Fe&&(ze+=ge(Fe-pt)),ze!=pe)return ga(p,ze,De(n,0),De(n,pe.length),"+input"),ie.stateAfter=null,!0;for(var Ut=0;Ut<p.sel.ranges.length;Ut++){var Qt=p.sel.ranges[Ut];if(Qt.head.line==n&&Qt.head.ch<pe.length){var fn=De(n,pe.length);Br(p,Ut,new Mi(fn,fn));break}}}var K=null;function ne(e){K=e}function le(e,n,s,a,p){var j=e.doc;e.display.shift=!1,a||(a=j.sel);var J=+new Date-200,ie=p=="paste"||e.state.pasteIncoming>J,se=gn(n),pe=null;if(ie&&a.ranges.length>1)if(K&&K.text.join(`
`)==n){if(a.ranges.length%K.text.length==0){pe=[];for(var Fe=0;Fe<K.text.length;Fe++)pe.push(j.splitLines(K.text[Fe]))}}else se.length==a.ranges.length&&e.options.pasteLinesPerSelection&&(pe=fe(se,function(Fn){return[Fn]}));for(var ze=e.curOp.updateInput,pt=a.ranges.length-1;pt>=0;pt--){var ut=a.ranges[pt],Ut=ut.from(),Qt=ut.to();ut.empty()&&(s&&s>0?Ut=De(Ut.line,Ut.ch-s):e.state.overwrite&&!ie?Qt=De(Qt.line,Math.min(ct(j,Qt.line).text.length,Qt.ch+te(se).length)):ie&&K&&K.lineWise&&K.text.join(`
`)==se.join(`
`)&&(Ut=Qt=De(Ut.line,0)));var fn={from:Ut,to:Qt,text:pe?pe[pt%pe.length]:se,origin:p||(ie?"paste":e.state.cutIncoming>J?"cut":"+input")};pa(e.doc,fn),Yt(e,"inputRead",e,fn)}n&&!ie&&Te(e,n),ia(e),e.curOp.updateInput<2&&(e.curOp.updateInput=ze),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function ue(e,n){var s=e.clipboardData&&e.clipboardData.getData("Text");if(s)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&cr(n,function(){return le(n,s,0,null,"paste")}),!0}function Te(e,n){if(!e.options.electricChars||!e.options.smartIndent)return;for(var s=e.doc.sel,a=s.ranges.length-1;a>=0;a--){var p=s.ranges[a];if(p.head.ch>100||a&&s.ranges[a-1].head.line==p.head.line)continue;var j=e.getModeAt(p.head),J=!1;if(j.electricChars){for(var ie=0;ie<j.electricChars.length;ie++)if(n.indexOf(j.electricChars.charAt(ie))>-1){J=P(e,p.head.line,"smart");break}}else j.electricInput&&(j.electricInput.test(ct(e.doc,p.head.line).text.slice(0,p.head.ch))&&(J=P(e,p.head.line,"smart")));J&&Yt(e,"electricInput",e,p.head.line)}}function Se(e){for(var n=[],s=[],a=0;a<e.doc.sel.ranges.length;a++){var p=e.doc.sel.ranges[a].head.line,j={anchor:De(p,0),head:De(p+1,0)};s.push(j),n.push(e.getRange(j.anchor,j.head))}return{text:n,ranges:s}}function He(e,n,s,a){e.setAttribute("autocorrect",s?"":"off"),e.setAttribute("autocapitalize",a?"":"off"),e.setAttribute("spellcheck",!!n)}function et(){var e=d("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),n=d("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return k?e.style.width="1000px":e.setAttribute("wrap","off"),r&&(e.style.border="1px solid black"),He(e),n}function rt(e){var n=e.optionHandlers,s=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(a,p){var j=this.options,J=j[a];if(j[a]==p&&a!="mode")return;j[a]=p,n.hasOwnProperty(a)&&Gi(this,n[a])(this,p,J),Je(this,"optionChange",this,a)},getOption:function(a){return this.options[a]},getDoc:function(){return this.doc},addKeyMap:function(a,p){this.state.keyMaps[p?"push":"unshift"](Ba(a))},removeKeyMap:function(a){for(var p=this.state.keyMaps,j=0;j<p.length;++j)if(p[j]==a||p[j].name==a)return p.splice(j,1),!0},addOverlay:or(function(a,p){var j=a.token?a:e.getMode(this.options,a);if(j.startState)throw new Error("Overlays may not be stateful.");_e(this.state.overlays,{mode:j,modeSpec:a,opaque:p&&p.opaque,priority:p&&p.priority||0},function(J){return J.priority}),this.state.modeGen++,lr(this)}),removeOverlay:or(function(a){for(var p=this.state.overlays,j=0;j<p.length;++j){var J=p[j].modeSpec;if(J==a||typeof a=="string"&&J.name==a){p.splice(j,1),this.state.modeGen++,lr(this);return}}}),indentLine:or(function(a,p,j){typeof p!="string"&&typeof p!="number"&&(p==null?p=this.options.smartIndent?"smart":"prev":p=p?"add":"subtract"),di(this.doc,a)&&P(this,a,p,j)}),indentSelection:or(function(a){for(var p=this.doc.sel.ranges,j=-1,J=0;J<p.length;J++){var ie=p[J];if(ie.empty())ie.head.line>j&&(P(this,ie.head.line,a,!0),j=ie.head.line,J==this.doc.sel.primIndex&&ia(this));else{var se=ie.from(),pe=ie.to(),Fe=Math.max(j,se.line);j=Math.min(this.lastLine(),pe.line-(pe.ch?0:1))+1;for(var ze=Fe;ze<j;++ze)P(this,ze,a);var pt=this.doc.sel.ranges;se.ch==0&&p.length==pt.length&&pt[J].from().ch>0&&Br(this.doc,J,new Mi(se,pt[J].to()),xe)}}}),getTokenAt:function(a,p){return wn(this,a,p)},getLineTokens:function(a,p){return wn(this,De(a),p,!0)},getTokenTypeAt:function(a){a=C(this.doc,a);var p=nt(this,ct(this.doc,a.line)),j=0,J=(p.length-1)/2,ie=a.ch,se;if(ie==0)se=p[2];else for(;;){var pe=j+J>>1;if((pe?p[pe*2-1]:0)>=ie)J=pe;else if(p[pe*2+1]<ie)j=pe+1;else{se=p[pe*2+2];break}}var Fe=se?se.indexOf("overlay "):-1;return Fe<0?se:Fe==0?null:se.slice(0,Fe-1)},getModeAt:function(a){var p=this.doc.mode;return p.innerMode?e.innerMode(p,this.getTokenAt(a).state).mode:p},getHelper:function(a,p){return this.getHelpers(a,p)[0]},getHelpers:function(a,p){var j=[];if(!s.hasOwnProperty(p))return j;var J=s[p],ie=this.getModeAt(a);if(typeof ie[p]=="string")J[ie[p]]&&j.push(J[ie[p]]);else if(ie[p])for(var se=0;se<ie[p].length;se++){var pe=J[ie[p][se]];pe&&j.push(pe)}else ie.helperType&&J[ie.helperType]?j.push(J[ie.helperType]):J[ie.name]&&j.push(J[ie.name]);for(var Fe=0;Fe<J._global.length;Fe++){var ze=J._global[Fe];ze.pred(ie,this)&&re(j,ze.val)==-1&&j.push(ze.val)}return j},getStateAfter:function(a,p){var j=this.doc;return a=q(j,a==null?j.first+j.size-1:a),xt(this,a+1,p).state},cursorCoords:function(a,p){var j,J=this.doc.sel.primary();return a==null?j=J.head:typeof a=="object"?j=C(this.doc,a):j=a?J.from():J.to(),xr(this,j,p||"page")},charCoords:function(a,p){return So(this,C(this.doc,a),p||"page")},coordsChar:function(a,p){return a=To(this,a,p||"page"),Ro(this,a.left,a.top)},lineAtHeight:function(a,p){return a=To(this,{top:a,left:0},p||"page").top,ve(this.doc,a+this.display.viewOffset)},heightAtLine:function(a,p,j){var J=!1,ie;if(typeof a=="number"){var se=this.doc.first+this.doc.size-1;a<this.doc.first?a=this.doc.first:a>se&&(a=se,J=!0),ie=ct(this.doc,a)}else ie=a;return $a(this,ie,{top:0,left:0},p||"page",j||J).top+(J?this.doc.height-Vt(ie):0)},defaultTextHeight:function(){return Jr(this.display)},defaultCharWidth:function(){return Zr(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(a,p,j,J,ie){var se=this.display;a=xr(this,C(this.doc,a));var pe=a.bottom,Fe=a.left;if(p.style.position="absolute",p.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(p),se.sizer.appendChild(p),J=="over")pe=a.top;else if(J=="above"||J=="near"){var ze=Math.max(se.wrapper.clientHeight,this.doc.height),pt=Math.max(se.sizer.clientWidth,se.lineSpace.clientWidth);(J=="above"||a.bottom+p.offsetHeight>ze)&&a.top>p.offsetHeight?pe=a.top-p.offsetHeight:a.bottom+p.offsetHeight<=ze&&(pe=a.bottom),Fe+p.offsetWidth>pt&&(Fe=pt-p.offsetWidth)}p.style.top=pe+"px",p.style.left=p.style.right="",ie=="right"?(Fe=se.sizer.clientWidth-p.offsetWidth,p.style.right="0px"):(ie=="left"?Fe=0:ie=="middle"&&(Fe=(se.sizer.clientWidth-p.offsetWidth)/2),p.style.left=Fe+"px"),j&&Cl(this,{left:Fe,top:pe,right:Fe+p.offsetWidth,bottom:pe+p.offsetHeight})},triggerOnKeyDown:or(hl),triggerOnKeyPress:or(pl),triggerOnKeyUp:fl,triggerOnMouseDown:or(ls),execCommand:function(a){if(Ea.hasOwnProperty(a))return Ea[a].call(null,this)},triggerElectric:or(function(a){Te(this,a)}),findPosH:function(a,p,j,J){var ie=1;p<0&&(ie=-1,p=-p);for(var se=C(this.doc,a),pe=0;pe<p&&!(se=Ge(this.doc,se,ie,j,J),se.hitSide);++pe);return se},moveH:or(function(a,p){var j=this;this.extendSelectionsBy(function(J){return j.display.shift||j.doc.extend||J.empty()?Ge(j.doc,J.head,a,p,j.options.rtlMoveVisually):a<0?J.from():J.to()},Ce)}),deleteH:or(function(a,p){var j=this.doc.sel,J=this.doc;j.somethingSelected()?J.replaceSelection("",null,"+delete"):ba(this,function(ie){var se=Ge(J,ie.head,a,p,!1);return a<0?{from:se,to:ie.head}:{from:ie.head,to:se}})}),findPosV:function(a,p,j,J){var ie=1,se=J;p<0&&(ie=-1,p=-p);for(var pe=C(this.doc,a),Fe=0;Fe<p;++Fe){var ze=xr(this,pe,"div");if(se==null?se=ze.left:ze.left=se,pe=Ke(this,ze,ie,j),pe.hitSide)break}return pe},moveV:or(function(a,p){var j=this,J=this.doc,ie=[],se=!this.display.shift&&!J.extend&&J.sel.somethingSelected();if(J.extendSelectionsBy(function(Fe){if(se)return a<0?Fe.from():Fe.to();var ze=xr(j,Fe.head,"div");Fe.goalColumn!=null&&(ze.left=Fe.goalColumn),ie.push(ze.left);var pt=Ke(j,ze,a,p);return p=="page"&&Fe==J.sel.primary()&&eo(j,So(j,pt,"div").top-ze.top),pt},Ce),ie.length)for(var pe=0;pe<J.sel.ranges.length;pe++)J.sel.ranges[pe].goalColumn=ie[pe]}),findWordAt:function(a){var p=this.doc,j=ct(p,a.line).text,J=a.ch,ie=a.ch;if(j){var se=this.getHelper(a,"wordChars");(a.sticky=="before"||ie==j.length)&&J?--J:++ie;for(var pe=j.charAt(J),Fe=ft(pe,se)?function(ze){return ft(ze,se)}:/\s/.test(pe)?function(ze){return/\s/.test(ze)}:function(ze){return!/\s/.test(ze)&&!ft(ze)};J>0&&Fe(j.charAt(J-1));)--J;for(;ie<j.length&&Fe(j.charAt(ie));)++ie}return new Mi(De(a.line,J),De(a.line,ie))},toggleOverwrite:function(a){if(a!=null&&a==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):b(this.display.cursorDiv,"CodeMirror-overwrite"),Je(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==F()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:or(function(a,p){ra(this,a,p)}),getScrollInfo:function(){var a=this.display.scroller;return{left:a.scrollLeft,top:a.scrollTop,height:a.scrollHeight-Ji(this)-this.display.barHeight,width:a.scrollWidth-Ji(this)-this.display.barWidth,clientHeight:yr(this),clientWidth:er(this)}},scrollIntoView:or(function(a,p){a==null?(a={from:this.doc.sel.primary().head,to:null},p==null&&(p=this.options.cursorScrollMargin)):typeof a=="number"?a={from:De(a,0),to:null}:a.from==null&&(a={from:a,to:null}),a.to||(a.to=a.from),a.margin=p||0,a.from.line!=null?Cs(this,a):ws(this,a.from,a.to,a.margin)}),setSize:or(function(a,p){var j=this,J=function(se){return typeof se=="number"||/^\d+$/.test(String(se))?se+"px":se};a!=null&&(this.display.wrapper.style.width=J(a)),p!=null&&(this.display.wrapper.style.height=J(p)),this.options.lineWrapping&&Co(this);var ie=this.display.viewFrom;this.doc.iter(ie,this.display.viewTo,function(se){if(se.widgets){for(var pe=0;pe<se.widgets.length;pe++)if(se.widgets[pe].noHScroll){Mr(j,ie,"widget");break}}++ie}),this.curOp.forceUpdate=!0,Je(this,"refresh",this)}),operation:function(a){return cr(this,a)},startOperation:function(){return Vr(this)},endOperation:function(){return Xr(this)},refresh:or(function(){var a=this.display.cachedTextHeight;lr(this),this.curOp.forceUpdate=!0,wa(this),ra(this,this.doc.scrollLeft,this.doc.scrollTop),Aa(this.display),(a==null||Math.abs(a-Jr(this.display))>.5||this.options.lineWrapping)&&Lo(this),Je(this,"refresh",this)}),swapDoc:or(function(a){var p=this.doc;return p.cm=null,this.state.selectingText&&this.state.selectingText(),zo(this,a),wa(this),this.display.input.reset(),ra(this,a.scrollLeft,a.scrollTop),this.curOp.forceScroll=!0,Yt(this,"swapDoc",this,p),p}),phrase:function(a){var p=this.options.phrases;return p&&Object.prototype.hasOwnProperty.call(p,a)?p[a]:a},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}},ke(e),e.registerHelper=function(a,p,j){s.hasOwnProperty(a)||(s[a]=e[a]={_global:[]}),s[a][p]=j},e.registerGlobalHelper=function(a,p,j,J){e.registerHelper(a,p,J),s[a]._global.push({pred:j,val:J})}}function Ge(e,n,s,a,p){var j=n,J=s,ie=ct(e,n.line),se=p&&e.direction=="rtl"?-s:s;function pe(){var oi=n.line+se;return oi<e.first||oi>=e.first+e.size?!1:(n=new De(oi,n.ch,n.sticky),ie=ct(e,oi))}function Fe(oi){var Bn;if(a=="codepoint"){var ci=ie.text.charCodeAt(n.ch+(a>0?0:-1));isNaN(ci)?Bn=null:Bn=new De(n.line,Math.max(0,Math.min(ie.text.length,n.ch+s*(ci>=55296&&ci<56320?2:1))),-s)}else p?Bn=is(e.cm,ie,n,s):Bn=ts(ie,n,s);if(Bn==null)if(!oi&&pe())n=ns(p,e.cm,ie,n.line,se);else return!1;else n=Bn;return!0}if(a=="char"||a=="codepoint")Fe();else if(a=="column")Fe(!0);else if(a=="word"||a=="group")for(var ze=null,pt=a=="group",ut=e.cm&&e.cm.getHelper(n,"wordChars"),Ut=!0;!(s<0&&!Fe(!Ut));Ut=!1){var Qt=ie.text.charAt(n.ch)||`
`,fn=ft(Qt,ut)?"w":pt&&Qt==`
`?"n":!pt||/\s/.test(Qt)?null:"p";if(pt&&!Ut&&!fn&&(fn="s"),ze&&ze!=fn){s<0&&(s=1,Fe(),n.sticky="after");break}if(fn&&(ze=fn),s>0&&!Fe(!Ut))break}var Fn=co(e,n,j,J,!0);return we(j,Fn)&&(Fn.hitSide=!0),Fn}function Ke(e,n,s,a){var p=e.doc,j=n.left,J;if(a=="page"){var ie=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),se=Math.max(ie-.5*Jr(e.display),3);J=(s>0?n.bottom:n.top)+s*se}else a=="line"&&(J=s>0?n.bottom+3:n.top-3);for(var pe;!(pe=Ro(e,j,J),!pe.outside);){if(s<0?J<=0:J>=p.height){pe.hitSide=!0;break}J+=s*5}return pe}var Qe=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Y,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Qe.prototype.init=function(e){var n=this,s=this,a=s.cm,p=s.div=e.lineDiv;He(p,a.options.spellcheck,a.options.autocorrect,a.options.autocapitalize);function j(ie){for(var se=ie.target;se;se=se.parentNode){if(se==p)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(se.className))break}return!1}Xe(p,"paste",function(ie){if(!j(ie)||mt(a,ie)||ue(ie,a))return;X<=11&&setTimeout(Gi(a,function(){return n.updateFromDOM()}),20)}),Xe(p,"compositionstart",function(ie){n.composing={data:ie.data,done:!1}}),Xe(p,"compositionupdate",function(ie){n.composing||(n.composing={data:ie.data,done:!1})}),Xe(p,"compositionend",function(ie){n.composing&&(ie.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Xe(p,"touchstart",function(){return s.forceCompositionEnd()}),Xe(p,"input",function(){n.composing||n.readFromDOMSoon()});function J(ie){if(!j(ie)||mt(a,ie))return;if(a.somethingSelected())ne({lineWise:!1,text:a.getSelections()}),ie.type=="cut"&&a.replaceSelection("",null,"cut");else if(a.options.lineWiseCopyCut){var se=Se(a);ne({lineWise:!0,text:se.text}),ie.type=="cut"&&a.operation(function(){a.setSelections(se.ranges,0,xe),a.replaceSelection("",null,"cut")})}else return;if(ie.clipboardData){ie.clipboardData.clearData();var pe=K.text.join(`
`);if(ie.clipboardData.setData("Text",pe),ie.clipboardData.getData("Text")==pe){ie.preventDefault();return}}var Fe=et(),ze=Fe.firstChild;a.display.lineSpace.insertBefore(Fe,a.display.lineSpace.firstChild),ze.value=K.text.join(`
`);var pt=document.activeElement;G(ze),setTimeout(function(){a.display.lineSpace.removeChild(Fe),pt.focus(),pt==p&&s.showPrimarySelection()},50)}Xe(p,"copy",J),Xe(p,"cut",J)},Qe.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Qe.prototype.prepareSelection=function(){var e=ko(this.cm,!1);return e.focus=document.activeElement==this.div,e},Qe.prototype.showSelection=function(e,n){if(!e||!this.cm.display.view.length)return;(e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Qe.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Qe.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,s=n.doc.sel.primary(),a=s.from(),p=s.to();if(n.display.viewTo==n.display.viewFrom||a.line>=n.display.viewTo||p.line<n.display.viewFrom){e.removeAllRanges();return}var j=ui(n,e.anchorNode,e.anchorOffset),J=ui(n,e.focusNode,e.focusOffset);if(j&&!j.bad&&J&&!J.bad&&ht(gi(j,J),a)==0&&ht(fi(j,J),p)==0)return;var ie=n.display.view,se=a.line>=n.display.viewFrom&&Rt(n,a)||{node:ie[0].measure.map[2],offset:0},pe=p.line<n.display.viewTo&&Rt(n,p);if(!pe){var Fe=ie[ie.length-1].measure,ze=Fe.maps?Fe.maps[Fe.maps.length-1]:Fe.map;pe={node:ze[ze.length-1],offset:ze[ze.length-2]-ze[ze.length-3]}}if(!se||!pe){e.removeAllRanges();return}var pt=e.rangeCount&&e.getRangeAt(0),ut;try{ut=g(se.node,se.offset,pe.offset,pe.node)}catch(Ut){}ut&&(!U&&n.state.focused?(e.collapse(se.node,se.offset),ut.collapsed||(e.removeAllRanges(),e.addRange(ut))):(e.removeAllRanges(),e.addRange(ut)),pt&&e.anchorNode==null?e.addRange(pt):U&&this.startGracePeriod()),this.rememberSelection()},Qe.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)},Qe.prototype.showMultipleSelections=function(e){u(this.cm.display.cursorDiv,e.cursors),u(this.cm.display.selectionDiv,e.selection)},Qe.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Qe.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return y(this.div,n)},Qe.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Qe.prototype.blur=function(){this.div.blur()},Qe.prototype.getField=function(){return this.div},Qe.prototype.supportsTouch=function(){return!0},Qe.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():cr(this.cm,function(){return e.cm.curOp.selectionChanged=!0});function n(){e.cm.state.focused&&(e.pollSelection(),e.polling.set(e.cm.options.pollInterval,n))}this.polling.set(this.cm.options.pollInterval,n)},Qe.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Qe.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),n=this.cm;if(i&&m&&this.cm.display.gutterSpecs.length&&Rn(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var s=ui(n,e.anchorNode,e.anchorOffset),a=ui(n,e.focusNode,e.focusOffset);s&&a&&cr(n,function(){nr(n.doc,Fr(s,a),xe),(s.bad||a.bad)&&(n.curOp.selectionChanged=!0)})},Qe.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,s=e.doc.sel.primary(),a=s.from(),p=s.to();if(a.ch==0&&a.line>e.firstLine()&&(a=De(a.line-1,ct(e.doc,a.line-1).length)),p.ch==ct(e.doc,p.line).text.length&&p.line<e.lastLine()&&(p=De(p.line+1,0)),a.line<n.viewFrom||p.line>n.viewTo-1)return!1;var j,J,ie;a.line==n.viewFrom||(j=zr(e,a.line))==0?(J=Ee(n.view[0].line),ie=n.view[0].node):(J=Ee(n.view[j].line),ie=n.view[j-1].node.nextSibling);var se=zr(e,p.line),pe,Fe;if(se==n.view.length-1?(pe=n.viewTo-1,Fe=n.lineDiv.lastChild):(pe=Ee(n.view[se+1].line)-1,Fe=n.view[se+1].node.previousSibling),!ie)return!1;for(var ze=e.doc.splitLines(ai(e,ie,Fe,J,pe)),pt=je(e.doc,De(J,0),De(pe,ct(e.doc,pe).text.length));ze.length>1&&pt.length>1;)if(te(ze)==te(pt))ze.pop(),pt.pop(),pe--;else if(ze[0]==pt[0])ze.shift(),pt.shift(),J++;else break;for(var ut=0,Ut=0,Qt=ze[0],fn=pt[0],Fn=Math.min(Qt.length,fn.length);ut<Fn&&Qt.charCodeAt(ut)==fn.charCodeAt(ut);)++ut;for(var oi=te(ze),Bn=te(pt),ci=Math.min(oi.length-(ze.length==1?ut:0),Bn.length-(pt.length==1?ut:0));Ut<ci&&oi.charCodeAt(oi.length-Ut-1)==Bn.charCodeAt(Bn.length-Ut-1);)++Ut;if(ze.length==1&&pt.length==1&&J==a.line)for(;ut&&ut>a.ch&&oi.charCodeAt(oi.length-Ut-1)==Bn.charCodeAt(Bn.length-Ut-1);)ut--,Ut++;ze[ze.length-1]=oi.slice(0,oi.length-Ut).replace(/^\u200b+/,""),ze[0]=ze[0].slice(ut).replace(/\u200b+$/,"");var Ri=De(J,ut),Ci=De(pe,pt.length?te(pt).length-Ut:0);if(ze.length>1||ze[0]||ht(Ri,Ci))return ga(e.doc,ze,Ri,Ci,"+input"),!0},Qe.prototype.ensurePolled=function(){this.forceCompositionEnd()},Qe.prototype.reset=function(){this.forceCompositionEnd()},Qe.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Qe.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)},Qe.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&cr(this.cm,function(){return lr(e.cm)})},Qe.prototype.setUneditable=function(e){e.contentEditable="false"},Qe.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Gi(this.cm,le)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Qe.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Qe.prototype.onContextMenu=function(){},Qe.prototype.resetPosition=function(){},Qe.prototype.needsContentAttribute=!0;function Rt(e,n){var s=Kr(e,n.line);if(!s||s.hidden)return null;var a=ct(e.doc,n.line),p=Va(s,a,n.line),j=mn(a,e.doc.direction),J="left";if(j){var ie=rn(j,n.ch);J=ie%2?"right":"left"}var se=bo(p.map,n.ch,J);return se.offset=se.collapse=="right"?se.end:se.start,se}function Rn(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function Nn(e,n){return n&&(e.bad=!0),e}function ai(e,n,s,a,p){var j="",J=!1,ie=e.doc.lineSeparator(),se=!1;function pe(ut){return function(Ut){return Ut.id==ut}}function Fe(){J&&(j+=ie,se&&(j+=ie),J=se=!1)}function ze(ut){ut&&(Fe(),j+=ut)}function pt(ut){if(ut.nodeType==1){var Ut=ut.getAttribute("cm-text");if(Ut){ze(Ut);return}var Qt=ut.getAttribute("cm-marker"),fn;if(Qt){var Fn=e.findMarks(De(a,0),De(p+1,0),pe(+Qt));Fn.length&&(fn=Fn[0].find(0))&&ze(je(e.doc,fn.from,fn.to).join(ie));return}if(ut.getAttribute("contenteditable")=="false")return;var oi=/^(pre|div|p|li|table|br)$/i.test(ut.nodeName);if(!/^br$/i.test(ut.nodeName)&&ut.textContent.length==0)return;oi&&Fe();for(var Bn=0;Bn<ut.childNodes.length;Bn++)pt(ut.childNodes[Bn]);/^(pre|p)$/i.test(ut.nodeName)&&(se=!0),oi&&(J=!0)}else ut.nodeType==3&&ze(ut.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(pt(n),n==s);)n=n.nextSibling,se=!1;return j}function ui(e,n,s){var a;if(n==e.display.lineDiv){if(a=e.display.lineDiv.childNodes[s],!a)return Nn(e.clipPos(De(e.display.viewTo-1)),!0);n=null,s=0}else for(a=n;;a=a.parentNode){if(!a||a==e.display.lineDiv)return null;if(a.parentNode&&a.parentNode==e.display.lineDiv)break}for(var p=0;p<e.display.view.length;p++){var j=e.display.view[p];if(j.node==a)return Ti(j,n,s)}}function Ti(e,n,s){var a=e.text.firstChild,p=!1;if(!n||!y(a,n))return Nn(De(Ee(e.line),0),!0);if(n==a&&(p=!0,n=a.childNodes[s],s=0,!n)){var j=e.rest?te(e.rest):e.line;return Nn(De(Ee(j),j.text.length),p)}var J=n.nodeType==3?n:null,ie=n;for(!J&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(J=n.firstChild,s&&(s=J.nodeValue.length));ie.parentNode!=a;)ie=ie.parentNode;var se=e.measure,pe=se.maps;function Fe(fn,Fn,oi){for(var Bn=-1;Bn<(pe?pe.length:0);Bn++)for(var ci=Bn<0?se.map:pe[Bn],Ri=0;Ri<ci.length;Ri+=3){var Ci=ci[Ri+2];if(Ci==fn||Ci==Fn){var Di=Ee(Bn<0?e.line:e.rest[Bn]),Wi=ci[Ri]+oi;return(oi<0||Ci!=fn)&&(Wi=ci[Ri+(oi?1:0)]),De(Di,Wi)}}}var ze=Fe(J,ie,s);if(ze)return Nn(ze,p);for(var pt=ie.nextSibling,ut=J?J.nodeValue.length-s:0;pt;pt=pt.nextSibling){if(ze=Fe(pt,pt.firstChild,0),ze)return Nn(De(ze.line,ze.ch-ut),p);ut+=pt.textContent.length}for(var Ut=ie.previousSibling,Qt=s;Ut;Ut=Ut.previousSibling){if(ze=Fe(Ut,Ut.firstChild,-1),ze)return Nn(De(ze.line,ze.ch+Qt),p);Qt+=Ut.textContent.length}}var li=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Y,this.hasSelection=!1,this.composing=null};li.prototype.init=function(e){var n=this,s=this,a=this.cm;this.createField(e);var p=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),r&&(p.style.width="0px"),Xe(p,"input",function(){$&&X>=9&&n.hasSelection&&(n.hasSelection=null),s.poll()}),Xe(p,"paste",function(J){if(mt(a,J)||ue(J,a))return;a.state.pasteIncoming=+new Date,s.fastPoll()});function j(J){if(mt(a,J))return;if(a.somethingSelected())ne({lineWise:!1,text:a.getSelections()});else if(a.options.lineWiseCopyCut){var ie=Se(a);ne({lineWise:!0,text:ie.text}),J.type=="cut"?a.setSelections(ie.ranges,null,xe):(s.prevInput="",p.value=ie.text.join(`
`),G(p))}else return;J.type=="cut"&&(a.state.cutIncoming=+new Date)}Xe(p,"cut",j),Xe(p,"copy",j),Xe(e.scroller,"paste",function(J){if(Ii(e,J)||mt(a,J))return;if(!p.dispatchEvent){a.state.pasteIncoming=+new Date,s.focus();return}var ie=new Event("paste");ie.clipboardData=J.clipboardData,p.dispatchEvent(ie)}),Xe(e.lineSpace,"selectstart",function(J){Ii(e,J)||me(J)}),Xe(p,"compositionstart",function(){var J=a.getCursor("from");s.composing&&s.composing.range.clear(),s.composing={start:J,range:a.markText(J,a.getCursor("to"),{className:"CodeMirror-composing"})}}),Xe(p,"compositionend",function(){s.composing&&(s.poll(),s.composing.range.clear(),s.composing=null)})},li.prototype.createField=function(e){this.wrapper=et(),this.textarea=this.wrapper.firstChild},li.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},li.prototype.prepareSelection=function(){var e=this.cm,n=e.display,s=e.doc,a=ko(e);if(e.options.moveInputWithCursor){var p=xr(e,s.sel.primary().head,"div"),j=n.wrapper.getBoundingClientRect(),J=n.lineDiv.getBoundingClientRect();a.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,p.top+J.top-j.top)),a.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,p.left+J.left-j.left))}return a},li.prototype.showSelection=function(e){var n=this.cm,s=n.display;u(s.cursorDiv,e.cursors),u(s.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},li.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var n=this.cm;if(n.somethingSelected()){this.prevInput="";var s=n.getSelection();this.textarea.value=s,n.state.focused&&G(this.textarea),$&&X>=9&&(this.hasSelection=s)}else e||(this.prevInput=this.textarea.value="",$&&X>=9&&(this.hasSelection=null))},li.prototype.getField=function(){return this.textarea},li.prototype.supportsTouch=function(){return!1},li.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!t||F()!=this.textarea))try{this.textarea.focus()}catch(e){}},li.prototype.blur=function(){this.textarea.blur()},li.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},li.prototype.receivedFocus=function(){this.slowPoll()},li.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()})},li.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function s(){var a=n.poll();!a&&!e?(e=!0,n.polling.set(60,s)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,s)},li.prototype.poll=function(){var e=this,n=this.cm,s=this.textarea,a=this.prevInput;if(this.contextMenuPending||!n.state.focused||an(s)&&!a&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var p=s.value;if(p==a&&!n.somethingSelected())return!1;if($&&X>=9&&this.hasSelection===p||c&&/[\uf700-\uf7ff]/.test(p))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var j=p.charCodeAt(0);if(j==8203&&!a&&(a="\u200B"),j==8666)return this.reset(),this.cm.execCommand("undo")}for(var J=0,ie=Math.min(a.length,p.length);J<ie&&a.charCodeAt(J)==p.charCodeAt(J);)++J;return cr(n,function(){le(n,p.slice(J),a.length-J,null,e.composing?"*compose":null),p.length>1e3||p.indexOf(`
`)>-1?s.value=e.prevInput="":e.prevInput=p,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},li.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},li.prototype.onKeyPress=function(){$&&X>=9&&(this.hasSelection=null),this.fastPoll()},li.prototype.onContextMenu=function(e){var n=this,s=n.cm,a=s.display,p=n.textarea;n.contextMenuPending&&n.contextMenuPending();var j=Gr(s,e),J=a.scroller.scrollTop;if(!j||v)return;var ie=s.options.resetSelectionOnContextMenu;ie&&s.doc.sel.contains(j)==-1&&Gi(s,nr)(s.doc,Fr(j),xe);var se=p.style.cssText,pe=n.wrapper.style.cssText,Fe=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",p.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-Fe.top-5)+"px; left: "+(e.clientX-Fe.left-5)+`px;
z-index: 1000; background: `+($?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var ze;k&&(ze=window.scrollY),a.input.focus(),k&&window.scrollTo(null,ze),a.input.reset(),s.somethingSelected()||(p.value=n.prevInput=" "),n.contextMenuPending=ut,a.selForContextMenu=s.doc.sel,clearTimeout(a.detectingSelectAll);function pt(){if(p.selectionStart!=null){var Qt=s.somethingSelected(),fn="\u200B"+(Qt?p.value:"");p.value="\u21DA",p.value=fn,n.prevInput=Qt?"":"\u200B",p.selectionStart=1,p.selectionEnd=fn.length,a.selForContextMenu=s.doc.sel}}function ut(){if(n.contextMenuPending!=ut)return;if(n.contextMenuPending=!1,n.wrapper.style.cssText=pe,p.style.cssText=se,$&&X<9&&a.scrollbars.setScrollTop(a.scroller.scrollTop=J),p.selectionStart!=null){(!$||$&&X<9)&&pt();var Qt=0,fn=function(){a.selForContextMenu==s.doc.sel&&p.selectionStart==0&&p.selectionEnd>0&&n.prevInput=="\u200B"?Gi(s,Qs)(s):Qt++<10?a.detectingSelectAll=setTimeout(fn,500):(a.selForContextMenu=null,a.input.reset())};a.detectingSelectAll=setTimeout(fn,200)}}if($&&X>=9&&pt(),O){ce(e);var Ut=function(){Et(window,"mouseup",Ut),setTimeout(ut,20)};Xe(window,"mouseup",Ut)}else setTimeout(ut,50)},li.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},li.prototype.setUneditable=function(){},li.prototype.needsContentAttribute=!1;function ki(e,n){if(n=n?x(n):{},n.value=e.value,!n.tabindex&&e.tabIndex&&(n.tabindex=e.tabIndex),!n.placeholder&&e.placeholder&&(n.placeholder=e.placeholder),n.autofocus==null){var s=F();n.autofocus=s==e||e.getAttribute("autofocus")!=null&&s==document.body}function a(){e.value=ie.getValue()}var p;if(e.form&&(Xe(e.form,"submit",a),!n.leaveSubmitMethodAlone)){var j=e.form;p=j.submit;try{var J=j.submit=function(){a(),j.submit=p,j.submit(),j.submit=J}}catch(se){}}n.finishInit=function(se){se.save=a,se.getTextArea=function(){return e},se.toTextArea=function(){se.toTextArea=isNaN,a(),e.parentNode.removeChild(se.getWrapperElement()),e.style.display="",e.form&&(Et(e.form,"submit",a),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=p))}},e.style.display="none";var ie=Hi(function(se){return e.parentNode.insertBefore(se,e.nextSibling)},n);return ie}function Pi(e){e.off=Et,e.on=Xe,e.wheelEventPixels=io,e.Doc=ur,e.splitLines=gn,e.countColumn=B,e.findColumn=Oe,e.isWordChar=at,e.Pass=he,e.signal=Je,e.Line=yn,e.changeEnd=Yr,e.scrollbarModel=Os,e.Pos=De,e.cmpPos=ht,e.modes=mi,e.mimeModes=ri,e.resolveMode=At,e.getMode=Wn,e.modeExtensions=hi,e.extendMode=ti,e.copyState=Oi,e.startState=Ni,e.innerMode=Ai,e.commands=Ea,e.keyMap=Lr,e.keyName=po,e.isModifierKey=Fa,e.lookupKey=Ir,e.normalizeKeyMap=ll,e.StringStream=wi,e.SharedTextMarker=ya,e.TextMarker=br,e.LineWidget=Ma,e.e_preventDefault=me,e.e_stopPropagation=ye,e.e_stop=ce,e.addClass=N,e.contains=y,e.rmClass=b,e.keyNames=Wr}Zl(Hi),rt(Hi);var Bi="iter insert remove copy getEditor constructor".split(" ");for(var $i in ur.prototype)ur.prototype.hasOwnProperty($i)&&re(Bi,$i)<0&&(Hi.prototype[$i]=function(e){return function(){return e.apply(this.doc,arguments)}}(ur.prototype[$i]));return ke(ur),Hi.inputStyles={textarea:li,contenteditable:Qe},Hi.defineMode=function(e){!Hi.defaults.mode&&e!="null"&&(Hi.defaults.mode=e),_i.apply(this,arguments)},Hi.defineMIME=Si,Hi.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Hi.defineMIME("text/plain","null"),Hi.defineExtension=function(e,n){Hi.prototype[e]=n},Hi.defineDocExtension=function(e,n){ur.prototype[e]=n},Hi.fromTextArea=ki,Pi(Hi),Hi.version="5.58.2",Hi})},WaYH:function(Wt,st,z){"use strict";var oe=z("rePB"),Z=z("Ff2n"),U=z("VTBJ"),ee=z("1OyB"),W=z("vuIU"),M=z("JX7q"),$=z("Ji7U"),X=z("LK+K"),k=z("q1tI"),D=z("TSYQ"),m=z.n(D),v=z("sboe"),f=z("OZM5"),o=function(O){var R=O.prefixCls,b=O.level,_=O.isStart,u=O.isEnd;if(!b)return null;for(var d="".concat(R,"-indent-unit"),E=[],g=0;g<b;g+=1){var y;E.push(k.createElement("span",{key:g,className:m()(d,(y={},Object(oe.a)(y,"".concat(d,"-start"),_[g+1]),Object(oe.a)(y,"".concat(d,"-end"),u[g+1]),Object(oe.a)(y,"".concat(d,"-end-first-level"),!g&&u[0]),y))}))}return k.createElement("span",{"aria-hidden":"true",className:"".concat(R,"-indent")},E)},l=o,r=z("815F"),i="open",t="close",c="---",h=function(w){Object($.a)(R,w);var O=Object(X.a)(R);function R(){var b;return Object(ee.a)(this,R),b=O.apply(this,arguments),b.state={dragNodeHighlight:!1},b.onSelectorClick=function(_){var u=b.props.context.onNodeClick;u(_,Object(r.b)(b.props)),b.isSelectable()?b.onSelect(_):b.onCheck(_)},b.onSelectorDoubleClick=function(_){var u=b.props.context.onNodeDoubleClick;u(_,Object(r.b)(b.props))},b.onSelect=function(_){if(b.isDisabled())return;var u=b.props.context.onNodeSelect;_.preventDefault(),u(_,Object(r.b)(b.props))},b.onCheck=function(_){if(b.isDisabled())return;var u=b.props,d=u.disableCheckbox,E=u.checked,g=b.props.context.onNodeCheck;if(!b.isCheckable()||d)return;_.preventDefault();var y=!E;g(_,Object(r.b)(b.props),y)},b.onMouseEnter=function(_){var u=b.props.context.onNodeMouseEnter;u(_,Object(r.b)(b.props))},b.onMouseLeave=function(_){var u=b.props.context.onNodeMouseLeave;u(_,Object(r.b)(b.props))},b.onContextMenu=function(_){var u=b.props.context.onNodeContextMenu;u(_,Object(r.b)(b.props))},b.onDragStart=function(_){var u=b.props.context.onNodeDragStart;_.stopPropagation(),b.setState({dragNodeHighlight:!0}),u(_,Object(M.a)(b));try{_.dataTransfer.setData("text/plain","")}catch(d){}},b.onDragEnter=function(_){var u=b.props.context.onNodeDragEnter;_.preventDefault(),_.stopPropagation(),u(_,Object(M.a)(b))},b.onDragOver=function(_){var u=b.props.context.onNodeDragOver;_.preventDefault(),_.stopPropagation(),u(_,Object(M.a)(b))},b.onDragLeave=function(_){var u=b.props.context.onNodeDragLeave;_.stopPropagation(),u(_,Object(M.a)(b))},b.onDragEnd=function(_){var u=b.props.context.onNodeDragEnd;_.stopPropagation(),b.setState({dragNodeHighlight:!1}),u(_,Object(M.a)(b))},b.onDrop=function(_){var u=b.props.context.onNodeDrop;_.preventDefault(),_.stopPropagation(),b.setState({dragNodeHighlight:!1}),u(_,Object(M.a)(b))},b.onExpand=function(_){var u=b.props.context.onNodeExpand;u(_,Object(r.b)(b.props))},b.setSelectHandle=function(_){b.selectHandle=_},b.getNodeState=function(){var _=b.props.expanded;return b.isLeaf()?null:_?i:t},b.hasChildren=function(){var _=b.props.eventKey,u=b.props.context.keyEntities,d=u[_]||{},E=d.children;return!!(E||[]).length},b.isLeaf=function(){var _=b.props,u=_.isLeaf,d=_.loaded,E=b.props.context.loadData,g=b.hasChildren();return u===!1?!1:u||!E&&!g||E&&d&&!g},b.isDisabled=function(){var _=b.props.disabled,u=b.props.context.disabled;return!!(u||_)},b.isCheckable=function(){var _=b.props.checkable,u=b.props.context.checkable;return!u||_===!1?!1:u},b.syncLoadData=function(_){var u=_.expanded,d=_.loading,E=_.loaded,g=b.props.context,y=g.loadData,F=g.onNodeLoad;if(d)return;y&&u&&!b.isLeaf()&&(!b.hasChildren()&&!E&&F(Object(r.b)(b.props)))},b.renderSwitcher=function(){var _=b.props,u=_.expanded,d=_.switcherIcon,E=b.props.context,g=E.prefixCls,y=E.switcherIcon,F=d||y;if(b.isLeaf())return k.createElement("span",{className:m()("".concat(g,"-switcher"),"".concat(g,"-switcher-noop"))},typeof F=="function"?F(Object(U.a)(Object(U.a)({},b.props),{},{isLeaf:!0})):F);var N=m()("".concat(g,"-switcher"),"".concat(g,"-switcher_").concat(u?i:t));return k.createElement("span",{onClick:b.onExpand,className:N},typeof F=="function"?F(Object(U.a)(Object(U.a)({},b.props),{},{isLeaf:!1})):F)},b.renderCheckbox=function(){var _=b.props,u=_.checked,d=_.halfChecked,E=_.disableCheckbox,g=b.props.context.prefixCls,y=b.isDisabled(),F=b.isCheckable();if(!F)return null;var N=typeof F!="boolean"?F:null;return k.createElement("span",{className:m()("".concat(g,"-checkbox"),u&&"".concat(g,"-checkbox-checked"),!u&&d&&"".concat(g,"-checkbox-indeterminate"),(y||E)&&"".concat(g,"-checkbox-disabled")),onClick:b.onCheck},N)},b.renderIcon=function(){var _=b.props.loading,u=b.props.context.prefixCls;return k.createElement("span",{className:m()("".concat(u,"-iconEle"),"".concat(u,"-icon__").concat(b.getNodeState()||"docu"),_&&"".concat(u,"-icon_loading"))})},b.renderSelector=function(){var _=b.state.dragNodeHighlight,u=b.props,d=u.title,E=u.selected,g=u.icon,y=u.loading,F=u.data,N=b.props.context,H=N.prefixCls,G=N.showIcon,I=N.icon,x=N.draggable,B=N.loadData,Y=N.titleRender,re=b.isDisabled(),de="".concat(H,"-node-content-wrapper"),he;if(G){var xe=g||I;he=xe?k.createElement("span",{className:m()("".concat(H,"-iconEle"),"".concat(H,"-icon__customize"))},typeof xe=="function"?xe(b.props):xe):b.renderIcon()}else B&&y&&(he=b.renderIcon());var Pe;typeof d=="function"?Pe=d(F):Y?Pe=Y(F):Pe=d;var Ce=k.createElement("span",{className:"".concat(H,"-title")},Pe);return k.createElement("span",{ref:b.setSelectHandle,title:typeof d=="string"?d:"",className:m()("".concat(de),"".concat(de,"-").concat(b.getNodeState()||"normal"),!re&&(E||_)&&"".concat(H,"-node-selected"),!re&&x&&"draggable"),draggable:!re&&x||void 0,"aria-grabbed":!re&&x||void 0,onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,onContextMenu:b.onContextMenu,onClick:b.onSelectorClick,onDoubleClick:b.onSelectorDoubleClick,onDragStart:x?b.onDragStart:void 0},he,Ce)},b}return Object(W.a)(R,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var _=this.props.selectable,u=this.props.context.selectable;return typeof _=="boolean"?_:u}},{key:"render",value:function(){var _,u=this.props,d=u.eventKey,E=u.className,g=u.style,y=u.dragOver,F=u.dragOverGapTop,N=u.dragOverGapBottom,H=u.isLeaf,G=u.isStart,I=u.isEnd,x=u.expanded,B=u.selected,Y=u.checked,re=u.halfChecked,de=u.loading,he=u.domRef,xe=u.active,Pe=u.onMouseMove,Ce=Object(Z.a)(u,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Oe=this.props.context,be=Oe.prefixCls,ge=Oe.filterTreeNode,te=Oe.draggable,fe=Oe.keyEntities,_e=this.isDisabled(),Le=Object(f.f)(Ce),$e=fe[d]||{},Ue=$e.level,at=I[I.length-1];return k.createElement("div",Object.assign({ref:he,className:m()(E,"".concat(be,"-treenode"),(_={},Object(oe.a)(_,"".concat(be,"-treenode-disabled"),_e),Object(oe.a)(_,"".concat(be,"-treenode-switcher-").concat(x?"open":"close"),!H),Object(oe.a)(_,"".concat(be,"-treenode-checkbox-checked"),Y),Object(oe.a)(_,"".concat(be,"-treenode-checkbox-indeterminate"),re),Object(oe.a)(_,"".concat(be,"-treenode-selected"),B),Object(oe.a)(_,"".concat(be,"-treenode-loading"),de),Object(oe.a)(_,"".concat(be,"-treenode-active"),xe),Object(oe.a)(_,"".concat(be,"-treenode-leaf-last"),at),Object(oe.a)(_,"drag-over",!_e&&y),Object(oe.a)(_,"drag-over-gap-top",!_e&&F),Object(oe.a)(_,"drag-over-gap-bottom",!_e&&N),Object(oe.a)(_,"filter-node",ge&&ge(Object(r.b)(this.props))),_)),style:g,onDragEnter:te?this.onDragEnter:void 0,onDragOver:te?this.onDragOver:void 0,onDragLeave:te?this.onDragLeave:void 0,onDrop:te?this.onDrop:void 0,onDragEnd:te?this.onDragEnd:void 0,onMouseMove:Pe},Le),k.createElement(l,{prefixCls:be,level:Ue,isStart:G,isEnd:I}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),R}(k.Component),A=function(O){return k.createElement(v.a.Consumer,null,function(R){return k.createElement(h,Object.assign({},O,{context:R}))})};A.displayName="TreeNode",A.defaultProps={title:c},A.isTreeNode=1;var S=st.a=A},XIdC:function(Wt,st,z){"use strict";var oe=z("rePB"),Z=z("ODXe"),U=z("Ff2n"),ee=z("q1tI"),W=z.n(ee),M=z("TSYQ"),$=z.n(M),X=z("6cGi"),k=z("4IlW"),D=ee.forwardRef(function(m,v){var f,o=m.prefixCls,l=o===void 0?"rc-switch":o,r=m.className,i=m.checked,t=m.defaultChecked,c=m.disabled,h=m.loadingIcon,A=m.checkedChildren,S=m.unCheckedChildren,w=m.onClick,O=m.onChange,R=m.onKeyDown,b=Object(U.a)(m,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),_=Object(X.a)(!1,{value:i,defaultValue:t}),u=Object(Z.a)(_,2),d=u[0],E=u[1];function g(H,G){var I=d;return c||(I=H,E(I),O==null||O(I,G)),I}function y(H){H.which===k.a.LEFT?g(!1,H):H.which===k.a.RIGHT&&g(!0,H),R==null||R(H)}function F(H){var G=g(!d,H);w==null||w(G,H)}var N=$()(l,r,(f={},Object(oe.a)(f,"".concat(l,"-checked"),d),Object(oe.a)(f,"".concat(l,"-disabled"),c),f));return ee.createElement("button",Object.assign({},b,{type:"button",role:"switch","aria-checked":d,disabled:c,className:N,ref:v,onKeyDown:y,onClick:F}),h,ee.createElement("span",{className:"".concat(l,"-inner")},d?A:S))});D.displayName="Switch",st.a=D},Y1PL:function(Wt,st,z){"use strict";z.r(st),z.d(st,"ResizableTextArea",function(){return re});var oe=z("wx14"),Z=z("1OyB"),U=z("vuIU"),ee=z("Ji7U"),W=z("LK+K"),M=z("q1tI"),$=z("VTBJ"),X=z("rePB"),k=z("Zm9Q"),D=z("Kwbf"),m=z("c+Xe"),v=z("m+aA"),f=z("bdgK"),o=new Map;function l(xe){xe.forEach(function(Pe){var Ce,Oe=Pe.target;(Ce=o.get(Oe))===null||Ce===void 0||Ce.forEach(function(be){return be(Oe)})})}var r=new f.default(l),i=null,t=null;function c(xe,Pe){o.has(xe)||(o.set(xe,new Set),r.observe(xe)),o.get(xe).add(Pe)}function h(xe,Pe){o.has(xe)&&(o.get(xe).delete(Pe),o.get(xe).size||(r.unobserve(xe),o.delete(xe)))}var A=function(xe){Object(ee.a)(Ce,xe);var Pe=Object(W.a)(Ce);function Ce(){return Object(Z.a)(this,Ce),Pe.apply(this,arguments)}return Object(U.a)(Ce,[{key:"render",value:function(){return this.props.children}}]),Ce}(M.Component),S=M.createContext(null);function w(xe){var Pe=xe.children,Ce=xe.onBatchResize,Oe=M.useRef(0),be=M.useRef([]),ge=M.useContext(S),te=M.useCallback(function(fe,_e,Le){Oe.current+=1;var $e=Oe.current;be.current.push({size:fe,element:_e,data:Le}),Promise.resolve().then(function(){$e===Oe.current&&(Ce==null||Ce(be.current),be.current=[])}),ge==null||ge(fe,_e,Le)},[Ce,ge]);return M.createElement(S.Provider,{value:te},Pe)}function O(xe){var Pe=xe.children,Ce=xe.disabled,Oe=M.useRef(null),be=M.useRef(null),ge=M.useContext(S),te=M.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),fe=M.isValidElement(Pe)&&Object(m.c)(Pe),_e=fe?Pe.ref:null,Le=M.useMemo(function(){return Object(m.a)(_e,Oe)},[_e,Oe]),$e=M.useRef(xe);$e.current=xe;var Ue=M.useCallback(function(at){var ft=$e.current,Ct=ft.onResize,yt=ft.data,_t=at.getBoundingClientRect(),lt=_t.width,Ft=_t.height,Xt=at.offsetWidth,Jt=at.offsetHeight,rn=Math.floor(lt),En=Math.floor(Ft);if(te.current.width!==rn||te.current.height!==En||te.current.offsetWidth!==Xt||te.current.offsetHeight!==Jt){var mn={width:rn,height:En,offsetWidth:Xt,offsetHeight:Jt};te.current=mn;var Ye=Xt===Math.round(lt)?lt:Xt,Xe=Jt===Math.round(Ft)?Ft:Jt,Ot=Object($.a)(Object($.a)({},mn),{},{offsetWidth:Ye,offsetHeight:Xe});ge==null||ge(Ot,at,yt),Ct&&Promise.resolve().then(function(){Ct(Ot,at)})}},[]);return M.useEffect(function(){var at=Object(v.a)(Oe.current)||Object(v.a)(be.current);return at&&!Ce&&c(at,Ue),function(){return h(at,Ue)}},[Oe.current,Ce]),M.createElement(A,{ref:be},fe?M.cloneElement(Pe,{ref:Le}):Pe)}var R="rc-observer-key";function b(xe){var Pe=xe.children,Ce=Object(k.a)(Pe);return Ce.map(function(Oe,be){var ge=(Oe==null?void 0:Oe.key)||"".concat(R,"-").concat(be);return M.createElement(O,Object(oe.a)({},xe,{key:ge}),Oe)})}b.Collection=w;var _=b,u=z("bT9E"),d=z("TSYQ"),E=z.n(d),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
`,y=["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"],F={},N;function H(xe){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Pe&&F[Ce])return F[Ce];var Oe=window.getComputedStyle(xe),be=Oe.getPropertyValue("box-sizing")||Oe.getPropertyValue("-moz-box-sizing")||Oe.getPropertyValue("-webkit-box-sizing"),ge=parseFloat(Oe.getPropertyValue("padding-bottom"))+parseFloat(Oe.getPropertyValue("padding-top")),te=parseFloat(Oe.getPropertyValue("border-bottom-width"))+parseFloat(Oe.getPropertyValue("border-top-width")),fe=y.map(function(Le){return"".concat(Le,":").concat(Oe.getPropertyValue(Le))}).join(";"),_e={sizingStyle:fe,paddingSize:ge,borderSize:te,boxSizing:be};return Pe&&Ce&&(F[Ce]=_e),_e}function G(xe){var Pe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Oe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;N||(N=document.createElement("textarea"),N.setAttribute("tab-index","-1"),N.setAttribute("aria-hidden","true"),document.body.appendChild(N)),xe.getAttribute("wrap")?N.setAttribute("wrap",xe.getAttribute("wrap")):N.removeAttribute("wrap");var be=H(xe,Pe),ge=be.paddingSize,te=be.borderSize,fe=be.boxSizing,_e=be.sizingStyle;N.setAttribute("style","".concat(_e,";").concat(g)),N.value=xe.value||xe.placeholder||"";var Le=Number.MIN_SAFE_INTEGER,$e=Number.MAX_SAFE_INTEGER,Ue=N.scrollHeight,at;if(fe==="border-box"?Ue+=te:fe==="content-box"&&(Ue-=ge),Ce!==null||Oe!==null){N.value=" ";var ft=N.scrollHeight-ge;Ce!==null&&(Le=ft*Ce,fe==="border-box"&&(Le=Le+ge+te),Ue=Math.max(Le,Ue)),Oe!==null&&($e=ft*Oe,fe==="border-box"&&($e=$e+ge+te),at=Ue>$e?"":"hidden",Ue=Math.min($e,Ue))}return{height:Ue,minHeight:Le,maxHeight:$e,overflowY:at,resize:"none"}}var I=z("Gytx"),x=z.n(I),B;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(B||(B={}));var Y=function(xe){Object(ee.a)(Ce,xe);var Pe=Object(W.a)(Ce);function Ce(Oe){var be;return Object(Z.a)(this,Ce),be=Pe.call(this,Oe),be.nextFrameActionId=void 0,be.resizeFrameId=void 0,be.textArea=void 0,be.saveTextArea=function(ge){be.textArea=ge},be.handleResize=function(ge){var te=be.state.resizeStatus,fe=be.props,_e=fe.autoSize,Le=fe.onResize;if(te!==B.NONE)return;typeof Le=="function"&&Le(ge),_e&&be.resizeOnNextFrame()},be.resizeOnNextFrame=function(){cancelAnimationFrame(be.nextFrameActionId),be.nextFrameActionId=requestAnimationFrame(be.resizeTextarea)},be.resizeTextarea=function(){var ge=be.props.autoSize;if(!ge||!be.textArea)return;var te=ge.minRows,fe=ge.maxRows,_e=G(be.textArea,!1,te,fe);be.setState({textareaStyles:_e,resizeStatus:B.RESIZING},function(){cancelAnimationFrame(be.resizeFrameId),be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:B.RESIZED},function(){be.resizeFrameId=requestAnimationFrame(function(){be.setState({resizeStatus:B.NONE}),be.fixFirefoxAutoScroll()})})})})},be.renderTextArea=function(){var ge=be.props,te=ge.prefixCls,fe=te===void 0?"rc-textarea":te,_e=ge.autoSize,Le=ge.onResize,$e=ge.className,Ue=ge.disabled,at=be.state,ft=at.textareaStyles,Ct=at.resizeStatus,yt=Object(u.a)(be.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),_t=E()(fe,$e,Object(X.a)({},"".concat(fe,"-disabled"),Ue));"value"in yt&&(yt.value=yt.value||"");var lt=Object($.a)(Object($.a)(Object($.a)({},be.props.style),ft),Ct===B.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return M.createElement(_,{onResize:be.handleResize,disabled:!(_e||Le)},M.createElement("textarea",Object(oe.a)({},yt,{className:_t,style:lt,ref:be.saveTextArea})))},be.state={textareaStyles:{},resizeStatus:B.NONE},be}return Object(U.a)(Ce,[{key:"componentDidUpdate",value:function(be){(be.value!==this.props.value||!x()(be.autoSize,this.props.autoSize))&&this.resizeTextarea()}},{key:"componentWillUnmount",value:function(){cancelAnimationFrame(this.nextFrameActionId),cancelAnimationFrame(this.resizeFrameId)}},{key:"fixFirefoxAutoScroll",value:function(){try{if(document.activeElement===this.textArea){var be=this.textArea.selectionStart,ge=this.textArea.selectionEnd;this.textArea.setSelectionRange(be,ge)}}catch(te){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ce}(M.Component),re=Y,de=function(xe){Object(ee.a)(Ce,xe);var Pe=Object(W.a)(Ce);function Ce(Oe){var be;Object(Z.a)(this,Ce),be=Pe.call(this,Oe),be.resizableTextArea=void 0,be.focus=function(){be.resizableTextArea.textArea.focus()},be.saveTextArea=function(te){be.resizableTextArea=te},be.handleChange=function(te){var fe=be.props.onChange;be.setValue(te.target.value,function(){be.resizableTextArea.resizeTextarea()}),fe&&fe(te)},be.handleKeyDown=function(te){var fe=be.props,_e=fe.onPressEnter,Le=fe.onKeyDown;te.keyCode===13&&_e&&_e(te),Le&&Le(te)};var ge=typeof Oe.value=="undefined"||Oe.value===null?Oe.defaultValue:Oe.value;return be.state={value:ge},be}return Object(U.a)(Ce,[{key:"setValue",value:function(be,ge){"value"in this.props||this.setState({value:be},ge)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return M.createElement(re,Object(oe.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(be){return"value"in be?{value:be.value}:null}}]),Ce}(M.Component),he=st.default=de},YIbm:function(Wt,st,z){Wt.exports={content:"content___24s9X"}},"YJx+":function(Wt,st,z){Wt.exports={flex_box_center:"flex_box_center___TKIS5",flex_space_between:"flex_space_between___3ITJg",flex_box_vertical_center:"flex_box_vertical_center___pGLbk",flex_box_center_end:"flex_box_center_end___3-z2A",flex_box_column:"flex_box_column___1SlIq",wrap:"wrap___2TxDh",modal:"modal___jkvmI",titleWrap:"titleWrap___386Y5",required:"required___3ddar",title:"title___2scfU",colorGray:"colorGray___10JDh",choiceWrap:"choiceWrap___3UMox",answer:"answer___1kvCr",activeAnswer:"activeAnswer___1tun2",deleteIcon:"deleteIcon___2_EJk",addIcon:"addIcon___b404_",editorWrap:"editorWrap___1qDS7",htmlWrap:"htmlWrap___2ear6",radio:"radio___3EFAB",color333:"color333___lt3ql",color999:"color999___11Mt_",questionType:"questionType___1yIj7",questionChoices:"questionChoices___1n3A7",action:"action___3PqBm",difficult:"difficult___1L4Zj",fold:"fold___3zBy6",head:"head___1dsW5"}},Z9P2:function(Wt,st,z){"use strict";var oe=z("+BJd"),Z=z("mr32"),U=z("14J3"),ee=z("BMrR"),W=z("5NDa"),M=z("5rEg"),$=z("oBTY"),X=z("5Dmo"),k=z("3S7+"),D=z("miYZ"),m=z("tsqr"),v=z("tJVT"),f=z("q1tI"),o=z.n(f),l=function(i){var t,c,h=i.value,A=h===void 0?[[],[]]:h,S=i.onChange,w=Object(f.useState)(""),O=Object(v.a)(w,2),R=O[0],b=O[1],_=Object(f.useState)(""),u=Object(v.a)(_,2),d=u[0],E=u[1],g=function(F){if(!F)return!1;var N=new RegExp("[ `~!@#$^&*()={}':;,\\[\\].<>/?~\uFF01@#\uFFE5\u2026\u2026&*\uFF08\uFF09\u2014\u3010\u3011\u2018\uFF1B\uFF1A\u201D\u201C\u3002\uFF0C\u3001\uFF1F\u300C\u300D\u300E\u300F_\\+\\-\xB7%\u300A\u300B]|[\\\\/]");return N.test(F)?(m.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u542B\u6709\u7279\u6B8A\u5B57\u7B26\uFF01"),!1):F==="|"?(m.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0};return o.a.createElement("div",null,o.a.createElement("p",{className:"font14"},"\u5173\u952E\u8BCD",o.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5173\u952E\u8BCD\u53EF\u7528\u4E8E\u81EA\u52A8\u5224\u5206\uFF09"),o.a.createElement(k.a,{overlayStyle:{maxWidth:350},title:o.a.createElement("div",null,o.a.createElement("div",null,"\u6BCF\u4E2A\u6838\u5FC3\u5173\u952E\u8BCD\u7684\u5206\u6570\u662F\u666E\u901A\u5173\u952E\u8BCD\u5206\u6570\u7684\u4E24\u500D"),o.a.createElement("div",null,"\u4F8B\u5982\uFF1A"),o.a.createElement("div",null,"\u672C\u989810\u5206\uFF0C\u666E\u901A\u5173\u952E\u8BCD1\u4E2A\uFF0C\u6838\u5FC3\u5173\u952E\u8BCD2\u4E2A\uFF0C\u5219\u6BCF\u4E2A"),o.a.createElement("div",null,"\u666E\u901A\u5173\u952E\u8BCD2\u5206\uFF0C\u6BCF\u4E2A\u6838\u5FC3\u5173\u952E\u8BCD4\u5206"))},o.a.createElement("span",{className:"iconfont icon-a-wenhaobeifen2 font14"}))),o.a.createElement(ee.a,{align:"middle",className:"font14"},"\u666E\u901A\u5173\u952E\u8BCD\uFF1A",o.a.createElement(M.a,{value:R,onChange:function(F){b(F.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(F){var N,H=(N=F.target)===null||N===void 0?void 0:N.value;if(g(H)){var G,I;(G=A[0])===null||G===void 0||G.push(H==null||((I=H.split("|"))===null||I===void 0)?void 0:I.filter(function(x){return!!x})),S(Object($.a)(A)),b("")}},style:{width:800},className:"ml5 mr10",placeholder:"\u652F\u6301\u4FDD\u5B58\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u7528\u201D|\u201D\u5206\u5272\u3002"}),o.a.createElement("span",{className:"c-grey-999"},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),o.a.createElement("div",{style:{paddingLeft:89},className:"mt10"},A==null||((t=A[0])===null||t===void 0)?void 0:t.map(function(y,F){return o.a.createElement(Z.a,{className:"mb10",key:F,closable:!0,onClose:function(H){var G;H.preventDefault(),A[0]=(G=A[0])===null||G===void 0?void 0:G.filter(function(I,x){return x!==F}),S(Object($.a)(A))}},y==null?void 0:y.join(" \u6216 "))})),o.a.createElement(ee.a,{align:"middle",className:"font14"},"\u6838\u5FC3\u5173\u952E\u8BCD\uFF1A",o.a.createElement(M.a,{value:d,onChange:function(F){E(F.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(F){var N,H=(N=F.target)===null||N===void 0?void 0:N.value;if(g(H)){var G,I;(G=A[1])===null||G===void 0||G.push(H==null||((I=H.split("|"))===null||I===void 0)?void 0:I.filter(function(x){return!!x})),S(Object($.a)(A)),E("")}},style:{width:800},className:"ml5 mr10",placeholder:"\u652F\u6301\u4FDD\u5B58\u591A\u4E2A\u5173\u952E\u8BCD\uFF1B\u5E76\u5217\u5173\u952E\u8BCD\uFF08\u6216\u7684\u5173\u7CFB\uFF09\u7528\u201D|\u201D\u5206\u5272\u3002"}),o.a.createElement("span",{className:"c-grey-999"},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),o.a.createElement("div",{style:{paddingLeft:89},className:"mt10"},A==null||((c=A[1])===null||c===void 0)?void 0:c.map(function(y,F){return o.a.createElement(Z.a,{className:"mb10",key:F,closable:!0,onClose:function(H){var G;H.preventDefault(),A[1]=(G=A[1])===null||G===void 0?void 0:G.filter(function(I,x){return x!==F}),S(Object($.a)(A))}},y==null?void 0:y.join(" \u6216 "))})))};st.a=l},ZW9T:function(Wt,st,z){"use strict";z.d(st,"a",function(){return G});var oe=z("k1fw"),Z=z("miYZ"),U=z("tsqr"),ee=z("rAM+"),W=z("tJVT"),M=z("PpiC"),$=z("q1tI"),X=z.n($),k=z("bdgK"),D=z("oBTY"),m=z("9og8"),v=z("WmNS"),f=z.n(v),o={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"]},l={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},r={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},i={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(`
`)}]},t=z("5VLF"),c=z.n(t),h={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"]}},A=function(x,B){return B.map(function(Y){return{label:Y,kind:x.languages.CompletionItemKind.Keyword,insertText:Y}})},S=function(x){return Object.keys(h.tables).map(function(B){return{label:B,kind:x.languages.CompletionItemKind.Variable,insertText:B}})},w=function(x,B){var Y=h.tables[x];return Y?Y.map(function(re){return{label:re,kind:B.languages.CompletionItemKind.Field,insertText:re}}):[]};function O(I,x,B,Y,re){var de=x.getWordUntilPosition(B),he={startLineNumber:B.lineNumber,endLineNumber:B.lineNumber,startColumn:de.startColumn,endColumn:de.endColumn},xe=Y.map(function(Pe){return{label:Pe,kind:I.languages.CompletionItemKind.Keyword,insertText:Pe,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:he}});return re.map(function(Pe){xe.push(Object(oe.a)(Object(oe.a)({},Pe),{},{range:he}))}),xe}var R=function(I){h.languages.map(function(re){return I.languages.registerDocumentFormattingEditProvider(re,{provideDocumentFormattingEdits:function(he,xe,Pe){return Object(m.a)(f.a.mark(function Ce(){var Oe;return f.a.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return Oe=c()(he.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}),ge.abrupt("return",[{range:he.getFullModelRange(),text:Oe}]);case 2:case"end":return ge.stop()}},Ce)}))()}}),re});var x=r.quickKey.map(function(re){return{label:re.label,kind:I.languages.CompletionItemKind.Method,insertText:re.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),B=i.quickKey.map(function(re){return{label:re.label,kind:I.languages.CompletionItemKind.Method,insertText:re.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Y=l.quickKey.map(function(re){return{label:re.label,kind:I.languages.CompletionItemKind.Method,insertText:re.content,insertTextRules:I.languages.CompletionItemInsertTextRule.InsertAsSnippet}});I.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(D.a)(r.keywords),Object(D.a)(r.quickKey.map(function(re){return re.label}))),provideCompletionItems:function(de,he){var xe=de.getValueInRange({startLineNumber:he.lineNumber,startColumn:1,endLineNumber:he.lineNumber,endColumn:he.column}),Pe=xe.match(/cu/gim);console.log("match:",Pe,he,xe,de);var Ce=[],Oe=he.lineNumber,be=he.column,ge=de.getValueInRange({startLineNumber:Oe,startColumn:0,endLineNumber:Oe,endColumn:be}),te=ge.trim().split(/\s+/),fe=te[te.length-1];if(fe.endsWith(".")){var _e=fe.slice(0,fe.length-1);Object.keys(h.tables).includes(_e)&&(Ce=Object(D.a)(w(_e,I)))}else fe==="."?Ce=[]:Ce=[].concat(Object(D.a)(S(I)),Object(D.a)(A(I,r.keywords)),Object(D.a)(x));return{suggestions:Ce}}}),I.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(D.a)(o.keywords)),provideCompletionItems:function(de,he){var xe=de.getValueInRange({startLineNumber:he.lineNumber,startColumn:1,endLineNumber:he.lineNumber,endColumn:he.column}),Pe=xe.match(/cu/gim);console.log("match:",Pe,he,xe,de);var Ce=[],Oe=he.lineNumber,be=he.column,ge=de.getValueInRange({startLineNumber:Oe,startColumn:0,endLineNumber:Oe,endColumn:be}),te=ge.trim().split(/\s+/),fe=te[te.length-1];if(fe.endsWith(".")){var _e=fe.slice(0,fe.length-1);Object.keys(h.tables).includes(_e)&&(Ce=Object(D.a)(w(_e,I)))}else fe==="."?Ce=[]:Ce=[].concat(Object(D.a)(S(I)),Object(D.a)(A(I,o.keywords)));return{suggestions:Ce}}}),I.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(D.a)(l.keywords)),provideCompletionItems:function(de,he){var xe=[],Pe=he.lineNumber,Ce=he.column,Oe=de.getValueInRange({startLineNumber:Pe,startColumn:0,endLineNumber:Pe,endColumn:Ce}),be=Oe.trim().split(/\s+/),ge=be[be.length-1];if(ge.endsWith(".")){var te=ge.slice(0,ge.length-1);Object.keys(h.tables).includes(te)&&(xe=Object(D.a)(w(te,I)))}else ge==="."?xe=[]:xe=[].concat(Object(D.a)(S(I)),Object(D.a)(A(I,l.keywords)),Object(D.a)(Y));return{suggestions:xe}}}),I.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(D.a)(i.keywords)),provideCompletionItems:function(de,he){var xe=[],Pe=he.lineNumber,Ce=he.column,Oe=de.getValueInRange({startLineNumber:Pe,startColumn:0,endLineNumber:Pe,endColumn:Ce}),be=Oe.trim().split(/\s+/),ge=be[be.length-1];if(ge.endsWith(".")){var te=ge.slice(0,ge.length-1);Object.keys(h.tables).includes(te)&&(xe=Object(D.a)(w(te,I)))}else ge==="."?xe=[]:xe=[].concat(Object(D.a)(S(I)),Object(D.a)(A(I,i.keywords)),Object(D.a)(B));return{suggestions:xe}}})},b="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",_=z("LvDl"),u=z("+ua5");function d(I){return/^\d+$/.test(I)?"".concat(I,"px"):I}function E(){}var g=!1,y={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function F(){var I=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],x=I;if(Array.isArray(I)){for(var B=0;B<I.length;B++){var Y=y[I[B]];if(Y)return Y}return x[0]}return y[x]||x}var N=null,H=st.b=function(I){var x=I.width,B=x===void 0?"100%":x,Y=I.height,re=Y===void 0?"100%":Y,de=I.value,he=I.language,xe=he===void 0?"javascript":he,Pe=I.style,Ce=Pe===void 0?{}:Pe,Oe=I.options,be=Oe===void 0?{}:Oe,ge=I.overrideServices,te=ge===void 0?{}:ge,fe=I.theme,_e=fe===void 0?"vs-dark":fe,Le=I.onEditBlur,$e=I.onSave,Ue=I.autoHeight,at=Ue===void 0?!1:Ue,ft=I.forbidCopy,Ct=ft===void 0?!1:ft,yt=I.onChange,_t=yt===void 0?E:yt,lt=I.editorDidMount,Ft=lt===void 0?E:lt,Xt=I.onFocus,Jt=Xt===void 0?E:Xt,rn=I.filename,En=rn===void 0?"educoder.txt":rn,mn=I.errorLine,Ye=I.errorContent,Xe=Ye===void 0?"":Ye,Ot=Object(M.a)(I,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Et=Object($.useRef)(),Je=Object($.useRef)({}),mt=Object($.useRef)(),Be=Object($.useRef)(!1),Ie=Object($.useRef)(),ke=Object($.useState)(!1),me=Object(W.a)(ke,2),ye=me[0],Re=me[1];function ce(){var At;return Et.current&&(At=new k.default(function(Wn){var hi=Object(ee.a)(Wn),ti;try{for(hi.s();!(ti=hi.n()).done;){var Oi=ti.value;(Oi.target.offsetHeight>0||Oi.target.offsetWidth>0)&&Je.current.instance.layout()}}catch(Ai){hi.e(Ai)}finally{hi.f()}}),At.observe(Et.current)),At}function Me(){U.b.warn(decodeURIComponent(b))}var tt=function(){var Wn=Je.current.instance;if(de!=null&&Wn&&ye){var hi=Wn.getModel();hi&&de!==hi.getValue()&&(g=!0,hi.setValue(de),Wn.layout(),g=!1)}};Object($.useEffect)(function(){mt.current&&clearTimeout(mt.current),mt.current=setTimeout(function(){tt()},500)},[de,ye,Je.current]),Object($.useEffect)(function(){if(mn&&Je.current&&Je.current.instance){var At=Je.current.instance;At.changeViewZones(function(hi){var ti=document.createElement("div");ti.style.padding="10px 20px",ti.style.width="calc(100% - 20px)",ti.className="my-error-line-wrp",ti.innerHTML=Xe,hi.addZone({afterLineNumber:mn||11,heightInLines:3,domNode:ti})});var Wn={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}};At.addOverlayWidget(Wn),At.revealPositionInCenter({lineNumber:20,column:1})}},[mn,Je.current,ye]);function bt(){var At=Je.current.instance;if(At){var Wn=At.getSelection(),hi=Je.current.pastePos||{},ti=new N.Range(hi.startLineNumber||Wn.endLineNumber,hi.startColumn||Wn.endColumn,hi.endLineNumber||Wn.endLineNumber,hi.endColumn||Wn.endColumn);setTimeout(function(){At.executeEdits("",[{range:ti,text:""}])},300)}}function Kt(At){(window.navigator.platform.match("Mac")?At.metaKey:At.ctrlKey)&&At.keyCode==83&&(At.preventDefault(),$e())}var Gt=function(){if(at&&Je.current.instance){var Wn=Je.current.instance.getContentHeight();_i(Wn<re?re:Wn)}else _i(re)};function $t(At){var Wn=document.createEvent("MouseEvents");Wn.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),At.dispatchEvent(Wn)}function ei(At,Wn){var hi=window.URL||window.webkitURL||window,ti=new Blob([Wn]),Oi=document.createElementNS("http://www.w3.org/1999/xhtml","a");Oi.href=hi.createObjectURL(ti),Oi.download=At,$t(Oi)}Object($.useEffect)(function(){Gt()},[Gt]),Object($.useEffect)(function(){Et.current&&!ye&&z.e(27).then(z.t.bind(null,"M/lh",7)).then(function(At){try{N=At,Je.current.instance=N.editor.create(Et.current,{value:de,language:F(xe),theme:_e,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},te);var Wn=Je.current.instance;if(Ft(Wn,N),setTimeout(function(){Gt(),Je.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ei(En||"educoder.txt",Wn.getValue())}})},500),Je.current.subscription=Wn.onDidChangeModelContent(function(ti){Be.current?clearTimeout(Ie.current):(Gt(),_t(Wn.getValue(),ti)),Ie.current=setTimeout(function(){Be.current=!1},500)}),window.Monaco||R(N),Ct&&(Wn.addCommand(N.KeyMod.CtrlCmd|N.KeyMod.Shift|N.KeyCode.KEY_V,function(){return Me(),null}),Wn.addCommand(N.KeyMod.CtrlCmd|N.KeyCode.KEY_C,function(){return Me(),null})),window.Monaco=N,Le&&Wn.onDidBlurEditorWidget(function(){Le(Wn.getValue())}),Jt&&Wn.onDidFocusEditorText(function(){Jt(Wn.getValue())}),Ct){Wn.addCommand(N.KeyMod.CtrlCmd|N.KeyCode.KEY_V,function(){return Me(),null}),Wn.onDidPaste(function(ti){Je.current.pastePos=ti});try{window.addEventListener("paste",bt)}catch(ti){}}var hi=ce();return Re(!0),function(){var ti=Je.current.instance;ti.dispose();var Oi=ti.getModel();Oi&&Oi.dispose(),Je.current.subscription&&Je.current.subscription.dispose(),Ct&&window.removeEventListener("paste",bt),hi.unobserve(Et.current)}}catch(ti){}})},[]),Object($.useEffect)(function(){var At=Je.current.instance;if(At&&ye)return document.addEventListener("keydown",Kt,!1),function(){document.removeEventListener("keydown",Kt)}},[$e,ye]),Object($.useEffect)(function(){var At=Je.current.instance;if(At&&ye){var Wn=F(xe);N.editor.setModelLanguage(At.getModel(),Wn),console.log("language:",xe,At.getModel(),Wn)}},[xe,ye]),Object($.useEffect)(function(){var At=Je.current.instance;At&&ye&&N.editor.setTheme(_e)},[_e,ye]),Object($.useEffect)(function(){var At=Je.current.instance;At&&ye&&(At.updateOptions(Object(oe.a)({},be)),setTimeout(function(){At.getModel().updateOptions(Object(oe.a)({},be))},200))},[JSON.stringify(be),ye]),Object($.useEffect)(function(){var At=Je.current.instance;At&&ye&&At.layout()},[B,re,ye]);var gn=Object($.useState)(d(B)),an=Object(W.a)(gn,2),dn=an[0],zn=an[1],pi=Object($.useState)(d(re)),mi=Object(W.a)(pi,2),ri=mi[0],_i=mi[1],Si=Object(oe.a)(Object(oe.a)({},Ce),{},{width:dn,height:ri});return X.a.createElement("div",{className:"my-monaco-editor",ref:Et,style:Si})};function G(I){var x=I.width,B=x===void 0?"100%":x,Y=I.height,re=Y===void 0?"100%":Y,de=I.original,he=I.modified,xe=I.language,Pe=I.options,Ce=Pe===void 0?{}:Pe,Oe=Object($.useRef)(),be=Object($.useState)(null),ge=Object(W.a)(be,2),te=ge[0],fe=ge[1];function _e(at){var ft;return Oe.current&&(ft=new k.default(function(Ct){var yt=Object(ee.a)(Ct),_t;try{for(yt.s();!(_t=yt.n()).done;){var lt=_t.value;(lt.target.offsetHeight>0||lt.target.offsetWidth>0)&&at.layout()}}catch(Ft){yt.e(Ft)}finally{yt.f()}}),ft.observe(Oe.current)),ft}Object($.useEffect)(function(){Oe.current&&z.e(27).then(z.t.bind(null,"M/lh",7)).then(function(at){N=at;var ft=N.editor.createDiffEditor(Oe.current,Object(oe.a)(Object(oe.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},Ce),{},{wordWrap:!0}));fe(ft);var Ct=_e(ft);return function(){ft.dispose();var yt=ft.getModel();yt&&yt.dispose(),Ct.unobserve(Oe.current)}})},[]),Object($.useEffect)(function(){te&&te.setModel({original:N.editor.createModel(de,xe),modified:N.editor.createModel(he,xe)})},[de,he,xe,te]);var Le=d(B),$e=d(re),Ue={width:Le,height:$e};return X.a.createElement("div",{className:"my-diff-editor",ref:Oe,style:Ue})}},ZWs3:function(Wt,st,z){"use strict";z.d(st,"a",function(){return m});var oe=z("+L6B"),Z=z("2/Rp"),U=z("0Owb"),ee=z("9og8"),W=z("tJVT"),M=z("PpiC"),$=z("WmNS"),X=z.n($),k=z("q1tI"),D=z.n(k),m=function(f){var o=f.children,l=Object(M.a)(f,["children"]),r=Object(k.useState)(!1),i=Object(W.a)(r,2),t=i[0],c=i[1];return D.a.createElement(Z.a,Object(U.a)({},l,{loading:t,onClick:function(){var h=Object(ee.a)(X.a.mark(function A(S){return X.a.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.prev=0,c(!0),O.next=4,l.onClick(S);case 4:c(!1),O.next=10;break;case 7:O.prev=7,O.t0=O.catch(0),c(!1);case 10:case"end":return O.stop()}},A,null,[[0,7]])}));return function(A){return h.apply(this,arguments)}}()}),o)}},ZpRC:function(Wt,st,z){"use strict";function oe(m){return typeof m=="object"&&m!=null&&m.nodeType===1}function Z(m,v){return(!v||m!=="hidden")&&m!=="visible"&&m!=="clip"}function U(m,v){if(m.clientHeight<m.scrollHeight||m.clientWidth<m.scrollWidth){var f=getComputedStyle(m,null);return Z(f.overflowY,v)||Z(f.overflowX,v)||function(o){var l=function(r){if(!r.ownerDocument||!r.ownerDocument.defaultView)return null;try{return r.ownerDocument.defaultView.frameElement}catch(i){return null}}(o);return!!l&&(l.clientHeight<o.scrollHeight||l.clientWidth<o.scrollWidth)}(m)}return!1}function ee(m,v,f,o,l,r,i,t){return r<m&&i>v||r>m&&i<v?0:r<=m&&t<=f||i>=v&&t>=f?r-m-o:i>v&&t<f||r<m&&t>f?i-v+l:0}var W=function(m,v){var f=window,o=v.scrollMode,l=v.block,r=v.inline,i=v.boundary,t=v.skipOverflowHiddenElements,c=typeof i=="function"?i:function(ft){return ft!==i};if(!oe(m))throw new TypeError("Invalid target");for(var h=document.scrollingElement||document.documentElement,A=[],S=m;oe(S)&&c(S);){if((S=S.parentElement)===h){A.push(S);break}S!=null&&S===document.body&&U(S)&&!U(document.documentElement)||S!=null&&U(S,t)&&A.push(S)}for(var w=f.visualViewport?f.visualViewport.width:innerWidth,O=f.visualViewport?f.visualViewport.height:innerHeight,R=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,_=m.getBoundingClientRect(),u=_.height,d=_.width,E=_.top,g=_.right,y=_.bottom,F=_.left,N=l==="start"||l==="nearest"?E:l==="end"?y:E+u/2,H=r==="center"?F+d/2:r==="end"?g:F,G=[],I=0;I<A.length;I++){var x=A[I],B=x.getBoundingClientRect(),Y=B.height,re=B.width,de=B.top,he=B.right,xe=B.bottom,Pe=B.left;if(o==="if-needed"&&E>=0&&F>=0&&y<=O&&g<=w&&E>=de&&y<=xe&&F>=Pe&&g<=he)return G;var Ce=getComputedStyle(x),Oe=parseInt(Ce.borderLeftWidth,10),be=parseInt(Ce.borderTopWidth,10),ge=parseInt(Ce.borderRightWidth,10),te=parseInt(Ce.borderBottomWidth,10),fe=0,_e=0,Le="offsetWidth"in x?x.offsetWidth-x.clientWidth-Oe-ge:0,$e="offsetHeight"in x?x.offsetHeight-x.clientHeight-be-te:0;if(h===x)fe=l==="start"?N:l==="end"?N-O:l==="nearest"?ee(b,b+O,O,be,te,b+N,b+N+u,u):N-O/2,_e=r==="start"?H:r==="center"?H-w/2:r==="end"?H-w:ee(R,R+w,w,Oe,ge,R+H,R+H+d,d),fe=Math.max(0,fe+b),_e=Math.max(0,_e+R);else{fe=l==="start"?N-de-be:l==="end"?N-xe+te+$e:l==="nearest"?ee(de,xe,Y,be,te+$e,N,N+u,u):N-(de+Y/2)+$e/2,_e=r==="start"?H-Pe-Oe:r==="center"?H-(Pe+re/2)+Le/2:r==="end"?H-he+ge+Le:ee(Pe,he,re,Oe,ge+Le,H,H+d,d);var Ue=x.scrollLeft,at=x.scrollTop;N+=at-(fe=Math.max(0,Math.min(at+fe,x.scrollHeight-Y+$e))),H+=Ue-(_e=Math.max(0,Math.min(Ue+_e,x.scrollWidth-re+Le)))}G.push({el:x,top:fe,left:_e})}return G};function M(m){return m===Object(m)&&Object.keys(m).length!==0}function $(m,v){v===void 0&&(v="auto");var f="scrollBehavior"in document.body.style;m.forEach(function(o){var l=o.el,r=o.top,i=o.left;l.scroll&&f?l.scroll({top:r,left:i,behavior:v}):(l.scrollTop=r,l.scrollLeft=i)})}function X(m){return m===!1?{block:"end",inline:"nearest"}:M(m)?m:{block:"start",inline:"nearest"}}function k(m,v){var f=!m.ownerDocument.documentElement.contains(m);if(M(v)&&typeof v.behavior=="function")return v.behavior(f?[]:W(m,v));if(f)return;var o=X(v);return $(W(m,o),o.behavior)}var D=st.a=k},Zss7:function(Wt,st,z){var oe;(function(Z){var U=/^\s+/,ee=/\s+$/,W=0,M=Z.round,$=Z.min,X=Z.max,k=Z.random;function D(te,fe){if(te=te||"",fe=fe||{},te instanceof D)return te;if(!(this instanceof D))return new D(te,fe);var _e=m(te);this._originalInput=te,this._r=_e.r,this._g=_e.g,this._b=_e.b,this._a=_e.a,this._roundA=M(100*this._a)/100,this._format=fe.format||_e.format,this._gradientType=fe.gradientType,this._r<1&&(this._r=M(this._r)),this._g<1&&(this._g=M(this._g)),this._b<1&&(this._b=M(this._b)),this._ok=_e.ok,this._tc_id=W++}D.prototype={isDark:function(){return this.getBrightness()<128},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var te=this.toRgb();return(te.r*299+te.g*587+te.b*114)/1e3},getLuminance:function(){var te=this.toRgb(),fe,_e,Le,$e,Ue,at;return fe=te.r/255,_e=te.g/255,Le=te.b/255,fe<=.03928?$e=fe/12.92:$e=Z.pow((fe+.055)/1.055,2.4),_e<=.03928?Ue=_e/12.92:Ue=Z.pow((_e+.055)/1.055,2.4),Le<=.03928?at=Le/12.92:at=Z.pow((Le+.055)/1.055,2.4),.2126*$e+.7152*Ue+.0722*at},setAlpha:function(te){return this._a=G(te),this._roundA=M(100*this._a)/100,this},toHsv:function(){var te=l(this._r,this._g,this._b);return{h:te.h*360,s:te.s,v:te.v,a:this._a}},toHsvString:function(){var te=l(this._r,this._g,this._b),fe=M(te.h*360),_e=M(te.s*100),Le=M(te.v*100);return this._a==1?"hsv("+fe+", "+_e+"%, "+Le+"%)":"hsva("+fe+", "+_e+"%, "+Le+"%, "+this._roundA+")"},toHsl:function(){var te=f(this._r,this._g,this._b);return{h:te.h*360,s:te.s,l:te.l,a:this._a}},toHslString:function(){var te=f(this._r,this._g,this._b),fe=M(te.h*360),_e=M(te.s*100),Le=M(te.l*100);return this._a==1?"hsl("+fe+", "+_e+"%, "+Le+"%)":"hsla("+fe+", "+_e+"%, "+Le+"%, "+this._roundA+")"},toHex:function(te){return i(this._r,this._g,this._b,te)},toHexString:function(te){return"#"+this.toHex(te)},toHex8:function(te){return t(this._r,this._g,this._b,this._a,te)},toHex8String:function(te){return"#"+this.toHex8(te)},toRgb:function(){return{r:M(this._r),g:M(this._g),b:M(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+M(this._r)+", "+M(this._g)+", "+M(this._b)+")":"rgba("+M(this._r)+", "+M(this._g)+", "+M(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:M(I(this._r,255)*100)+"%",g:M(I(this._g,255)*100)+"%",b:M(I(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+M(I(this._r,255)*100)+"%, "+M(I(this._g,255)*100)+"%, "+M(I(this._b,255)*100)+"%)":"rgba("+M(I(this._r,255)*100)+"%, "+M(I(this._g,255)*100)+"%, "+M(I(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:N[i(this._r,this._g,this._b,!0)]||!1},toFilter:function(te){var fe="#"+c(this._r,this._g,this._b,this._a),_e=fe,Le=this._gradientType?"GradientType = 1, ":"";if(te){var $e=D(te);_e="#"+c($e._r,$e._g,$e._b,$e._a)}return"progid:DXImageTransform.Microsoft.gradient("+Le+"startColorstr="+fe+",endColorstr="+_e+")"},toString:function(te){var fe=!!te;te=te||this._format;var _e=!1,Le=this._a<1&&this._a>=0,$e=!fe&&Le&&(te==="hex"||te==="hex6"||te==="hex3"||te==="hex4"||te==="hex8"||te==="name");return $e?te==="name"&&this._a===0?this.toName():this.toRgbString():(te==="rgb"&&(_e=this.toRgbString()),te==="prgb"&&(_e=this.toPercentageRgbString()),(te==="hex"||te==="hex6")&&(_e=this.toHexString()),te==="hex3"&&(_e=this.toHexString(!0)),te==="hex4"&&(_e=this.toHex8String(!0)),te==="hex8"&&(_e=this.toHex8String()),te==="name"&&(_e=this.toName()),te==="hsl"&&(_e=this.toHslString()),te==="hsv"&&(_e=this.toHsvString()),_e||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(te,fe){var _e=te.apply(null,[this].concat([].slice.call(fe)));return this._r=_e._r,this._g=_e._g,this._b=_e._b,this.setAlpha(_e._a),this},lighten:function(){return this._applyModification(w,arguments)},brighten:function(){return this._applyModification(O,arguments)},darken:function(){return this._applyModification(R,arguments)},desaturate:function(){return this._applyModification(h,arguments)},saturate:function(){return this._applyModification(A,arguments)},greyscale:function(){return this._applyModification(S,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(te,fe){return te.apply(null,[this].concat([].slice.call(fe)))},analogous:function(){return this._applyCombination(g,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(y,arguments)},splitcomplement:function(){return this._applyCombination(E,arguments)},triad:function(){return this._applyCombination(u,arguments)},tetrad:function(){return this._applyCombination(d,arguments)}},D.fromRatio=function(te,fe){if(typeof te=="object"){var _e={};for(var Le in te)te.hasOwnProperty(Le)&&(Le==="a"?_e[Le]=te[Le]:_e[Le]=he(te[Le]));te=_e}return D(te,fe)};function m(te){var fe={r:0,g:0,b:0},_e=1,Le=null,$e=null,Ue=null,at=!1,ft=!1;return typeof te=="string"&&(te=be(te)),typeof te=="object"&&(Oe(te.r)&&Oe(te.g)&&Oe(te.b)?(fe=v(te.r,te.g,te.b),at=!0,ft=String(te.r).substr(-1)==="%"?"prgb":"rgb"):Oe(te.h)&&Oe(te.s)&&Oe(te.v)?(Le=he(te.s),$e=he(te.v),fe=r(te.h,Le,$e),at=!0,ft="hsv"):Oe(te.h)&&Oe(te.s)&&Oe(te.l)&&(Le=he(te.s),Ue=he(te.l),fe=o(te.h,Le,Ue),at=!0,ft="hsl"),te.hasOwnProperty("a")&&(_e=te.a)),_e=G(_e),{ok:at,format:te.format||ft,r:$(255,X(fe.r,0)),g:$(255,X(fe.g,0)),b:$(255,X(fe.b,0)),a:_e}}function v(te,fe,_e){return{r:I(te,255)*255,g:I(fe,255)*255,b:I(_e,255)*255}}function f(te,fe,_e){te=I(te,255),fe=I(fe,255),_e=I(_e,255);var Le=X(te,fe,_e),$e=$(te,fe,_e),Ue,at,ft=(Le+$e)/2;if(Le==$e)Ue=at=0;else{var Ct=Le-$e;at=ft>.5?Ct/(2-Le-$e):Ct/(Le+$e);switch(Le){case te:Ue=(fe-_e)/Ct+(fe<_e?6:0);break;case fe:Ue=(_e-te)/Ct+2;break;case _e:Ue=(te-fe)/Ct+4;break}Ue/=6}return{h:Ue,s:at,l:ft}}function o(te,fe,_e){var Le,$e,Ue;te=I(te,360),fe=I(fe,100),_e=I(_e,100);function at(yt,_t,lt){return lt<0&&(lt+=1),lt>1&&(lt-=1),lt<1/6?yt+(_t-yt)*6*lt:lt<1/2?_t:lt<2/3?yt+(_t-yt)*(2/3-lt)*6:yt}if(fe===0)Le=$e=Ue=_e;else{var ft=_e<.5?_e*(1+fe):_e+fe-_e*fe,Ct=2*_e-ft;Le=at(Ct,ft,te+1/3),$e=at(Ct,ft,te),Ue=at(Ct,ft,te-1/3)}return{r:Le*255,g:$e*255,b:Ue*255}}function l(te,fe,_e){te=I(te,255),fe=I(fe,255),_e=I(_e,255);var Le=X(te,fe,_e),$e=$(te,fe,_e),Ue,at,ft=Le,Ct=Le-$e;if(at=Le===0?0:Ct/Le,Le==$e)Ue=0;else{switch(Le){case te:Ue=(fe-_e)/Ct+(fe<_e?6:0);break;case fe:Ue=(_e-te)/Ct+2;break;case _e:Ue=(te-fe)/Ct+4;break}Ue/=6}return{h:Ue,s:at,v:ft}}function r(te,fe,_e){te=I(te,360)*6,fe=I(fe,100),_e=I(_e,100);var Le=Z.floor(te),$e=te-Le,Ue=_e*(1-fe),at=_e*(1-$e*fe),ft=_e*(1-(1-$e)*fe),Ct=Le%6,yt=[_e,at,Ue,Ue,ft,_e][Ct],_t=[ft,_e,_e,at,Ue,Ue][Ct],lt=[Ue,Ue,ft,_e,_e,at][Ct];return{r:yt*255,g:_t*255,b:lt*255}}function i(te,fe,_e,Le){var $e=[de(M(te).toString(16)),de(M(fe).toString(16)),de(M(_e).toString(16))];return Le&&$e[0].charAt(0)==$e[0].charAt(1)&&$e[1].charAt(0)==$e[1].charAt(1)&&$e[2].charAt(0)==$e[2].charAt(1)?$e[0].charAt(0)+$e[1].charAt(0)+$e[2].charAt(0):$e.join("")}function t(te,fe,_e,Le,$e){var Ue=[de(M(te).toString(16)),de(M(fe).toString(16)),de(M(_e).toString(16)),de(xe(Le))];return $e&&Ue[0].charAt(0)==Ue[0].charAt(1)&&Ue[1].charAt(0)==Ue[1].charAt(1)&&Ue[2].charAt(0)==Ue[2].charAt(1)&&Ue[3].charAt(0)==Ue[3].charAt(1)?Ue[0].charAt(0)+Ue[1].charAt(0)+Ue[2].charAt(0)+Ue[3].charAt(0):Ue.join("")}function c(te,fe,_e,Le){var $e=[de(xe(Le)),de(M(te).toString(16)),de(M(fe).toString(16)),de(M(_e).toString(16))];return $e.join("")}D.equals=function(te,fe){return!te||!fe?!1:D(te).toRgbString()==D(fe).toRgbString()},D.random=function(){return D.fromRatio({r:k(),g:k(),b:k()})};function h(te,fe){fe=fe===0?0:fe||10;var _e=D(te).toHsl();return _e.s-=fe/100,_e.s=x(_e.s),D(_e)}function A(te,fe){fe=fe===0?0:fe||10;var _e=D(te).toHsl();return _e.s+=fe/100,_e.s=x(_e.s),D(_e)}function S(te){return D(te).desaturate(100)}function w(te,fe){fe=fe===0?0:fe||10;var _e=D(te).toHsl();return _e.l+=fe/100,_e.l=x(_e.l),D(_e)}function O(te,fe){fe=fe===0?0:fe||10;var _e=D(te).toRgb();return _e.r=X(0,$(255,_e.r-M(255*-(fe/100)))),_e.g=X(0,$(255,_e.g-M(255*-(fe/100)))),_e.b=X(0,$(255,_e.b-M(255*-(fe/100)))),D(_e)}function R(te,fe){fe=fe===0?0:fe||10;var _e=D(te).toHsl();return _e.l-=fe/100,_e.l=x(_e.l),D(_e)}function b(te,fe){var _e=D(te).toHsl(),Le=(_e.h+fe)%360;return _e.h=Le<0?360+Le:Le,D(_e)}function _(te){var fe=D(te).toHsl();return fe.h=(fe.h+180)%360,D(fe)}function u(te){var fe=D(te).toHsl(),_e=fe.h;return[D(te),D({h:(_e+120)%360,s:fe.s,l:fe.l}),D({h:(_e+240)%360,s:fe.s,l:fe.l})]}function d(te){var fe=D(te).toHsl(),_e=fe.h;return[D(te),D({h:(_e+90)%360,s:fe.s,l:fe.l}),D({h:(_e+180)%360,s:fe.s,l:fe.l}),D({h:(_e+270)%360,s:fe.s,l:fe.l})]}function E(te){var fe=D(te).toHsl(),_e=fe.h;return[D(te),D({h:(_e+72)%360,s:fe.s,l:fe.l}),D({h:(_e+216)%360,s:fe.s,l:fe.l})]}function g(te,fe,_e){fe=fe||6,_e=_e||30;var Le=D(te).toHsl(),$e=360/_e,Ue=[D(te)];for(Le.h=(Le.h-($e*fe>>1)+720)%360;--fe;)Le.h=(Le.h+$e)%360,Ue.push(D(Le));return Ue}function y(te,fe){fe=fe||6;for(var _e=D(te).toHsv(),Le=_e.h,$e=_e.s,Ue=_e.v,at=[],ft=1/fe;fe--;)at.push(D({h:Le,s:$e,v:Ue})),Ue=(Ue+ft)%1;return at}D.mix=function(te,fe,_e){_e=_e===0?0:_e||50;var Le=D(te).toRgb(),$e=D(fe).toRgb(),Ue=_e/100,at={r:($e.r-Le.r)*Ue+Le.r,g:($e.g-Le.g)*Ue+Le.g,b:($e.b-Le.b)*Ue+Le.b,a:($e.a-Le.a)*Ue+Le.a};return D(at)},D.readability=function(te,fe){var _e=D(te),Le=D(fe);return(Z.max(_e.getLuminance(),Le.getLuminance())+.05)/(Z.min(_e.getLuminance(),Le.getLuminance())+.05)},D.isReadable=function(te,fe,_e){var Le=D.readability(te,fe),$e,Ue;Ue=!1,$e=ge(_e);switch($e.level+$e.size){case"AAsmall":case"AAAlarge":Ue=Le>=4.5;break;case"AAlarge":Ue=Le>=3;break;case"AAAsmall":Ue=Le>=7;break}return Ue},D.mostReadable=function(te,fe,_e){var Le=null,$e=0,Ue,at,ft,Ct;_e=_e||{},at=_e.includeFallbackColors,ft=_e.level,Ct=_e.size;for(var yt=0;yt<fe.length;yt++)Ue=D.readability(te,fe[yt]),Ue>$e&&($e=Ue,Le=D(fe[yt]));return D.isReadable(te,Le,{level:ft,size:Ct})||!at?Le:(_e.includeFallbackColors=!1,D.mostReadable(te,["#fff","#000"],_e))};var F=D.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},N=D.hexNames=H(F);function H(te){var fe={};for(var _e in te)te.hasOwnProperty(_e)&&(fe[te[_e]]=_e);return fe}function G(te){return te=parseFloat(te),(isNaN(te)||te<0||te>1)&&(te=1),te}function I(te,fe){Y(te)&&(te="100%");var _e=re(te);return te=$(fe,X(0,parseFloat(te))),_e&&(te=parseInt(te*fe,10)/100),Z.abs(te-fe)<1e-6?1:te%fe/parseFloat(fe)}function x(te){return $(1,X(0,te))}function B(te){return parseInt(te,16)}function Y(te){return typeof te=="string"&&te.indexOf(".")!=-1&&parseFloat(te)===1}function re(te){return typeof te=="string"&&te.indexOf("%")!=-1}function de(te){return te.length==1?"0"+te:""+te}function he(te){return te<=1&&(te=te*100+"%"),te}function xe(te){return Z.round(parseFloat(te)*255).toString(16)}function Pe(te){return B(te)/255}var Ce=function(){var te="[-\\+]?\\d+%?",fe="[-\\+]?\\d*\\.\\d+%?",_e="(?:"+fe+")|(?:"+te+")",Le="[\\s|\\(]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")\\s*\\)?",$e="[\\s|\\(]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")\\s*\\)?";return{CSS_UNIT:new RegExp(_e),rgb:new RegExp("rgb"+Le),rgba:new RegExp("rgba"+$e),hsl:new RegExp("hsl"+Le),hsla:new RegExp("hsla"+$e),hsv:new RegExp("hsv"+Le),hsva:new RegExp("hsva"+$e),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/}}();function Oe(te){return!!Ce.CSS_UNIT.exec(te)}function be(te){te=te.replace(U,"").replace(ee,"").toLowerCase();var fe=!1;if(F[te])te=F[te],fe=!0;else if(te=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var _e;return(_e=Ce.rgb.exec(te))?{r:_e[1],g:_e[2],b:_e[3]}:(_e=Ce.rgba.exec(te))?{r:_e[1],g:_e[2],b:_e[3],a:_e[4]}:(_e=Ce.hsl.exec(te))?{h:_e[1],s:_e[2],l:_e[3]}:(_e=Ce.hsla.exec(te))?{h:_e[1],s:_e[2],l:_e[3],a:_e[4]}:(_e=Ce.hsv.exec(te))?{h:_e[1],s:_e[2],v:_e[3]}:(_e=Ce.hsva.exec(te))?{h:_e[1],s:_e[2],v:_e[3],a:_e[4]}:(_e=Ce.hex8.exec(te))?{r:B(_e[1]),g:B(_e[2]),b:B(_e[3]),a:Pe(_e[4]),format:fe?"name":"hex8"}:(_e=Ce.hex6.exec(te))?{r:B(_e[1]),g:B(_e[2]),b:B(_e[3]),format:fe?"name":"hex"}:(_e=Ce.hex4.exec(te))?{r:B(_e[1]+""+_e[1]),g:B(_e[2]+""+_e[2]),b:B(_e[3]+""+_e[3]),a:Pe(_e[4]+""+_e[4]),format:fe?"name":"hex8"}:(_e=Ce.hex3.exec(te))?{r:B(_e[1]+""+_e[1]),g:B(_e[2]+""+_e[2]),b:B(_e[3]+""+_e[3]),format:fe?"name":"hex"}:!1}function ge(te){var fe,_e;return te=te||{level:"AA",size:"small"},fe=(te.level||"AA").toUpperCase(),_e=(te.size||"small").toLowerCase(),fe!=="AA"&&fe!=="AAA"&&(fe="AA"),_e!=="small"&&_e!=="large"&&(_e="small"),{level:fe,size:_e}}Wt.exports?Wt.exports=D:!(oe=function(){return D}.call(st,z,st,Wt),oe!==void 0&&(Wt.exports=oe))})(Math)},a99f:function(Wt,st,z){"use strict";z.r(st);var oe=z("T2oS"),Z=z("W9HT"),U=z("14J3"),ee=z("BMrR"),W=z("jCWc"),M=z("kPKH"),$=z("sPJy"),X=z("bE4q"),k=z("k1fw"),D=z("oBTY"),m=z("miYZ"),v=z("tsqr"),f=z("9og8"),o=z("tJVT"),l=z("WmNS"),r=z.n(l),i=z("q1tI"),t=z.n(i),c=z("Ty5D"),h=z("9kvl"),A=z("55Ip"),S=z("LvDl"),w=z("bbsP"),O=z("/wGt"),R=z("DjyN"),b=z("NUBc"),_=z("/zsF"),u=z("PArb"),d=z("5Dmo"),E=z("3S7+"),g=z("sRBo"),y=z("kaz8"),F=z("+L6B"),N=z("2/Rp"),H=z("5NDa"),G=z("5rEg"),I=z("xKgJ"),x=z("kCvp"),B=z.n(x),Y=z("NLgs"),re=z("9z17"),de=G.a.Search,he=[{id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]}],xe=[{id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]}],Pe=function(ce){var Me,tt=ce.classroomList,bt=ce.shixunsList,Kt=ce.dispatch,Gt=ce.callback,$t=ce.inNewPaperLibrary,ei=Object(i.useState)(Object(k.a)({},Object(c.i)())),gn=Object(o.a)(ei,2),an=gn[0],dn=gn[1],zn=tt.shixunLists,pi=Object(i.useState)([]),mi=Object(o.a)(pi,2),ri=mi[0],_i=mi[1],Si=Object(i.useState)(""),At=Object(o.a)(Si,2),Wn=At[0],hi=At[1],ti=Object(i.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1,keyword:""}),Oi=Object(o.a)(ti,2),Ai=Oi[0],Ni=Oi[1];Object(i.useEffect)(function(){return tt.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?document.body.setAttribute("data-custom","height"):document.body.removeAttribute("data-custom"),function(){document.body.removeAttribute("data-custom")}},[tt.actionTabs.key]);var wi=tt.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE";Object(i.useEffect)(function(){wi&&Kt({type:"classroomList/getShixunLists",payload:Object(k.a)({},Ai)})},[an.categoryId,wi,Ai]),Object(i.useEffect)(function(){Kt({type:"shixunsList/getMenus",payload:{}})},[]),Object(i.useEffect)(function(){_i([])},[tt.actionTabs.key]);var ct=Object(re.b)(),je=Object(o.a)(ct,4),It=je[0],Ne=je[1],Ee=je[2],ve=je[3],di=function(ht,we,un){Ai.tag_level=ht,Ai.sub_discipline_id=we,Ai.discipline_id=un,Ni(Object(k.a)({},Ai))},en=function(){var De=Object(f.a)(r.a.mark(function ht(we){var un,fi;return r.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:Gt&&Gt(zn==null||((un=zn.shixun_list)===null||un===void 0)?void 0:un.filter(function(C){return C.identifier===ri[0]})[0],(fi=tt.actionTabs)===null||fi===void 0?void 0:fi.editData,we),Kt({type:"classroomList/setActionTabs",payload:{}}),Ne();case 3:case"end":return q.stop()}},ht)}));return function(we){return De.apply(this,arguments)}}();return tt.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:t.a.createElement(O.a,{title:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",placement:"bottom",height:"100%",closable:!0,onClose:function(){Kt({type:"classroomList/setActionTabs",payload:{key:""}})},visible:!!wi,key:"bottom",className:B.a.drawer,footer:t.a.createElement("div",{className:"tc"},t.a.createElement(N.a,{size:"large",onClick:function(){Kt({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8}},"\u53D6\u6D88"),t.a.createElement(N.a,{size:"large",onClick:Object(f.a)(r.a.mark(function De(){var ht;return r.a.wrap(function(un){for(;;)switch(un.prev=un.next){case 0:if(!(ri.length>1)){un.next=4;break}v.b.error("\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u5B9E\u8DF5\u9879\u76EE"),un.next=16;break;case 4:if(!(ri.length===0)){un.next=8;break}v.b.error("\u8BF7\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE"),un.next=16;break;case 8:if(!$t){un.next=12;break}en(0),un.next=16;break;case 12:return un.next=14,ve({id:ri[0],course_id:an.coursesId,type:"shixun"});case 14:ht=un.sent,ht||en(0);case 16:case"end":return un.stop()}},De)})),type:"primary"},"\u786E\u5B9A"))},t.a.createElement("section",{className:"tc"},t.a.createElement(de,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"large",value:Wn,onChange:function(ht){return hi(ht.target.value)},className:B.a.search,onSearch:function(ht){Ai.keyword=ht,Ai.page=1,Ni(Object(k.a)({},Ai))}})),t.a.createElement("section",{className:"edu-container"},he.map(function(De,ht){var we;return t.a.createElement("ul",{className:B.a.menu,key:ht},t.a.createElement("li",null,De.name),De==null||((we=De.children)===null||we===void 0)?void 0:we.map(function(un,fi){return t.a.createElement("li",{key:fi,className:Ai[De.id]==un.id?B.a.actived:"",onClick:function(){Ai[De.id]=un.id,Ni(Object(k.a)({},Ai)),Kt({type:"classroomList/getShixunLists",payload:Object(k.a)({},Ai)})}},t.a.createElement("strong",null,un.name))}))}),t.a.createElement("ul",{className:B.a.menut},t.a.createElement("span",{style:{padding:"18px",fontWeight:"600"}},"\u65B9\u5411\uFF1A"),t.a.createElement("li",{className:Ai.discipline_id?"":B.a.actived3,onClick:function(){di(null,null,null)}},t.a.createElement("strong",null,"\u5168\u90E8")),bt.menus&&bt.menus.map(function(De,ht){return t.a.createElement("li",{key:ht,className:Ai.discipline_id==De.id?B.a.actived3:""},t.a.createElement("strong",{onClick:function(){di(1,null,De.id)}},De.name),t.a.createElement("div",null,De.sub_repertoires.map(function(we,un){return t.a.createElement("div",{key:un,className:"mt5"},t.a.createElement("div",{className:Ai.sub_discipline_id==we.id?"".concat(B.a.actived4," ").concat(B.a.subTag):B.a.subTag,onClick:function(){di(2,we.id,De.id)}},we.name),t.a.createElement("ul",{className:"mt5"},we.tags&&we.tags.map(function(fi,gi){return t.a.createElement("li",{key:gi,className:Ai.sub_discipline_id==fi.id?B.a.actived4:"",onClick:function(){di(3,fi.id,De.id)}},fi.name)})))})))})),xe.map(function(De,ht){var we;return t.a.createElement("ul",{className:B.a.menu,key:ht},t.a.createElement("li",null,De.name),De==null||((we=De.children)===null||we===void 0)?void 0:we.map(function(un,fi){return t.a.createElement("li",{key:fi,className:Ai[De.id]==un.id?B.a.actived:"",onClick:function(){Ai[De.id]=un.id,Ni(Object(k.a)({},Ai)),Kt({type:"classroomList/getShixunLists",payload:Object(k.a)({},Ai)})}},t.a.createElement("strong",null,un.name))}))}),t.a.createElement("div",{className:B.a.menuCourse,style:{margin:"0px 15px"}},t.a.createElement("ul",null,t.a.createElement("li",null,"\u5DF2\u9009",t.a.createElement("span",{className:"c-blue"},ri.length),"\u4E2A\u5B9E\u8BAD"),t.a.createElement("li",null,"\u5171",t.a.createElement("span",{className:"c-blue"},zn.shixuns_count),"\u4E2A\u8BFE\u7A0B"),t.a.createElement("li",{className:"current",onClick:function(){Ai.order=Ai.order==="asc"?"desc":"asc",Ni(Object(k.a)({},Ai))}},"\u5B66\u4E60\u4EBA\u6570",t.a.createElement("p",{className:"edu-sorter current ".concat(Ai.order)},Ai.order==="asc"?t.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):t.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"}))))),t.a.createElement(y.a.Group,{style:{display:"block"},value:ri,onChange:function(ht){_i(ht)}},zn==null||((Me=zn.shixun_list)===null||Me===void 0)?void 0:Me.map(function(De,ht){return t.a.createElement("div",{className:B.a.listItem,key:De.identifier},t.a.createElement(y.a,{value:De.identifier,disabled:De==null?void 0:De.need_authorize}),t.a.createElement("div",{className:B.a.info},t.a.createElement("div",{className:B.a.title},t.a.createElement("div",{className:B.a.titleLeft},t.a.createElement(A.a,{to:"/shixuns/".concat(De.identifier,"/challenges"),target:"_blank"},t.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:De.title}})),(De==null?void 0:De.need_authorize)&&t.a.createElement("span",{onClick:function(){Object(Y.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(I.v)()&&(De==null?void 0:De.mark_status)===1&&t.a.createElement(E.a,{title:De==null?void 0:De.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(I.v)()&&(De==null?void 0:De.mark_status)===2&&t.a.createElement(E.a,{title:De==null?void 0:De.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(I.v)()&&(De==null?void 0:De.mark_status)===3&&t.a.createElement(E.a,{title:De==null?void 0:De.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#E53333"},className:"tag-style current ml10"},"\u65E0\u6CD5\u4F7F\u7528")))),t.a.createElement("div",{className:"flex-wrp mt10 font14 c-light-black"},t.a.createElement("span",{className:B.a.description,dangerouslySetInnerHTML:{__html:De.description}})),t.a.createElement("div",{className:"flex-wrp mt15"},De.challenge_names.map(function(we,un){return t.a.createElement("span",{key:un,className:"mr30"},"\u7B2C",un+1,"\u5173 ",we," ")})),t.a.createElement(u.a,{dashed:!0}),t.a.createElement("div",{className:"c-light-black mt20"},t.a.createElement("span",null,De.author_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,De.author_school_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",De.level),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),t.a.createElement("span",null,De.study_count))))})),t.a.createElement("p",null)),t.a.createElement("div",{className:"tc"},t.a.createElement(b.a,{defaultCurrent:1,current:Ai.page||1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,showSizeChanger:!1,total:zn==null?void 0:zn.shixuns_count,onChange:function(ht){Ai.page=ht,Ni(Object(k.a)({},Ai)),_i([])}})),t.a.createElement(re.a,{visible:It,onCancel:Ne,onOk:en,renderData:Ee,inPaper:!0,modalType:"single",type:"shixun"}))},Ce=Object(h.a)(function(Re){var ce=Re.classroomList,Me=Re.shixunsList,tt=Re.user;return{classroomList:ce,shixunsList:Me,user:tt}})(Pe),Oe=z("sZF6"),be=z("2aBv"),ge=z("zWo0"),te=z.n(ge),fe=z("LYsE"),_e=z("1vsH"),Le=z("vCeJ"),$e=z("7Kak"),Ue=z("9yH6"),at=z("giR+"),ft=z("fyUT"),Ct=z("6UJt"),yt=z("DFOY"),_t=z("rAM+"),lt=z("y8nQ"),Ft=z("Vl3Y"),Xt=z("ZWs3"),Jt=function(ce){var Me=ce.initValue,tt=ce.courseOptions,bt=ce.setIsEdit,Kt=ce.setEditKey,Gt=ce.reload,$t=Ft.a.useForm(),ei=Object(o.a)($t,1),gn=ei[0],an=Object(c.i)(),dn=Object(i.useMemo)(function(){var zn=Me==null?void 0:Me.sub_discipline_id,pi=[],mi=Object(_t.a)(tt),ri;try{for(mi.s();!(ri=mi.n()).done;){var _i=ri.value,Si=Object(_t.a)(_i.children),At;try{for(Si.s();!(At=Si.n()).done;){var Wn=At.value;Wn.value===zn&&(pi=[_i.value,Wn.value])}}catch(ti){Si.e(ti)}finally{Si.f()}}}catch(ti){mi.e(ti)}finally{mi.f()}var hi=Me.time;return Object(k.a)(Object(k.a)({},Me),{},{sub_discipline_id:pi,time:hi===-1?null:hi})},[Me,tt]);return t.a.createElement(Ft.a,{initialValues:dn,layout:"vertical",form:gn,className:te.a.formWrap},t.a.createElement(Ft.a.Item,{label:"\u65B9\u5411&\u8BFE\u7A0B\uFF1A",name:"sub_discipline_id",labelCol:{span:5},wrapperCol:{span:5},rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u8BFE\u7A0B"}]},t.a.createElement(yt.a,{placeholder:"\u8BF7\u9009\u62E9...",options:tt})),t.a.createElement(Ft.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u540D\u79F0\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u540D\u79F0"}]},t.a.createElement(G.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),t.a.createElement("div",{style:{display:"flex"}},t.a.createElement(Ft.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F"},t.a.createElement(ft.a,{min:1,max:9999,style:{width:110},maxLength:60,placeholder:"\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"})),t.a.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"32px",marginTop:23}},"\u5206\u949F")),t.a.createElement(Ft.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},t.a.createElement(Ue.a.Group,null,t.a.createElement(Ue.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(Ue.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(Ue.a.Button,{value:3},"\u56F0\u96BE"))),t.a.createElement(Ft.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},t.a.createElement(G.a.TextArea,{maxLength:65535,rows:6,placeholder:"\u8BF7\u5728\u6B64\u8F93\u5165\u672C\u6B21\u8BD5\u5377\u7B54\u9898\u7684\u76F8\u5173\u8BF4\u660E\uFF0C\u6700\u5927\u9650\u523665535\u4E2A\u5B57\u7B26"})),t.a.createElement(Ft.a.Item,{className:"tr"},t.a.createElement(Xt.a,{type:"primary",onClick:Object(f.a)(r.a.mark(function zn(){var pi,mi;return r.a.wrap(function(_i){for(;;)switch(_i.prev=_i.next){case 0:return _i.next=2,gn.validateFields();case 2:return pi=gn.getFieldsValue(),pi.sub_discipline_id=pi.sub_discipline_id[1],_i.next=6,Object(Le.z)(Object(k.a)({id:an.id},pi));case 6:mi=_i.sent,mi.status===0&&(bt(!1),Kt(-1),Gt());case 8:case"end":return _i.stop()}},zn)}))},"\u4FDD\u5B58"),t.a.createElement(N.a,{style:{marginLeft:10},onClick:function(){gn.resetFields(),bt(!1)}},"\u53D6\u6D88")))},rn=Jt,En=z("g9YV"),mn=z("wCAj"),Ye=z("+BqJ"),Xe=z.n(Ye),Ot=z("9Bee"),Et=function(ce){var Me=ce.isPreview,tt=Me===void 0?!1:Me,bt=ce.isExportBlank,Kt=bt===void 0?!1:bt,Gt=ce.newExercisePaper,$t=ce.setIsEdit,ei=Object(c.i)(),gn=Object(i.useState)(),an=Object(o.a)(gn,2),dn=an[0],zn=an[1],pi=Object(i.useState)(),mi=Object(o.a)(pi,2),ri=mi[0],_i=mi[1],Si=Object(i.useRef)(null),At=Object(i.useState)(21),Wn=Object(o.a)(At,2),hi=Wn[0],ti=Wn[1];Object(i.useEffect)(function(){Oi()},[]),Object(i.useEffect)(function(){Si.current&&ti(Si.current.clientHeight)},[Si.current]),Object(i.useEffect)(function(){var ct;if((ct=Gt.exerciseExportHeadData)!==null&&ct!==void 0&&ct.title){var je=Gt.exerciseExportHeadData;zn(Object(k.a)({},je||{}));var It=je||{},Ne=It.table,Ee,ve;(Ne!=null&&Ne.total_singles_scores||Ne!=null&&Ne.total_doubles_scores||Ne!=null&&Ne.total_nulls_scores||Ne!=null&&Ne.total_judges_scores||Ne!=null&&Ne.total_pros_scores||Ne!=null&&Ne.total_shixuns_scores||Ne!=null&&Ne.total_mains_scores||Ne!=null&&Ne.total_combination_scores)&&(Ee=Number(Ne==null?void 0:Ne.total_singles_scores)+Number(Ne==null?void 0:Ne.total_doubles_scores)+Number(Ne==null?void 0:Ne.total_nulls_scores)+Number(Ne==null?void 0:Ne.total_judges_scores)+Number(Ne==null?void 0:Ne.total_pros_scores)+Number(Ne==null?void 0:Ne.total_shixuns_scores)+Number(Ne==null?void 0:Ne.total_mains_scores)+Number(Ne==null?void 0:Ne.total_combination_scores)),(Ne!=null&&Ne.singles_scores||Ne!=null&&Ne.doubles_scores||Ne!=null&&Ne.nulls_scores||Ne!=null&&Ne.judges_scores||Ne!=null&&Ne.pros_scores||Ne!=null&&Ne.shixuns_scores||Ne!=null&&Ne.mains_scores||Ne!=null&&Ne.combination_scores)&&(ve=Number(Ne==null?void 0:Ne.singles_scores)+Number(Ne==null?void 0:Ne.doubles_scores)+Number(Ne==null?void 0:Ne.nulls_scores)+Number(Ne==null?void 0:Ne.judges_scores)+Number(Ne==null?void 0:Ne.pros_scores)+Number(Ne==null?void 0:Ne.shixuns_scores)+Number(Ne==null?void 0:Ne.mains_scores)+Number(Ne==null?void 0:Ne.combination_scores));var di=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Ne==null?void 0:Ne.total_singles_scores,doubles_score:Ne==null?void 0:Ne.total_doubles_scores,nulls_score:Ne==null?void 0:Ne.total_nulls_scores,judges_score:Ne==null?void 0:Ne.total_judges_scores,pros_score:Ne==null?void 0:Ne.total_pros_scores,shixuns_score:Ne==null?void 0:Ne.total_shixuns_scores,mains_score:Ne==null?void 0:Ne.total_mains_scores,combinations_score:Ne==null?void 0:Ne.total_combination_scores,total_score:Ee},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:Ne==null?void 0:Ne.singles_scores,doubles_score:Ne==null?void 0:Ne.doubles_scores,nulls_score:Ne==null?void 0:Ne.nulls_scores,judges_score:Ne==null?void 0:Ne.judges_scores,pros_score:Ne==null?void 0:Ne.pros_scores,shixuns_score:Ne==null?void 0:Ne.shixuns_scores,mains_score:Ne==null?void 0:Ne.mains_scores,combinations_score:Ne==null?void 0:Ne.combination_scores,total_score:ve},{key:"3",name:"\u8BC4\u5377\u4EBA"}],en=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Ne==null?void 0:Ne.total_singles_scores,doubles_score:Ne==null?void 0:Ne.total_doubles_scores,nulls_score:Ne==null?void 0:Ne.total_nulls_scores,judges_score:Ne==null?void 0:Ne.total_judges_scores,pros_score:Ne==null?void 0:Ne.total_pros_scores,shixuns_score:Ne==null?void 0:Ne.total_shixuns_scores,mains_score:Ne==null?void 0:Ne.total_mains_scores,combinations_score:Ne==null?void 0:Ne.combination_scores,total_score:Ee},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}];_i(Object(D.a)(Kt?en:di))}},[Gt.exerciseExportHeadData]);var Oi=function(){var ct=Object(f.a)(r.a.mark(function je(){var It,Ne,Ee,ve,di,en,De;return r.a.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return we.next=2,Object(Le.m)(ei.id);case 2:It=we.sent,zn(It||{}),Ne=It||{},Ee=Ne.table,(Ee!=null&&Ee.total_singles_scores||Ee!=null&&Ee.total_doubles_scores||Ee!=null&&Ee.total_nulls_scores||Ee!=null&&Ee.total_judges_scores||Ee!=null&&Ee.total_pros_scores||Ee!=null&&Ee.total_shixuns_scores||Ee!=null&&Ee.total_mains_scores||Ee!=null&&Ee.total_combination_scores)&&(ve=Number(Ee==null?void 0:Ee.total_singles_scores)+Number(Ee==null?void 0:Ee.total_doubles_scores)+Number(Ee==null?void 0:Ee.total_nulls_scores)+Number(Ee==null?void 0:Ee.total_judges_scores)+Number(Ee==null?void 0:Ee.total_pros_scores)+Number(Ee==null?void 0:Ee.total_shixuns_scores)+Number(Ee==null?void 0:Ee.total_mains_scores)+Number(Ee==null?void 0:Ee.total_combination_scores)),(Ee!=null&&Ee.singles_scores||Ee!=null&&Ee.doubles_scores||Ee!=null&&Ee.nulls_scores||Ee!=null&&Ee.judges_scores||Ee!=null&&Ee.pros_scores||Ee!=null&&Ee.shixuns_scores||Ee!=null&&Ee.mains_scores||Ee!=null&&Ee.combinations_score)&&(di=Number(Ee==null?void 0:Ee.singles_scores)+Number(Ee==null?void 0:Ee.doubles_scores)+Number(Ee==null?void 0:Ee.nulls_scores)+Number(Ee==null?void 0:Ee.judges_scores)+Number(Ee==null?void 0:Ee.pros_scores)+Number(Ee==null?void 0:Ee.shixuns_scores)+Number(Ee==null?void 0:Ee.mains_scores)+Number(Ee==null?void 0:Ee.combinations_score)),en=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Ee==null?void 0:Ee.total_singles_scores,doubles_score:Ee==null?void 0:Ee.total_doubles_scores,nulls_score:Ee==null?void 0:Ee.total_nulls_scores,judges_score:Ee==null?void 0:Ee.total_judges_scores,pros_score:Ee==null?void 0:Ee.total_pros_scores,shixuns_score:Ee==null?void 0:Ee.total_shixuns_scores,combinations_score:Ee==null?void 0:Ee.total_combination_scores,mains_score:Ee==null?void 0:Ee.total_mains_scores,total_score:ve},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:Ee==null?void 0:Ee.singles_scores,doubles_score:Ee==null?void 0:Ee.doubles_scores,nulls_score:Ee==null?void 0:Ee.nulls_scores,judges_score:Ee==null?void 0:Ee.judges_scores,pros_score:Ee==null?void 0:Ee.pros_scores,shixuns_score:Ee==null?void 0:Ee.shixuns_scores,mains_score:Ee==null?void 0:Ee.mains_scores,combinations_score:Ee==null?void 0:Ee.combination_scores,total_score:di},{key:"3",name:"\u8BC4\u5377\u4EBA"}],De=[{key:"1",name:"\u5E94\u5F97\u5206"},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}],_i(Kt?De:en);case 10:case"end":return we.stop()}},je)}));return function(){return ct.apply(this,arguments)}}(),Ai=[{width:"10%",title:"\u9898\u578B",align:"center",dataIndex:"name",render:function(je){return t.a.createElement("a",null,je)}},{width:"10%",title:"\u5355\u9009\u9898",align:"center",dataIndex:"singles_score",render:function(je){return t.a.createElement("a",null,je==="0.0"?0:je)}},{width:"10%",title:"\u591A\u9009\u9898",align:"center",dataIndex:"doubles_score",render:function(je){return t.a.createElement("a",null,je==="0.0"?0:je)}},{width:"10%",title:"\u586B\u7A7A\u9898",align:"center",dataIndex:"nulls_score",render:function(je){return t.a.createElement("a",null,je==="0.0"?0:je)}},{width:"10%",title:"\u5224\u65AD\u9898",align:"center",dataIndex:"judges_score",render:function(je){return t.a.createElement("a",null,je==="0.0"?0:je)}},{width:"10%",title:"\u7F16\u7A0B\u9898",align:"center",dataIndex:"pros_score",render:function(je){return t.a.createElement("a",null,je==="0.0"?0:je)}},{width:"10%",title:"\u5B9E\u8BAD\u9898",align:"center",dataIndex:"shixuns_score",render:function(je){return t.a.createElement("a",null,je==="0.0"?0:je)}},{width:"10%",title:"\u7B80\u7B54\u9898",align:"center",dataIndex:"mains_score",render:function(je){return t.a.createElement("a",null,je==="0.0"?0:je)}},{width:"10%",title:"\u7EC4\u5408\u9898",align:"center",dataIndex:"combinations_score",render:function(je){return t.a.createElement("a",null,je==="0.0"?0:je)}},{width:"10%",title:"\u603B\u5206",align:"center",dataIndex:"total_score",render:function(je){return t.a.createElement("a",null,je==="0.0"?0:je)}}],Ni=dn||{},wi=Ni.exercise_header;return t.a.createElement(t.a.Fragment,null,t.a.createElement("section",{className:"".concat(Xe.a.wrap," ").concat(tt?"pl20":""," ")},(dn==null?void 0:dn.photo_url)&&t.a.createElement("img",{className:Xe.a.img,src:dn==null?void 0:dn.photo_url}),t.a.createElement("div",{style:{width:"100%",textAlign:"end"}},t.a.createElement(N.a,{onClick:function(){return $t(!0)}},"\u7F16\u8F91\u8BD5\u5377")),(wi==null?void 0:wi.show_title)&&t.a.createElement("p",{className:"font16 tc c-grey-333"},t.a.createElement("strong",null,dn==null?void 0:dn.title)),(dn==null?void 0:dn.exercise_description)&&t.a.createElement("span",{ref:Si,style:{justifyContent:hi===21?"center":"left",wordBreak:"break-all",display:"flex",textAlign:"left",marginBottom:12},className:"tc c-grey-333"},"\u8BD5\u5377\u987B\u77E5\uFF1A".concat(dn==null?void 0:dn.exercise_description)),(wi==null?void 0:wi.show_info)&&t.a.createElement("p",{className:"tc c-grey-666"},"\u5171:\u3010",dn==null?void 0:dn.large_counts,"\u5927\u9898\u3011\u3010",dn==null?void 0:dn.total_count,"\u5C0F\u9898\u3011\u3010 \u6EE1\u5206",dn==null?void 0:dn.score,"\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010",(dn==null?void 0:dn.time)>-1?"".concat(dn==null?void 0:dn.time,"\u5206\u949F"):"\u4E0D\u9650","\u3011"),(wi==null?void 0:wi.show_desc)&&t.a.createElement("div",{className:"mt10"},t.a.createElement("p",{className:"font16"},"\u8003\u8BD5\u8BF4\u660E\uFF1A"),t.a.createElement(Ot.a,{value:dn==null?void 0:dn.description})),(wi==null?void 0:wi.show_table)&&t.a.createElement("div",{className:"mt10"},t.a.createElement(mn.a,{className:Xe.a.table,columns:Ai,dataSource:Object(D.a)(ri||[]),bordered:!0,pagination:!1}))))},Je=Object(h.a)(function(Re){var ce=Re.newExercisePaper;return{newExercisePaper:ce}})(Et),mt=z("VYcG"),Be=function(ce){var Me=ce.onImport,tt=ce.questionType,bt=ce.onAdd,Kt=ce.onSort,Gt=ce.user,$t=Object(c.i)(),ei=function(){var gn=Object(f.a)(r.a.mark(function an(){var dn,zn;return r.a.wrap(function(mi){for(;;)switch(mi.prev=mi.next){case 0:return mi.next=2,Object(Le.h)($t.id);case 2:dn=mi.sent,dn.status===0&&h.d.push("/classrooms/coursesId/exercise/".concat(dn.exercise_id,"/").concat((zn=Gt.userInfo)===null||zn===void 0?void 0:zn.login,"/initate_answer"));case 4:case"end":return mi.stop()}},an)}));return function(){return gn.apply(this,arguments)}}();return t.a.createElement("section",{style:{display:"flex",width:"100%",position:"fixed",bottom:0,height:70,boxShadow:"rgb(0 0 0 / 5%) 0px -4px 4px 0px",zIndex:666},className:[te.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},t.a.createElement("div",{style:{width:"1200px",margin:"0px auto",display:"flex",alignItems:"center"}},t.a.createElement(N.a,{style:{height:30,marginRight:10,width:104},type:"primary",onClick:function(){h.d.push("/paperlibrary/edit_select/".concat($t.id))}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),t.a.createElement(N.a,{style:{height:30,marginRight:27,width:104},type:"primary",onClick:Me},"\u6279\u91CF\u5BFC\u5165\u8BD5\u9898"),t.a.createElement("div",{style:{marginRight:"27px",height:"30px",width:1,background:"#F5F5F5"}}),t.a.createElement("div",{style:{display:"flex",marginRight:27}},tt.map(function(gn){return t.a.createElement("span",{key:gn.id,className:te.a.button,onClick:function(){return bt(gn.id)}},t.a.createElement("i",{className:"iconfont icon-tianjiashitixiaojiahao mr5",style:{fontSize:"10px",color:"#B1BACD"}}),gn.name)})),t.a.createElement("div",{style:{marginRight:"25px",height:"30px",width:1,background:"#F5F5F5"}}),t.a.createElement(N.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},className:"mr8",onClick:Kt},t.a.createElement("i",{className:"iconfont icon-tixingpaixu mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u9898\u578B\u6392\u5E8F"),t.a.createElement(N.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},className:"mr8"},t.a.createElement(A.a,{to:"/paperlibrary/see/".concat($t.id)},t.a.createElement("i",{className:"iconfont icon-yulan mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u9884\u89C8")),t.a.createElement(N.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},onClick:Object(S.throttle)(ei,3500)},t.a.createElement("i",{className:"iconfont icon-monikaoshi1 mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u6A21\u62DF\u8003\u8BD5")))},Ie=Object(h.a)(function(Re){var ce=Re.user;return{user:ce}})(Be),ke=z("hQp1"),me=function(ce){var Me,tt,bt,Kt=ce.exercise,Gt=ce.newExercisePaper,$t=ce.user,ei=ce.dispatch,gn=Object(c.i)(),an=Object(i.useState)(!1),dn=Object(o.a)(an,2),zn=dn[0],pi=dn[1],mi=Object(i.useState)(!1),ri=Object(o.a)(mi,2),_i=ri[0],Si=ri[1],At=Object(i.useState)(-1),Wn=Object(o.a)(At,2),hi=Wn[0],ti=Wn[1],Oi=Object(i.useRef)(),Ai=[{name:"\u5355\u9009\u9898",id:0,count:"q_singles",score:"q_singles_scores"},{name:"\u591A\u9009\u9898",id:1,count:"q_doubles",score:"q_doubles_scores"},{name:"\u5224\u65AD\u9898",id:2,count:"q_judges",score:"q_judges_scores"},{name:"\u586B\u7A7A\u9898",id:3,count:"q_nulls",score:"q_nulls_scores"},{name:"\u7B80\u7B54\u9898",id:4,count:"q_mains",score:"q_mains_scores"},{name:"\u5B9E\u8BAD\u9898",id:5,count:"q_shixuns",score:"q_shixuns_scores"},{name:"\u7F16\u7A0B\u9898",id:6,count:"q_pros",score:"q_pros_scores"},{name:"\u7EC4\u5408\u9898",id:7,count:"q_combinations",score:"q_combinations_scores"}],Ni=Object(_e.I)();Object(i.useEffect)(function(){return ei({type:"globalSetting/footerToggle",payload:!1}),function(){ei({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(i.useEffect)(function(){di()},[]);var wi=Object(mt.useCourseOptions)();Object(i.useEffect)(function(){var Q,Ae,nt;if(Gt!=null&&(Q=Gt.editData)!==null&&Q!==void 0&&Q.exercise_question_types){var xt,Dt;Ee(Object(S.cloneDeep)(Gt==null||((xt=Gt.editData)===null||xt===void 0)?void 0:xt.exercise_question_types)),ve.current=Object(S.cloneDeep)(Gt==null||((Dt=Gt.editData)===null||Dt===void 0)?void 0:Dt.exercise_question_types)}var ot=(Ae=Gt.editData)===null||Ae===void 0||((nt=Ae.exercise)===null||nt===void 0)?void 0:nt.sub_discipline_id;ot&&ct(ot)},[Gt.editData]);var ct=function(){var Q=Object(f.a)(r.a.mark(function Ae(nt){return r.a.wrap(function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:return Dt.next=2,ei({type:"newExercisePaper/getTagDiscipline",payload:{sub_discipline_id:nt}});case 2:case"end":return Dt.stop()}},Ae)}));return function(nt){return Q.apply(this,arguments)}}(),je=Object(i.useState)(),It=Object(o.a)(je,2),Ne=It[0],Ee=It[1],ve=Object(i.useRef)(Ne),di=function(){var Q=Object(f.a)(r.a.mark(function Ae(){var nt;return r.a.wrap(function(Dt){for(;;)switch(Dt.prev=Dt.next){case 0:nt=ei({type:"newExercisePaper/editExercise",payload:{id:gn.id}}),nt.status===0&&Ee(nt.exercise_question_types);case 2:case"end":return Dt.stop()}},Ae)}));return function(){return Q.apply(this,arguments)}}(),en=function(){var Q=Object(f.a)(r.a.mark(function Ae(nt){var xt,Dt,ot,vt,Lt,wn,Xn;return r.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:if(!(hi!==-1)){cn.next=3;break}return v.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898"),cn.abrupt("return");case 3:if(!(nt===ke.a.Shixun)){cn.next=7;break}ei({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}),cn.next=21;break;case 7:if(!(nt===ke.a.Program)){cn.next=11;break}h.d.push("/problems/new?difficult=".concat((xt=Gt.editData)===null||xt===void 0||((Dt=xt.exercise)===null||Dt===void 0)?void 0:Dt.difficulty,"&sub_discipline_id=").concat((ot=Gt.editData)===null||ot===void 0||((vt=ot.exercise)===null||vt===void 0)?void 0:vt.sub_discipline_id,"&express_id=").concat(gn.id,"&callback_url=").concat(location.pathname)),cn.next=21;break;case 11:if(wn=Ne.find(function(jt){return jt.question_type===nt}),wn){cn.next=18;break}return ve.current=Object(S.cloneDeep)(Ne),Ne.push({name:Ai.find(function(jt){return jt.id===nt}).name,question_type:nt,count:0,score:0,items:[{key:1,insert_id:1,question_type:nt}]}),Ee(Object(D.a)(Ne)),ti("".concat(nt,"-",1)),cn.abrupt("return");case 18:setTimeout(function(){var jt;(jt=document.getElementById("".concat(nt,"-").concat(wn.count-1)))===null||jt===void 0||jt.scrollIntoView()},400),Xn={key:wn.count,insert_id:(Lt=wn.items[wn.count])===null||Lt===void 0?void 0:Lt.question_id,question_type:nt},ht(Xn);case 21:case"end":return cn.stop()}},Ae)}));return function(nt){return Q.apply(this,arguments)}}(),De=function(){ti(-1),Ee(ve.current)},ht=function(){var Ae=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ve.current=Object(S.cloneDeep)(Ne),Ae.question_type===ke.a.Program){var nt,xt,Dt,ot;return h.d.push("/problems/new?difficult=".concat((nt=Gt.editData)===null||nt===void 0||((xt=nt.exercise)===null||xt===void 0)?void 0:xt.difficulty,"&sub_discipline_id=").concat((Dt=Gt.editData)===null||Dt===void 0||((ot=Dt.exercise)===null||ot===void 0)?void 0:ot.sub_discipline_id,"&express_id=").concat(gn.id,"&callback_url=").concat(location.pathname)),!1}Ne.map(function(vt){if(vt.question_type===Ae.question_type){var Lt=Object(S.cloneDeep)(vt.items);Lt.splice(Ae==null?void 0:Ae.key,0,Object(k.a)({insert_id:Ae==null?void 0:Ae.insert_id},Ae)),vt.items=Lt}return vt}),Ee(Object(D.a)(Ne)),ti("".concat(Ae.question_type,"-").concat(Ae.key+1))},we={ref:Oi,editKey:hi,hideAction:!1,cancelAdd:function(){return De()},setEditKey:function(Ae){return ti(Ae)},addCallback:function(Ae){return ht(Ae)}},un=Object(i.useState)(!1),fi=Object(o.a)(un,2),gi=fi[0],q=fi[1],C=function(){var Q=Object(f.a)(r.a.mark(function Ae(nt,xt){var Dt,ot;return r.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:if(!(nt.length===0)){Lt.next=4;break}return v.b.warn("\u8BF7\u4E0A\u4F20\u6587\u4EF6"),xt(),Lt.abrupt("return");case 4:return Lt.next=6,Object(Le.s)(gn.id,(Dt=nt[0])===null||Dt===void 0?void 0:Dt.file);case 6:ot=Lt.sent,ot.status===0&&(v.b.success("\u6210\u529F\u5BFC\u5165".concat(ot==null?void 0:ot.success,"\u6761")),q(!1),di());case 8:case"end":return Lt.stop()}},Ae)}));return function(nt,xt){return Q.apply(this,arguments)}}(),L=function(){var Q=Object(f.a)(r.a.mark(function Ae(nt,xt){var Dt;return r.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return vt.next=2,Object(Le.y)(gn.id,{question_type:nt});case 2:Dt=vt.sent,(Dt==null?void 0:Dt.status)===0&&(v.b.success(Dt==null?void 0:Dt.message),Si(!1),di()),xt();case 5:case"end":return vt.stop()}},Ae)}));return function(nt,xt){return Q.apply(this,arguments)}}(),V=function(){if(hi!==-1){v.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002");return}q(!0)},ae=function(){var Q=Object(f.a)(r.a.mark(function Ae(nt,xt,Dt){var ot,vt,Lt;return r.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:return ve.current=Object(S.cloneDeep)(Ne),ot=Ne.findIndex(function(jn){return jn.question_type===Dt}),vt=Ne,vt[ot].items=xt,Ee(Object(D.a)(vt)),Xn.next=7,Object(Le.a)({id:gn.id,itemId:parseInt(nt.draggableId),position:nt.destination.index+1});case 7:Lt=Xn.sent;case 8:case"end":return Xn.stop()}},Ae)}));return function(nt,xt,Dt){return Q.apply(this,arguments)}}();return t.a.createElement("div",null,t.a.createElement("section",{className:"edu-container minH500"},t.a.createElement(Z.a,{spinning:!1,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},t.a.createElement("section",{className:"animated fadeIn"},t.a.createElement("aside",{className:"mt10"},t.a.createElement(X.a,{separator:">"},t.a.createElement(X.a.Item,null,t.a.createElement(A.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),t.a.createElement(X.a.Item,null,"\u7F16\u8F91\u8BD5\u5377"))),t.a.createElement("aside",{className:"".concat(te.a.title," mt20")},t.a.createElement(ee.a,{style:{width:"100%"}},t.a.createElement(M.a,{flex:"1"},t.a.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91\u8BD5\u5377")),t.a.createElement(M.a,null,t.a.createElement(A.a,{className:"font16 c-light-black",to:(Ni==null?void 0:Ni.fromadd)==="1"?"/paperlibrary/add/".concat(gn.id):"/paperlibrary"},"\u8FD4\u56DE"))))),t.a.createElement("section",{className:[te.a.bg,"pt30","pl30","pr30","pb60","mt20"].join(" ")},!zn&&t.a.createElement(Je,{setIsEdit:pi,isExportBlank:!1}),zn&&t.a.createElement(rn,{initValue:(Me=Gt.editData)===null||Me===void 0?void 0:Me.exercise,setIsEdit:pi,courseOptions:wi,reload:di,setEditKey:ti})),Ne&&t.a.createElement("section",{className:[te.a.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},t.a.createElement(fe.a,{inNewPaperLibrary:!0,data:Ne,editorProps:we,isDragDisabled:hi!==-1,onDragEnd:ae,batchScore:["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u7F16\u7A0B\u9898"],reload:di})),t.a.createElement(Ce,{inNewPaperLibrary:!0,callback:function(Ae,nt,xt){var Dt;ve.current=Object(S.cloneDeep)(Ne);var ot={shixun:Ae.challenge_names.map(function(wn){return{challenge_name:wn,challenge_score:5}}),shixun_name:Ae==null||((Dt=Ae.title)===null||Dt===void 0)?void 0:Dt.replace(/<.*?>/gi,""),shixun_id:Ae.id,question_type:5,edit:!0,is_copy:xt};if(nt&&(Ne.map(function(wn){if(wn.question_type===5){var Xn=Object(S.cloneDeep)(wn.items);Xn.splice(nt==null?void 0:nt.key,0,ot),wn.items=Xn}return wn}),ti("5-".concat(Ne.key+1)),Ee(Object(D.a)(Ne))),!nt){var vt,Lt=Ne.find(function(wn){return wn.question_type===5});if(!Lt){Ne.push({name:Ai.find(function(wn){return wn.id===5}).name,question_type:5,count:0,score:0,items:[ot]}),Ee(Object(D.a)(Ne)),ti("".concat(5,"-",1));return}(vt=document.getElementById("".concat(5,"-",Lt.count-1)))===null||vt===void 0||vt.scrollIntoView({block:"center",inline:"nearest"}),Lt.items.push(ot),Ee(Object(D.a)(Ne)),ti("".concat(5,"-",Lt.count))}}})),t.a.createElement(Oe.a,{visible:gi,onCancel:function(){return q(!1)},onOk:C}),t.a.createElement(be.a,{visible:_i,onCancel:function(){return Si(!1)},onOk:L,data:(tt=Gt.editData)===null||tt===void 0||((bt=tt.exercise)===null||bt===void 0)?void 0:bt.sort_by_qustion_type})),t.a.createElement(Ie,{questionType:Ai,onAdd:en,onImport:V,onSort:function(){return Si(!0)}}))},ye=st.default=Object(h.a)(function(Re){var ce=Re.exercise,Me=Re.newExercisePaper,tt=Re.user;return{exercise:ce,user:tt,newExercisePaper:Me}})(me)},bT9E:function(Wt,st,z){"use strict";z.d(st,"a",function(){return Z});var oe=z("VTBJ");function Z(U,ee){var W=Object(oe.a)({},U);return Array.isArray(ee)&&ee.forEach(function(M){delete W[M]}),W}},biw7:function(Wt,st,z){"use strict";var oe=z("q1tI"),Z=z.n(oe),U=oe.createContext(null);st.a=U},c5Ni:function(Wt,st,z){},dejd:function(Wt,st,z){},dmUQ:function(Wt,st,z){"use strict";var oe=z("Ff2n"),Z=z("rePB"),U=z("1OyB"),ee=z("vuIU"),W=z("Ji7U"),M=z("md7G"),$=z("foSv"),X=z("q1tI"),k=z.n(X),D=z("TSYQ"),m=z.n(D),v=z("4IlW");function f(u,d){var E=Object.keys(u);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(u);d&&(g=g.filter(function(y){return Object.getOwnPropertyDescriptor(u,y).enumerable})),E.push.apply(E,g)}return E}function o(u){for(var d=1;d<arguments.length;d++){var E=arguments[d]!=null?arguments[d]:{};d%2?f(Object(E),!0).forEach(function(g){Object(Z.a)(u,g,E[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(E)):f(Object(E)).forEach(function(g){Object.defineProperty(u,g,Object.getOwnPropertyDescriptor(E,g))})}return u}function l(u){var d=r();return function(){var g=Object($.a)(u),y;if(d){var F=Object($.a)(this).constructor;y=Reflect.construct(g,arguments,F)}else y=g.apply(this,arguments);return Object(M.a)(this,y)}}function r(){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(u){return!1}}function i(){}function t(u){u.preventDefault()}var c=function(d){return d.replace(/[^\w.-]+/g,"")},h=200,A=600,S=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,w=function(d){return d!=null},O=function(d,E){return E===d||typeof E=="number"&&typeof d=="number"&&isNaN(E)&&isNaN(d)},R=function(u){Object(W.a)(E,u);var d=l(E);function E(g){var y;Object(U.a)(this,E),y=d.call(this,g),y.onKeyDown=function(H){var G=y.props,I=G.onKeyDown,x=G.onPressEnter;if(H.keyCode===v.a.UP){var B=y.getRatio(H);y.up(H,B,null),y.stop()}else if(H.keyCode===v.a.DOWN){var Y=y.getRatio(H);y.down(H,Y,null),y.stop()}else H.keyCode===v.a.ENTER&&x&&x(H);if(y.recordCursorPosition(),y.lastKeyCode=H.keyCode,I){for(var re=arguments.length,de=new Array(re>1?re-1:0),he=1;he<re;he++)de[he-1]=arguments[he];I.apply(void 0,[H].concat(de))}},y.onKeyUp=function(H){var G=y.props.onKeyUp;if(y.stop(),y.recordCursorPosition(),G){for(var I=arguments.length,x=new Array(I>1?I-1:0),B=1;B<I;B++)x[B-1]=arguments[B];G.apply(void 0,[H].concat(x))}},y.onChange=function(H){var G=y.props.onChange;y.state.focused&&(y.inputting=!0),y.rawInput=y.props.parser(y.getValueFromEvent(H)),y.setState({inputValue:y.rawInput}),G(y.toNumber(y.rawInput))},y.onMouseUp=function(){var H=y.props.onMouseUp;y.recordCursorPosition(),H&&H.apply(void 0,arguments)},y.onFocus=function(){var H;y.setState({focused:!0}),(H=y.props).onFocus.apply(H,arguments)},y.onBlur=function(){var H=y.props.onBlur;y.inputting=!1,y.setState({focused:!1});var G=y.getCurrentValidValue(y.state.inputValue),I=y.setValue(G,i);if(H){var x=y.input.value,B=y.getInputDisplayValue({focus:!1,value:I});y.input.value=B&&Number(B),H.apply(void 0,arguments),y.input.value=x}},y.getRatio=function(H){var G=1;return H.metaKey||H.ctrlKey?G=.1:H.shiftKey&&(G=10),G},y.getFullNum=function(H){return isNaN(H)?H:/e/i.test(String(H))?Number(H).toFixed(18).replace(/\.?0+$/,""):H},y.getPrecision=function(H){if(w(y.props.precision))return y.props.precision;var G=String(H);if(G.indexOf("e-")>=0)return parseInt(G.slice(G.indexOf("e-")+2),10);var I=0;return G.indexOf(".")>=0&&(I=G.length-G.indexOf(".")-1),I},y.getInputDisplayValue=function(H){var G=H||y.state,I=G.focused,x=G.inputValue,B=G.value,Y;I?Y=x:Y=y.toPrecisionAsStep(B),Y==null&&(Y="");var re=y.formatWrapper(Y);return w(y.props.decimalSeparator)&&(re=re.toString().replace(".",y.props.decimalSeparator)),re},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(H){}},y.restoreByAfter=function(H){if(H===void 0)return!1;var G=y.input.value,I=G.lastIndexOf(H);if(I===-1)return!1;var x=y.cursorBefore.length;return y.lastKeyCode===v.a.DELETE&&y.cursorBefore.charAt(x-1)===H[0]?(y.fixCaret(x,x),!0):I+H.length===G.length?(y.fixCaret(I,I),!0):!1},y.partRestoreByAfter=function(H){return H===void 0?!1:Array.prototype.some.call(H,function(G,I){var x=H.substring(I);return y.restoreByAfter(x)})},y.isNotCompleteNumber=function(H){return isNaN(H)||H===""||H===null||H&&H.toString().indexOf(".")===H.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(H,G,I){y.pressingUpOrDown=!0,y.step("down",H,G,I)},y.up=function(H,G,I){y.pressingUpOrDown=!0,y.step("up",H,G,I)},y.saveInput=function(H){y.input=H};var F=g.value;F===void 0&&(F=g.defaultValue),y.state={focused:g.autoFocus};var N=y.getValidValue(y.toNumber(F));return y.state=o(o({},y.state),{},{inputValue:y.toPrecisionAsStep(N),value:N}),y}return Object(ee.a)(E,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var F=this.props,N=F.value,H=F.onChange,G=F.max,I=F.min,x=this.state.focused;if(y){if(!O(y.value,N)||!O(y.max,G)||!O(y.min,I)){var B=x?N:this.getValidValue(N),Y;this.pressingUpOrDown?Y=B:this.inputting?Y=this.rawInput:Y=this.toPrecisionAsStep(B),this.setState({value:B,inputValue:Y})}var re="value"in this.props?N:this.state.value;"max"in this.props&&y.max!==G&&typeof re=="number"&&re>G&&H&&H(G),"min"in this.props&&y.min!==I&&typeof re=="number"&&re<I&&H&&H(I)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var de=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===v.a.BACKSPACE?de=this.cursorStart-1:this.lastKeyCode===v.a.DELETE&&(de=this.cursorStart):de=this.input.value.length,this.fixCaret(de,de)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case v.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case v.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(he){}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(y){var F=y;return F===""?F="":this.isNotCompleteNumber(parseFloat(F))?F=this.state.value:F=this.getValidValue(F),this.toNumber(F)}},{key:"getValueFromEvent",value:function(y){var F=y.target.value.trim().replace(/。/g,".");return w(this.props.decimalSeparator)&&(F=F.replace(this.props.decimalSeparator,".")),F}},{key:"getValidValue",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,H=parseFloat(y);return isNaN(H)?y:(H<F&&(H=F),H>N&&(H=N),H)}},{key:"setValue",value:function(y,F){var N=this.props.precision,H=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),G=this.state.value,I=G===void 0?null:G,x=this.state.inputValue,B=x===void 0?null:x,Y=typeof H=="number"?H.toFixed(N):"".concat(H),re=H!==I||Y!=="".concat(B);return"value"in this.props?(B=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:B},F)):this.setState({value:H,inputValue:this.toPrecisionAsStep(y)},F),re&&this.props.onChange(H),H}},{key:"getMaxPrecision",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.props,H=N.precision,G=N.step;if(w(H))return H;var I=this.getPrecision(F),x=this.getPrecision(G),B=this.getPrecision(y);return y?Math.max(B,I+x):I+x}},{key:"getPrecisionFactor",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.getMaxPrecision(y,F);return Math.pow(10,N)}},{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(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var F=Math.abs(this.getMaxPrecision(y));return isNaN(F)?y.toString():Number(y).toFixed(F)}},{key:"toNumber",value:function(y){var F=this.props.precision,N=this.state.focused,H=y&&y.length>16&&N;return this.isNotCompleteNumber(y)||H?y:w(F)?Math.round(y*Math.pow(10,F))/Math.pow(10,F):Number(y)}},{key:"upStep",value:function(y,F){var N=this.props.step,H=this.getPrecisionFactor(y,F),G=Math.abs(this.getMaxPrecision(y,F)),I=((H*y+H*N*F)/H).toFixed(G);return this.toNumber(I)}},{key:"downStep",value:function(y,F){var N=this.props.step,H=this.getPrecisionFactor(y,F),G=Math.abs(this.getMaxPrecision(y,F)),I=((H*y-H*N*F)/H).toFixed(G);return this.toNumber(I)}},{key:"step",value:function(y,F){var N=this,H=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,G=arguments.length>3?arguments[3]:void 0;this.stop(),F&&(F.persist(),F.preventDefault());var I=this.props;if(I.disabled)return;var x=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(x))return;var B=this["".concat(y,"Step")](x,H),Y=B>I.max||B<I.min;if(B>I.max?B=I.max:B<I.min&&(B=I.min),this.setValue(B,null),this.setState({focused:!0},function(){N.pressingUpOrDown=!1}),Y)return;this.autoStepTimer=setTimeout(function(){N[y](F,H,!0)},G?h:A)}},{key:"fixCaret",value:function(y,F){if(y===void 0||F===void 0||!this.input||!this.input.value)return;try{var N=this.input.selectionStart,H=this.input.selectionEnd;(y!==N||F!==H)&&this.input.setSelectionRange(y,F)}catch(G){}}},{key:"render",value:function(){var y,F=this.props,N=F.prefixCls,H=F.disabled,G=F.readOnly,I=F.useTouch,x=F.autoComplete,B=F.upHandler,Y=F.downHandler,re=F.className,de=F.max,he=F.min,xe=F.style,Pe=F.title,Ce=F.onMouseEnter,Oe=F.onMouseLeave,be=F.onMouseOver,ge=F.onMouseOut,te=F.required,fe=F.onClick,_e=F.tabIndex,Le=F.type,$e=F.placeholder,Ue=F.id,at=F.inputMode,ft=F.pattern,Ct=F.step,yt=F.maxLength,_t=F.autoFocus,lt=F.name,Ft=F.onPaste,Xt=F.onInput,Jt=Object(oe.a)(F,["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"]),rn=this.state,En=rn.value,mn=rn.focused,Ye=m()(N,(y={},Object(Z.a)(y,re,!!re),Object(Z.a)(y,"".concat(N,"-disabled"),H),Object(Z.a)(y,"".concat(N,"-focused"),mn),y)),Xe={};Object.keys(Jt).forEach(function(ce){(ce.substr(0,5)==="data-"||ce.substr(0,5)==="aria-"||ce==="role")&&(Xe[ce]=Jt[ce])});var Ot=!G&&!H,Et=this.getInputDisplayValue(null),Je=(En||En===0)&&(isNaN(En)||Number(En)>=de),mt=(En||En===0)&&(isNaN(En)||Number(En)<=he),Be=Je||H||G,Ie=mt||H||G,ke=m()("".concat(N,"-handler"),"".concat(N,"-handler-up"),Object(Z.a)({},"".concat(N,"-handler-up-disabled"),Be)),me=m()("".concat(N,"-handler"),"".concat(N,"-handler-down"),Object(Z.a)({},"".concat(N,"-handler-down-disabled"),Ie)),ye=I?{onTouchStart:Be?i:this.up,onTouchEnd:this.stop}:{onMouseDown:Be?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},Re=I?{onTouchStart:Ie?i:this.down,onTouchEnd:this.stop}:{onMouseDown:Ie?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return k.a.createElement("div",{className:Ye,style:xe,title:Pe,onMouseEnter:Ce,onMouseLeave:Oe,onMouseOver:be,onMouseOut:ge,onFocus:function(){return null},onBlur:function(){return null}},k.a.createElement("div",{className:"".concat(N,"-handler-wrap")},k.a.createElement("span",Object.assign({unselectable:"on"},ye,{role:"button","aria-label":"Increase Value","aria-disabled":Be,className:ke}),B||k.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-up-inner"),onClick:t})),k.a.createElement("span",Object.assign({unselectable:"on"},Re,{role:"button","aria-label":"Decrease Value","aria-disabled":Ie,className:me}),Y||k.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-down-inner"),onClick:t}))),k.a.createElement("div",{className:"".concat(N,"-input-wrap")},k.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":he,"aria-valuemax":de,"aria-valuenow":En,required:te,type:Le,placeholder:$e,onPaste:Ft,onClick:fe,onMouseUp:this.onMouseUp,className:"".concat(N,"-input"),tabIndex:_e,autoComplete:x,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ot?this.onKeyDown:i,onKeyUp:Ot?this.onKeyUp:i,autoFocus:_t,maxLength:yt,readOnly:G,disabled:H,max:de,min:he,step:Ct,name:lt,title:Pe,id:Ue,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(Et),pattern:ft,inputMode:at,onInput:Xt},Xe))))}}]),E}(k.a.Component);R.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:S,min:-S,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:c,required:!1,autoComplete:"off"};var b=R,_=st.a=b},fcSX:function(Wt,st,z){"use strict";var oe=z("Ff2n"),Z=z("1OyB"),U=z("vuIU"),ee=z("Ji7U"),W=z("md7G"),M=z("foSv"),$=z("1W/9"),X=z("q1tI"),k=z("rePB"),D=z("JX7q"),m=z("TSYQ"),v=z.n(m),f=z("qx4F"),o=z("4IlW");function l(H){return Array.isArray(H)?H:[H]}var r={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(r).filter(function(H){if(typeof document=="undefined")return!1;var G=document.getElementsByTagName("html")[0];return H in(G?G.style:{})})[0],t=r[i];function c(H,G,I,x){H.addEventListener?H.addEventListener(G,I,x):H.attachEvent&&H.attachEvent("on".concat(G),I)}function h(H,G,I,x){H.removeEventListener?H.removeEventListener(G,I,x):H.attachEvent&&H.detachEvent("on".concat(G),I)}function A(H,G){var I=typeof H=="function"?H(G):H;return Array.isArray(I)?I.length===2?I:[I[0],I[1]]:[I]}var S=function(G){return!isNaN(parseFloat(G))&&isFinite(G)},w=!(typeof window!="undefined"&&window.document&&window.document.createElement),O=function H(G,I,x,B){if(!I||I===document||I instanceof Document)return!1;if(I===G.parentNode)return!0;var Y=Math.max(Math.abs(x),Math.abs(B))===Math.abs(B),re=Math.max(Math.abs(x),Math.abs(B))===Math.abs(x),de=I.scrollHeight-I.clientHeight,he=I.scrollWidth-I.clientWidth,xe=document.defaultView.getComputedStyle(I),Pe=xe.overflowY==="auto"||xe.overflowY==="scroll",Ce=xe.overflowX==="auto"||xe.overflowX==="scroll",Oe=de&&Pe,be=he&&Ce;return Y&&(!Oe||Oe&&(I.scrollTop>=de&&B<0||I.scrollTop<=0&&B>0))||re&&(!be||be&&(I.scrollLeft>=he&&x<0||I.scrollLeft<=0&&x>0))?H(G,I.parentNode,x,B):!1};function R(H){var G=b();return function(){var x=Object(M.a)(H),B;if(G){var Y=Object(M.a)(this).constructor;B=Reflect.construct(x,arguments,Y)}else B=x.apply(this,arguments);return Object(W.a)(this,B)}}function b(){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(H){return!1}}var _={},u=function(H){Object(ee.a)(I,H);var G=R(I);function I(x){var B;return Object(Z.a)(this,I),B=G.call(this,x),B.domFocus=function(){B.dom&&B.dom.focus()},B.removeStartHandler=function(Y){if(Y.touches.length>1)return;B.startPos={x:Y.touches[0].clientX,y:Y.touches[0].clientY}},B.removeMoveHandler=function(Y){if(Y.changedTouches.length>1)return;var re=Y.currentTarget,de=Y.changedTouches[0].clientX-B.startPos.x,he=Y.changedTouches[0].clientY-B.startPos.y;(re===B.maskDom||re===B.handlerDom||re===B.contentDom&&O(re,Y.target,de,he))&&Y.cancelable&&Y.preventDefault()},B.transitionEnd=function(Y){var re=Y.target;h(re,t,B.transitionEnd),re.style.transition=""},B.onKeyDown=function(Y){if(Y.keyCode===o.a.ESC){var re=B.props.onClose;Y.stopPropagation(),re&&re(Y)}},B.onWrapperTransitionEnd=function(Y){var re=B.props,de=re.open,he=re.afterVisibleChange;Y.target===B.contentWrapper&&Y.propertyName.match(/transform$/)&&(B.dom.style.transition="",!de&&B.getCurrentDrawerSome()&&(document.body.style.overflowX="",B.maskDom&&(B.maskDom.style.left="",B.maskDom.style.width="")),he&&he(!!de))},B.openLevelTransition=function(){var Y=B.props,re=Y.open,de=Y.width,he=Y.height,xe=B.getHorizontalBoolAndPlacementName(),Pe=xe.isHorizontal,Ce=xe.placementName,Oe=B.contentDom?B.contentDom.getBoundingClientRect()[Pe?"width":"height"]:0,be=(Pe?de:he)||Oe;B.setLevelAndScrolling(re,Ce,be)},B.setLevelTransform=function(Y,re,de,he){var xe=B.props,Pe=xe.placement,Ce=xe.levelMove,Oe=xe.duration,be=xe.ease,ge=xe.showMask;B.levelDom.forEach(function(te){te.style.transition="transform ".concat(Oe," ").concat(be),c(te,t,B.transitionEnd);var fe=Y?de:0;if(Ce){var _e=A(Ce,{target:te,open:Y});fe=Y?_e[0]:_e[1]||0}var Le=typeof fe=="number"?"".concat(fe,"px"):fe,$e=Pe==="left"||Pe==="top"?Le:"-".concat(Le);$e=ge&&Pe==="right"&&he?"calc(".concat($e," + ").concat(he,"px)"):$e,te.style.transform=fe?"".concat(re,"(").concat($e,")"):""})},B.setLevelAndScrolling=function(Y,re,de){var he=B.props.onChange;if(!w){var xe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(f.a)(!0):0;B.setLevelTransform(Y,re,de,xe),B.toggleScrollingToDrawerAndBody(xe)}he&&he(Y)},B.toggleScrollingToDrawerAndBody=function(Y){var re=B.props,de=re.getOpenCount,he=re.getContainer,xe=re.showMask,Pe=re.open,Ce=he&&he(),Oe=de&&de();if(Ce&&Ce.parentNode===document.body&&xe){var be=["touchstart"],ge=[document.body,B.maskDom,B.handlerDom,B.contentDom];Pe&&document.body.style.overflow!=="hidden"?(Y&&B.addScrollingEffect(Y),Oe===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",ge.forEach(function(te,fe){if(!te)return;c(te,be[fe]||"touchmove",fe?B.removeMoveHandler:B.removeStartHandler,B.passive)})):B.getCurrentDrawerSome()&&(Oe||(document.body.style.overflow=""),document.body.style.touchAction="",Y&&B.remScrollingEffect(Y),ge.forEach(function(te,fe){if(!te)return;h(te,be[fe]||"touchmove",fe?B.removeMoveHandler:B.removeStartHandler,B.passive)}))}},B.addScrollingEffect=function(Y){var re=B.props,de=re.placement,he=re.duration,xe=re.ease,Pe=re.getOpenCount,Ce=re.switchScrollingEffect,Oe=Pe&&Pe();Oe===1&&Ce();var be="width ".concat(he," ").concat(xe),ge="transform ".concat(he," ").concat(xe);B.dom.style.transition="none";switch(de){case"right":B.dom.style.transform="translateX(-".concat(Y,"px)");break;case"top":case"bottom":B.dom.style.width="calc(100% - ".concat(Y,"px)"),B.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(B.timeout),B.timeout=setTimeout(function(){B.dom&&(B.dom.style.transition="".concat(ge,",").concat(be),B.dom.style.width="",B.dom.style.transform="")})},B.remScrollingEffect=function(Y){var re=B.props,de=re.placement,he=re.duration,xe=re.ease,Pe=re.getOpenCount,Ce=re.switchScrollingEffect,Oe=Pe&&Pe();Oe||Ce(!0),i&&(document.body.style.overflowX="hidden"),B.dom.style.transition="none";var be,ge="width ".concat(he," ").concat(xe),te="transform ".concat(he," ").concat(xe);switch(de){case"left":{B.dom.style.width="100%",ge="width 0s ".concat(xe," ").concat(he);break}case"right":{B.dom.style.transform="translateX(".concat(Y,"px)"),B.dom.style.width="100%",ge="width 0s ".concat(xe," ").concat(he),B.maskDom&&(B.maskDom.style.left="-".concat(Y,"px"),B.maskDom.style.width="calc(100% + ".concat(Y,"px)"));break}case"top":case"bottom":{B.dom.style.width="calc(100% + ".concat(Y,"px)"),B.dom.style.height="100%",B.dom.style.transform="translateZ(0)",be="height 0s ".concat(xe," ").concat(he);break}default:break}clearTimeout(B.timeout),B.timeout=setTimeout(function(){B.dom&&(B.dom.style.transition="".concat(te,",").concat(be?"".concat(be,","):"").concat(ge),B.dom.style.transform="",B.dom.style.width="",B.dom.style.height="")})},B.getCurrentDrawerSome=function(){return!Object.keys(_).some(function(Y){return _[Y]})},B.getLevelDom=function(Y){var re=Y.level,de=Y.getContainer;if(w)return;var he=de&&de(),xe=he?he.parentNode:null;if(B.levelDom=[],re==="all"){var Pe=xe?Array.prototype.slice.call(xe.children):[];Pe.forEach(function(Ce){Ce.nodeName!=="SCRIPT"&&Ce.nodeName!=="STYLE"&&Ce.nodeName!=="LINK"&&Ce!==he&&B.levelDom.push(Ce)})}else re&&l(re).forEach(function(Ce){document.querySelectorAll(Ce).forEach(function(Oe){B.levelDom.push(Oe)})})},B.getHorizontalBoolAndPlacementName=function(){var Y=B.props.placement,re=Y==="left"||Y==="right",de="translate".concat(re?"X":"Y");return{isHorizontal:re,placementName:de}},B.state={_self:Object(D.a)(B)},B}return Object(U.a)(I,[{key:"componentDidMount",value:function(){var B=this;if(!w){var Y=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Y=!0,null}}))}catch(Pe){}this.passive=Y?{passive:!1}:!1}var re=this.props,de=re.open,he=re.getContainer,xe=he&&he();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),de&&(xe&&xe.parentNode===document.body&&(_[this.drawerId]=de),this.openLevelTransition(),this.forceUpdate(function(){B.domFocus()}))}},{key:"componentDidUpdate",value:function(B){var Y=this.props,re=Y.open,de=Y.getContainer,he=de&&de();re!==B.open&&(re&&this.domFocus(),he&&he.parentNode===document.body&&(_[this.drawerId]=!!re),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var B=this.props,Y=B.getOpenCount,re=B.open,de=B.switchScrollingEffect,he=typeof Y=="function"&&Y();delete _[this.drawerId],re&&(this.setLevelTransform(!1),document.body.style.touchAction=""),he||(document.body.style.overflow="",de(!0))}},{key:"render",value:function(){var B,Y=this,re=this.props,de=re.className,he=re.children,xe=re.style,Pe=re.width,Ce=re.height,Oe=re.defaultOpen,be=re.open,ge=re.prefixCls,te=re.placement,fe=re.level,_e=re.levelMove,Le=re.ease,$e=re.duration,Ue=re.getContainer,at=re.handler,ft=re.onChange,Ct=re.afterVisibleChange,yt=re.showMask,_t=re.maskClosable,lt=re.maskStyle,Ft=re.onClose,Xt=re.onHandleClick,Jt=re.keyboard,rn=re.getOpenCount,En=re.switchScrollingEffect,mn=Object(oe.a)(re,["className","children","style","width","height","defaultOpen","open","prefixCls","placement","level","levelMove","ease","duration","getContainer","handler","onChange","afterVisibleChange","showMask","maskClosable","maskStyle","onClose","onHandleClick","keyboard","getOpenCount","switchScrollingEffect"]),Ye=this.dom?be:!1,Xe=v()(ge,(B={},Object(k.a)(B,"".concat(ge,"-").concat(te),!0),Object(k.a)(B,"".concat(ge,"-open"),Ye),Object(k.a)(B,de||"",!!de),Object(k.a)(B,"no-mask",!yt),B)),Ot=this.getHorizontalBoolAndPlacementName(),Et=Ot.placementName,Je=te==="left"||te==="top"?"-100%":"100%",mt=Ye?"":"".concat(Et,"(").concat(Je,")"),Be=at&&X.cloneElement(at,{onClick:function(ke){at.props.onClick&&at.props.onClick(),Xt&&Xt(ke)},ref:function(ke){Y.handlerDom=ke}});return X.createElement("div",Object.assign({},mn,{tabIndex:-1,className:Xe,style:xe,ref:function(ke){Y.dom=ke},onKeyDown:Ye&&Jt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),yt&&X.createElement("div",{className:"".concat(ge,"-mask"),onClick:_t?Ft:void 0,style:lt,ref:function(ke){Y.maskDom=ke}}),X.createElement("div",{className:"".concat(ge,"-content-wrapper"),style:{transform:mt,msTransform:mt,width:S(Pe)?"".concat(Pe,"px"):Pe,height:S(Ce)?"".concat(Ce,"px"):Ce},ref:function(ke){Y.contentWrapper=ke}},X.createElement("div",{className:"".concat(ge,"-content"),ref:function(ke){Y.contentDom=ke},onTouchStart:Ye&&yt?this.removeStartHandler:void 0,onTouchMove:Ye&&yt?this.removeMoveHandler:void 0},he),Be))}}],[{key:"getDerivedStateFromProps",value:function(B,Y){var re=Y.prevProps,de=Y._self,he={prevProps:B};if(re!==void 0){var xe=B.placement,Pe=B.level;xe!==re.placement&&(de.contentDom=null),Pe!==re.level&&de.getLevelDom(B)}return he}}]),I}(X.Component);u.defaultProps={switchScrollingEffect:function(){}};var d=u;function E(H){var G=g();return function(){var x=Object(M.a)(H),B;if(G){var Y=Object(M.a)(this).constructor;B=Reflect.construct(x,arguments,Y)}else B=x.apply(this,arguments);return Object(W.a)(this,B)}}function g(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(H){return!1}}var y=function(H){Object(ee.a)(I,H);var G=E(I);function I(x){var B;Object(Z.a)(this,I),B=G.call(this,x),B.onHandleClick=function(re){var de=B.props,he=de.onHandleClick,xe=de.open;if(he&&he(re),typeof xe=="undefined"){var Pe=B.state.open;B.setState({open:!Pe})}},B.onClose=function(re){var de=B.props,he=de.onClose,xe=de.open;he&&he(re),typeof xe=="undefined"&&B.setState({open:!1})};var Y=typeof x.open!="undefined"?x.open:!!x.defaultOpen;return B.state={open:Y},"onMaskClick"in x&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),B}return Object(U.a)(I,[{key:"render",value:function(){var B=this,Y=this.props,re=Y.defaultOpen,de=Y.getContainer,he=Y.wrapperClassName,xe=Y.forceRender,Pe=Y.handler,Ce=Object(oe.a)(Y,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Oe=this.state.open;if(!de)return X.createElement("div",{className:he,ref:function(te){B.dom=te}},X.createElement(d,Object.assign({},Ce,{open:Oe,handler:Pe,getContainer:function(){return B.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var be=!!Pe||xe;return X.createElement($.a,{visible:Oe,forceRender:be,getContainer:de,wrapperClassName:he},function(ge){var te=ge.visible,fe=ge.afterClose,_e=Object(oe.a)(ge,["visible","afterClose"]);return X.createElement(d,Object.assign({},Ce,_e,{open:te!==void 0?te:Oe,afterVisibleChange:fe!==void 0?fe:Ce.afterVisibleChange,handler:Pe,onClose:B.onClose,onHandleClick:B.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(B,Y){var re=Y.prevProps,de={prevProps:B};return typeof re!="undefined"&&B.open!==re.open&&(de.open=B.open),de}}]),I}(X.Component);y.defaultProps={prefixCls:"drawer",placement:"left",getContainer:"body",defaultOpen:!1,level:"all",duration:".3s",ease:"cubic-bezier(0.78, 0.14, 0.15, 0.86)",onChange:function(){},afterVisibleChange:function(){},handler:X.createElement("div",{className:"drawer-handle"},X.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var F=y,N=st.a=F},fyJ8:function(Wt,st,z){"use strict";var oe=z("rePB"),Z=z("VTBJ"),U=z("Ff2n"),ee=z("U8pU"),W=z("q1tI"),M=z.n(W),$=z("TSYQ"),X=z.n($),k=z("c+Xe"),D=z("sR1s");function m(r){return r&&Object(ee.a)(r)==="object"&&!Array.isArray(r)&&!W.isValidElement(r)}function v(r){return typeof r=="string"?!0:Object(k.c)(r)}function f(r,i){var t,c=r.prefixCls,h=r.className,A=r.record,S=r.index,w=r.dataIndex,O=r.render,R=r.children,b=r.component,_=b===void 0?"td":b,u=r.colSpan,d=r.rowSpan,E=r.fixLeft,g=r.fixRight,y=r.firstFixLeft,F=r.lastFixLeft,N=r.firstFixRight,H=r.lastFixRight,G=r.appendNode,I=r.additionalProps,x=I===void 0?{}:I,B=r.ellipsis,Y=r.align,re=r.rowType,de=r.isSticky,he="".concat(c,"-cell"),xe,Pe;if(R)Pe=R;else{var Ce=Object(D.b)(A,w);if(Pe=Ce,O){var Oe=O(Ce,A,S);m(Oe)?(Pe=Oe.children,xe=Oe.props):Pe=Oe}}Object(ee.a)(Pe)==="object"&&!Array.isArray(Pe)&&!W.isValidElement(Pe)&&(Pe=null),B&&(F||N)&&(Pe=W.createElement("span",{className:"".concat(he,"-content")},Pe));var be=xe||{},ge=be.colSpan,te=be.rowSpan,fe=be.style,_e=be.className,Le=Object(U.a)(be,["colSpan","rowSpan","style","className"]),$e=ge!==void 0?ge:u,Ue=te!==void 0?te:d;if($e===0||Ue===0)return null;var at={},ft=typeof E=="number",Ct=typeof g=="number";ft&&(at.position="sticky",at.left=E),Ct&&(at.position="sticky",at.right=g);var yt={};Y&&(yt.textAlign=Y);var _t,lt=B===!0?{showTitle:!0}:B;lt&&(lt.showTitle||re==="header")&&(typeof Pe=="string"||typeof Pe=="number"?_t=Pe.toString():W.isValidElement(Pe)&&typeof Pe.props.children=="string"&&(_t=Pe.props.children));var Ft=Object(Z.a)(Object(Z.a)(Object(Z.a)({title:_t},Le),x),{},{colSpan:$e&&$e!==1?$e:null,rowSpan:Ue&&Ue!==1?Ue:null,className:X()(he,h,(t={},Object(oe.a)(t,"".concat(he,"-fix-left"),ft),Object(oe.a)(t,"".concat(he,"-fix-left-first"),y),Object(oe.a)(t,"".concat(he,"-fix-left-last"),F),Object(oe.a)(t,"".concat(he,"-fix-right"),Ct),Object(oe.a)(t,"".concat(he,"-fix-right-first"),N),Object(oe.a)(t,"".concat(he,"-fix-right-last"),H),Object(oe.a)(t,"".concat(he,"-ellipsis"),B),Object(oe.a)(t,"".concat(he,"-with-append"),G),Object(oe.a)(t,"".concat(he,"-fix-sticky"),(ft||Ct)&&de),t),x.className,_e),style:Object(Z.a)(Object(Z.a)(Object(Z.a)(Object(Z.a)({},x.style),yt),at),fe),ref:v(_)?i:null});return W.createElement(_,Object.assign({},Ft),G,Pe)}var o=W.forwardRef(f);o.displayName="Cell";var l=W.memo(o,function(r,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,r.record):!1});st.a=l},h78n:function(Wt,st,z){"use strict";z.d(st,"a",function(){return y});var oe=z("q1tI"),Z=z.n(oe),U=z("TSYQ"),ee=z.n(U),W={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},M=function(H){var G=H.map(function(){return Object(oe.useRef)()}),I=Object(oe.useRef)();return Object(oe.useEffect)(function(){var x=Date.now(),B=!1;Object.keys(G).forEach(function(Y){var re=G[Y].current;if(!re)return;B=!0;var de=re.style;de.transitionDuration=".3s, .3s, .3s, .06s",I.current&&x-I.current<100&&(de.transitionDuration="0s, 0s")}),B&&(I.current=Date.now())}),[G]};function $(){return $=Object.assign||function(N){for(var H=1;H<arguments.length;H++){var G=arguments[H];for(var I in G)Object.prototype.hasOwnProperty.call(G,I)&&(N[I]=G[I])}return N},$.apply(this,arguments)}function X(N,H){return f(N)||v(N,H)||D(N,H)||k()}function k(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D(N,H){if(!N)return;if(typeof N=="string")return m(N,H);var G=Object.prototype.toString.call(N).slice(8,-1);if(G==="Object"&&N.constructor&&(G=N.constructor.name),G==="Map"||G==="Set")return Array.from(N);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return m(N,H)}function m(N,H){(H==null||H>N.length)&&(H=N.length);for(var G=0,I=new Array(H);G<H;G++)I[G]=N[G];return I}function v(N,H){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(N)))return;var G=[],I=!0,x=!1,B=void 0;try{for(var Y=N[Symbol.iterator](),re;!(I=(re=Y.next()).done)&&!(G.push(re.value),H&&G.length===H);I=!0);}catch(de){x=!0,B=de}finally{try{!I&&Y.return!=null&&Y.return()}finally{if(x)throw B}}return G}function f(N){if(Array.isArray(N))return N}function o(N,H){if(N==null)return{};var G=l(N,H),I,x;if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(N);for(x=0;x<B.length;x++){if(I=B[x],H.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(N,I))continue;G[I]=N[I]}}return G}function l(N,H){if(N==null)return{};var G={},I=Object.keys(N),x,B;for(B=0;B<I.length;B++){if(x=I[B],H.indexOf(x)>=0)continue;G[x]=N[x]}return G}var r=function(H){var G=H.className,I=H.percent,x=H.prefixCls,B=H.strokeColor,Y=H.strokeLinecap,re=H.strokeWidth,de=H.style,he=H.trailColor,xe=H.trailWidth,Pe=H.transition,Ce=o(H,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete Ce.gapPosition;var Oe=Array.isArray(I)?I:[I],be=Array.isArray(B)?B:[B],ge=M(Oe),te=X(ge,1),fe=te[0],_e=re/2,Le=100-re/2,$e="M ".concat(Y==="round"?_e:0,",").concat(_e,`
L `).concat(Y==="round"?Le:100,",").concat(_e),Ue="0 0 100 ".concat(re),at=0;return Z.a.createElement("svg",$({className:ee()("".concat(x,"-line"),G),viewBox:Ue,preserveAspectRatio:"none",style:de},Ce),Z.a.createElement("path",{className:"".concat(x,"-line-trail"),d:$e,strokeLinecap:Y,stroke:he,strokeWidth:xe||re,fillOpacity:"0"}),Oe.map(function(ft,Ct){var yt={strokeDasharray:"".concat(ft,"px, 100px"),strokeDashoffset:"-".concat(at,"px"),transition:Pe||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},_t=be[Ct]||be[be.length-1];return at+=ft,Z.a.createElement("path",{key:Ct,className:"".concat(x,"-line-path"),d:$e,strokeLinecap:Y,stroke:_t,strokeWidth:re,fillOpacity:"0",ref:fe[Ct],style:yt})}))};r.defaultProps=W;var i=r;function t(){return t=Object.assign||function(N){for(var H=1;H<arguments.length;H++){var G=arguments[H];for(var I in G)Object.prototype.hasOwnProperty.call(G,I)&&(N[I]=G[I])}return N},t.apply(this,arguments)}function c(N,H){return O(N)||w(N,H)||A(N,H)||h()}function h(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function A(N,H){if(!N)return;if(typeof N=="string")return S(N,H);var G=Object.prototype.toString.call(N).slice(8,-1);if(G==="Object"&&N.constructor&&(G=N.constructor.name),G==="Map"||G==="Set")return Array.from(N);if(G==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(G))return S(N,H)}function S(N,H){(H==null||H>N.length)&&(H=N.length);for(var G=0,I=new Array(H);G<H;G++)I[G]=N[G];return I}function w(N,H){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(N)))return;var G=[],I=!0,x=!1,B=void 0;try{for(var Y=N[Symbol.iterator](),re;!(I=(re=Y.next()).done)&&!(G.push(re.value),H&&G.length===H);I=!0);}catch(de){x=!0,B=de}finally{try{!I&&Y.return!=null&&Y.return()}finally{if(x)throw B}}return G}function O(N){if(Array.isArray(N))return N}function R(N,H){if(N==null)return{};var G=b(N,H),I,x;if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(N);for(x=0;x<B.length;x++){if(I=B[x],H.indexOf(I)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(N,I))continue;G[I]=N[I]}}return G}function b(N,H){if(N==null)return{};var G={},I=Object.keys(N),x,B;for(B=0;B<I.length;B++){if(x=I[B],H.indexOf(x)>=0)continue;G[x]=N[x]}return G}var _=0;function u(N){return+N.replace("%","")}function d(N){return Array.isArray(N)?N:[N]}function E(N,H,G,I){var x=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,B=arguments.length>5?arguments[5]:void 0,Y=50-I/2,re=0,de=-Y,he=0,xe=-2*Y;switch(B){case"left":re=-Y,de=0,he=2*Y,xe=0;break;case"right":re=Y,de=0,he=-2*Y,xe=0;break;case"bottom":de=Y,xe=2*Y;break;default:}var Pe="M 50,50 m ".concat(re,",").concat(de,`
a `).concat(Y,",").concat(Y," 0 1 1 ").concat(he,",").concat(-xe,`
a `).concat(Y,",").concat(Y," 0 1 1 ").concat(-he,",").concat(xe),Ce=Math.PI*2*Y,Oe={stroke:G,strokeDasharray:"".concat(H/100*(Ce-x),"px ").concat(Ce,"px"),strokeDashoffset:"-".concat(x/2+N/100*(Ce-x),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Pe,pathStyle:Oe}}var g=function(H){var G=H.prefixCls,I=H.strokeWidth,x=H.trailWidth,B=H.gapDegree,Y=H.gapPosition,re=H.trailColor,de=H.strokeLinecap,he=H.style,xe=H.className,Pe=H.strokeColor,Ce=H.percent,Oe=R(H,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),be=Object(oe.useMemo)(function(){return _+=1,_},[]),ge=E(0,100,re,I,B,Y),te=ge.pathString,fe=ge.pathStyle,_e=d(Ce),Le=d(Pe),$e=Le.find(function(yt){return Object.prototype.toString.call(yt)==="[object Object]"}),Ue=M(_e),at=c(Ue,1),ft=at[0],Ct=function(){var _t=0;return _e.map(function(lt,Ft){var Xt=Le[Ft]||Le[Le.length-1],Jt=Object.prototype.toString.call(Xt)==="[object Object]"?"url(#".concat(G,"-gradient-").concat(be,")"):"",rn=E(_t,lt,Xt,I,B,Y);return _t+=lt,Z.a.createElement("path",{key:Ft,className:"".concat(G,"-circle-path"),d:rn.pathString,stroke:Jt,strokeLinecap:de,strokeWidth:I,opacity:lt===0?0:1,fillOpacity:"0",style:rn.pathStyle,ref:ft[Ft]})})};return Z.a.createElement("svg",t({className:ee()("".concat(G,"-circle"),xe),viewBox:"0 0 100 100",style:he},Oe),$e&&Z.a.createElement("defs",null,Z.a.createElement("linearGradient",{id:"".concat(G,"-gradient-").concat(be),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys($e).sort(function(yt,_t){return u(yt)-u(_t)}).map(function(yt,_t){return Z.a.createElement("stop",{key:_t,offset:yt,stopColor:$e[yt]})}))),Z.a.createElement("path",{className:"".concat(G,"-circle-trail"),d:te,stroke:re,strokeLinecap:de,strokeWidth:x||I,fillOpacity:"0",style:fe}),Ct().reverse())};g.defaultProps=W;var y=g,F={Line:i,Circle:y}},hQp1:function(Wt,st,z){"use strict";z.d(st,"a",function(){return Z});var oe;(function(U){U.FirstPage="firstPage",U.PrevPage="prevPage",U.NextPage="nextPage"})(oe||(oe={}));var Z;(function(U){U[U.Single=0]="Single",U[U.Multiple=1]="Multiple",U[U.Judge=2]="Judge",U[U.Fill=3]="Fill",U[U.Subjective=4]="Subjective",U[U.Shixun=5]="Shixun",U[U.Program=6]="Program",U[U.Combine=7]="Combine"})(Z||(Z={}))},hW8S:function(Wt,st,z){"use strict";z.d(st,"a",function(){return ee}),z.d(st,"c",function(){return W}),z.d(st,"b",function(){return M});var oe=z("VTBJ"),Z=z("Ff2n"),U=z("Kwbf"),ee="RC_TABLE_INTERNAL_COL_DEFINE";function W($){var X=$.expandable,k=Object(Z.a)($,["expandable"]);return"expandable"in $?Object(oe.a)(Object(oe.a)({},k),X):k}function M($){return Object.keys($).reduce(function(X,k){return(k.substr(0,5)==="data-"||k.substr(0,5)==="aria-")&&(X[k]=$[k]),X},{})}},i58Z:function(Wt,st,z){Wt.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},ie49:function(Wt,st,z){Wt.exports={brief:"brief___29L5W",contentTitle:"contentTitle___2wPLj",content:"content___2MAv3",tips:"tips___3qmPX",antdTable:"antdTable___o4ScH",tableCell:"tableCell___24I9Y",antdModal:"antdModal___1nRWw"}},kCvp:function(Wt,st,z){Wt.exports={flex_box_center:"flex_box_center___1wyfO",flex_space_between:"flex_space_between___3ie-6",flex_box_vertical_center:"flex_box_vertical_center___1eUAq",flex_box_center_end:"flex_box_center_end___29GnR",flex_box_column:"flex_box_column___1pS1E",wrp:"wrp___3A78D",drawer:"drawer___2J2c_",menu:"menu___2EGlp",actived:"actived___2vitA",actived2:"actived2___1qPkY",listItem:"listItem___2jBqU",info:"info___1kwD-",title:"title___2GCln",titleLeft:"titleLeft___3VSnz",titleRight:"titleRight___2bW7b",search:"search___llksR",description:"description____0dnE",menuCourse:"menuCourse___2-Hgo",menut:"menut___1lhlV",actived3:"actived3___P7x4U",actived4:"actived4___BZSP4",subTag:"subTag___1TmCh"}},kSUc:function(Wt,st,z){},kqOp:function(Wt,st,z){"use strict";z.d(st,"a",function(){return D});var oe=z("0Owb"),Z=z("fWQN"),U=z("mtLc"),ee=z("yKVA"),W=z("879j"),M=z("q1tI"),$=z.n(M),X=z("Ot1p"),k="\u2581",D=function(m){Object(ee.a)(f,m);var v=Object(W.a)(f);function f(){var o;Object(Z.a)(this,f);for(var l=arguments.length,r=new Array(l),i=0;i<l;i++)r[i]=arguments[i];return o=v.call.apply(v,[this].concat(r)),o.getChCountBeforeCursor=function(t,c){for(var h=c.line,A=0,S=0;S<h;S++)A+=t.getLine(S).split(k).length-1;var w=t.getLine(h).substring(0,c.ch);return A+=w.split(k).length-1,A},o.onCMBeforeChange=function(t,c){var h=t.getRange(c.from,c.to),A=0;if(c.text.forEach(function(R){A+=R.split(k).length-1}),h&&h.indexOf(k)!=-1){var S=h.split(k).length-1,w=o.getChCountBeforeCursor(t,c.from);console.log("\u5220\u9664".concat(S,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(w,"\u4E2A\uFF0C\u65B0\u589E").concat(A,"\u4E2A")),o.props.deleteEmptyDisabled?c.cancel():o.props.onPlaceholderChange&&o.props.onPlaceholderChange(w,S,A)}else if(A){var O=o.getChCountBeforeCursor(t,c.from);console.log("\u65B0\u589E".concat(A,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(O,"\u4E2A")),o.props.onPlaceholderChange&&o.props.onPlaceholderChange(O,0,A)}},o}return Object(U.a)(f,[{key:"render",value:function(){return $.a.createElement(X.a,Object(oe.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),f}(M.Component)},lZu9:function(Wt,st,z){(function(oe){oe(z("VrN/"),z("1eCo"),z("8EBN"))})(function(oe){"use strict";oe.defineMode("markdown",function(Z,U){var ee=oe.getMode(Z,"text/html"),W=ee.name=="null";function M(I){if(oe.findModeByName){var x=oe.findModeByName(I);x&&(I=x.mime||x.mimes[0])}var B=oe.getMode(Z,I);return B.name=="null"?null:B}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 $={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 X in $)$.hasOwnProperty(X)&&U.tokenTypeOverrides[X]&&($[X]=U.tokenTypeOverrides[X]);var k=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,m=/^\[(x| )\](?=\s)/i,v=U.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,f=/^ {0,3}(?:\={1,}|-{2,})\s*$/,o=/^[^#!\[\]*_\\<>` "'(~:]+/,l=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,r=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,t=" ";function c(I,x,B){return x.f=x.inline=B,B(I,x)}function h(I,x,B){return x.f=x.block=B,B(I,x)}function A(I){return!I||!/\S/.test(I.string)}function S(I){if(I.linkTitle=!1,I.linkHref=!1,I.linkText=!1,I.em=!1,I.strong=!1,I.strikethrough=!1,I.quote=0,I.indentedCode=!1,I.f==O){var x=W;if(!x){var B=oe.innerMode(ee,I.htmlState);x=B.mode.name=="xml"&&B.state.tagStart===null&&!B.state.context&&B.state.tokenize.isInText}x&&(I.f=u,I.block=w,I.htmlState=null)}return I.trailingSpace=0,I.trailingSpaceNewLine=!1,I.prevLine=I.thisLine,I.thisLine={stream:null},null}function w(I,x){var B=I.column()===x.indentation,Y=A(x.prevLine.stream),re=x.indentedCode,de=x.prevLine.hr,he=x.list!==!1,xe=(x.listStack[x.listStack.length-1]||0)+3;x.indentedCode=!1;var Pe=x.indentation;if(x.indentationDiff===null&&(x.indentationDiff=x.indentation,he)){for(x.list=null;Pe<x.listStack[x.listStack.length-1];)x.listStack.pop(),x.listStack.length?x.indentation=x.listStack[x.listStack.length-1]:x.list=!1;x.list!==!1&&(x.indentationDiff=Pe-x.listStack[x.listStack.length-1])}var Ce=!Y&&!de&&!x.prevLine.header&&(!he||!re)&&!x.prevLine.fencedCodeEnd,Oe=(x.list===!1||de||Y)&&x.indentation<=xe&&I.match(k),be=null;if(x.indentationDiff>=4&&(re||x.prevLine.fencedCodeEnd||x.prevLine.header||Y))return I.skipToEnd(),x.indentedCode=!0,$.code;if(I.eatSpace())return null;if(B&&x.indentation<=xe&&(be=I.match(v))&&be[1].length<=6)return x.quote=0,x.header=be[1].length,x.thisLine.header=!0,U.highlightFormatting&&(x.formatting="header"),x.f=x.inline,b(x);if(x.indentation<=xe&&I.eat(">"))return x.quote=B?1:x.quote+1,U.highlightFormatting&&(x.formatting="quote"),I.eatSpace(),b(x);if(!Oe&&!x.setext&&B&&x.indentation<=xe&&(be=I.match(D))){var ge=be[1]?"ol":"ul";return x.indentation=Pe+I.current().length,x.list=!0,x.quote=0,x.listStack.push(x.indentation),x.em=!1,x.strong=!1,x.code=!1,x.strikethrough=!1,U.taskLists&&I.match(m,!1)&&(x.taskList=!0),x.f=x.inline,U.highlightFormatting&&(x.formatting=["list","list-"+ge]),b(x)}else{if(B&&x.indentation<=xe&&(be=I.match(l,!0)))return x.quote=0,x.fencedEndRE=new RegExp(be[1]+"+ *$"),x.localMode=U.fencedCodeBlockHighlighting&&M(be[2]||U.fencedCodeBlockDefaultMode),x.localMode&&(x.localState=oe.startState(x.localMode)),x.f=x.block=R,U.highlightFormatting&&(x.formatting="code-block"),x.code=-1,b(x);if(x.setext||(!Ce||!he)&&!x.quote&&x.list===!1&&!x.code&&!Oe&&!r.test(I.string)&&(be=I.lookAhead(1))&&(be=be.match(f)))return x.setext?(x.header=x.setext,x.setext=0,I.skipToEnd(),U.highlightFormatting&&(x.formatting="header")):(x.header=be[0].charAt(0)=="="?1:2,x.setext=x.header),x.thisLine.header=!0,x.f=x.inline,b(x);if(Oe)return I.skipToEnd(),x.hr=!0,x.thisLine.hr=!0,$.hr;if(I.peek()==="[")return c(I,x,F)}return c(I,x,x.inline)}function O(I,x){var B=ee.token(I,x.htmlState);if(!W){var Y=oe.innerMode(ee,x.htmlState);(Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText||x.md_inside&&I.current().indexOf(">")>-1)&&(x.f=u,x.block=w,x.htmlState=null)}return B}function R(I,x){var B=x.listStack[x.listStack.length-1]||0,Y=x.indentation<B,re=B+3;if(x.fencedEndRE&&x.indentation<=re&&(Y||I.match(x.fencedEndRE))){U.highlightFormatting&&(x.formatting="code-block");var de;return Y||(de=b(x)),x.localMode=x.localState=null,x.block=w,x.f=u,x.fencedEndRE=null,x.code=0,x.thisLine.fencedCodeEnd=!0,Y?h(I,x,x.block):de}else return x.localMode?x.localMode.token(I,x.localState):(I.skipToEnd(),$.code)}function b(I){var x=[];if(I.formatting){x.push($.formatting),typeof I.formatting=="string"&&(I.formatting=[I.formatting]);for(var B=0;B<I.formatting.length;B++)x.push($.formatting+"-"+I.formatting[B]),I.formatting[B]==="header"&&x.push($.formatting+"-"+I.formatting[B]+"-"+I.header),I.formatting[B]==="quote"&&(!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=I.quote?x.push($.formatting+"-"+I.formatting[B]+"-"+I.quote):x.push("error"))}if(I.taskOpen)return x.push("meta"),x.length?x.join(" "):null;if(I.taskClosed)return x.push("property"),x.length?x.join(" "):null;if(I.linkHref?x.push($.linkHref,"url"):(I.strong&&x.push($.strong),I.em&&x.push($.em),I.strikethrough&&x.push($.strikethrough),I.emoji&&x.push($.emoji),I.linkText&&x.push($.linkText),I.code&&x.push($.code),I.image&&x.push($.image),I.imageAltText&&x.push($.imageAltText,"link"),I.imageMarker&&x.push($.imageMarker)),I.header&&x.push($.header,$.header+"-"+I.header),I.quote&&(x.push($.quote),!U.maxBlockquoteDepth||U.maxBlockquoteDepth>=I.quote?x.push($.quote+"-"+I.quote):x.push($.quote+"-"+U.maxBlockquoteDepth)),I.list!==!1){var Y=(I.listStack.length-1)%3;Y?Y===1?x.push($.list2):x.push($.list3):x.push($.list1)}return I.trailingSpaceNewLine?x.push("trailing-space-new-line"):I.trailingSpace&&x.push("trailing-space-"+(I.trailingSpace%2?"a":"b")),x.length?x.join(" "):null}function _(I,x){return I.match(o,!0)?b(x):void 0}function u(I,x){var B=x.text(I,x);if(typeof B!="undefined")return B;if(x.list)return x.list=null,b(x);if(x.taskList){var Y=I.match(m,!0)[1]===" ";return Y?x.taskOpen=!0:x.taskClosed=!0,U.highlightFormatting&&(x.formatting="task"),x.taskList=!1,b(x)}if(x.taskOpen=!1,x.taskClosed=!1,x.header&&I.match(/^#+$/,!0))return U.highlightFormatting&&(x.formatting="header"),b(x);var re=I.next();if(x.linkTitle){x.linkTitle=!1;var de=re;re==="("&&(de=")"),de=(de+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var he="^\\s*(?:[^"+de+"\\\\]+|\\\\\\\\|\\\\.)"+de;if(I.match(new RegExp(he),!0))return $.linkHref}if(re==="`"){var xe=x.formatting;U.highlightFormatting&&(x.formatting="code"),I.eatWhile("`");var Pe=I.current().length;if(x.code==0&&(!x.quote||Pe==1))return x.code=Pe,b(x);if(Pe==x.code){var Ce=b(x);return x.code=0,Ce}else return x.formatting=xe,b(x)}else if(x.code)return b(x);if(re==="\\"&&(I.next(),U.highlightFormatting)){var Oe=b(x),be=$.formatting+"-escape";return Oe?Oe+" "+be:be}if(re==="!"&&I.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return x.imageMarker=!0,x.image=!0,U.highlightFormatting&&(x.formatting="image"),b(x);if(re==="["&&x.imageMarker&&I.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return x.imageMarker=!1,x.imageAltText=!0,U.highlightFormatting&&(x.formatting="image"),b(x);if(re==="]"&&x.imageAltText){U.highlightFormatting&&(x.formatting="image");var Oe=b(x);return x.imageAltText=!1,x.image=!1,x.inline=x.f=E,Oe}if(re==="["&&!x.image)return x.linkText&&I.match(/^.*?\]/)||(x.linkText=!0,U.highlightFormatting&&(x.formatting="link")),b(x);if(re==="]"&&x.linkText){U.highlightFormatting&&(x.formatting="link");var Oe=b(x);return x.linkText=!1,x.inline=x.f=I.match(/\(.*?\)| ?\[.*?\]/,!1)?E:u,Oe}if(re==="<"&&I.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=d,U.highlightFormatting&&(x.formatting="link");var Oe=b(x);return Oe?Oe+=" ":Oe="",Oe+$.linkInline}if(re==="<"&&I.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=d,U.highlightFormatting&&(x.formatting="link");var Oe=b(x);return Oe?Oe+=" ":Oe="",Oe+$.linkEmail}if(U.xml&&re==="<"&&I.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var ge=I.string.indexOf(">",I.pos);if(ge!=-1){var te=I.string.substring(I.start,ge);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(te)&&(x.md_inside=!0)}return I.backUp(1),x.htmlState=oe.startState(ee),h(I,x,O)}if(U.xml&&re==="<"&&I.match(/^\/\w*?>/))return x.md_inside=!1,"tag";if(re==="*"||re==="_"){for(var fe=1,_e=I.pos==1?" ":I.string.charAt(I.pos-2);fe<3&&I.eat(re);)fe++;var Le=I.peek()||" ",$e=!/\s/.test(Le)&&(!i.test(Le)||/\s/.test(_e)||i.test(_e)),Ue=!/\s/.test(_e)&&(!i.test(_e)||/\s/.test(Le)||i.test(Le)),at=null,ft=null;if(fe%2&&(!x.em&&$e&&(re==="*"||!Ue||i.test(_e))?at=!0:x.em==re&&Ue&&(re==="*"||!$e||i.test(Le))&&(at=!1)),fe>1&&(!x.strong&&$e&&(re==="*"||!Ue||i.test(_e))?ft=!0:x.strong==re&&Ue&&(re==="*"||!$e||i.test(Le))&&(ft=!1)),ft!=null||at!=null){U.highlightFormatting&&(x.formatting=at==null?"strong":ft==null?"em":"strong em"),at===!0&&(x.em=re),ft===!0&&(x.strong=re);var Ce=b(x);return at===!1&&(x.em=!1),ft===!1&&(x.strong=!1),Ce}}else if(re===" "&&(I.eat("*")||I.eat("_"))){if(I.peek()===" ")return b(x);I.backUp(1)}if(U.strikethrough){if(re==="~"&&I.eatWhile(re)){if(x.strikethrough){U.highlightFormatting&&(x.formatting="strikethrough");var Ce=b(x);return x.strikethrough=!1,Ce}else if(I.match(/^[^\s]/,!1))return x.strikethrough=!0,U.highlightFormatting&&(x.formatting="strikethrough"),b(x)}else if(re===" "&&I.match(/^~~/,!0)){if(I.peek()===" ")return b(x);I.backUp(2)}}if(U.emoji&&re===":"&&I.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){x.emoji=!0,U.highlightFormatting&&(x.formatting="emoji");var Ct=b(x);return x.emoji=!1,Ct}return re===" "&&(I.match(/^ +$/,!1)?x.trailingSpace++:x.trailingSpace&&(x.trailingSpaceNewLine=!0)),b(x)}function d(I,x){var B=I.next();if(B===">"){x.f=x.inline=u,U.highlightFormatting&&(x.formatting="link");var Y=b(x);return Y?Y+=" ":Y="",Y+$.linkInline}return I.match(/^[^>]+/,!0),$.linkInline}function E(I,x){if(I.eatSpace())return null;var B=I.next();return B==="("||B==="["?(x.f=x.inline=y(B==="("?")":"]"),U.highlightFormatting&&(x.formatting="link-string"),x.linkHref=!0,b(x)):"error"}var g={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(I){return function(x,B){var Y=x.next();if(Y===I){B.f=B.inline=u,U.highlightFormatting&&(B.formatting="link-string");var re=b(B);return B.linkHref=!1,re}return x.match(g[I]),B.linkHref=!0,b(B)}}function F(I,x){return I.match(/^([^\]\\]|\\.)*\]:/,!1)?(x.f=N,I.next(),U.highlightFormatting&&(x.formatting="link"),x.linkText=!0,b(x)):c(I,x,u)}function N(I,x){if(I.match(/^\]:/,!0)){x.f=x.inline=H,U.highlightFormatting&&(x.formatting="link");var B=b(x);return x.linkText=!1,B}return I.match(/^([^\]\\]|\\.)+/,!0),$.linkText}function H(I,x){return I.eatSpace()?null:(I.match(/^[^\s]+/,!0),I.peek()===void 0?x.linkTitle=!0:I.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),x.f=x.inline=u,$.linkHref+" url")}var G={startState:function(){return{f:w,prevLine:{stream:null},thisLine:{stream:null},block:w,htmlState:null,indentation:0,inline:u,text:_,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(I){return{f:I.f,prevLine:I.prevLine,thisLine:I.thisLine,block:I.block,htmlState:I.htmlState&&oe.copyState(ee,I.htmlState),indentation:I.indentation,localMode:I.localMode,localState:I.localMode?oe.copyState(I.localMode,I.localState):null,inline:I.inline,text:I.text,formatting:!1,linkText:I.linkText,linkTitle:I.linkTitle,linkHref:I.linkHref,code:I.code,em:I.em,strong:I.strong,strikethrough:I.strikethrough,emoji:I.emoji,header:I.header,setext:I.setext,hr:I.hr,taskList:I.taskList,list:I.list,listStack:I.listStack.slice(0),quote:I.quote,indentedCode:I.indentedCode,trailingSpace:I.trailingSpace,trailingSpaceNewLine:I.trailingSpaceNewLine,md_inside:I.md_inside,fencedEndRE:I.fencedEndRE}},token:function(I,x){if(x.formatting=!1,I!=x.thisLine.stream){if(x.header=0,x.hr=!1,I.match(/^\s*$/,!0))return S(x),null;if(x.prevLine=x.thisLine,x.thisLine={stream:I},x.taskList=!1,x.trailingSpace=0,x.trailingSpaceNewLine=!1,!x.localState&&(x.f=x.block,x.f!=O)){var B=I.match(/^\s*/,!0)[0].replace(/\t/g,t).length;if(x.indentation=B,x.indentationDiff=null,B>0)return null}}return x.f(I,x)},innerMode:function(I){return I.block==O?{state:I.htmlState,mode:ee}:I.localState?{state:I.localState,mode:I.localMode}:{state:I,mode:G}},indent:function(I,x,B){return I.block==O&&ee.indent?ee.indent(I.htmlState,x,B):I.localState&&I.localMode.indent?I.localMode.indent(I.localState,x,B):oe.Pass},blankLine:S,getType:b,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return G},"xml"),oe.defineMIME("text/markdown","markdown"),oe.defineMIME("text/x-markdown","markdown")})},loLm:function(Wt,st,z){Wt.exports={flex_box_center:"flex_box_center___Ea2v9",flex_space_between:"flex_space_between___1bTGw",flex_box_vertical_center:"flex_box_vertical_center___2J4zW",flex_box_center_end:"flex_box_center_end___9_5OK",flex_box_column:"flex_box_column___2FLgO",posWarp:"posWarp___3pf1n",pos:"pos___3-NfR",tips:"tips___2-j_s",markWrongBtnWrapper:"markWrongBtnWrapper___37HXF"}},n6Qo:function(Wt,st,z){"use strict";z.d(st,"a",function(){return X});var oe=z("q1tI"),Z=z("biw7"),U=z("fyJ8");function ee(k){var D=k.className,m=k.index,v=k.children,f=k.colSpan,o=k.rowSpan,l=oe.useContext(Z.a),r=l.prefixCls,i=l.fixedInfoList,t=i[m];return oe.createElement(U.a,Object.assign({className:D,index:m,component:"td",prefixCls:r,record:null,dataIndex:null,render:function(){return{children:v,props:{colSpan:f,rowSpan:o}}}},t))}function W(k){return oe.createElement("tr",Object.assign({},k))}function M(k){var D=k.children,m=oe.useContext(Z.a),v=m.prefixCls;return oe.createElement("tfoot",{className:"".concat(v,"-summary")},D)}var $=st.b=M,X={Cell:ee,Row:W}},ngQI:function(Wt,st,z){"use strict";z.d(st,"a",function(){return Ul}),z.d(st,"b",function(){return yl}),z.d(st,"c",function(){return bl});var oe=z("q1tI"),Z=z.n(oe),U=z("dI71"),ee=z("wx14"),W=z("ANjH"),M=z("/MKj");function $(T,P){if(T.length!==P.length)return!1;for(var K=0;K<T.length;K++)if(T[K]!==P[K])return!1;return!0}function X(T,P){var K=Object(oe.useState)(function(){return{inputs:P,result:T()}})[0],ne=Object(oe.useRef)(!0),le=Object(oe.useRef)(K),ue=ne.current||Boolean(P&&le.current.inputs&&$(P,le.current.inputs)),Te=ue?le.current:{inputs:P,result:T()};return Object(oe.useEffect)(function(){ne.current=!1,le.current=Te},[Te]),Te.result}function k(T,P){return X(function(){return T},P)}var D=X,m=k,v=z("9R94"),f=function(P){var K=P.top,ne=P.right,le=P.bottom,ue=P.left,Te=ne-ue,Se=le-K,He={top:K,right:ne,bottom:le,left:ue,width:Te,height:Se,x:ue,y:K,center:{x:(ne+ue)/2,y:(le+K)/2}};return He},o=function(P,K){return{top:P.top-K.top,left:P.left-K.left,bottom:P.bottom+K.bottom,right:P.right+K.right}},l=function(P,K){return{top:P.top+K.top,left:P.left+K.left,bottom:P.bottom-K.bottom,right:P.right-K.right}},r=function(P,K){return{top:P.top+K.y,left:P.left+K.x,bottom:P.bottom+K.y,right:P.right+K.x}},i={top:0,right:0,bottom:0,left:0},t=function(P){var K=P.borderBox,ne=P.margin,le=ne===void 0?i:ne,ue=P.border,Te=ue===void 0?i:ue,Se=P.padding,He=Se===void 0?i:Se,et=f(o(K,le)),rt=f(l(K,Te)),Ge=f(l(rt,He));return{marginBox:et,borderBox:f(K),paddingBox:rt,contentBox:Ge,margin:le,border:Te,padding:He}},c=function(P){var K=P.slice(0,-2),ne=P.slice(-2);if(ne!=="px")return 0;var le=Number(K);return isNaN(le)&&Object(v.a)(!1),le},h=function(){return{x:window.pageXOffset,y:window.pageYOffset}},A=function(P,K){var ne=P.borderBox,le=P.border,ue=P.margin,Te=P.padding,Se=r(ne,K);return t({borderBox:Se,border:le,margin:ue,padding:Te})},S=function(P,K){return K===void 0&&(K=h()),A(P,K)},w=function(P,K){var ne={top:c(K.marginTop),right:c(K.marginRight),bottom:c(K.marginBottom),left:c(K.marginLeft)},le={top:c(K.paddingTop),right:c(K.paddingRight),bottom:c(K.paddingBottom),left:c(K.paddingLeft)},ue={top:c(K.borderTopWidth),right:c(K.borderRightWidth),bottom:c(K.borderBottomWidth),left:c(K.borderLeftWidth)};return t({borderBox:P,margin:ne,padding:le,border:ue})},O=function(P){var K=P.getBoundingClientRect(),ne=window.getComputedStyle(P);return w(K,ne)},R=Number.isNaN||function(P){return typeof P=="number"&&P!==P};function b(T,P){return T===P?!0:!!(R(T)&&R(P))}function _(T,P){if(T.length!==P.length)return!1;for(var K=0;K<T.length;K++)if(!b(T[K],P[K]))return!1;return!0}function u(T,P){P===void 0&&(P=_);var K,ne=[],le,ue=!1;function Te(){for(var Se=[],He=0;He<arguments.length;He++)Se[He]=arguments[He];return ue&&K===this&&P(Se,ne)||(le=T.apply(this,Se),ue=!0,K=this,ne=Se),le}return Te}var d=u,E=function(P){var K=[],ne=null,le=function(){for(var Te=arguments.length,Se=new Array(Te),He=0;He<Te;He++)Se[He]=arguments[He];if(K=Se,ne)return;ne=requestAnimationFrame(function(){ne=null,P.apply(void 0,K)})};return le.cancel=function(){if(!ne)return;cancelAnimationFrame(ne),ne=null},le},g=E,y=z("i8i4"),F=z.n(y),N=!0,H=/[ \t]{2,}/g,G=/^[ \t]*/gm,I=function(P){return P.replace(H," ").replace(G,"").trim()},x=function(P){return I(`
%creact-beautiful-dnd
%c`+I(P)+`
%c\u{1F477}\u200D This is a development only message. It will be removed in production builds.
`)},B=function(P){return[x(P),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},Y="__react-beautiful-dnd-disable-dev-warnings";function re(T,P){var K;if(N)return;if(typeof window!="undefined"&&window[Y])return;(K=console)[T].apply(K,B(P))}var de=re.bind(null,"warn"),he=re.bind(null,"error");function xe(){}function Pe(T,P){return Object(ee.a)({},T,{},P)}function Ce(T,P,K){var ne=P.map(function(le){var ue=Pe(K,le.options);return T.addEventListener(le.eventName,le.fn,ue),function(){T.removeEventListener(le.eventName,le.fn,ue)}});return function(){ne.forEach(function(ue){ue()})}}var Oe=!0,be="Invariant failed";function ge(T){this.message=T}ge.prototype.toString=function(){return this.message};function te(T,P){if(T)return;throw Oe?new ge(be):new ge(be+": "+(P||""))}var fe=function(T){Object(U.a)(P,T);function P(){for(var ne,le=arguments.length,ue=new Array(le),Te=0;Te<le;Te++)ue[Te]=arguments[Te];return ne=T.call.apply(T,[this].concat(ue))||this,ne.callbacks=null,ne.unbind=xe,ne.onWindowError=function(Se){var He=ne.getCallbacks();He.isDragging()&&He.tryAbort();var et=Se.error;et instanceof ge&&Se.preventDefault()},ne.getCallbacks=function(){if(!ne.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return ne.callbacks},ne.setCallbacks=function(Se){ne.callbacks=Se},ne}var K=P.prototype;return K.componentDidMount=function(){this.unbind=Ce(window,[{eventName:"error",fn:this.onWindowError}])},K.componentWillUnmount=function(){this.unbind()},K.componentDidCatch=function(le){if(le instanceof ge){this.setState({});return}throw le},K.render=function(){return this.props.children(this.setCallbacks)},P}(Z.a.Component),_e=`
Press space bar to start a drag.
When dragging you can use the arrow keys to move the item around and escape to cancel.
Some screen readers may require you to be in focus mode or to use your pass through key
`,Le=function(P){return P+1},$e=function(P){return`
You have lifted an item in position `+Le(P.source.index)+`
`},Ue=function(P,K){var ne=P.droppableId===K.droppableId,le=Le(P.index),ue=Le(K.index);return ne?`
You have moved the item from position `+le+`
to position `+ue+`
`:`
You have moved the item from position `+le+`
in list `+P.droppableId+`
to list `+K.droppableId+`
in position `+ue+`
`},at=function(P,K,ne){var le=K.droppableId===ne.droppableId;return le?`
The item `+P+`
has been combined with `+ne.draggableId:`
The item `+P+`
in list `+K.droppableId+`
has been combined with `+ne.draggableId+`
in list `+ne.droppableId+`
`},ft=function(P){var K=P.destination;if(K)return Ue(P.source,K);var ne=P.combine;return ne?at(P.draggableId,P.source,ne):"You are over an area that cannot be dropped on"},Ct=function(P){return`
The item has returned to its starting position
of `+Le(P.index)+`
`},yt=function(P){if(P.reason==="CANCEL")return`
Movement cancelled.
`+Ct(P.source)+`
`;var K=P.destination,ne=P.combine;return K?`
You have dropped the item.
`+Ue(P.source,K)+`
`:ne?`
You have dropped the item.
`+at(P.draggableId,P.source,ne)+`
`:`
The item has been dropped while not over a drop area.
`+Ct(P.source)+`
`},_t={dragHandleUsageInstructions:_e,onDragStart:$e,onDragUpdate:ft,onDragEnd:yt},lt={x:0,y:0},Ft=function(P,K){return{x:P.x+K.x,y:P.y+K.y}},Xt=function(P,K){return{x:P.x-K.x,y:P.y-K.y}},Jt=function(P,K){return P.x===K.x&&P.y===K.y},rn=function(P){return{x:P.x!==0?-P.x:0,y:P.y!==0?-P.y:0}},En=function(P,K,ne){var le;return ne===void 0&&(ne=0),le={},le[P]=K,le[P==="x"?"y":"x"]=ne,le},mn=function(P,K){return Math.sqrt(Math.pow(K.x-P.x,2)+Math.pow(K.y-P.y,2))},Ye=function(P,K){return Math.min.apply(Math,K.map(function(ne){return mn(P,ne)}))},Xe=function(P){return function(K){return{x:P(K.x),y:P(K.y)}}},Ot=function(T,P){var K=f({top:Math.max(P.top,T.top),right:Math.min(P.right,T.right),bottom:Math.min(P.bottom,T.bottom),left:Math.max(P.left,T.left)});return K.width<=0||K.height<=0?null:K},Et=function(P,K){return{top:P.top+K.y,left:P.left+K.x,bottom:P.bottom+K.y,right:P.right+K.x}},Je=function(P){return[{x:P.left,y:P.top},{x:P.right,y:P.top},{x:P.left,y:P.bottom},{x:P.right,y:P.bottom}]},mt={top:0,right:0,bottom:0,left:0},Be=function(P,K){return K?Et(P,K.scroll.diff.displacement):P},Ie=function(P,K,ne){if(ne&&ne.increasedBy){var le;return Object(ee.a)({},P,(le={},le[K.end]=P[K.end]+ne.increasedBy[K.line],le))}return P},ke=function(P,K){return K&&K.shouldClipSubject?Ot(K.pageMarginBox,P):f(P)},me=function(T){var P=T.page,K=T.withPlaceholder,ne=T.axis,le=T.frame,ue=Be(P.marginBox,le),Te=Ie(ue,ne,K),Se=ke(Te,le);return{page:P,withPlaceholder:K,active:Se}},ye=function(T,P){T.frame||te(!1);var K=T.frame,ne=Xt(P,K.scroll.initial),le=rn(ne),ue=Object(ee.a)({},K,{scroll:{initial:K.scroll.initial,current:P,diff:{value:ne,displacement:le},max:K.scroll.max}}),Te=me({page:T.subject.page,withPlaceholder:T.subject.withPlaceholder,axis:T.axis,frame:ue}),Se=Object(ee.a)({},T,{frame:ue,subject:Te});return Se};function Re(T){return Number.isInteger?Number.isInteger(T):typeof T=="number"&&isFinite(T)&&Math.floor(T)===T}function ce(T){return Object.values?Object.values(T):Object.keys(T).map(function(P){return T[P]})}function Me(T,P){if(T.findIndex)return T.findIndex(P);for(var K=0;K<T.length;K++)if(P(T[K]))return K;return-1}function tt(T,P){if(T.find)return T.find(P);var K=Me(T,P);return K!==-1?T[K]:void 0}function bt(T){return Array.prototype.slice.call(T)}var Kt=d(function(T){return T.reduce(function(P,K){return P[K.descriptor.id]=K,P},{})}),Gt=d(function(T){return T.reduce(function(P,K){return P[K.descriptor.id]=K,P},{})}),$t=d(function(T){return ce(T)}),ei=d(function(T){return ce(T)}),gn=d(function(T,P){var K=ei(P).filter(function(ne){return T===ne.descriptor.droppableId}).sort(function(ne,le){return ne.descriptor.index-le.descriptor.index});return K});function an(T){return T.at&&T.at.type==="REORDER"?T.at.destination:null}function dn(T){return T.at&&T.at.type==="COMBINE"?T.at.combine:null}var zn=d(function(T,P){return P.filter(function(K){return K.descriptor.id!==T.descriptor.id})}),pi=function(T){var P=T.isMovingForward,K=T.draggable,ne=T.destination,le=T.insideDestination,ue=T.previousImpact;if(!ne.isCombineEnabled)return null;var Te=an(ue);if(!Te)return null;function Se(Rn){var Nn={type:"COMBINE",combine:{draggableId:Rn,droppableId:ne.descriptor.id}};return Object(ee.a)({},ue,{at:Nn})}var He=ue.displaced.all,et=He.length?He[0]:null;if(P)return et?Se(et):null;var rt=zn(K,le);if(!et){if(!rt.length)return null;var Ge=rt[rt.length-1];return Se(Ge.descriptor.id)}var Ke=Me(rt,function(Rn){return Rn.descriptor.id===et});Ke!==-1||te(!1);var Qe=Ke-1;if(Qe<0)return null;var Rt=rt[Qe];return Se(Rt.descriptor.id)},mi=function(T,P){return T.descriptor.droppableId===P.descriptor.id},ri={point:lt,value:0},_i={invisible:{},visible:{},all:[]},Si={displaced:_i,displacedBy:ri,at:null},At=function(T,P){return function(K){return T<=K&&K<=P}},Wn=function(T){var P=At(T.top,T.bottom),K=At(T.left,T.right);return function(ne){var le=P(ne.top)&&P(ne.bottom)&&K(ne.left)&&K(ne.right);if(le)return!0;var ue=P(ne.top)||P(ne.bottom),Te=K(ne.left)||K(ne.right),Se=ue&&Te;if(Se)return!0;var He=ne.top<T.top&&ne.bottom>T.bottom,et=ne.left<T.left&&ne.right>T.right,rt=He&&et;if(rt)return!0;var Ge=He&&Te||et&&ue;return Ge}},hi=function(T){var P=At(T.top,T.bottom),K=At(T.left,T.right);return function(ne){var le=P(ne.top)&&P(ne.bottom)&&K(ne.left)&&K(ne.right);return le}},ti={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Oi={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},Ai=function(T){return function(P){var K=At(P.top,P.bottom),ne=At(P.left,P.right);return function(le){return T===ti?K(le.top)&&K(le.bottom):ne(le.left)&&ne(le.right)}}},Ni=function(P,K){var ne=K.frame?K.frame.scroll.diff.displacement:lt;return Et(P,ne)},wi=function(P,K,ne){return K.subject.active?ne(K.subject.active)(P):!1},ct=function(P,K,ne){return ne(K)(P)},je=function(P){var K=P.target,ne=P.destination,le=P.viewport,ue=P.withDroppableDisplacement,Te=P.isVisibleThroughFrameFn,Se=ue?Ni(K,ne):K;return wi(Se,ne,Te)&&ct(Se,le,Te)},It=function(P){return je(Object(ee.a)({},P,{isVisibleThroughFrameFn:Wn}))},Ne=function(P){return je(Object(ee.a)({},P,{isVisibleThroughFrameFn:hi}))},Ee=function(P){return je(Object(ee.a)({},P,{isVisibleThroughFrameFn:Ai(P.destination.axis)}))},ve=function(P,K,ne){if(typeof ne=="boolean")return ne;if(!K)return!0;var le=K.invisible,ue=K.visible;if(le[P])return!1;var Te=ue[P];return Te?Te.shouldAnimate:!0};function di(T,P){var K=T.page.marginBox,ne={top:P.point.y,right:0,bottom:0,left:P.point.x};return f(o(K,ne))}function en(T){var P=T.afterDragging,K=T.destination,ne=T.displacedBy,le=T.viewport,ue=T.forceShouldAnimate,Te=T.last;return P.reduce(function(He,et){var rt=di(et,ne),Ge=et.descriptor.id;He.all.push(Ge);var Ke=It({target:rt,destination:K,viewport:le,withDroppableDisplacement:!0});if(!Ke)return He.invisible[et.descriptor.id]=!0,He;var Qe=ve(Ge,Te,ue),Rt={draggableId:Ge,shouldAnimate:Qe};return He.visible[Ge]=Rt,He},{all:[],visible:{},invisible:{}})}function De(T,P){if(!T.length)return 0;var K=T[T.length-1].descriptor.index;return P.inHomeList?K:K+1}function ht(T){var P=T.insideDestination,K=T.inHomeList,ne=T.displacedBy,le=T.destination,ue=De(P,{inHomeList:K});return{displaced:_i,displacedBy:ne,at:{type:"REORDER",destination:{droppableId:le.descriptor.id,index:ue}}}}function we(T){var P=T.draggable,K=T.insideDestination,ne=T.destination,le=T.viewport,ue=T.displacedBy,Te=T.last,Se=T.index,He=T.forceShouldAnimate,et=mi(P,ne);if(Se==null)return ht({insideDestination:K,inHomeList:et,displacedBy:ue,destination:ne});var rt=tt(K,function(Rn){return Rn.descriptor.index===Se});if(!rt)return ht({insideDestination:K,inHomeList:et,displacedBy:ue,destination:ne});var Ge=zn(P,K),Ke=K.indexOf(rt),Qe=Ge.slice(Ke),Rt=en({afterDragging:Qe,destination:ne,displacedBy:ue,last:Te,viewport:le.frame,forceShouldAnimate:He});return{displaced:Rt,displacedBy:ue,at:{type:"REORDER",destination:{droppableId:ne.descriptor.id,index:Se}}}}function un(T,P){return Boolean(P.effected[T])}var fi=function(T){var P=T.isMovingForward,K=T.destination,ne=T.draggables,le=T.combine,ue=T.afterCritical;if(!K.isCombineEnabled)return null;var Te=le.draggableId,Se=ne[Te],He=Se.descriptor.index,et=un(Te,ue);return et?P?He:He-1:P?He+1:He},gi=function(T){var P=T.isMovingForward,K=T.isInHomeList,ne=T.insideDestination,le=T.location;if(!ne.length)return null;var ue=le.index,Te=P?ue+1:ue-1,Se=ne[0].descriptor.index,He=ne[ne.length-1].descriptor.index,et=K?He:He+1;return Te<Se||Te>et?null:Te},q=function(T){var P=T.isMovingForward,K=T.isInHomeList,ne=T.draggable,le=T.draggables,ue=T.destination,Te=T.insideDestination,Se=T.previousImpact,He=T.viewport,et=T.afterCritical,rt=Se.at;if(rt||te(!1),rt.type==="REORDER"){var Ge=gi({isMovingForward:P,isInHomeList:K,location:rt.destination,insideDestination:Te});return Ge==null?null:we({draggable:ne,insideDestination:Te,destination:ue,viewport:He,last:Se.displaced,displacedBy:Se.displacedBy,index:Ge})}var Ke=fi({isMovingForward:P,destination:ue,displaced:Se.displaced,draggables:le,combine:rt.combine,afterCritical:et});return Ke==null?null:we({draggable:ne,insideDestination:Te,destination:ue,viewport:He,last:Se.displaced,displacedBy:Se.displacedBy,index:Ke})},C=function(T){var P=T.displaced,K=T.afterCritical,ne=T.combineWith,le=T.displacedBy,ue=Boolean(P.visible[ne]||P.invisible[ne]);return un(ne,K)?ue?lt:rn(le.point):ue?le.point:lt},L=function(T){var P=T.afterCritical,K=T.impact,ne=T.draggables,le=dn(K);le||te(!1);var ue=le.draggableId,Te=ne[ue].page.borderBox.center,Se=C({displaced:K.displaced,afterCritical:P,combineWith:ue,displacedBy:K.displacedBy});return Ft(Te,Se)},V=function(P,K){return K.margin[P.start]+K.borderBox[P.size]/2},ae=function(P,K){return K.margin[P.end]+K.borderBox[P.size]/2},Q=function(P,K,ne){return K[P.crossAxisStart]+ne.margin[P.crossAxisStart]+ne.borderBox[P.crossAxisSize]/2},Ae=function(P){var K=P.axis,ne=P.moveRelativeTo,le=P.isMoving;return En(K.line,ne.marginBox[K.end]+V(K,le),Q(K,ne.marginBox,le))},nt=function(P){var K=P.axis,ne=P.moveRelativeTo,le=P.isMoving;return En(K.line,ne.marginBox[K.start]-ae(K,le),Q(K,ne.marginBox,le))},xt=function(P){var K=P.axis,ne=P.moveInto,le=P.isMoving;return En(K.line,ne.contentBox[K.start]+V(K,le),Q(K,ne.contentBox,le))},Dt=function(T){var P=T.impact,K=T.draggable,ne=T.draggables,le=T.droppable,ue=T.afterCritical,Te=gn(le.descriptor.id,ne),Se=K.page,He=le.axis;if(!Te.length)return xt({axis:He,moveInto:le.page,isMoving:Se});var et=P.displaced,rt=P.displacedBy,Ge=et.all[0];if(Ge){var Ke=ne[Ge];if(un(Ge,ue))return nt({axis:He,moveRelativeTo:Ke.page,isMoving:Se});var Qe=A(Ke.page,rt.point);return nt({axis:He,moveRelativeTo:Qe,isMoving:Se})}var Rt=Te[Te.length-1];if(Rt.descriptor.id===K.descriptor.id)return Se.borderBox.center;if(un(Rt.descriptor.id,ue)){var Rn=A(Rt.page,rn(ue.displacedBy.point));return Ae({axis:He,moveRelativeTo:Rn,isMoving:Se})}return Ae({axis:He,moveRelativeTo:Rt.page,isMoving:Se})},ot=function(T,P){var K=T.frame;return K?Ft(P,K.scroll.diff.displacement):P},vt=function(P){var K=P.impact,ne=P.draggable,le=P.droppable,ue=P.draggables,Te=P.afterCritical,Se=ne.page.borderBox.center,He=K.at;return le&&He?He.type==="REORDER"?Dt({impact:K,draggable:ne,draggables:ue,droppable:le,afterCritical:Te}):L({impact:K,draggables:ue,afterCritical:Te}):Se},Lt=function(T){var P=vt(T),K=T.droppable,ne=K?ot(K,P):P;return ne},wn=function(T,P){var K=Xt(P,T.scroll.initial),ne=rn(K),le=f({top:P.y,bottom:P.y+T.frame.height,left:P.x,right:P.x+T.frame.width}),ue={frame:le,scroll:{initial:T.scroll.initial,max:T.scroll.max,current:P,diff:{value:K,displacement:ne}}};return ue};function Xn(T,P){return T.map(function(K){return P[K]})}function jn(T,P){for(var K=0;K<P.length;K++){var ne=P[K].visible[T];if(ne)return ne}return null}var cn=function(T){var P=T.impact,K=T.viewport,ne=T.destination,le=T.draggables,ue=T.maxScrollChange,Te=wn(K,Ft(K.scroll.current,ue)),Se=ne.frame?ye(ne,Ft(ne.frame.scroll.current,ue)):ne,He=P.displaced,et=en({afterDragging:Xn(He.all,le),destination:ne,displacedBy:P.displacedBy,viewport:Te.frame,last:He,forceShouldAnimate:!1}),rt=en({afterDragging:Xn(He.all,le),destination:Se,displacedBy:P.displacedBy,viewport:K.frame,last:He,forceShouldAnimate:!1}),Ge={},Ke={},Qe=[He,et,rt];He.all.forEach(function(Rn){var Nn=jn(Rn,Qe);if(Nn){Ke[Rn]=Nn;return}Ge[Rn]=!0});var Rt=Object(ee.a)({},P,{displaced:{all:He.all,invisible:Ge,visible:Ke}});return Rt},jt=function(T,P){return Ft(T.scroll.diff.displacement,P)},nn=function(T){var P=T.pageBorderBoxCenter,K=T.draggable,ne=T.viewport,le=jt(ne,P),ue=Xt(le,K.page.borderBox.center);return Ft(K.client.borderBox.center,ue)},qt=function(T){var P=T.draggable,K=T.destination,ne=T.newPageBorderBoxCenter,le=T.viewport,ue=T.withDroppableDisplacement,Te=T.onlyOnMainAxis,Se=Te===void 0?!1:Te,He=Xt(ne,P.page.borderBox.center),et=Et(P.page.borderBox,He),rt={target:et,destination:K,withDroppableDisplacement:ue,viewport:le};return Se?Ee(rt):Ne(rt)},Nt=function(T){var P=T.isMovingForward,K=T.draggable,ne=T.destination,le=T.draggables,ue=T.previousImpact,Te=T.viewport,Se=T.previousPageBorderBoxCenter,He=T.previousClientSelection,et=T.afterCritical;if(!ne.isEnabled)return null;var rt=gn(ne.descriptor.id,le),Ge=mi(K,ne),Ke=pi({isMovingForward:P,draggable:K,destination:ne,insideDestination:rt,previousImpact:ue})||q({isMovingForward:P,isInHomeList:Ge,draggable:K,draggables:le,destination:ne,insideDestination:rt,previousImpact:ue,viewport:Te,afterCritical:et});if(!Ke)return null;var Qe=Lt({impact:Ke,draggable:K,droppable:ne,draggables:le,afterCritical:et}),Rt=qt({draggable:K,destination:ne,newPageBorderBoxCenter:Qe,viewport:Te.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(Rt){var Rn=nn({pageBorderBoxCenter:Qe,draggable:K,viewport:Te});return{clientSelection:Rn,impact:Ke,scrollJumpRequest:null}}var Nn=Xt(Qe,Se),ai=cn({impact:Ke,viewport:Te,destination:ne,draggables:le,maxScrollChange:Nn});return{clientSelection:He,impact:ai,scrollJumpRequest:Nn}},$n=function(P){var K=P.subject.active;return K||te(!1),K},Un=function(T){var P=T.isMovingForward,K=T.pageBorderBoxCenter,ne=T.source,le=T.droppables,ue=T.viewport,Te=ne.subject.active;if(!Te)return null;var Se=ne.axis,He=At(Te[Se.start],Te[Se.end]),et=$t(le).filter(function(Ge){return Ge!==ne}).filter(function(Ge){return Ge.isEnabled}).filter(function(Ge){return Boolean(Ge.subject.active)}).filter(function(Ge){return Wn(ue.frame)($n(Ge))}).filter(function(Ge){var Ke=$n(Ge);return P?Te[Se.crossAxisEnd]<Ke[Se.crossAxisEnd]:Ke[Se.crossAxisStart]<Te[Se.crossAxisStart]}).filter(function(Ge){var Ke=$n(Ge),Qe=At(Ke[Se.start],Ke[Se.end]);return He(Ke[Se.start])||He(Ke[Se.end])||Qe(Te[Se.start])||Qe(Te[Se.end])}).sort(function(Ge,Ke){var Qe=$n(Ge)[Se.crossAxisStart],Rt=$n(Ke)[Se.crossAxisStart];return P?Qe-Rt:Rt-Qe}).filter(function(Ge,Ke,Qe){return $n(Ge)[Se.crossAxisStart]===$n(Qe[0])[Se.crossAxisStart]});if(!et.length)return null;if(et.length===1)return et[0];var rt=et.filter(function(Ge){var Ke=At($n(Ge)[Se.start],$n(Ge)[Se.end]);return Ke(K[Se.line])});return rt.length===1?rt[0]:rt.length>1?rt.sort(function(Ge,Ke){return $n(Ge)[Se.start]-$n(Ke)[Se.start]})[0]:et.sort(function(Ge,Ke){var Qe=Ye(K,Je($n(Ge))),Rt=Ye(K,Je($n(Ke)));return Qe!==Rt?Qe-Rt:$n(Ge)[Se.start]-$n(Ke)[Se.start]})[0]},xn=function(P,K){var ne=P.page.borderBox.center;return un(P.descriptor.id,K)?Xt(ne,K.displacedBy.point):ne},Yn=function(P,K){var ne=P.page.borderBox;return un(P.descriptor.id,K)?Et(ne,rn(K.displacedBy.point)):ne},hn=function(T){var P=T.pageBorderBoxCenter,K=T.viewport,ne=T.destination,le=T.insideDestination,ue=T.afterCritical,Te=le.filter(function(Se){return Ne({target:Yn(Se,ue),destination:ne,viewport:K.frame,withDroppableDisplacement:!0})}).sort(function(Se,He){var et=mn(P,ot(ne,xn(Se,ue))),rt=mn(P,ot(ne,xn(He,ue)));return et<rt?-1:rt<et?1:Se.descriptor.index-He.descriptor.index});return Te[0]||null},Tn=d(function(P,K){var ne=K[P.line];return{value:ne,point:En(P.line,ne)}}),ln=function(P,K,ne){var le=P.axis;if(P.descriptor.mode==="virtual")return En(le.line,K[le.line]);var ue=P.subject.page.contentBox[le.size],Te=gn(P.descriptor.id,ne),Se=Te.reduce(function(rt,Ge){return rt+Ge.client.marginBox[le.size]},0),He=Se+K[le.line],et=He-ue;return et<=0?null:En(le.line,et)},Mn=function(P,K){return Object(ee.a)({},P,{scroll:Object(ee.a)({},P.scroll,{max:K})})},Vn=function(P,K,ne){var le=P.frame;mi(K,P)&&te(!1),P.subject.withPlaceholder&&te(!1);var ue=Tn(P.axis,K.displaceBy).point,Te=ln(P,ue,ne),Se={placeholderSize:ue,increasedBy:Te,oldFrameMaxScroll:P.frame?P.frame.scroll.max:null};if(!le){var He=me({page:P.subject.page,withPlaceholder:Se,axis:P.axis,frame:P.frame});return Object(ee.a)({},P,{subject:He})}var et=Te?Ft(le.scroll.max,Te):le.scroll.max,rt=Mn(le,et),Ge=me({page:P.subject.page,withPlaceholder:Se,axis:P.axis,frame:rt});return Object(ee.a)({},P,{subject:Ge,frame:rt})},ni=function(P){var K=P.subject.withPlaceholder;K||te(!1);var ne=P.frame;if(!ne){var le=me({page:P.subject.page,axis:P.axis,frame:null,withPlaceholder:null});return Object(ee.a)({},P,{subject:le})}var ue=K.oldFrameMaxScroll;ue||te(!1);var Te=Mn(ne,ue),Se=me({page:P.subject.page,axis:P.axis,frame:Te,withPlaceholder:null});return Object(ee.a)({},P,{subject:Se,frame:Te})},Pn=function(T){var P=T.previousPageBorderBoxCenter,K=T.moveRelativeTo,ne=T.insideDestination,le=T.draggable,ue=T.draggables,Te=T.destination,Se=T.viewport,He=T.afterCritical;if(!K){if(ne.length)return null;var et={displaced:_i,displacedBy:ri,at:{type:"REORDER",destination:{droppableId:Te.descriptor.id,index:0}}},rt=Lt({impact:et,draggable:le,droppable:Te,draggables:ue,afterCritical:He}),Ge=mi(le,Te)?Te:Vn(Te,le,ue),Ke=qt({draggable:le,destination:Ge,newPageBorderBoxCenter:rt,viewport:Se.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return Ke?et:null}var Qe=Boolean(P[Te.axis.line]<=K.page.borderBox.center[Te.axis.line]),Rt=function(){var Nn=K.descriptor.index;return K.descriptor.id===le.descriptor.id||Qe?Nn:Nn+1}(),Rn=Tn(Te.axis,le.displaceBy);return we({draggable:le,insideDestination:ne,destination:Te,viewport:Se,displacedBy:Rn,last:_i,index:Rt})},Hn=function(T){var P=T.isMovingForward,K=T.previousPageBorderBoxCenter,ne=T.draggable,le=T.isOver,ue=T.draggables,Te=T.droppables,Se=T.viewport,He=T.afterCritical,et=Un({isMovingForward:P,pageBorderBoxCenter:K,source:le,droppables:Te,viewport:Se});if(!et)return null;var rt=gn(et.descriptor.id,ue),Ge=hn({pageBorderBoxCenter:K,viewport:Se,destination:et,insideDestination:rt,afterCritical:He}),Ke=Pn({previousPageBorderBoxCenter:K,destination:et,draggable:ne,draggables:ue,moveRelativeTo:Ge,insideDestination:rt,viewport:Se,afterCritical:He});if(!Ke)return null;var Qe=Lt({impact:Ke,draggable:ne,droppable:et,draggables:ue,afterCritical:He}),Rt=nn({pageBorderBoxCenter:Qe,draggable:ne,viewport:Se});return{clientSelection:Rt,impact:Ke,scrollJumpRequest:null}},tn=function(T){var P=T.at;return P?P.type==="REORDER"?P.destination.droppableId:P.combine.droppableId:null},vn=function(P,K){var ne=tn(P);return ne?K[ne]:null},Ln=function(T){var P=T.state,K=T.type,ne=vn(P.impact,P.dimensions.droppables),le=Boolean(ne),ue=P.dimensions.droppables[P.critical.droppable.id],Te=ne||ue,Se=Te.axis.direction,He=Se==="vertical"&&(K==="MOVE_UP"||K==="MOVE_DOWN")||Se==="horizontal"&&(K==="MOVE_LEFT"||K==="MOVE_RIGHT");if(He&&!le)return null;var et=K==="MOVE_DOWN"||K==="MOVE_RIGHT",rt=P.dimensions.draggables[P.critical.draggable.id],Ge=P.current.page.borderBoxCenter,Ke=P.dimensions,Qe=Ke.draggables,Rt=Ke.droppables;return He?Nt({isMovingForward:et,previousPageBorderBoxCenter:Ge,draggable:rt,destination:Te,draggables:Qe,viewport:P.viewport,previousClientSelection:P.current.client.selection,previousImpact:P.impact,afterCritical:P.afterCritical}):Hn({isMovingForward:et,previousPageBorderBoxCenter:Ge,draggable:rt,isOver:Te,draggables:Qe,droppables:Rt,viewport:P.viewport,afterCritical:P.afterCritical})};function Cn(T){return T.phase==="DRAGGING"||T.phase==="COLLECTING"}function Qn(T){var P=At(T.top,T.bottom),K=At(T.left,T.right);return function(le){return P(le.y)&&K(le.x)}}function _n(T,P){return T.left<P.right&&T.right>P.left&&T.top<P.bottom&&T.bottom>P.top}function Gn(T){var P=T.pageBorderBox,K=T.draggable,ne=T.candidates,le=K.page.borderBox.center,ue=ne.map(function(Te){var Se=Te.axis,He=En(Te.axis.line,P.center[Se.line],Te.page.borderBox.center[Se.crossAxisLine]);return{id:Te.descriptor.id,distance:mn(le,He)}}).sort(function(Te,Se){return Se.distance-Te.distance});return ue[0]?ue[0].id:null}function qn(T){var P=T.pageBorderBox,K=T.draggable,ne=T.droppables,le=$t(ne).filter(function(ue){if(!ue.isEnabled)return!1;var Te=ue.subject.active;if(!Te)return!1;if(!_n(P,Te))return!1;if(Qn(Te)(P.center))return!0;var Se=ue.axis,He=Te.center[Se.crossAxisLine],et=P[Se.crossAxisStart],rt=P[Se.crossAxisEnd],Ge=At(Te[Se.crossAxisStart],Te[Se.crossAxisEnd]),Ke=Ge(et),Qe=Ge(rt);return!Ke&&!Qe?!0:Ke?et<He:rt>He});return le.length?le.length===1?le[0].descriptor.id:Gn({pageBorderBox:P,draggable:K,candidates:le}):null}var In=function(P,K){return f(Et(P,K))},Dn=function(T,P){var K=T.frame;return K?In(P,K.scroll.diff.value):P};function kn(T){var P=T.displaced,K=T.id;return Boolean(P.visible[K]||P.invisible[K])}function An(T){var P=T.draggable,K=T.closest,ne=T.inHomeList;return K?ne&&K.descriptor.index>P.descriptor.index?K.descriptor.index-1:K.descriptor.index:null}var sn=function(T){var P=T.pageBorderBoxWithDroppableScroll,K=T.draggable,ne=T.destination,le=T.insideDestination,ue=T.last,Te=T.viewport,Se=T.afterCritical,He=ne.axis,et=Tn(ne.axis,K.displaceBy),rt=et.value,Ge=P[He.start],Ke=P[He.end],Qe=zn(K,le),Rt=tt(Qe,function(Nn){var ai=Nn.descriptor.id,ui=Nn.page.borderBox.center[He.line],Ti=un(ai,Se),li=kn({displaced:ue,id:ai});return Ti?li?Ke<=ui:Ge<ui-rt:li?Ke<=ui+rt:Ge<ui}),Rn=An({draggable:K,closest:Rt,inHomeList:mi(K,ne)});return we({draggable:K,insideDestination:le,destination:ne,viewport:Te,last:ue,displacedBy:et,index:Rn})},Mt=4,zt=function(T){var P=T.draggable,K=T.pageBorderBoxWithDroppableScroll,ne=T.previousImpact,le=T.destination,ue=T.insideDestination,Te=T.afterCritical;if(!le.isCombineEnabled)return null;var Se=le.axis,He=Tn(le.axis,P.displaceBy),et=He.value,rt=K[Se.start],Ge=K[Se.end],Ke=zn(P,ue),Qe=tt(Ke,function(Rn){var Nn=Rn.descriptor.id,ai=Rn.page.borderBox,ui=ai[Se.size],Ti=ui/Mt,li=un(Nn,Te),ki=kn({displaced:ne.displaced,id:Nn});return li?ki?Ge>ai[Se.start]+Ti&&Ge<ai[Se.end]-Ti:rt>ai[Se.start]-et+Ti&&rt<ai[Se.end]-et-Ti:ki?Ge>ai[Se.start]+et+Ti&&Ge<ai[Se.end]+et-Ti:rt>ai[Se.start]+Ti&&rt<ai[Se.end]-Ti});if(!Qe)return null;var Rt={displacedBy:He,displaced:ne.displaced,at:{type:"COMBINE",combine:{draggableId:Qe.descriptor.id,droppableId:le.descriptor.id}}};return Rt},Vt=function(T){var P=T.pageOffset,K=T.draggable,ne=T.draggables,le=T.droppables,ue=T.previousImpact,Te=T.viewport,Se=T.afterCritical,He=In(K.page.borderBox,P),et=qn({pageBorderBox:He,draggable:K,droppables:le});if(!et)return Si;var rt=le[et],Ge=gn(rt.descriptor.id,ne),Ke=Dn(rt,He);return zt({pageBorderBoxWithDroppableScroll:Ke,draggable:K,previousImpact:ue,destination:rt,insideDestination:Ge,afterCritical:Se})||sn({pageBorderBoxWithDroppableScroll:Ke,draggable:K,destination:rt,insideDestination:Ge,last:ue.displaced,viewport:Te,afterCritical:Se})},Bt=function(T,P){var K;return Object(ee.a)({},T,(K={},K[P.descriptor.id]=P,K))},Zt=function(P){var K=P.previousImpact,ne=P.impact,le=P.droppables,ue=tn(K),Te=tn(ne);if(!ue)return le;if(ue===Te)return le;var Se=le[ue];if(!Se.subject.withPlaceholder)return le;var He=ni(Se);return Bt(le,He)},yn=function(T){var P=T.draggable,K=T.draggables,ne=T.droppables,le=T.previousImpact,ue=T.impact,Te=Zt({previousImpact:le,impact:ue,droppables:ne}),Se=tn(ue);if(!Se)return Te;var He=ne[Se];if(mi(P,He))return Te;if(He.subject.withPlaceholder)return Te;var et=Vn(He,P,K);return Bt(Te,et)},pn=function(T){var P=T.state,K=T.clientSelection,ne=T.dimensions,le=T.viewport,ue=T.impact,Te=T.scrollJumpRequest,Se=le||P.viewport,He=ne||P.dimensions,et=K||P.current.client.selection,rt=Xt(et,P.initial.client.selection),Ge={offset:rt,selection:et,borderBoxCenter:Ft(P.initial.client.borderBoxCenter,rt)},Ke={selection:Ft(Ge.selection,Se.scroll.current),borderBoxCenter:Ft(Ge.borderBoxCenter,Se.scroll.current),offset:Ft(Ge.offset,Se.scroll.diff.value)},Qe={client:Ge,page:Ke};if(P.phase==="COLLECTING")return Object(ee.a)({phase:"COLLECTING"},P,{dimensions:He,viewport:Se,current:Qe});var Rt=He.draggables[P.critical.draggable.id],Rn=ue||Vt({pageOffset:Ke.offset,draggable:Rt,draggables:He.draggables,droppables:He.droppables,previousImpact:P.impact,viewport:Se,afterCritical:P.afterCritical}),Nn=yn({draggable:Rt,impact:Rn,previousImpact:P.impact,draggables:He.draggables,droppables:He.droppables}),ai=Object(ee.a)({},P,{current:Qe,dimensions:{draggables:He.draggables,droppables:Nn},impact:Rn,viewport:Se,scrollJumpRequest:Te||null,forceShouldAnimate:Te?!1:null});return ai};function gt(T,P){return T.map(function(K){return P[K]})}var it=function(T){var P=T.impact,K=T.viewport,ne=T.draggables,le=T.destination,ue=T.forceShouldAnimate,Te=P.displaced,Se=gt(Te.all,ne),He=en({afterDragging:Se,destination:le,displacedBy:P.displacedBy,viewport:K.frame,forceShouldAnimate:ue,last:Te});return Object(ee.a)({},P,{displaced:He})},Ve=function(T){var P=T.impact,K=T.draggable,ne=T.droppable,le=T.draggables,ue=T.viewport,Te=T.afterCritical,Se=Lt({impact:P,draggable:K,draggables:le,droppable:ne,afterCritical:Te});return nn({pageBorderBoxCenter:Se,draggable:K,viewport:ue})},qe=function(T){var P=T.state,K=T.dimensions,ne=T.viewport;P.movementMode==="SNAP"||te(!1);var le=P.impact,ue=ne||P.viewport,Te=K||P.dimensions,Se=Te.draggables,He=Te.droppables,et=Se[P.critical.draggable.id],rt=tn(le);rt||te(!1);var Ge=He[rt],Ke=it({impact:le,viewport:ue,destination:Ge,draggables:Se}),Qe=Ve({impact:Ke,draggable:et,droppable:Ge,draggables:Se,viewport:ue,afterCritical:P.afterCritical});return pn({impact:Ke,clientSelection:Qe,state:P,dimensions:Te,viewport:ue})},We=function(T){return{index:T.index,droppableId:T.droppableId}},dt=function(T){var P=T.draggable,K=T.home,ne=T.draggables,le=T.viewport,ue=Tn(K.axis,P.displaceBy),Te=gn(K.descriptor.id,ne),Se=Te.indexOf(P);Se!==-1||te(!1);var He=Te.slice(Se+1),et=He.reduce(function(Qe,Rt){return Qe[Rt.descriptor.id]=!0,Qe},{}),rt={inVirtualList:K.descriptor.mode==="virtual",displacedBy:ue,effected:et},Ge=en({afterDragging:He,destination:K,displacedBy:ue,last:null,viewport:le.frame,forceShouldAnimate:!1}),Ke={displaced:Ge,displacedBy:ue,at:{type:"REORDER",destination:We(P.descriptor)}};return{impact:Ke,afterCritical:rt}},Ze=function(T,P){return{draggables:T.draggables,droppables:Bt(T.droppables,P)}},wt=function(P){},kt=function(P){},Tt=function(T){var P=T.draggable,K=T.offset,ne=T.initialWindowScroll,le=A(P.client,K),ue=S(le,ne),Te=Object(ee.a)({},P,{placeholder:Object(ee.a)({},P.placeholder,{client:le}),client:le,page:ue});return Te},Ht=function(T){var P=T.frame;return P||te(!1),P},St=function(T){var P=T.additions,K=T.updatedDroppables,ne=T.viewport,le=ne.scroll.diff.value;return P.map(function(ue){var Te=ue.descriptor.droppableId,Se=K[Te],He=Ht(Se),et=He.scroll.diff.value,rt=Ft(le,et),Ge=Tt({draggable:ue,offset:rt,initialWindowScroll:ne.scroll.initial});return Ge})},Pt=function(T){var P=T.state,K=T.published;wt();var ne=K.modified.map(function(Ti){var li=P.dimensions.droppables[Ti.droppableId],ki=ye(li,Ti.scroll);return ki}),le=Object(ee.a)({},P.dimensions.droppables,{},Kt(ne)),ue=Gt(St({additions:K.additions,updatedDroppables:le,viewport:P.viewport})),Te=Object(ee.a)({},P.dimensions.draggables,{},ue);K.removals.forEach(function(Ti){delete Te[Ti]});var Se={droppables:le,draggables:Te},He=tn(P.impact),et=He?Se.droppables[He]:null,rt=Se.draggables[P.critical.draggable.id],Ge=Se.droppables[P.critical.droppable.id],Ke=dt({draggable:rt,home:Ge,draggables:Te,viewport:P.viewport}),Qe=Ke.impact,Rt=Ke.afterCritical,Rn=et&&et.isCombineEnabled?P.impact:Qe,Nn=Vt({pageOffset:P.current.page.offset,draggable:Se.draggables[P.critical.draggable.id],draggables:Se.draggables,droppables:Se.droppables,previousImpact:Rn,viewport:P.viewport,afterCritical:Rt});kt();var ai=Object(ee.a)({phase:"DRAGGING"},P,{phase:"DRAGGING",impact:Nn,onLiftImpact:Qe,dimensions:Se,afterCritical:Rt,forceShouldAnimate:!1});if(P.phase==="COLLECTING")return ai;var ui=Object(ee.a)({phase:"DROP_PENDING"},ai,{phase:"DROP_PENDING",reason:P.reason,isWaiting:!1});return ui},bn=function(P){return P.movementMode==="SNAP"},on=function(P,K,ne){var le=Ze(P.dimensions,K);return!bn(P)||ne?pn({state:P,dimensions:le}):qe({state:P,dimensions:le})};function vi(T){return T.isDragging&&T.movementMode==="SNAP"?Object(ee.a)({phase:"DRAGGING"},T,{scrollJumpRequest:null}):T}var Jn={phase:"IDLE",completed:null,shouldFlush:!1},Zn=function(T,P){if(T===void 0&&(T=Jn),P.type==="FLUSH")return Object(ee.a)({},Jn,{shouldFlush:!0});if(P.type==="INITIAL_PUBLISH"){T.phase==="IDLE"||te(!1);var K=P.payload,ne=K.critical,le=K.clientSelection,ue=K.viewport,Te=K.dimensions,Se=K.movementMode,He=Te.draggables[ne.draggable.id],et=Te.droppables[ne.droppable.id],rt={selection:le,borderBoxCenter:He.client.borderBox.center,offset:lt},Ge={client:rt,page:{selection:Ft(rt.selection,ue.scroll.initial),borderBoxCenter:Ft(rt.selection,ue.scroll.initial),offset:Ft(rt.selection,ue.scroll.diff.value)}},Ke=$t(Te.droppables).every(function(Ci){return!Ci.isFixedOnPage}),Qe=dt({draggable:He,home:et,draggables:Te.draggables,viewport:ue}),Rt=Qe.impact,Rn=Qe.afterCritical,Nn={phase:"DRAGGING",isDragging:!0,critical:ne,movementMode:Se,dimensions:Te,initial:Ge,current:Ge,isWindowScrollAllowed:Ke,impact:Rt,afterCritical:Rn,onLiftImpact:Rt,viewport:ue,scrollJumpRequest:null,forceShouldAnimate:null};return Nn}if(P.type==="COLLECTION_STARTING"){if(T.phase==="COLLECTING"||T.phase==="DROP_PENDING")return T;T.phase==="DRAGGING"||te(!1);var ai=Object(ee.a)({phase:"COLLECTING"},T,{phase:"COLLECTING"});return ai}if(P.type==="PUBLISH_WHILE_DRAGGING")return T.phase==="COLLECTING"||T.phase==="DROP_PENDING"||te(!1),Pt({state:T,published:P.payload});if(P.type==="MOVE"){if(T.phase==="DROP_PENDING")return T;Cn(T)||te(!1);var ui=P.payload.client;return Jt(ui,T.current.client.selection)?T:pn({state:T,clientSelection:ui,impact:bn(T)?T.impact:null})}if(P.type==="UPDATE_DROPPABLE_SCROLL"){if(T.phase==="DROP_PENDING")return vi(T);if(T.phase==="COLLECTING")return vi(T);Cn(T)||te(!1);var Ti=P.payload,li=Ti.id,ki=Ti.newScroll,Pi=T.dimensions.droppables[li];if(!Pi)return T;var Bi=ye(Pi,ki);return on(T,Bi,!1)}if(P.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(T.phase==="DROP_PENDING")return T;Cn(T)||te(!1);var $i=P.payload,e=$i.id,n=$i.isEnabled,s=T.dimensions.droppables[e];s||te(!1),s.isEnabled!==n||te(!1);var a=Object(ee.a)({},s,{isEnabled:n});return on(T,a,!0)}if(P.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(T.phase==="DROP_PENDING")return T;Cn(T)||te(!1);var p=P.payload,j=p.id,J=p.isCombineEnabled,ie=T.dimensions.droppables[j];ie||te(!1),ie.isCombineEnabled!==J||te(!1);var se=Object(ee.a)({},ie,{isCombineEnabled:J});return on(T,se,!0)}if(P.type==="MOVE_BY_WINDOW_SCROLL"){if(T.phase==="DROP_PENDING"||T.phase==="DROP_ANIMATING")return T;Cn(T)||te(!1),T.isWindowScrollAllowed||te(!1);var pe=P.payload.newScroll;if(Jt(T.viewport.scroll.current,pe))return vi(T);var Fe=wn(T.viewport,pe);return bn(T)?qe({state:T,viewport:Fe}):pn({state:T,viewport:Fe})}if(P.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!Cn(T))return T;var ze=P.payload.maxScroll;if(Jt(ze,T.viewport.scroll.max))return T;var pt=Object(ee.a)({},T.viewport,{scroll:Object(ee.a)({},T.viewport.scroll,{max:ze})});return Object(ee.a)({phase:"DRAGGING"},T,{viewport:pt})}if(P.type==="MOVE_UP"||P.type==="MOVE_DOWN"||P.type==="MOVE_LEFT"||P.type==="MOVE_RIGHT"){if(T.phase==="COLLECTING"||T.phase==="DROP_PENDING")return T;T.phase==="DRAGGING"||te(!1);var ut=Ln({state:T,type:P.type});return ut?pn({state:T,impact:ut.impact,clientSelection:ut.clientSelection,scrollJumpRequest:ut.scrollJumpRequest}):T}if(P.type==="DROP_PENDING"){var Ut=P.payload.reason;T.phase==="COLLECTING"||te(!1);var Qt=Object(ee.a)({phase:"DROP_PENDING"},T,{phase:"DROP_PENDING",isWaiting:!0,reason:Ut});return Qt}if(P.type==="DROP_ANIMATE"){var fn=P.payload,Fn=fn.completed,oi=fn.dropDuration,Bn=fn.newHomeClientOffset;T.phase==="DRAGGING"||T.phase==="DROP_PENDING"||te(!1);var ci={phase:"DROP_ANIMATING",completed:Fn,dropDuration:oi,newHomeClientOffset:Bn,dimensions:T.dimensions};return ci}if(P.type==="DROP_COMPLETE"){var Ri=P.payload.completed;return{phase:"IDLE",completed:Ri,shouldFlush:!1}}return T},Yt=function(P){return{type:"BEFORE_INITIAL_CAPTURE",payload:P}},Sn=function(P){return{type:"LIFT",payload:P}},Kn=function(P){return{type:"INITIAL_PUBLISH",payload:P}},ii=function(P){return{type:"PUBLISH_WHILE_DRAGGING",payload:P}},On=function(){return{type:"COLLECTION_STARTING",payload:null}},Li=function(P){return{type:"UPDATE_DROPPABLE_SCROLL",payload:P}},ji=function(P){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:P}},bi=function(P){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:P}},si=function(P){return{type:"MOVE",payload:P}},Ei=function(P){return{type:"MOVE_BY_WINDOW_SCROLL",payload:P}},yi=function(P){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:P}},xi=function(){return{type:"MOVE_UP",payload:null}},Ui=function(){return{type:"MOVE_DOWN",payload:null}},Vi=function(){return{type:"MOVE_RIGHT",payload:null}},Fi=function(){return{type:"MOVE_LEFT",payload:null}},Ii=function(){return{type:"FLUSH",payload:null}},Tr=function(P){return{type:"DROP_ANIMATE",payload:P}},Ki=function(P){return{type:"DROP_COMPLETE",payload:P}},Sr=function(P){return{type:"DROP",payload:P}},Ji=function(P){return{type:"DROP_PENDING",payload:P}},er=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function yr(T){if(T.length<=1)return;for(var P=T.map(function(Se){return Se.descriptor.index}),K={},ne=1;ne<P.length;ne++){var le=P[ne],ue=P[ne-1];le!==ue+1&&(K[le]=!0)}if(!Object.keys(K).length)return;var Te=P.map(function(Se){var He=Boolean(K[Se]);return He?"[\u{1F525}"+Se+"]":""+Se}).join(", ")}function Or(T,P){if(!1)var K}var Va=function(T){return function(P){var K=P.getState,ne=P.dispatch;return function(le){return function(ue){if(ue.type!=="LIFT"){le(ue);return}var Te=ue.payload,Se=Te.id,He=Te.clientSelection,et=Te.movementMode,rt=K();rt.phase==="DROP_ANIMATING"&&ne(Ki({completed:rt.completed})),K().phase==="IDLE"||te(!1),ne(Ii()),ne(Yt({draggableId:Se,movementMode:et}));var Ge={shouldPublishImmediately:et==="SNAP"},Ke={draggableId:Se,scrollOptions:Ge},Qe=T.startPublishing(Ke),Rt=Qe.critical,Rn=Qe.dimensions,Nn=Qe.viewport;Or(Rt,Rn),ne(Kn({critical:Rt,dimensions:Rn,clientSelection:He,movementMode:et,viewport:Nn}))}}}},fr=function(T){return function(){return function(P){return function(K){K.type==="INITIAL_PUBLISH"&&T.dragging(),K.type==="DROP_ANIMATE"&&T.dropping(K.payload.completed.result.reason),(K.type==="FLUSH"||K.type==="DROP_COMPLETE")&&T.resting(),P(K)}}}},Xa={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Kr={opacity:{drop:0,combining:.7},scale:{drop:.75}},kr={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ar=kr.outOfTheWay+"s "+Xa.outOfTheWay,qr={fluid:"opacity "+ar,snap:"transform "+ar+", opacity "+ar,drop:function(P){var K=P+"s "+Xa.drop;return"transform "+K+", opacity "+K},outOfTheWay:"transform "+ar,placeholder:"height "+ar+", width "+ar+", margin "+ar},bo=function(P){return Jt(P,lt)?null:"translate("+P.x+"px, "+P.y+"px)"},Eo={moveTo:bo,drop:function(P,K){var ne=bo(P);return ne?K?ne+" scale("+Kr.scale.drop+")":ne:null}},xo=kr.minDropTime,cs=kr.maxDropTime,hs=cs-xo,Co=1500,wa=.6,fs=function(T){var P=T.current,K=T.destination,ne=T.reason,le=mn(P,K);if(le<=0)return xo;if(le>=Co)return cs;var ue=le/Co,Te=xo+hs*ue,Se=ne==="CANCEL"?Te*wa:Te;return Number(Se.toFixed(2))},ps=function(T){var P=T.impact,K=T.draggable,ne=T.dimensions,le=T.viewport,ue=T.afterCritical,Te=ne.draggables,Se=ne.droppables,He=tn(P),et=He?Se[He]:null,rt=Se[K.descriptor.droppableId],Ge=Ve({impact:P,draggable:K,draggables:Te,afterCritical:ue,droppable:et||rt,viewport:le}),Ke=Xt(Ge,K.client.borderBox.center);return Ke},wo=function(T){var P=T.draggables,K=T.reason,ne=T.lastImpact,le=T.home,ue=T.viewport,Te=T.onLiftImpact;if(!ne.at||K!=="DROP"){var Se=it({draggables:P,impact:Te,destination:le,viewport:ue,forceShouldAnimate:!0});return{impact:Se,didDropInsideDroppable:!1}}if(ne.at.type==="REORDER")return{impact:ne,didDropInsideDroppable:!0};var He=Object(ee.a)({},ne,{displaced:_i});return{impact:He,didDropInsideDroppable:!0}},$a=function(T){var P=T.getState,K=T.dispatch;return function(ne){return function(le){if(le.type!=="DROP"){ne(le);return}var ue=P(),Te=le.payload.reason;if(ue.phase==="COLLECTING"){K(Ji({reason:Te}));return}if(ue.phase==="IDLE")return;var Se=ue.phase==="DROP_PENDING"&&ue.isWaiting;Se&&te(!1),ue.phase==="DRAGGING"||ue.phase==="DROP_PENDING"||te(!1);var He=ue.critical,et=ue.dimensions,rt=et.draggables[ue.critical.draggable.id],Ge=wo({reason:Te,lastImpact:ue.impact,afterCritical:ue.afterCritical,onLiftImpact:ue.onLiftImpact,home:ue.dimensions.droppables[ue.critical.droppable.id],viewport:ue.viewport,draggables:ue.dimensions.draggables}),Ke=Ge.impact,Qe=Ge.didDropInsideDroppable,Rt=Qe?an(Ke):null,Rn=Qe?dn(Ke):null,Nn={index:He.draggable.index,droppableId:He.droppable.id},ai={draggableId:rt.descriptor.id,type:rt.descriptor.type,source:Nn,reason:Te,mode:ue.movementMode,destination:Rt,combine:Rn},ui=ps({impact:Ke,draggable:rt,dimensions:et,viewport:ue.viewport,afterCritical:ue.afterCritical}),Ti={critical:ue.critical,afterCritical:ue.afterCritical,result:ai,impact:Ke},li=!Jt(ue.current.client.offset,ui)||Boolean(ai.combine);if(!li){K(Ki({completed:Ti}));return}var ki=fs({current:ue.current.client.offset,destination:ui,reason:Te}),Pi={newHomeClientOffset:ui,dropDuration:ki,completed:Ti};K(Tr(Pi))}}},To=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function So(T){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(K){if(K.target!==window&&K.target!==window.document)return;T()}}}function xr(T){var P=T.onWindowScroll;function K(){P(To())}var ne=g(K),le=So(ne),ue=xe;function Te(){return ue!==xe}function Se(){Te()&&te(!1),ue=Ce(window,[le])}function He(){Te()||te(!1),ne.cancel(),ue(),ue=xe}return{start:Se,stop:He,isActive:Te}}var ms=function(P){return P.type==="DROP_COMPLETE"||P.type==="DROP_ANIMATE"||P.type==="FLUSH"},Oo=function(T){var P=xr({onWindowScroll:function(ne){T.dispatch(Ei({newScroll:ne}))}});return function(K){return function(ne){!P.isActive()&&ne.type==="INITIAL_PUBLISH"&&P.start(),P.isActive()&&ms(ne)&&P.stop(),K(ne)}}},Ro=function(T){var P=!1,K=!1,ne=setTimeout(function(){K=!0}),le=function(Te){if(P)return;if(K)return;P=!0,T(Te),clearTimeout(ne)};return le.wasCalled=function(){return P},le},gs=function(){var T=[],P=function(ue){var Te=Me(T,function(et){return et.timerId===ue});Te!==-1||te(!1);var Se=T.splice(Te,1),He=Se[0];He.callback()},K=function(ue){var Te=setTimeout(function(){return P(Te)}),Se={timerId:Te,callback:ue};T.push(Se)},ne=function(){if(!T.length)return;var ue=[].concat(T);T.length=0,ue.forEach(function(Te){clearTimeout(Te.timerId),Te.callback()})};return{add:K,flush:ne}},vs=function(P,K){return P==null&&K==null?!0:P==null||K==null?!1:P.droppableId===K.droppableId&&P.index===K.index},Ao=function(P,K){return P==null&&K==null?!0:P==null||K==null?!1:P.draggableId===K.draggableId&&P.droppableId===K.droppableId},El=function(P,K){if(P===K)return!0;var ne=P.draggable.id===K.draggable.id&&P.draggable.droppableId===K.draggable.droppableId&&P.draggable.type===K.draggable.type&&P.draggable.index===K.draggable.index,le=P.droppable.id===K.droppable.id&&P.droppable.type===K.droppable.type;return ne&&le},Ta=function(P,K){wt(),K(),kt()},Ya=function(P,K){return{draggableId:P.draggable.id,type:P.droppable.type,source:{droppableId:P.droppable.id,index:P.draggable.index},mode:K}},Rr=function(P,K,ne,le){if(!P){ne(le(K));return}var ue=Ro(ne),Te={announce:ue};P(K,Te),ue.wasCalled()||ne(le(K))},Jr=function(T,P){var K=gs(),ne=null,le=function(Ke,Qe){ne&&te(!1),Ta("onBeforeCapture",function(){var Rt=T().onBeforeCapture;if(Rt){var Rn={draggableId:Ke,mode:Qe};Rt(Rn)}})},ue=function(Ke,Qe){ne&&te(!1),Ta("onBeforeDragStart",function(){var Rt=T().onBeforeDragStart;Rt&&Rt(Ya(Ke,Qe))})},Te=function(Ke,Qe){ne&&te(!1);var Rt=Ya(Ke,Qe);ne={mode:Qe,lastCritical:Ke,lastLocation:Rt.source,lastCombine:null},K.add(function(){Ta("onDragStart",function(){return Rr(T().onDragStart,Rt,P,_t.onDragStart)})})},Se=function(Ke,Qe){var Rt=an(Qe),Rn=dn(Qe);ne||te(!1);var Nn=!El(Ke,ne.lastCritical);Nn&&(ne.lastCritical=Ke);var ai=!vs(ne.lastLocation,Rt);ai&&(ne.lastLocation=Rt);var ui=!Ao(ne.lastCombine,Rn);if(ui&&(ne.lastCombine=Rn),!Nn&&!ai&&!ui)return;var Ti=Object(ee.a)({},Ya(Ke,ne.mode),{combine:Rn,destination:Rt});K.add(function(){Ta("onDragUpdate",function(){return Rr(T().onDragUpdate,Ti,P,_t.onDragUpdate)})})},He=function(){ne||te(!1),K.flush()},et=function(Ke){ne||te(!1),ne=null,Ta("onDragEnd",function(){return Rr(T().onDragEnd,Ke,P,_t.onDragEnd)})},rt=function(){if(!ne)return;var Ke=Object(ee.a)({},Ya(ne.lastCritical,ne.mode),{combine:null,destination:null,reason:"CANCEL"});et(Ke)};return{beforeCapture:le,beforeStart:ue,start:Te,update:Se,flush:He,drop:et,abort:rt}},Zr=function(T,P){var K=Jr(T,P);return function(ne){return function(le){return function(ue){if(ue.type==="BEFORE_INITIAL_CAPTURE"){K.beforeCapture(ue.payload.draggableId,ue.payload.movementMode);return}if(ue.type==="INITIAL_PUBLISH"){var Te=ue.payload.critical;K.beforeStart(Te,ue.payload.movementMode),le(ue),K.start(Te,ue.payload.movementMode);return}if(ue.type==="DROP_COMPLETE"){var Se=ue.payload.completed.result;K.flush(),le(ue),K.drop(Se);return}if(le(ue),ue.type==="FLUSH"){K.abort();return}var He=ne.getState();He.phase==="DRAGGING"&&K.update(He.critical,He.impact)}}}},Do=function(T){return function(P){return function(K){if(K.type!=="DROP_ANIMATION_FINISHED"){P(K);return}var ne=T.getState();ne.phase==="DROP_ANIMATING"||te(!1),T.dispatch(Ki({completed:ne.completed}))}}},Po=function(T){var P=null,K=null;function ne(){K&&(cancelAnimationFrame(K),K=null),P&&(P(),P=null)}return function(le){return function(ue){if((ue.type==="FLUSH"||ue.type==="DROP_COMPLETE"||ue.type==="DROP_ANIMATION_FINISHED")&&ne(),le(ue),ue.type!=="DROP_ANIMATE")return;var Te={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var He=T.getState();He.phase==="DROP_ANIMATING"&&T.dispatch(er())}};K=requestAnimationFrame(function(){K=null,P=Ce(window,[Te])})}}},_s=function(T){return function(){return function(P){return function(K){(K.type==="DROP_COMPLETE"||K.type==="FLUSH"||K.type==="DROP_ANIMATE")&&T.stopPublishing(),P(K)}}}},Lo=function(T){var P=!1;return function(){return function(K){return function(ne){if(ne.type==="INITIAL_PUBLISH"){P=!0,T.tryRecordFocus(ne.payload.critical.draggable.id),K(ne),T.tryRestoreFocusRecorded();return}if(K(ne),!P)return;if(ne.type==="FLUSH"){P=!1,T.tryRestoreFocusRecorded();return}if(ne.type==="DROP_COMPLETE"){P=!1;var le=ne.payload.completed.result;le.combine&&T.tryShiftRecord(le.draggableId,le.combine.draggableId),T.tryRestoreFocusRecorded()}}}}},Gr=function(P){return P.type==="DROP_COMPLETE"||P.type==="DROP_ANIMATE"||P.type==="FLUSH"},zr=function(T){return function(P){return function(K){return function(ne){if(Gr(ne)){T.stop(),K(ne);return}if(ne.type==="INITIAL_PUBLISH"){K(ne);var le=P.getState();le.phase==="DRAGGING"||te(!1),T.start(le);return}K(ne),T.scroll(P.getState())}}}},lr=function(T){return function(P){return function(K){if(P(K),K.type!=="PUBLISH_WHILE_DRAGGING")return;var ne=T.getState();if(ne.phase!=="DROP_PENDING")return;if(ne.isWaiting)return;T.dispatch(Sr({reason:ne.reason}))}}},Mr=W.d,Nr=function(T){var P=T.dimensionMarshal,K=T.focusMarshal,ne=T.styleMarshal,le=T.getResponders,ue=T.announce,Te=T.autoScroller;return Object(W.e)(Zn,Mr(Object(W.a)(fr(ne),_s(P),Va(P),$a,Do,Po,lr,zr(Te),Oo,Lo(K),Zr(le,ue))))},ea=function(){return{additions:{},removals:{},modified:{}}};function xl(T){var P=T.registry,K=T.callbacks,ne=ea(),le=null,ue=function(){if(le)return;K.collectionStarting(),le=requestAnimationFrame(function(){le=null,wt();var rt=ne,Ge=rt.additions,Ke=rt.removals,Qe=rt.modified,Rt=Object.keys(Ge).map(function(ai){return P.draggable.getById(ai).getDimension(lt)}).sort(function(ai,ui){return ai.descriptor.index-ui.descriptor.index}),Rn=Object.keys(Qe).map(function(ai){var ui=P.droppable.getById(ai),Ti=ui.callbacks.getScrollWhileDragging();return{droppableId:ai,scroll:Ti}}),Nn={additions:Rt,removals:Object.keys(Ke),modified:Rn};ne=ea(),kt(),K.publish(Nn)})},Te=function(rt){var Ge=rt.descriptor.id;ne.additions[Ge]=rt,ne.modified[rt.descriptor.droppableId]=!0,ne.removals[Ge]&&delete ne.removals[Ge],ue()},Se=function(rt){var Ge=rt.descriptor;ne.removals[Ge.id]=!0,ne.modified[Ge.droppableId]=!0,ne.additions[Ge.id]&&delete ne.additions[Ge.id],ue()},He=function(){if(!le)return;cancelAnimationFrame(le),le=null,ne=ea()};return{add:Te,remove:Se,stop:He}}var Io=function(T){var P=T.scrollHeight,K=T.scrollWidth,ne=T.height,le=T.width,ue=Xt({x:K,y:P},{x:le,y:ne}),Te={x:Math.max(0,ue.x),y:Math.max(0,ue.y)};return Te},ta=function(){var T=document.documentElement;return T||te(!1),T},ko=function(){var T=ta(),P=Io({scrollHeight:T.scrollHeight,scrollWidth:T.scrollWidth,width:T.clientWidth,height:T.clientHeight});return P},ys=function(){var T=To(),P=ko(),K=T.y,ne=T.x,le=ta(),ue=le.clientWidth,Te=le.clientHeight,Se=ne+ue,He=K+Te,et=f({top:K,left:ne,right:Se,bottom:He}),rt={frame:et,scroll:{initial:T,current:T,max:P,diff:{value:lt,displacement:lt}}};return rt},Qa=function(T){var P=T.critical,K=T.scrollOptions,ne=T.registry;wt();var le=ys(),ue=le.scroll.current,Te=P.droppable,Se=ne.droppable.getAllByType(Te.type).map(function(Ge){return Ge.callbacks.getDimensionAndWatchScroll(ue,K)}),He=ne.draggable.getAllByType(P.draggable.type).map(function(Ge){return Ge.getDimension(ue)}),et={draggables:Gt(He),droppables:Kt(Se)};kt();var rt={dimensions:et,critical:P,viewport:le};return rt};function bs(T,P,K){if(K.descriptor.id===P.id)return!1;if(K.descriptor.type!==P.type)return!1;var ne=T.droppable.getById(K.descriptor.droppableId);return!(ne.descriptor.mode!=="virtual")}var Mo=function(T,P){var K=null,ne=xl({callbacks:{publish:P.publishWhileDragging,collectionStarting:P.collectionStarting},registry:T}),le=function(Qe,Rt){if(T.droppable.exists(Qe)||te(!1),!K)return;P.updateDroppableIsEnabled({id:Qe,isEnabled:Rt})},ue=function(Qe,Rt){if(!K)return;T.droppable.exists(Qe)||te(!1),P.updateDroppableIsCombineEnabled({id:Qe,isCombineEnabled:Rt})},Te=function(Qe,Rt){if(!K)return;T.droppable.exists(Qe)||te(!1),P.updateDroppableScroll({id:Qe,newScroll:Rt})},Se=function(Qe,Rt){if(!K)return;T.droppable.getById(Qe).callbacks.scroll(Rt)},He=function(){if(!K)return;ne.stop();var Qe=K.critical.droppable;T.droppable.getAllByType(Qe.type).forEach(function(Rt){return Rt.callbacks.dragStopped()}),K.unsubscribe(),K=null},et=function(Qe){K||te(!1);var Rt=K.critical.draggable;Qe.type==="ADDITION"&&(bs(T,Rt,Qe.value)&&ne.add(Qe.value)),Qe.type==="REMOVAL"&&(bs(T,Rt,Qe.value)&&ne.remove(Qe.value))},rt=function(Qe){K&&te(!1);var Rt=T.draggable.getById(Qe.draggableId),Rn=T.droppable.getById(Rt.descriptor.droppableId),Nn={draggable:Rt.descriptor,droppable:Rn.descriptor},ai=T.subscribe(et);return K={critical:Nn,unsubscribe:ai},Qa({critical:Nn,registry:T,scrollOptions:Qe.scrollOptions})},Ge={updateDroppableIsEnabled:le,updateDroppableIsCombineEnabled:ue,scrollDroppable:Se,updateDroppableScroll:Te,startPublishing:rt,stopPublishing:He};return Ge},No=function(T,P){return T.phase==="IDLE"?!0:T.phase!=="DROP_ANIMATING"||T.completed.result.draggableId===P?!1:T.completed.result.reason==="DROP"},Es=function(T){window.scrollBy(T.x,T.y)},Uo=d(function(T){return $t(T).filter(function(P){return P.isEnabled?!!P.frame:!1})}),na=function(P,K){var ne=tt(Uo(K),function(le){return le.frame||te(!1),Qn(le.frame.pageMarginBox)(P)});return ne},qa=function(T){var P=T.center,K=T.destination,ne=T.droppables;if(K){var le=ne[K];return le.frame?le:null}var ue=na(P,ne);return ue},Ar={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(P){return Math.pow(P,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},Ja=function(T,P){var K=T[P.size]*Ar.startFromPercentage,ne=T[P.size]*Ar.maxScrollAtPercentage,le={startScrollingFrom:K,maxScrollValueAt:ne};return le},xs=function(T){var P=T.startOfRange,K=T.endOfRange,ne=T.current,le=K-P;if(le===0)return 0;var ue=ne-P,Te=ue/le;return Te},Fo=1,Cl=function(T,P){if(T>P.startScrollingFrom)return 0;if(T<=P.maxScrollValueAt)return Ar.maxPixelScroll;if(T===P.startScrollingFrom)return Fo;var K=xs({startOfRange:P.maxScrollValueAt,endOfRange:P.startScrollingFrom,current:T}),ne=1-K,le=Ar.maxPixelScroll*Ar.ease(ne);return Math.ceil(le)},Za=Ar.durationDampening.accelerateAt,eo=Ar.durationDampening.stopDampeningAt,ia=function(T,P){var K=P,ne=eo,le=Date.now(),ue=le-K;if(ue>=eo)return T;if(ue<Za)return Fo;var Te=xs({startOfRange:Za,endOfRange:ne,current:ue}),Se=T*Ar.ease(Te);return Math.ceil(Se)},ra=function(T){var P=T.distanceToEdge,K=T.thresholds,ne=T.dragStartTime,le=T.shouldUseTimeDampening,ue=Cl(P,K);return ue===0?0:le?Math.max(ia(ue,ne),Fo):ue},Cs=function(T){var P=T.container,K=T.distanceToEdges,ne=T.dragStartTime,le=T.axis,ue=T.shouldUseTimeDampening,Te=Ja(P,le),Se=K[le.end]<K[le.start];return Se?ra({distanceToEdge:K[le.end],thresholds:Te,dragStartTime:ne,shouldUseTimeDampening:ue}):-1*ra({distanceToEdge:K[le.start],thresholds:Te,dragStartTime:ne,shouldUseTimeDampening:ue})},to=function(T){var P=T.container,K=T.subject,ne=T.proposedScroll,le=K.height>P.height,ue=K.width>P.width;return!ue&&!le?ne:ue&&le?null:{x:ue?0:ne.x,y:le?0:ne.y}},ws=Xe(function(T){return T===0?0:T}),aa=function(T){var P=T.dragStartTime,K=T.container,ne=T.subject,le=T.center,ue=T.shouldUseTimeDampening,Te={top:le.y-K.top,right:K.right-le.x,bottom:K.bottom-le.y,left:le.x-K.left},Se=Cs({container:K,distanceToEdges:Te,dragStartTime:P,axis:ti,shouldUseTimeDampening:ue}),He=Cs({container:K,distanceToEdges:Te,dragStartTime:P,axis:Oi,shouldUseTimeDampening:ue}),et=ws({x:He,y:Se});if(Jt(et,lt))return null;var rt=to({container:K,subject:ne,proposedScroll:et});return rt?Jt(rt,lt)?null:rt:null},Ts=Xe(function(T){return T===0?0:T>0?1:-1}),Dr=function(){var T=function(K,ne){return K<0?K:K>ne?K-ne:0};return function(P){var K=P.current,ne=P.max,le=P.change,ue=Ft(K,le),Te={x:T(ue.x,ne.x),y:T(ue.y,ne.y)};return Jt(Te,lt)?null:Te}}(),oa=function(P){var K=P.max,ne=P.current,le=P.change,ue={x:Math.max(ne.x,K.x),y:Math.max(ne.y,K.y)},Te=Ts(le),Se=Dr({max:ue,current:ne,change:Te});return Se?Te.x!==0&&Se.x===0?!0:Te.y!==0&&Se.y===0:!0},Pr=function(P,K){return oa({current:P.scroll.current,max:P.scroll.max,change:K})},Sa=function(P,K){if(!Pr(P,K))return null;var ne=P.scroll.max,le=P.scroll.current;return Dr({current:le,max:ne,change:K})},Ur=function(P,K){var ne=P.frame;return ne?oa({current:ne.scroll.current,max:ne.scroll.max,change:K}):!1},Ss=function(P,K){var ne=P.frame;return ne&&Ur(P,K)?Dr({current:ne.scroll.current,max:ne.scroll.max,change:K}):null},Os=function(T){var P=T.viewport,K=T.subject,ne=T.center,le=T.dragStartTime,ue=T.shouldUseTimeDampening,Te=aa({dragStartTime:le,container:P.frame,subject:K,center:ne,shouldUseTimeDampening:ue});return Te&&Pr(P,Te)?Te:null},Rs=function(T){var P=T.droppable,K=T.subject,ne=T.center,le=T.dragStartTime,ue=T.shouldUseTimeDampening,Te=P.frame;if(!Te)return null;var Se=aa({dragStartTime:le,container:Te.pageMarginBox,subject:K,center:ne,shouldUseTimeDampening:ue});return Se&&Ur(P,Se)?Se:null},As=function(T){var P=T.state,K=T.dragStartTime,ne=T.shouldUseTimeDampening,le=T.scrollWindow,ue=T.scrollDroppable,Te=P.current.page.borderBoxCenter,Se=P.dimensions.draggables[P.critical.draggable.id],He=Se.page.marginBox;if(P.isWindowScrollAllowed){var et=P.viewport,rt=Os({dragStartTime:K,viewport:et,subject:He,center:Te,shouldUseTimeDampening:ne});if(rt){le(rt);return}}var Ge=qa({center:Te,destination:tn(P.impact),droppables:P.dimensions.droppables});if(!Ge)return;var Ke=Rs({dragStartTime:K,droppable:Ge,subject:He,center:Te,shouldUseTimeDampening:ne});Ke&&ue(Ge.descriptor.id,Ke)},Vr=function(T){var P=T.scrollWindow,K=T.scrollDroppable,ne=g(P),le=g(K),ue=null,Te=function(rt){ue||te(!1);var Ge=ue,Ke=Ge.shouldUseTimeDampening,Qe=Ge.dragStartTime;As({state:rt,scrollWindow:ne,scrollDroppable:le,dragStartTime:Qe,shouldUseTimeDampening:Ke})},Se=function(rt){wt(),ue&&te(!1);var Ge=Date.now(),Ke=!1,Qe=function(){Ke=!0};As({state:rt,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:Qe,scrollDroppable:Qe}),ue={dragStartTime:Ge,shouldUseTimeDampening:Ke},kt(),Ke&&Te(rt)},He=function(){if(!ue)return;ne.cancel(),le.cancel(),ue=null};return{start:Se,stop:He,scroll:Te}},Xr=function(T){var P=T.move,K=T.scrollDroppable,ne=T.scrollWindow,le=function(et,rt){var Ge=Ft(et.current.client.selection,rt);P({client:Ge})},ue=function(et,rt){if(!Ur(et,rt))return rt;var Ge=Ss(et,rt);if(!Ge)return K(et.descriptor.id,rt),null;var Ke=Xt(rt,Ge);K(et.descriptor.id,Ke);var Qe=Xt(rt,Ke);return Qe},Te=function(et,rt,Ge){if(!et)return Ge;if(!Pr(rt,Ge))return Ge;var Ke=Sa(rt,Ge);if(!Ke)return ne(Ge),null;var Qe=Xt(Ge,Ke);ne(Qe);var Rt=Xt(Ge,Qe);return Rt},Se=function(et){var rt=et.scrollJumpRequest;if(!rt)return;var Ge=tn(et.impact);Ge||te(!1);var Ke=ue(et.dimensions.droppables[Ge],rt);if(!Ke)return;var Qe=et.viewport,Rt=Te(et.isWindowScrollAllowed,Qe,Ke);if(!Rt)return;le(et,Rt)};return Se},wl=function(T){var P=T.scrollDroppable,K=T.scrollWindow,ne=T.move,le=Vr({scrollWindow:K,scrollDroppable:P}),ue=Xr({move:ne,scrollWindow:K,scrollDroppable:P}),Te=function(et){if(et.phase!=="DRAGGING")return;if(et.movementMode==="FLUID"){le.scroll(et);return}if(!et.scrollJumpRequest)return;ue(et)},Se={scroll:Te,start:le.start,stop:le.stop};return Se},sa="data-rbd",la=function(){var T=sa+"-drag-handle";return{base:T,draggableId:T+"-draggable-id",contextId:T+"-context-id"}}(),Bo=function(){var T=sa+"-draggable";return{base:T,contextId:T+"-context-id",id:T+"-id"}}(),Tl=function(){var T=sa+"-droppable";return{base:T,contextId:T+"-context-id",id:T+"-id"}}(),Ds={contextId:sa+"-scroll-container-context-id"},cr=function(P){return function(K){return"["+K+'="'+P+'"]'}},Gi=function(P,K){return P.map(function(ne){var le=ne.styles[K];return le?ne.selector+" { "+le+" }":""}).join(" ")},or="pointer-events: none;",Yi=function(T){var P=cr(T),K=function(){var Se=`
cursor: -webkit-grab;
cursor: grab;
`;return{selector:P(la.contextId),styles:{always:`
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
touch-action: manipulation;
`,resting:Se,dragging:or,dropAnimating:Se}}}(),ne=function(){var Se=`
transition: `+qr.outOfTheWay+`;
`;return{selector:P(Bo.contextId),styles:{dragging:Se,dropAnimating:Se,userCancel:Se}}}(),le={selector:P(Tl.contextId),styles:{always:"overflow-anchor: none;"}},ue={selector:"body",styles:{dragging:`
cursor: grabbing;
cursor: -webkit-grabbing;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
overflow-anchor: none;
`}},Te=[ne,K,le,ue];return{always:Gi(Te,"always"),resting:Gi(Te,"resting"),dragging:Gi(Te,"dragging"),dropAnimating:Gi(Te,"dropAnimating"),userCancel:Gi(Te,"userCancel")}},tr=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?oe.useLayoutEffect:oe.useEffect,jo=function(){var P=document.querySelector("head");return P||te(!1),P},Oa=function(P){var K=document.createElement("style");return P&&K.setAttribute("nonce",P),K.type="text/css",K};function Sl(T,P){var K=D(function(){return Yi(T)},[T]),ne=Object(oe.useRef)(null),le=Object(oe.useRef)(null),ue=m(d(function(Ge){var Ke=le.current;Ke||te(!1),Ke.textContent=Ge}),[]),Te=m(function(Ge){var Ke=ne.current;Ke||te(!1),Ke.textContent=Ge},[]);tr(function(){!ne.current&&!le.current||te(!1);var Ge=Oa(P),Ke=Oa(P);return ne.current=Ge,le.current=Ke,Ge.setAttribute(sa+"-always",T),Ke.setAttribute(sa+"-dynamic",T),jo().appendChild(Ge),jo().appendChild(Ke),Te(K.always),ue(K.resting),function(){var Qe=function(Rn){var Nn=Rn.current;Nn||te(!1),jo().removeChild(Nn),Rn.current=null};Qe(ne),Qe(le)}},[P,Te,ue,K.always,K.resting,T]);var Se=m(function(){return ue(K.dragging)},[ue,K.dragging]),He=m(function(Ge){if(Ge==="DROP"){ue(K.dropAnimating);return}ue(K.userCancel)},[ue,K.dropAnimating,K.userCancel]),et=m(function(){if(!le.current)return;ue(K.resting)},[ue,K.resting]),rt=D(function(){return{dragging:Se,dropping:He,resting:et}},[Se,He,et]);return rt}var Ps=function(T){return T&&T.ownerDocument?T.ownerDocument.defaultView:window};function Ra(T){return T instanceof Ps(T).HTMLElement}function no(T,P){var K="["+la.contextId+'="'+T+'"]',ne=bt(document.querySelectorAll(K));if(!ne.length)return null;var le=tt(ne,function(ue){return ue.getAttribute(la.draggableId)===P});return le&&Ra(le)?le:null}function Ls(T){var P=Object(oe.useRef)({}),K=Object(oe.useRef)(null),ne=Object(oe.useRef)(null),le=Object(oe.useRef)(!1),ue=m(function(Ke,Qe){var Rt={id:Ke,focus:Qe};return P.current[Ke]=Rt,function(){var Nn=P.current,ai=Nn[Ke];ai!==Rt&&delete Nn[Ke]}},[]),Te=m(function(Ke){var Qe=no(T,Ke);Qe&&Qe!==document.activeElement&&Qe.focus()},[T]),Se=m(function(Ke,Qe){K.current===Ke&&(K.current=Qe)},[]),He=m(function(){if(ne.current)return;if(!le.current)return;ne.current=requestAnimationFrame(function(){ne.current=null;var Ke=K.current;Ke&&Te(Ke)})},[Te]),et=m(function(Ke){K.current=null;var Qe=document.activeElement;if(!Qe)return;if(Qe.getAttribute(la.draggableId)!==Ke)return;K.current=Ke},[]);tr(function(){return le.current=!0,function(){le.current=!1;var Ke=ne.current;Ke&&cancelAnimationFrame(Ke)}},[]);var rt=D(function(){return{register:ue,tryRecordFocus:et,tryRestoreFocusRecorded:He,tryShiftRecord:Se}},[ue,et,He,Se]);return rt}function Wo(){var T={draggables:{},droppables:{}},P=[];function K(Ge){return P.push(Ge),function(){var Qe=P.indexOf(Ge);if(Qe===-1)return;P.splice(Qe,1)}}function ne(Ge){P.length&&P.forEach(function(Ke){return Ke(Ge)})}function le(Ge){return T.draggables[Ge]||null}function ue(Ge){var Ke=le(Ge);return Ke||te(!1),Ke}var Te={register:function(Ke){T.draggables[Ke.descriptor.id]=Ke,ne({type:"ADDITION",value:Ke})},update:function(Ke,Qe){var Rt=T.draggables[Qe.descriptor.id];if(!Rt)return;if(Rt.uniqueId!==Ke.uniqueId)return;delete T.draggables[Qe.descriptor.id],T.draggables[Ke.descriptor.id]=Ke},unregister:function(Ke){var Qe=Ke.descriptor.id,Rt=le(Qe);if(!Rt)return;if(Ke.uniqueId!==Rt.uniqueId)return;delete T.draggables[Qe],ne({type:"REMOVAL",value:Ke})},getById:ue,findById:le,exists:function(Ke){return Boolean(le(Ke))},getAllByType:function(Ke){return ce(T.draggables).filter(function(Qe){return Qe.descriptor.type===Ke})}};function Se(Ge){return T.droppables[Ge]||null}function He(Ge){var Ke=Se(Ge);return Ke||te(!1),Ke}var et={register:function(Ke){T.droppables[Ke.descriptor.id]=Ke},unregister:function(Ke){var Qe=Se(Ke.descriptor.id);if(!Qe)return;if(Ke.uniqueId!==Qe.uniqueId)return;delete T.droppables[Ke.descriptor.id]},getById:He,findById:Se,exists:function(Ke){return Boolean(Se(Ke))},getAllByType:function(Ke){return ce(T.droppables).filter(function(Qe){return Qe.descriptor.type===Ke})}};function rt(){T.draggables={},T.droppables={},P.length=0}return{draggable:Te,droppable:et,subscribe:K,clean:rt}}function Ol(){var T=D(Wo,[]);return Object(oe.useEffect)(function(){return function(){requestAnimationFrame(T.clean)}},[T]),T}var Aa=Z.a.createContext(null),$r=function(){var T=document.body;return T||te(!1),T},Is={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},ks=function(P){return"rbd-announcement-"+P};function Ho(T){var P=D(function(){return ks(T)},[T]),K=Object(oe.useRef)(null);Object(oe.useEffect)(function(){var ue=document.createElement("div");return K.current=ue,ue.id=P,ue.setAttribute("aria-live","assertive"),ue.setAttribute("aria-atomic","true"),Object(ee.a)(ue.style,Is),$r().appendChild(ue),function(){setTimeout(function(){var He=$r();He.contains(ue)&&He.removeChild(ue),ue===K.current&&(K.current=null)})}},[P]);var ne=m(function(le){var ue=K.current;if(ue){ue.textContent=le;return}},[]);return ne}var Ko=0,Da={separator:"::"};function Rl(){Ko=0}function ua(T,P){return P===void 0&&(P=Da),D(function(){return""+T+P.separator+Ko++},[P.separator,T])}function pr(T){var P=T.contextId,K=T.uniqueId;return"rbd-hidden-text-"+P+"-"+K}function Ms(T){var P=T.contextId,K=T.text,ne=ua("hidden-text",{separator:"-"}),le=D(function(){return pr({contextId:P,uniqueId:ne})},[ne,P]);return Object(oe.useEffect)(function(){var Te=document.createElement("div");return Te.id=le,Te.textContent=K,Te.style.display="none",$r().appendChild(Te),function(){var He=$r();He.contains(Te)&&He.removeChild(Te)}},[le,K]),le}var io=Z.a.createContext(null),Ns={react:"^16.8.5","react-dom":"^16.8.5"},mr=/(\d+)\.(\d+)\.(\d+)/,Mi=function(P){var K=mr.exec(P);K!=null||te(!1);var ne=Number(K[1]),le=Number(K[2]),ue=Number(K[3]);return{major:ne,minor:le,patch:ue,raw:P}},Cr=function(P,K){return K.major>P.major?!0:K.major<P.major?!1:K.minor>P.minor?!0:K.minor<P.minor?!1:K.patch>=P.patch},Fr=function(T,P){var K=Mi(T),ne=Mi(P);if(Cr(K,ne))return},Yr=`
We expect a html5 doctype: <!doctype html>
This is to ensure consistent browser layout and measurement
More information: https://github.com/atlassian/react-beautiful-dnd/blob/master/docs/guides/doctype.md
`,Us=function(T){var P=T.doctype;if(!P)return;P.name.toLowerCase()!=="html",P.publicId!==""};function Pa(T){}function da(T,P){Pa(function(){Object(oe.useEffect)(function(){try{T()}catch(K){he(`
A setup problem was encountered.
> `+K.message+`
`)}},P)})}function Al(){da(function(){Fr(Ns.react,Z.a.version),Us(document)},[])}function La(T){var P=Object(oe.useRef)(T);return Object(oe.useEffect)(function(){P.current=T}),P}function Ia(){var T=null;function P(){return Boolean(T)}function K(Te){return Te===T}function ne(Te){T&&te(!1);var Se={abandon:Te};return T=Se,Se}function le(){T||te(!1),T=null}function ue(){T&&(T.abandon(),le())}return{isClaimed:P,isActive:K,claim:ne,release:le,tryAbandon:ue}}var Fs=9,Go=13,wr=27,zo=32,Bs=33,Dl=34,ro=35,Vo=36,js=37,Pl=38,Ws=39,Ll=40,ao,oo=(ao={},ao[Go]=!0,ao[Fs]=!0,ao),Xo=function(T){oo[T.keyCode]&&T.preventDefault()},so=function(){var T="visibilitychange";if(typeof document=="undefined")return T;var P=[T,"ms"+T,"webkit"+T,"moz"+T,"o"+T],K=tt(P,function(ne){return"on"+ne in document});return K||T}(),Hs=0,$o=5;function ca(T,P){return Math.abs(P.x-T.x)>=$o||Math.abs(P.y-T.y)>=$o}var lo={type:"IDLE"};function uo(T){var P=T.cancel,K=T.completed,ne=T.getPhase,le=T.setPhase;return[{eventName:"mousemove",fn:function(Te){var Se=Te.button,He=Te.clientX,et=Te.clientY;if(Se!==Hs)return;var rt={x:He,y:et},Ge=ne();if(Ge.type==="DRAGGING"){Te.preventDefault(),Ge.actions.move(rt);return}Ge.type==="PENDING"||te(!1);var Ke=Ge.point;if(!ca(Ke,rt))return;Te.preventDefault();var Qe=Ge.actions.fluidLift(rt);le({type:"DRAGGING",actions:Qe})}},{eventName:"mouseup",fn:function(Te){var Se=ne();if(Se.type!=="DRAGGING"){P();return}Te.preventDefault(),Se.actions.drop({shouldBlockNextClick:!0}),K()}},{eventName:"mousedown",fn:function(Te){ne().type==="DRAGGING"&&Te.preventDefault(),P()}},{eventName:"keydown",fn:function(Te){var Se=ne();if(Se.type==="PENDING"){P();return}if(Te.keyCode===wr){Te.preventDefault(),P();return}Xo(Te)}},{eventName:"resize",fn:P},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){ne().type==="PENDING"&&P()}},{eventName:"webkitmouseforcedown",fn:function(Te){var Se=ne();if(Se.type!=="IDLE"||te(!1),Se.actions.shouldRespectForcePress()){P();return}Te.preventDefault()}},{eventName:so,fn:P}]}function Ks(T){var P=Object(oe.useRef)(lo),K=Object(oe.useRef)(xe),ne=D(function(){return{eventName:"mousedown",fn:function(Ge){if(Ge.defaultPrevented)return;if(Ge.button!==Hs)return;if(Ge.ctrlKey||Ge.metaKey||Ge.shiftKey||Ge.altKey)return;var Ke=T.findClosestDraggableId(Ge);if(!Ke)return;var Qe=T.tryGetLock(Ke,Te,{sourceEvent:Ge});if(!Qe)return;Ge.preventDefault();var Rt={x:Ge.clientX,y:Ge.clientY};K.current(),et(Qe,Rt)}}},[T]),le=D(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(Ge){if(Ge.defaultPrevented)return;var Ke=T.findClosestDraggableId(Ge);if(!Ke)return;var Qe=T.findOptionsForDraggable(Ke);if(!Qe)return;if(Qe.shouldRespectForcePress)return;if(!T.canGetLock(Ke))return;Ge.preventDefault()}}},[T]),ue=m(function(){var Ge={passive:!1,capture:!0};K.current=Ce(window,[le,ne],Ge)},[le,ne]),Te=m(function(){var rt=P.current;if(rt.type==="IDLE")return;P.current=lo,K.current(),ue()},[ue]),Se=m(function(){var rt=P.current;Te(),rt.type==="DRAGGING"&&rt.actions.cancel({shouldBlockNextClick:!0}),rt.type==="PENDING"&&rt.actions.abort()},[Te]),He=m(function(){var Ge={capture:!0,passive:!1},Ke=uo({cancel:Se,completed:Te,getPhase:function(){return P.current},setPhase:function(Rt){P.current=Rt}});K.current=Ce(window,Ke,Ge)},[Se,Te]),et=m(function(Ge,Ke){P.current.type==="IDLE"||te(!1),P.current={type:"PENDING",point:Ke,actions:Ge},He()},[He]);tr(function(){return ue(),function(){K.current()}},[ue])}var Br;function Gs(){}var Il=(Br={},Br[Dl]=!0,Br[Bs]=!0,Br[Vo]=!0,Br[ro]=!0,Br);function zs(T,P){function K(){P(),T.cancel()}function ne(){P(),T.drop()}return[{eventName:"keydown",fn:function(ue){if(ue.keyCode===wr){ue.preventDefault(),K();return}if(ue.keyCode===zo){ue.preventDefault(),ne();return}if(ue.keyCode===Ll){ue.preventDefault(),T.moveDown();return}if(ue.keyCode===Pl){ue.preventDefault(),T.moveUp();return}if(ue.keyCode===Ws){ue.preventDefault(),T.moveRight();return}if(ue.keyCode===js){ue.preventDefault(),T.moveLeft();return}if(Il[ue.keyCode]){ue.preventDefault();return}Xo(ue)}},{eventName:"mousedown",fn:K},{eventName:"mouseup",fn:K},{eventName:"click",fn:K},{eventName:"touchstart",fn:K},{eventName:"resize",fn:K},{eventName:"wheel",fn:K,options:{passive:!0}},{eventName:so,fn:K}]}function nr(T){var P=Object(oe.useRef)(Gs),K=D(function(){return{eventName:"keydown",fn:function(ue){if(ue.defaultPrevented)return;if(ue.keyCode!==zo)return;var Te=T.findClosestDraggableId(ue);if(!Te)return;var Se=T.tryGetLock(Te,rt,{sourceEvent:ue});if(!Se)return;ue.preventDefault();var He=!0,et=Se.snapLift();P.current();function rt(){He||te(!1),He=!1,P.current(),ne()}P.current=Ce(window,zs(et,rt),{capture:!0,passive:!1})}}},[T]),ne=m(function(){var ue={passive:!1,capture:!0};P.current=Ce(window,[K],ue)},[K]);tr(function(){return ne(),function(){P.current()}},[ne])}var ha={type:"IDLE"},Vs=120,Xs=.15;function $s(T){var P=T.cancel,K=T.getPhase;return[{eventName:"orientationchange",fn:P},{eventName:"resize",fn:P},{eventName:"contextmenu",fn:function(le){le.preventDefault()}},{eventName:"keydown",fn:function(le){if(K().type!=="DRAGGING"){P();return}le.keyCode===wr&&le.preventDefault(),P()}},{eventName:so,fn:P}]}function fa(T){var P=T.cancel,K=T.completed,ne=T.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(ue){var Te=ne();if(Te.type!=="DRAGGING"){P();return}Te.hasMoved=!0;var Se=ue.touches[0],He=Se.clientX,et=Se.clientY,rt={x:He,y:et};ue.preventDefault(),Te.actions.move(rt)}},{eventName:"touchend",fn:function(ue){var Te=ne();if(Te.type!=="DRAGGING"){P();return}ue.preventDefault(),Te.actions.drop({shouldBlockNextClick:!0}),K()}},{eventName:"touchcancel",fn:function(ue){if(ne().type!=="DRAGGING"){P();return}ue.preventDefault(),P()}},{eventName:"touchforcechange",fn:function(ue){var Te=ne();Te.type!=="IDLE"||te(!1);var Se=ue.touches[0];if(!Se)return;var He=Se.force>=Xs;if(!He)return;var et=Te.actions.shouldRespectForcePress();if(Te.type==="PENDING"){et&&P();return}if(et){if(Te.hasMoved){ue.preventDefault();return}P();return}ue.preventDefault()}},{eventName:so,fn:P}]}function co(T){var P=Object(oe.useRef)(ha),K=Object(oe.useRef)(xe),ne=m(function(){return P.current},[]),le=m(function(Qe){P.current=Qe},[]),ue=D(function(){return{eventName:"touchstart",fn:function(Qe){if(Qe.defaultPrevented)return;var Rt=T.findClosestDraggableId(Qe);if(!Rt)return;var Rn=T.tryGetLock(Rt,Se,{sourceEvent:Qe});if(!Rn)return;var Nn=Qe.touches[0],ai=Nn.clientX,ui=Nn.clientY,Ti={x:ai,y:ui};K.current(),Ge(Rn,Ti)}}},[T]),Te=m(function(){var Qe={capture:!0,passive:!1};K.current=Ce(window,[ue],Qe)},[ue]),Se=m(function(){var Ke=P.current;if(Ke.type==="IDLE")return;Ke.type==="PENDING"&&clearTimeout(Ke.longPressTimerId),le(ha),K.current(),Te()},[Te,le]),He=m(function(){var Ke=P.current;Se(),Ke.type==="DRAGGING"&&Ke.actions.cancel({shouldBlockNextClick:!0}),Ke.type==="PENDING"&&Ke.actions.abort()},[Se]),et=m(function(){var Qe={capture:!0,passive:!1},Rt={cancel:He,completed:Se,getPhase:ne},Rn=Ce(window,fa(Rt),Qe),Nn=Ce(window,$s(Rt),Qe);K.current=function(){Rn(),Nn()}},[He,ne,Se]),rt=m(function(){var Qe=ne();Qe.type==="PENDING"||te(!1);var Rt=Qe.actions.fluidLift(Qe.point);le({type:"DRAGGING",actions:Rt,hasMoved:!1})},[ne,le]),Ge=m(function(Qe,Rt){ne().type==="IDLE"||te(!1);var Rn=setTimeout(rt,Vs);le({type:"PENDING",point:Rt,actions:Qe,longPressTimerId:Rn}),et()},[et,ne,le,rt]);tr(function(){return Te(),function(){K.current();var Rt=ne();Rt.type==="PENDING"&&(clearTimeout(Rt.longPressTimerId),le(ha))}},[ne,Te,le]),tr(function(){var Qe=Ce(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return Qe},[])}function Ys(T){Pa(function(){var P=La(T);da(function(){P.current.length===T.length||te(!1)})})}var Qs={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function Yo(T,P){if(P==null)return!1;var K=Boolean(Qs[P.tagName.toLowerCase()]);if(K)return!0;var ne=P.getAttribute("contenteditable");return ne==="true"||ne===""?!0:P===T?!1:Yo(T,P.parentElement)}function pa(T,P){var K=P.target;return Ra(K)?Yo(T,K):!1}var qs=function(T){return f(T.getBoundingClientRect()).center};function ho(T){return T instanceof Ps(T).Element}var Js=function(){var T="matches";if(typeof document=="undefined")return T;var P=[T,"msMatchesSelector","webkitMatchesSelector"],K=tt(P,function(ne){return ne in Element.prototype});return K||T}();function ma(T,P){return T==null?null:T[Js](P)?T:ma(T.parentElement,P)}function kl(T,P){return T.closest?T.closest(P):ma(T,P)}function ga(T){return"["+la.contextId+'="'+T+'"]'}function Zs(T,P){var K=P.target;if(!ho(K))return null;var ne=ga(T),le=kl(K,ne);return le&&Ra(le)?le:null}function el(T,P){var K=Zs(T,P);return K?K.getAttribute(la.draggableId):null}function tl(T,P){var K="["+Bo.contextId+'="'+T+'"]',ne=bt(document.querySelectorAll(K)),le=tt(ne,function(ue){return ue.getAttribute(Bo.id)===P});return le&&Ra(le)?le:null}function ka(T){T.preventDefault()}function jr(T){var P=T.expected,K=T.phase,ne=T.isLockActive,le=T.shouldWarn;return ne()?!(P!==K):!1}function va(T){var P=T.lockAPI,K=T.store,ne=T.registry,le=T.draggableId;if(P.isClaimed())return!1;var ue=ne.draggable.findById(le);return ue&&ue.options.isEnabled?!!No(K.getState(),le):!1}function Ma(T){var P=T.lockAPI,K=T.contextId,ne=T.store,le=T.registry,ue=T.draggableId,Te=T.forceSensorStop,Se=T.sourceEvent,He=va({lockAPI:P,store:ne,registry:le,draggableId:ue});if(!He)return null;var et=le.draggable.getById(ue),rt=tl(K,et.descriptor.id);if(!rt)return null;if(Se&&!et.options.canDragInteractiveElements&&pa(rt,Se))return null;var Ge=P.claim(Te||xe),Ke="PRE_DRAG";function Qe(){return et.options.shouldRespectForcePress}function Rt(){return P.isActive(Ge)}function Rn(Pi,Bi){jr({expected:Pi,phase:Ke,isLockActive:Rt,shouldWarn:!0})&&ne.dispatch(Bi())}var Nn=Rn.bind(null,"DRAGGING");function ai(Pi){function Bi(){P.release(),Ke="COMPLETED"}Ke!=="PRE_DRAG"&&(Bi(),Ke==="PRE_DRAG"||te(!1)),ne.dispatch(Sn(Pi.liftActionArgs)),Ke="DRAGGING";function $i(e,n){if(n===void 0&&(n={shouldBlockNextClick:!1}),Pi.cleanup(),n.shouldBlockNextClick){var s=Ce(window,[{eventName:"click",fn:ka,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(s)}Bi(),ne.dispatch(Sr({reason:e}))}return Object(ee.a)({isActive:function(){return jr({expected:"DRAGGING",phase:Ke,isLockActive:Rt,shouldWarn:!1})},shouldRespectForcePress:Qe,drop:function(n){return $i("DROP",n)},cancel:function(n){return $i("CANCEL",n)}},Pi.actions)}function ui(Pi){var Bi=g(function(e){Nn(function(){return si({client:e})})}),$i=ai({liftActionArgs:{id:ue,clientSelection:Pi,movementMode:"FLUID"},cleanup:function(){return Bi.cancel()},actions:{move:Bi}});return Object(ee.a)({},$i,{move:Bi})}function Ti(){var Pi={moveUp:function(){return Nn(xi)},moveRight:function(){return Nn(Vi)},moveDown:function(){return Nn(Ui)},moveLeft:function(){return Nn(Fi)}};return ai({liftActionArgs:{id:ue,clientSelection:qs(rt),movementMode:"SNAP"},cleanup:xe,actions:Pi})}function li(){var Pi=jr({expected:"PRE_DRAG",phase:Ke,isLockActive:Rt,shouldWarn:!0});Pi&&P.release()}var ki={isActive:function(){return jr({expected:"PRE_DRAG",phase:Ke,isLockActive:Rt,shouldWarn:!1})},shouldRespectForcePress:Qe,fluidLift:ui,snapLift:Ti,abort:li};return ki}var nl=[Ks,nr,co];function Ml(T){var P=T.contextId,K=T.store,ne=T.registry,le=T.customSensors,ue=T.enableDefaultSensors,Te=[].concat(ue?nl:[],le||[]),Se=Object(oe.useState)(function(){return Ia()})[0],He=m(function(ui,Ti){ui.isDragging&&!Ti.isDragging&&Se.tryAbandon()},[Se]);tr(function(){var ui=K.getState(),Ti=K.subscribe(function(){var li=K.getState();He(ui,li),ui=li});return Ti},[Se,K,He]),tr(function(){return Se.tryAbandon},[Se.tryAbandon]);var et=m(function(ai){return va({lockAPI:Se,registry:ne,store:K,draggableId:ai})},[Se,ne,K]),rt=m(function(ai,ui,Ti){return Ma({lockAPI:Se,registry:ne,contextId:P,store:K,draggableId:ai,forceSensorStop:ui,sourceEvent:Ti&&Ti.sourceEvent?Ti.sourceEvent:null})},[P,Se,ne,K]),Ge=m(function(ai){return el(P,ai)},[P]),Ke=m(function(ai){var ui=ne.draggable.findById(ai);return ui?ui.options:null},[ne.draggable]),Qe=m(function(){if(!Se.isClaimed())return;Se.tryAbandon(),K.getState().phase!=="IDLE"&&K.dispatch(Ii())},[Se,K]),Rt=m(Se.isClaimed,[Se]),Rn=D(function(){return{canGetLock:et,tryGetLock:rt,findClosestDraggableId:Ge,findOptionsForDraggable:Ke,tryReleaseLock:Qe,isLockClaimed:Rt}},[et,rt,Ge,Ke,Qe,Rt]);Ys(Te);for(var Nn=0;Nn<Te.length;Nn++)Te[Nn](Rn)}var il=function(P){return{onBeforeCapture:P.onBeforeCapture,onBeforeDragStart:P.onBeforeDragStart,onDragStart:P.onDragStart,onDragEnd:P.onDragEnd,onDragUpdate:P.onDragUpdate}};function br(T){return T.current||te(!1),T.current}function _a(T){var P=T.contextId,K=T.setCallbacks,ne=T.sensors,le=T.nonce,ue=T.dragHandleUsageInstructions,Te=Object(oe.useRef)(null);Al();var Se=La(T),He=m(function(){return il(Se.current)},[Se]),et=Ho(P),rt=Ms({contextId:P,text:ue}),Ge=Sl(P,le),Ke=m(function(e){br(Te).dispatch(e)},[]),Qe=D(function(){return Object(W.b)({publishWhileDragging:ii,updateDroppableScroll:Li,updateDroppableIsEnabled:ji,updateDroppableIsCombineEnabled:bi,collectionStarting:On},Ke)},[Ke]),Rt=Ol(),Rn=D(function(){return Mo(Rt,Qe)},[Rt,Qe]),Nn=D(function(){return wl(Object(ee.a)({scrollWindow:Es,scrollDroppable:Rn.scrollDroppable},Object(W.b)({move:si},Ke)))},[Rn.scrollDroppable,Ke]),ai=Ls(P),ui=D(function(){return Nr({announce:et,autoScroller:Nn,dimensionMarshal:Rn,focusMarshal:ai,getResponders:He,styleMarshal:Ge})},[et,Nn,Rn,ai,He,Ge]);Te.current=ui;var Ti=m(function(){var e=br(Te),n=e.getState();n.phase!=="IDLE"&&e.dispatch(Ii())},[]),li=m(function(){var e=br(Te).getState();return e.isDragging||e.phase==="DROP_ANIMATING"},[]),ki=D(function(){return{isDragging:li,tryAbort:Ti}},[li,Ti]);K(ki);var Pi=m(function(e){return No(br(Te).getState(),e)},[]),Bi=m(function(){return Cn(br(Te).getState())},[]),$i=D(function(){return{marshal:Rn,focus:ai,contextId:P,canLift:Pi,isMovementAllowed:Bi,dragHandleUsageInstructionsId:rt,registry:Rt}},[P,Rn,rt,ai,Pi,Bi,Rt]);return Ml({contextId:P,store:ui,registry:Rt,customSensors:ne,enableDefaultSensors:T.enableDefaultSensors!==!1}),Object(oe.useEffect)(function(){return Ti},[Ti]),Z.a.createElement(io.Provider,{value:$i},Z.a.createElement(M.a,{context:Aa,store:ui},T.children))}var ya=0;function Nl(){ya=0}function rl(){return D(function(){return""+ya++},[])}function ru(){Nl(),Rl()}function Ul(T){var P=rl(),K=T.dragHandleUsageInstructions||_t.dragHandleUsageInstructions;return Z.a.createElement(fe,null,function(ne){return Z.a.createElement(_a,{nonce:T.nonce,contextId:P,setCallbacks:ne,dragHandleUsageInstructions:K,enableDefaultSensors:T.enableDefaultSensors,sensors:T.sensors,onBeforeCapture:T.onBeforeCapture,onBeforeDragStart:T.onBeforeDragStart,onDragStart:T.onDragStart,onDragUpdate:T.onDragUpdate,onDragEnd:T.onDragEnd},T.children)})}var Qo=function(P){return function(K){return P===K}},ur=Qo("scroll"),al=Qo("auto"),Fl=Qo("visible"),ol=function(P,K){return K(P.overflowX)||K(P.overflowY)},Bl=function(P,K){return K(P.overflowX)&&K(P.overflowY)},qo=function(P){var K=window.getComputedStyle(P),ne={overflowX:K.overflowX,overflowY:K.overflowY};return ol(ne,ur)||ol(ne,al)},sl=function(){return!1;var P,K;if(!qo(P))return!1;var ne,le;if(Bl(le,Fl))return!1},Jo=function T(P){return P==null?null:P===document.body?sl()?P:null:P===document.documentElement?null:qo(P)?P:T(P.parentElement)},au=function(T){if(!T)return;var P=Jo(T.parentElement);if(!P)return},Zo=function(T){return{x:T.scrollLeft,y:T.scrollTop}},jl=function T(P){if(!P)return!1;var K=window.getComputedStyle(P);return K.position==="fixed"?!0:T(P.parentElement)},Wr=function(T){var P=Jo(T),K=jl(T);return{closestScrollable:P,isFixedOnPage:K}},Na=function(T){var P=T.descriptor,K=T.isEnabled,ne=T.isCombineEnabled,le=T.isFixedOnPage,ue=T.direction,Te=T.client,Se=T.page,He=T.closest,et=function(){if(!He)return null;var Qe=He.scrollSize,Rt=He.client,Rn=Io({scrollHeight:Qe.scrollHeight,scrollWidth:Qe.scrollWidth,height:Rt.paddingBox.height,width:Rt.paddingBox.width});return{pageMarginBox:He.page.marginBox,frameClient:Rt,scrollSize:Qe,shouldClipSubject:He.shouldClipSubject,scroll:{initial:He.scroll,current:He.scroll,max:Rn,diff:{value:lt,displacement:lt}}}}(),rt=ue==="vertical"?ti:Oi,Ge=me({page:Se,withPlaceholder:null,axis:rt,frame:et}),Ke={descriptor:P,isCombineEnabled:ne,isFixedOnPage:le,axis:rt,isEnabled:K,client:Te,page:Se,frame:et,subject:Ge};return Ke},fo=function(P,K){var ne=O(P);if(!K)return ne;if(P!==K)return ne;var le=ne.paddingBox.top-K.scrollTop,ue=ne.paddingBox.left-K.scrollLeft,Te=le+K.scrollHeight,Se=ue+K.scrollWidth,He={top:le,right:Se,bottom:Te,left:ue},et=o(He,ne.border),rt=t({borderBox:et,margin:ne.margin,border:ne.border,padding:ne.padding});return rt},Ua=function(T){var P=T.ref,K=T.descriptor,ne=T.env,le=T.windowScroll,ue=T.direction,Te=T.isDropDisabled,Se=T.isCombineEnabled,He=T.shouldClipSubject,et=ne.closestScrollable,rt=fo(P,et),Ge=S(rt,le),Ke=function(){if(!et)return null;var Rt=O(et),Rn={scrollHeight:et.scrollHeight,scrollWidth:et.scrollWidth};return{client:Rt,page:S(Rt,le),scroll:Zo(et),scrollSize:Rn,shouldClipSubject:He}}(),Qe=Na({descriptor:K,isEnabled:!Te,isCombineEnabled:Se,isFixedOnPage:ne.isFixedOnPage,direction:ue,client:rt,page:Ge,closest:Ke});return Qe},Lr={passive:!1},Wl={passive:!0},ll=function(T){return T.shouldPublishImmediately?Lr:Wl};function Ir(T){var P=Object(oe.useContext)(T);return P||te(!1),P}var Fa=function(P){return P&&P.env.closestScrollable||null};function ul(T){var P=Object(oe.useRef)(null),K=Ir(io),ne=ua("droppable"),le=K.registry,ue=K.marshal,Te=La(T),Se=D(function(){return{id:T.droppableId,type:T.type,mode:T.mode}},[T.droppableId,T.mode,T.type]),He=Object(oe.useRef)(Se),et=D(function(){return d(function(li,ki){P.current||te(!1);var Pi={x:li,y:ki};ue.updateDroppableScroll(Se.id,Pi)})},[Se.id,ue]),rt=m(function(){var li=P.current;return!li||!li.env.closestScrollable?lt:Zo(li.env.closestScrollable)},[]),Ge=m(function(){var li=rt();et(li.x,li.y)},[rt,et]),Ke=D(function(){return g(Ge)},[Ge]),Qe=m(function(){var li=P.current,ki=Fa(li);li&&ki||te(!1);var Pi=li.scrollOptions;if(Pi.shouldPublishImmediately){Ge();return}Ke()},[Ke,Ge]),Rt=m(function(li,ki){P.current&&te(!1);var Pi=Te.current,Bi=Pi.getDroppableRef();Bi||te(!1);var $i=Wr(Bi),e={ref:Bi,descriptor:Se,env:$i,scrollOptions:ki};P.current=e;var n=Ua({ref:Bi,descriptor:Se,env:$i,windowScroll:li,direction:Pi.direction,isDropDisabled:Pi.isDropDisabled,isCombineEnabled:Pi.isCombineEnabled,shouldClipSubject:!Pi.ignoreContainerClipping}),s=$i.closestScrollable;return s&&(s.setAttribute(Ds.contextId,K.contextId),s.addEventListener("scroll",Qe,ll(e.scrollOptions))),n},[K.contextId,Se,Qe,Te]),Rn=m(function(){var li=P.current,ki=Fa(li);return li&&ki||te(!1),Zo(ki)},[]),Nn=m(function(){var li=P.current;li||te(!1);var ki=Fa(li);if(P.current=null,!ki)return;Ke.cancel(),ki.removeAttribute(Ds.contextId),ki.removeEventListener("scroll",Qe,ll(li.scrollOptions))},[Qe,Ke]),ai=m(function(li){var ki=P.current;ki||te(!1);var Pi=Fa(ki);Pi||te(!1),Pi.scrollTop+=li.y,Pi.scrollLeft+=li.x},[]),ui=D(function(){return{getDimensionAndWatchScroll:Rt,getScrollWhileDragging:Rn,dragStopped:Nn,scroll:ai}},[Nn,Rt,Rn,ai]),Ti=D(function(){return{uniqueId:ne,descriptor:Se,callbacks:ui}},[ui,Se,ne]);tr(function(){return He.current=Ti.descriptor,le.droppable.register(Ti),function(){P.current&&Nn(),le.droppable.unregister(Ti)}},[ui,Se,Nn,Ti,ue,le.droppable]),tr(function(){if(!P.current)return;ue.updateDroppableIsEnabled(He.current.id,!T.isDropDisabled)},[T.isDropDisabled,ue]),tr(function(){if(!P.current)return;ue.updateDroppableIsCombineEnabled(He.current.id,T.isCombineEnabled)},[T.isCombineEnabled,ue])}function po(){}var Ba={width:0,height:0,margin:mt},ba=function(P){var K=P.isAnimatingOpenOnMount,ne=P.placeholder,le=P.animate;return K||le==="close"?Ba:{height:ne.client.borderBox.height,width:ne.client.borderBox.width,margin:ne.client.margin}},es=function(P){var K=P.isAnimatingOpenOnMount,ne=P.placeholder,le=P.animate,ue=ba({isAnimatingOpenOnMount:K,placeholder:ne,animate:le});return{display:ne.display,boxSizing:"border-box",width:ue.width,height:ue.height,marginTop:ue.margin.top,marginRight:ue.margin.right,marginBottom:ue.margin.bottom,marginLeft:ue.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:le!=="none"?qr.placeholder:null}};function ts(T){var P=Object(oe.useRef)(null),K=m(function(){if(!P.current)return;clearTimeout(P.current),P.current=null},[]),ne=T.animate,le=T.onTransitionEnd,ue=T.onClose,Te=T.contextId,Se=Object(oe.useState)(T.animate==="open"),He=Se[0],et=Se[1];Object(oe.useEffect)(function(){return He?ne!=="open"?(K(),et(!1),po):P.current?po:(P.current=setTimeout(function(){P.current=null,et(!1)}),K):po},[ne,He,K]);var rt=m(function(Ke){if(Ke.propertyName!=="height")return;le(),ne==="close"&&ue()},[ne,ue,le]),Ge=es({isAnimatingOpenOnMount:He,animate:T.animate,placeholder:T.placeholder});return Z.a.createElement(T.placeholder.tagName,{style:Ge,"data-rbd-placeholder-context-id":Te,onTransitionEnd:rt,ref:T.innerRef})}var ns=Z.a.memo(ts),is=Z.a.createContext(null);function Ea(T){T&&Ra(T)||te(!1)}function mo(T){return typeof T=="boolean"}function rs(T,P){P.forEach(function(K){return K(T)})}var dl=[function(P){var K=P.props;K.droppableId||te(!1),typeof K.droppableId=="string"||te(!1)},function(P){var K=P.props;mo(K.isDropDisabled)||te(!1),mo(K.isCombineEnabled)||te(!1),mo(K.ignoreContainerClipping)||te(!1)},function(P){var K=P.getDroppableRef;Ea(K())}],go=[function(P){var K=P.props,ne=P.getPlaceholderRef;if(!K.placeholder)return;var le=ne();if(le)return}],Hl=[function(P){var K=P.props;K.renderClone||te(!1)},function(P){var K=P.getPlaceholderRef;K()&&te(!1)}];function Kl(T){da(function(){rs(T,dl),T.props.mode==="standard"&&rs(T,go),T.props.mode==="virtual"&&rs(T,Hl)})}var ja=function(T){Object(U.a)(P,T);function P(){for(var ne,le=arguments.length,ue=new Array(le),Te=0;Te<le;Te++)ue[Te]=arguments[Te];return ne=T.call.apply(T,[this].concat(ue))||this,ne.state={isVisible:Boolean(ne.props.on),data:ne.props.on,animate:ne.props.shouldAnimate&&ne.props.on?"open":"none"},ne.onClose=function(){if(ne.state.animate!=="close")return;ne.setState({isVisible:!1})},ne}P.getDerivedStateFromProps=function(le,ue){return le.shouldAnimate?le.on?{isVisible:!0,data:le.on,animate:"open"}:ue.isVisible?{isVisible:!0,data:ue.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(le.on),data:le.on,animate:"none"}};var K=P.prototype;return K.render=function(){if(!this.state.isVisible)return null;var le={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(le)},P}(Z.a.PureComponent),as={dragging:5e3,dropAnimating:4500},cl=function(P,K){return K?qr.drop(K.duration):P?qr.snap:qr.fluid},Gl=function(P,K){return P?K?Kr.opacity.drop:Kr.opacity.combining:null},os=function(P){return P.forceShouldAnimate!=null?P.forceShouldAnimate:P.mode==="SNAP"};function hl(T){var P=T.dimension,K=P.client,ne=T.offset,le=T.combineWith,ue=T.dropping,Te=Boolean(le),Se=os(T),He=Boolean(ue),et=He?Eo.drop(ne,Te):Eo.moveTo(ne),rt={position:"fixed",top:K.marginBox.top,left:K.marginBox.left,boxSizing:"border-box",width:K.borderBox.width,height:K.borderBox.height,transition:cl(Se,ue),transform:et,opacity:Gl(Te,He),zIndex:He?as.dropAnimating:as.dragging,pointerEvents:"none"};return rt}function zl(T){return{transform:Eo.moveTo(T.offset),transition:T.shouldAnimateDisplacement?null:"none"}}function fl(T){return T.type==="DRAGGING"?hl(T):zl(T)}function pl(T,P,K){K===void 0&&(K=lt);var ne=window.getComputedStyle(P),le=P.getBoundingClientRect(),ue=w(le,ne),Te=S(ue,K),Se={client:ue,tagName:P.tagName.toLowerCase(),display:ne.display},He={x:ue.marginBox.width,y:ue.marginBox.height},et={descriptor:T,placeholder:Se,displaceBy:He,client:ue,page:Te};return et}function Vl(T){var P=ua("draggable"),K=T.descriptor,ne=T.registry,le=T.getDraggableRef,ue=T.canDragInteractiveElements,Te=T.shouldRespectForcePress,Se=T.isEnabled,He=D(function(){return{canDragInteractiveElements:ue,shouldRespectForcePress:Te,isEnabled:Se}},[ue,Se,Te]),et=m(function(Qe){var Rt=le();return Rt||te(!1),pl(K,Rt,Qe)},[K,le]),rt=D(function(){return{uniqueId:P,descriptor:K,options:He,getDimension:et}},[K,et,He,P]),Ge=Object(oe.useRef)(rt),Ke=Object(oe.useRef)(!0);tr(function(){return ne.draggable.register(Ge.current),function(){return ne.draggable.unregister(Ge.current)}},[ne.draggable]),tr(function(){if(Ke.current){Ke.current=!1;return}var Qe=Ge.current;Ge.current=rt,ne.draggable.update(rt,Qe)},[rt,ne.draggable])}function ss(T,P,K){da(function(){function ne(ue){return"Draggable[id: "+ue+"]: "}var le=T.draggableId;if(le||te(!1),typeof le=="string"||te(!1),Re(T.index)||te(!1),T.mapped.type==="DRAGGING")return;Ea(K()),T.isEnabled&&(no(P,le)||te(!1))})}function Wa(T){Pa(function(){var P=Object(oe.useRef)(T);da(function(){T===P.current||te(!1)},[T])})}function Ha(T){T.preventDefault()}function Xl(T){var P=Object(oe.useRef)(null),K=m(function(e){P.current=e},[]),ne=m(function(){return P.current},[]),le=Ir(io),ue=le.contextId,Te=le.dragHandleUsageInstructionsId,Se=le.registry,He=Ir(is),et=He.type,rt=He.droppableId,Ge=D(function(){return{id:T.draggableId,index:T.index,type:et,droppableId:rt}},[T.draggableId,T.index,et,rt]),Ke=T.children,Qe=T.draggableId,Rt=T.isEnabled,Rn=T.shouldRespectForcePress,Nn=T.canDragInteractiveElements,ai=T.isClone,ui=T.mapped,Ti=T.dropAnimationFinished;if(ss(T,ue,ne),Wa(ai),!ai){var li=D(function(){return{descriptor:Ge,registry:Se,getDraggableRef:ne,canDragInteractiveElements:Nn,shouldRespectForcePress:Rn,isEnabled:Rt}},[Ge,Se,ne,Nn,Rn,Rt]);Vl(li)}var ki=D(function(){return Rt?{tabIndex:0,role:"button","aria-describedby":Te,"data-rbd-drag-handle-draggable-id":Qe,"data-rbd-drag-handle-context-id":ue,draggable:!1,onDragStart:Ha}:null},[ue,Te,Qe,Rt]),Pi=m(function(e){if(ui.type!=="DRAGGING")return;if(!ui.dropping)return;if(e.propertyName!=="transform")return;Ti()},[Ti,ui]),Bi=D(function(){var e=fl(ui),n=ui.type==="DRAGGING"&&ui.dropping?Pi:null,s={innerRef:K,draggableProps:{"data-rbd-draggable-context-id":ue,"data-rbd-draggable-id":Qe,style:e,onTransitionEnd:n},dragHandleProps:ki};return s},[ue,ki,Qe,ui,Pi,K]),$i=D(function(){return{draggableId:Ge.id,type:Ge.type,source:{index:Ge.index,droppableId:Ge.droppableId}}},[Ge.droppableId,Ge.id,Ge.index,Ge.type]);return Ke(Bi,ui.snapshot,$i)}var ls=function(T,P){return T===P},ml=function(T){var P=T.combine,K=T.destination;return K?K.droppableId:P?P.droppableId:null},$l=function(P){return P.combine?P.combine.draggableId:null},Yl=function(P){return P.at&&P.at.type==="COMBINE"?P.at.combine.draggableId:null};function Ql(){var T=d(function(le,ue){return{x:le,y:ue}}),P=d(function(le,ue,Te,Se,He){return{isDragging:!0,isClone:ue,isDropAnimating:Boolean(He),dropAnimation:He,mode:le,draggingOver:Te,combineWith:Se,combineTargetFor:null}}),K=d(function(le,ue,Te,Se,He,et,rt){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:He,combineWith:et,mode:ue,offset:le,dimension:Te,forceShouldAnimate:rt,snapshot:P(ue,Se,He,et,null)}}}),ne=function(ue,Te){if(ue.isDragging){if(ue.critical.draggable.id!==Te.draggableId)return null;var Se=ue.current.client.offset,He=ue.dimensions.draggables[Te.draggableId],et=tn(ue.impact),rt=Yl(ue.impact),Ge=ue.forceShouldAnimate;return K(T(Se.x,Se.y),ue.movementMode,He,Te.isClone,et,rt,Ge)}if(ue.phase==="DROP_ANIMATING"){var Ke=ue.completed;if(Ke.result.draggableId!==Te.draggableId)return null;var Qe=Te.isClone,Rt=ue.dimensions.draggables[Te.draggableId],Rn=Ke.result,Nn=Rn.mode,ai=ml(Rn),ui=$l(Rn),Ti=ue.dropDuration,li={duration:Ti,curve:Xa.drop,moveTo:ue.newHomeClientOffset,opacity:ui?Kr.opacity.drop:null,scale:ui?Kr.scale.drop:null};return{mapped:{type:"DRAGGING",offset:ue.newHomeClientOffset,dimension:Rt,dropping:li,draggingOver:ai,combineWith:ui,mode:Nn,forceShouldAnimate:null,snapshot:P(Nn,Qe,ai,ui,li)}}}return null};return ne}function us(T){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:T,combineWith:null}}var ql={mapped:{type:"SECONDARY",offset:lt,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:us(null)}};function Jl(){var T=d(function(Te,Se){return{x:Te,y:Se}}),P=d(us),K=d(function(Te,Se,He){return Se===void 0&&(Se=null),{mapped:{type:"SECONDARY",offset:Te,combineTargetFor:Se,shouldAnimateDisplacement:He,snapshot:P(Se)}}}),ne=function(Se){return Se?K(lt,Se,!0):null},le=function(Se,He,et,rt){var Ge=et.displaced.visible[Se],Ke=Boolean(rt.inVirtualList&&rt.effected[Se]),Qe=dn(et),Rt=Qe&&Qe.draggableId===Se?He:null;if(!Ge){if(!Ke)return ne(Rt);if(et.displaced.invisible[Se])return null;var Rn=rn(rt.displacedBy.point),Nn=T(Rn.x,Rn.y);return K(Nn,Rt,!0)}if(Ke)return ne(Rt);var ai=et.displacedBy.point,ui=T(ai.x,ai.y);return K(ui,Rt,Ge.shouldAnimate)},ue=function(Se,He){if(Se.isDragging)return Se.critical.draggable.id===He.draggableId?null:le(He.draggableId,Se.critical.draggable.id,Se.impact,Se.afterCritical);if(Se.phase==="DROP_ANIMATING"){var et=Se.completed;return et.result.draggableId===He.draggableId?null:le(He.draggableId,et.result.draggableId,et.impact,et.afterCritical)}return null};return ue}var gl=function(){var P=Ql(),K=Jl(),ne=function(ue,Te){return P(ue,Te)||K(ue,Te)||ql};return ne},ds={dropAnimationFinished:er},vl=Object(M.c)(gl,ds,null,{context:Aa,pure:!0,areStatePropsEqual:ls})(Xl);function _l(T){var P=Ir(is),K=P.isUsingCloneFor;return K===T.draggableId&&!T.isClone?null:Z.a.createElement(vl,T)}function yl(T){var P=typeof T.isDragDisabled=="boolean"?!T.isDragDisabled:!0,K=Boolean(T.disableInteractiveElementBlocking),ne=Boolean(T.shouldRespectForcePress);return Z.a.createElement(_l,Object(ee.a)({},T,{isClone:!1,isEnabled:P,canDragInteractiveElements:K,shouldRespectForcePress:ne}))}function xa(T){var P=Object(oe.useContext)(io);P||te(!1);var K=P.contextId,ne=P.isMovementAllowed,le=Object(oe.useRef)(null),ue=Object(oe.useRef)(null),Te=T.children,Se=T.droppableId,He=T.type,et=T.mode,rt=T.direction,Ge=T.ignoreContainerClipping,Ke=T.isDropDisabled,Qe=T.isCombineEnabled,Rt=T.snapshot,Rn=T.useClone,Nn=T.updateViewportMaxScroll,ai=T.getContainerForClone,ui=m(function(){return le.current},[]),Ti=m(function(a){le.current=a},[]),li=m(function(){return ue.current},[]),ki=m(function(a){ue.current=a},[]);Kl({props:T,getDroppableRef:ui,getPlaceholderRef:li});var Pi=m(function(){ne()&&Nn({maxScroll:ko()})},[ne,Nn]);ul({droppableId:Se,type:He,mode:et,direction:rt,isDropDisabled:Ke,isCombineEnabled:Qe,ignoreContainerClipping:Ge,getDroppableRef:ui});var Bi=Z.a.createElement(ja,{on:T.placeholder,shouldAnimate:T.shouldAnimatePlaceholder},function(a){var p=a.onClose,j=a.data,J=a.animate;return Z.a.createElement(ns,{placeholder:j,onClose:p,innerRef:ki,animate:J,contextId:K,onTransitionEnd:Pi})}),$i=D(function(){return{innerRef:Ti,placeholder:Bi,droppableProps:{"data-rbd-droppable-id":Se,"data-rbd-droppable-context-id":K}}},[K,Se,Bi,Ti]),e=Rn?Rn.dragging.draggableId:null,n=D(function(){return{droppableId:Se,type:He,isUsingCloneFor:e}},[Se,e,He]);function s(){if(!Rn)return null;var a=Rn.dragging,p=Rn.render,j=Z.a.createElement(_l,{draggableId:a.draggableId,index:a.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(J,ie){return p(J,ie,a)});return F.a.createPortal(j,ai())}return Z.a.createElement(is.Provider,{value:n},Te($i,Rt),s())}var vo=function(P,K){return P===K.droppable.type},Ka=function(P,K){return K.draggables[P.draggable.id]},Zl=function(){var P={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},K=Object(ee.a)({},P,{shouldAnimatePlaceholder:!1}),ne=d(function(Te){return{draggableId:Te.id,type:Te.type,source:{index:Te.index,droppableId:Te.droppableId}}}),le=d(function(Te,Se,He,et,rt,Ge){var Ke=rt.descriptor.id,Qe=rt.descriptor.droppableId===Te;if(Qe){var Rt=Ge?{render:Ge,dragging:ne(rt.descriptor)}:null,Rn={isDraggingOver:He,draggingOverWith:He?Ke:null,draggingFromThisWith:Ke,isUsingPlaceholder:!0};return{placeholder:rt.placeholder,shouldAnimatePlaceholder:!1,snapshot:Rn,useClone:Rt}}if(!Se)return K;if(!et)return P;var Nn={isDraggingOver:He,draggingOverWith:Ke,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:rt.placeholder,shouldAnimatePlaceholder:!0,snapshot:Nn,useClone:null}}),ue=function(Se,He){var et=He.droppableId,rt=He.type,Ge=!He.isDropDisabled,Ke=He.renderClone;if(Se.isDragging){var Qe=Se.critical;if(!vo(rt,Qe))return K;var Rt=Ka(Qe,Se.dimensions),Rn=tn(Se.impact)===et;return le(et,Ge,Rn,Rn,Rt,Ke)}if(Se.phase==="DROP_ANIMATING"){var Nn=Se.completed;if(!vo(rt,Nn.critical))return K;var ai=Ka(Nn.critical,Se.dimensions);return le(et,Ge,ml(Nn.result)===et,tn(Nn.impact)===et,ai,Ke)}if(Se.phase==="IDLE"&&Se.completed&&!Se.shouldFlush){var ui=Se.completed;if(!vo(rt,ui.critical))return K;var Ti=tn(ui.impact)===et,li=Boolean(ui.impact.at&&ui.impact.at.type==="COMBINE"),ki=ui.critical.droppable.id===et;return Ti?li?P:K:ki?P:K}return K};return ue},eu={updateViewportMaxScroll:yi};function tu(){return document.body||te(!1),document.body}var Hi={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:tu},bl=Object(M.c)(Zl,eu,null,{context:Aa,pure:!0,areStatePropsEqual:ls})(xa);bl.defaultProps=Hi},osHv:function(Wt,st,z){(function(oe){oe(z("VrN/"))})(function(oe){"use strict";var Z=oe.Pos;function U(i,t){return i.line-t.line||i.ch-t.ch}var ee="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",W=ee+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",M=new RegExp("<(/?)(["+ee+"]["+W+"]*)","g");function $(i,t,c,h){this.line=t,this.ch=c,this.cm=i,this.text=i.getLine(t),this.min=h?Math.max(h.from,i.firstLine()):i.firstLine(),this.max=h?Math.min(h.to-1,i.lastLine()):i.lastLine()}function X(i,t){var c=i.cm.getTokenTypeAt(Z(i.line,t));return c&&/\btag\b/.test(c)}function k(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function D(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function m(i){for(;;){var t=i.text.indexOf(">",i.ch);if(t==-1){if(k(i))continue;return}if(!X(i,t+1)){i.ch=t+1;continue}var c=i.text.lastIndexOf("/",t),h=c>-1&&!/\S/.test(i.text.slice(c+1,t));return i.ch=t+1,h?"selfClose":"regular"}}function v(i){for(;;){var t=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(t==-1){if(D(i))continue;return}if(!X(i,t+1)){i.ch=t;continue}M.lastIndex=t,i.ch=t;var c=M.exec(i.text);if(c&&c.index==t)return c}}function f(i){for(;;){M.lastIndex=i.ch;var t=M.exec(i.text);if(!t){if(k(i))continue;return}if(!X(i,t.index+1)){i.ch=t.index+1;continue}return i.ch=t.index+t[0].length,t}}function o(i){for(;;){var t=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(t==-1){if(D(i))continue;return}if(!X(i,t+1)){i.ch=t;continue}var c=i.text.lastIndexOf("/",t),h=c>-1&&!/\S/.test(i.text.slice(c+1,t));return i.ch=t+1,h?"selfClose":"regular"}}function l(i,t){for(var c=[];;){var h=f(i),A,S=i.line,w=i.ch-(h?h[0].length:0);if(!h||!(A=m(i)))return;if(A=="selfClose")continue;if(h[1]){for(var O=c.length-1;O>=0;--O)if(c[O]==h[2]){c.length=O;break}if(O<0&&(!t||t==h[2]))return{tag:h[2],from:Z(S,w),to:Z(i.line,i.ch)}}else c.push(h[2])}}function r(i,t){for(var c=[];;){var h=o(i);if(!h)return;if(h=="selfClose"){v(i);continue}var A=i.line,S=i.ch,w=v(i);if(!w)return;if(w[1])c.push(w[2]);else{for(var O=c.length-1;O>=0;--O)if(c[O]==w[2]){c.length=O;break}if(O<0&&(!t||t==w[2]))return{tag:w[2],from:Z(i.line,i.ch),to:Z(A,S)}}}}oe.registerHelper("fold","xml",function(i,t){for(var c=new $(i,t.line,0);;){var h=f(c);if(!h||c.line!=t.line)return;var A=m(c);if(!A)return;if(!h[1]&&A!="selfClose"){var S=Z(c.line,c.ch),w=l(c,h[2]);return w&&U(w.from,S)>0?{from:S,to:w.from}:null}}}),oe.findMatchingTag=function(i,t,c){var h=new $(i,t.line,t.ch,c);if(h.text.indexOf(">")==-1&&h.text.indexOf("<")==-1)return;var A=m(h),S=A&&Z(h.line,h.ch),w=A&&v(h);if(!A||!w||U(h,t)>0)return;var O={from:Z(h.line,h.ch),to:S,tag:w[2]};return A=="selfClose"?{open:O,close:null,at:"open"}:w[1]?{open:r(h,w[2]),close:O,at:"close"}:(h=new $(i,S.line,S.ch,c),{open:O,close:l(h,w[2]),at:"open"})},oe.findEnclosingTag=function(i,t,c,h){for(var A=new $(i,t.line,t.ch,c);;){var S=r(A,h);if(!S)break;var w=new $(i,t.line,t.ch,c),O=l(w,S.tag);if(O)return{open:S,close:O}}},oe.scanForClosingTag=function(i,t,c,h){var A=new $(i,t.line,t.ch,h?{from:0,to:h}:null);return l(A,c)}})},p5ED:function(Wt,st,z){"use strict";var oe=z("+L6B"),Z=z("2/Rp"),U=z("5Dmo"),ee=z("3S7+"),W=z("k1fw"),M=z("tJVT"),$=z("q1tI"),X=z.n($),k=z("vHTk"),D=z.n(k),m=z("yEEn"),v=z("ZW9T"),f=z("1vsH");st.a=function(o){var l=o.name,r=o.data,i=o.theme,t=o.type,c=o.filename,h=o.monacoEditor,A=o.className,S=o.style,w=o.close,O=o.onClose,R=o.hasMask,b=Object($.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),_=Object(M.a)(b,2),u=_[0],d=_[1],E=Object($.useState)(""),g=Object(M.a)(E,2),y=g[0],F=g[1],N,H=1024*1024,G=10*H,I=Object($.useRef)();t==="office"&&(N=Object(f.T)(r).filesize,N>G&&(t="other")),c&&(h.filename=c),Object($.useEffect)(function(){var Y,re,de=(Y=document.cookie)===null||Y===void 0||((re=Y.replace(/\s/g,""))===null||re===void 0)?void 0:re.split(";");de==null||de.map(function(he){var xe=he.split("=");xe[0]==="_educoder_session"&&F(xe[1])})},[]);var x=function(){if(r.startsWith("http")||r.startsWith("/")){B();return}Object(f.z)(c||"educoder",r,c)},B=function(){Object(f.x)(c||l,r)};return console.log("data:",r,"fileanme:",c," name:",l),X.a.createElement("div",{style:Object(W.a)({},S||{}),className:"".concat(R&&D.a.bgBlack," ").concat(t?D.a.wrp:"hide")},w&&X.a.createElement("div",{className:D.a.close,ref:I},X.a.createElement(ee.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return I.current}},X.a.createElement("span",{onClick:B},X.a.createElement("i",{className:"icon-quxiaozhiding"}))),X.a.createElement(ee.a,{title:"\u5173\u95ED",getPopupContainer:function(){return I.current}},X.a.createElement("span",{className:"",onClick:O},X.a.createElement("i",{className:"icon-guanbi1"})))),X.a.createElement("div",{className:"".concat(D.a[A]," ").concat(A," ").concat(D.a.monaco," ").concat(t==="txt"?"show":"hide")},t==="txt"&&X.a.createElement(v.b,h)),t==="audio"&&X.a.createElement("audio",{src:"".concat(r!=null&&r.startsWith("/")||(r==null?void 0:r.indexOf("https://"))>-1?r:"data:audio/mp3;base64,").concat(r),autoPlay:!0}),t==="video"&&X.a.createElement(X.a.Fragment,null,r!=null&&r.startsWith("/")?X.a.createElement("video",{controls:!0,src:"".concat(r),autoPlay:!0}):X.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(r),autoPlay:!0})),t==="html"&&X.a.createElement("iframe",{src:r+"&disposition=inline"}),t==="pdf"&&X.a.createElement("embed",{className:D.a.embed,src:r}),t==="image"&&X.a.createElement(X.a.Fragment,null,X.a.createElement("img",{src:"".concat(r!=null&&r.startsWith("/")||(r==null?void 0:r.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(r)})),t==="other"&&X.a.createElement("div",null,X.a.createElement(Z.a,{type:"primary",size:"large",onClick:x},X.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(t==="download"||t==="office")&&X.a.createElement(Z.a,{type:"primary",size:"large",onClick:x},X.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Wt,st,z){},psGv:function(Wt,st,z){var oe,Z;(function(){var U;(function(){"use strict";var $=[,,function(m){function v(l){this.__parent=l,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=[]}v.prototype.clone_empty=function(){var l=new v(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},v.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},v.prototype.has_match=function(l){for(var r=this.__items.length-1;r>=0;r--)if(this.__items[r].match(l))return!0;return!1},v.prototype.set_indent=function(l,r){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=r||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},v.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)},v.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},v.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var l=this.__parent.current_line;return l.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),l.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),l.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,l.__items[0]===" "&&(l.__items.splice(0,1),l.__character_count-=1),!0}return!1},v.prototype.is_empty=function(){return this.__items.length===0},v.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},v.prototype.push=function(l){this.__items.push(l);var r=l.lastIndexOf(`
`);r!==-1?this.__character_count=l.length-r:this.__character_count+=l.length},v.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},v.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},v.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},v.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},v.prototype.toString=function(){var l="";return this.is_empty()?this.__parent.indent_empty_lines&&(l=this.__parent.get_indent_string(this.__indent_count)):(l=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),l+=this.__items.join("")),l};function f(l,r){this.__cache=[""],this.__indent_size=l.indent_size,this.__indent_string=l.indent_char,l.indent_with_tabs||(this.__indent_string=new Array(l.indent_size+1).join(l.indent_char)),r=r||"",l.indent_level>0&&(r=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=r,this.__base_string_length=r.length}f.prototype.get_indent_size=function(l,r){var i=this.__base_string_length;return r=r||0,l<0&&(i=0),i+=l*this.__indent_size,i+=r,i},f.prototype.get_indent_string=function(l,r){var i=this.__base_string;return r=r||0,l<0&&(l=0,i=""),r+=l*this.__indent_size,this.__ensure_cache(r),i+=this.__cache[r],i},f.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var l=this.__cache.length,r=0,i="";this.__indent_size&&l>=this.__indent_size&&(r=Math.floor(l/this.__indent_size),l-=r*this.__indent_size,i=new Array(r+1).join(this.__indent_string)),l&&(i+=new Array(l+1).join(" ")),this.__cache.push(i)};function o(l,r){this.__indent_cache=new f(l,r),this.raw=!1,this._end_with_newline=l.end_with_newline,this.indent_size=l.indent_size,this.wrap_line_length=l.wrap_line_length,this.indent_empty_lines=l.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new v(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}o.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},o.prototype.get_line_number=function(){return this.__lines.length},o.prototype.get_indent_string=function(l,r){return this.__indent_cache.get_indent_string(l,r)},o.prototype.get_indent_size=function(l,r){return this.__indent_cache.get_indent_size(l,r)},o.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},o.prototype.add_new_line=function(l){return this.is_empty()||!l&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},o.prototype.get_code=function(l){this.trim(!0);var r=this.current_line.pop();r&&(r[r.length-1]===`
`&&(r=r.replace(/\n+$/g,"")),this.current_line.push(r)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return l!==`
`&&(i=i.replace(/[\n]/g,l)),i},o.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},o.prototype.set_indent=function(l,r){return l=l||0,r=r||0,this.next_line.set_indent(l,r),this.__lines.length>1?(this.current_line.set_indent(l,r),!0):(this.current_line.set_indent(),!1)},o.prototype.add_raw_token=function(l){for(var r=0;r<l.newlines;r++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(l.whitespace_before),this.current_line.push(l.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},o.prototype.add_token=function(l){this.__add_space_before_token(),this.current_line.push(l),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},o.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(" "))},o.prototype.remove_indent=function(l){for(var r=this.__lines.length;l<r;)this.__lines[l]._remove_indent(),l++;this.current_line._remove_wrap_indent()},o.prototype.trim=function(l){for(l=l===void 0?!1:l,this.current_line.trim();l&&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},o.prototype.just_added_newline=function(){return this.current_line.is_empty()},o.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},o.prototype.ensure_empty_line_above=function(l,r){for(var i=this.__lines.length-2;i>=0;){var t=this.__lines[i];if(t.is_empty())break;if(t.item(0).indexOf(l)!==0&&t.item(-1)!==r){this.__lines.splice(i+1,0,new v(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},m.exports.Output=o},function(m){function v(f,o,l,r){this.type=f,this.text=o,this.comments_before=null,this.newlines=l||0,this.whitespace_before=r||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}m.exports.Token=v},,,function(m){function v(l,r){this.raw_options=f(l,r),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}v.prototype._get_array=function(l,r){var i=this.raw_options[l],t=r||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(t=i.concat()):typeof i=="string"&&(t=i.split(/[^a-zA-Z0-9_\/\-]+/)),t},v.prototype._get_boolean=function(l,r){var i=this.raw_options[l],t=i===void 0?!!r:!!i;return t},v.prototype._get_characters=function(l,r){var i=this.raw_options[l],t=r||"";return typeof i=="string"&&(t=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),t},v.prototype._get_number=function(l,r){var i=this.raw_options[l];r=parseInt(r,10),isNaN(r)&&(r=0);var t=parseInt(i,10);return isNaN(t)&&(t=r),t},v.prototype._get_selection=function(l,r,i){var t=this._get_selection_list(l,r,i);if(t.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
`+r+`
You passed in: '`+this.raw_options[l]+"'");return t[0]},v.prototype._get_selection_list=function(l,r,i){if(!r||r.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[r[0]],!this._is_valid_selection(i,r))throw new Error("Invalid Default Value!");var t=this._get_array(l,i);if(!this._is_valid_selection(t,r))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
`+r+`
You passed in: '`+this.raw_options[l]+"'");return t},v.prototype._is_valid_selection=function(l,r){return l.length&&r.length&&!l.some(function(i){return r.indexOf(i)===-1})};function f(l,r){var i={};l=o(l);var t;for(t in l)t!==r&&(i[t]=l[t]);if(r&&l[r])for(t in l[r])i[t]=l[r][t];return i}function o(l){var r={},i;for(i in l){var t=i.replace(/-/g,"_");r[t]=l[i]}return r}m.exports.Options=v,m.exports.normalizeOpts=o,m.exports.mergeOpts=f},,function(m){var v=RegExp.prototype.hasOwnProperty("sticky");function f(o){this.__input=o||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position<this.__input_length},f.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__input.charAt(this.__position),this.__position+=1),o},f.prototype.peek=function(o){var l=null;return o=o||0,o+=this.__position,o>=0&&o<this.__input_length&&(l=this.__input.charAt(o)),l},f.prototype.__match=function(o,l){o.lastIndex=l;var r=o.exec(this.__input);return r&&!(v&&o.sticky)&&(r.index!==l&&(r=null)),r},f.prototype.test=function(o,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(o,l):!1},f.prototype.testChar=function(o,l){var r=this.peek(l);return o.lastIndex=0,r!==null&&o.test(r)},f.prototype.match=function(o){var l=this.__match(o,this.__position);return l?this.__position+=l[0].length:l=null,l},f.prototype.read=function(o,l,r){var i="",t;return o&&(t=this.match(o),t&&(i+=t[0])),l&&(t||!o)&&(i+=this.readUntil(l,r)),i},f.prototype.readUntil=function(o,l){var r="",i=this.__position;o.lastIndex=this.__position;var t=o.exec(this.__input);return t?(i=t.index,l&&(i+=t[0].length)):i=this.__input_length,r=this.__input.substring(this.__position,i),this.__position=i,r},f.prototype.readUntilAfter=function(o){return this.readUntil(o,!0)},f.prototype.get_regexp=function(o,l){var r=null,i="g";return l&&v&&(i="y"),typeof o=="string"&&o!==""?r=new RegExp(o,i):o&&(r=new RegExp(o.source,i)),r},f.prototype.get_literal_regexp=function(o){return RegExp(o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},f.prototype.peekUntilAfter=function(o){var l=this.__position,r=this.readUntilAfter(o);return this.__position=l,r},f.prototype.lookBack=function(o){var l=this.__position-1;return l>=o.length&&this.__input.substring(l-o.length,l).toLowerCase()===o},m.exports.InputScanner=f},function(m,v,f){var o=f(8).InputScanner,l=f(3).Token,r=f(10).TokenStream,i=f(11).WhitespacePattern,t={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},c=function(h,A){this._input=new o(h),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};c.prototype.tokenize=function(){this._input.restart(),this.__tokens=new r,this._reset();for(var h,A=new l(t.START,""),S=null,w=[],O=new r;A.type!==t.EOF;){for(h=this._get_next_token(A,S);this._is_comment(h);)O.add(h),h=this._get_next_token(A,S);O.isEmpty()||(h.comments_before=O,O=new r),h.parent=S,this._is_opening(h)?(w.push(S),S=h):S&&this._is_closing(h,S)&&(h.opened=S,S.closed=h,S=w.pop(),h.parent=S),h.previous=A,A.next=h,this.__tokens.add(h),A=h}return this.__tokens},c.prototype._is_first_token=function(){return this.__tokens.isEmpty()},c.prototype._reset=function(){},c.prototype._get_next_token=function(h,A){this._readWhitespace();var S=this._input.read(/.+/g);return S?this._create_token(t.RAW,S):this._create_token(t.EOF,"")},c.prototype._is_comment=function(h){return!1},c.prototype._is_opening=function(h){return!1},c.prototype._is_closing=function(h,A){return!1},c.prototype._create_token=function(h,A){var S=new l(h,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return S},c.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},m.exports.Tokenizer=c,m.exports.TOKEN=t},function(m){function v(f){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=f}v.prototype.restart=function(){this.__position=0},v.prototype.isEmpty=function(){return this.__tokens_length===0},v.prototype.hasNext=function(){return this.__position<this.__tokens_length},v.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__tokens[this.__position],this.__position+=1),f},v.prototype.peek=function(f){var o=null;return f=f||0,f+=this.__position,f>=0&&f<this.__tokens_length&&(o=this.__tokens[f]),o},v.prototype.add=function(f){this.__parent_token&&(f.parent=this.__parent_token),this.__tokens.push(f),this.__tokens_length+=1},m.exports.TokenStream=v},function(m,v,f){var o=f(12).Pattern;function l(r,i){o.call(this,r,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}l.prototype=new o,l.prototype.__set_whitespace_patterns=function(r,i){r+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+r+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},l.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var r=this._input.read(this._match_pattern);if(r===" ")this.whitespace_before_token=" ";else if(r){var i=this.__split(this._newline_regexp,r);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return r},l.prototype.matching=function(r,i){var t=this._create();return t.__set_whitespace_patterns(r,i),t._update(),t},l.prototype._create=function(){return new l(this._input,this)},l.prototype.__split=function(r,i){r.lastIndex=0;for(var t=0,c=[],h=r.exec(i);h;)c.push(i.substring(t,h.index)),t=h.index+h[0].length,h=r.exec(i);return t<i.length?c.push(i.substring(t,i.length)):c.push(""),c},m.exports.WhitespacePattern=l},function(m){function v(f,o){this._input=f,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,o&&(this._starting_pattern=this._input.get_regexp(o._starting_pattern,!0),this._match_pattern=this._input.get_regexp(o._match_pattern,!0),this._until_pattern=this._input.get_regexp(o._until_pattern),this._until_after=o._until_after)}v.prototype.read=function(){var f=this._input.read(this._starting_pattern);return(!this._starting_pattern||f)&&(f+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),f},v.prototype.read_match=function(){return this._input.match(this._match_pattern)},v.prototype.until_after=function(f){var o=this._create();return o._until_after=!0,o._until_pattern=this._input.get_regexp(f),o._update(),o},v.prototype.until=function(f){var o=this._create();return o._until_after=!1,o._until_pattern=this._input.get_regexp(f),o._update(),o},v.prototype.starting_with=function(f){var o=this._create();return o._starting_pattern=this._input.get_regexp(f,!0),o._update(),o},v.prototype.matching=function(f){var o=this._create();return o._match_pattern=this._input.get_regexp(f,!0),o._update(),o},v.prototype._create=function(){return new v(this._input,this)},v.prototype._update=function(){},m.exports.Pattern=v},function(m){function v(f,o){f=typeof f=="string"?f:f.source,o=typeof o=="string"?o:o.source,this.__directives_block_pattern=new RegExp(f+/ beautify( \w+[:]\w+)+ /.source+o,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(f+/\sbeautify\signore:end\s/.source+o,"g")}v.prototype.get_directives=function(f){if(!f.match(this.__directives_block_pattern))return null;var o={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(f);l;)o[l[1]]=l[2],l=this.__directive_pattern.exec(f);return o},v.prototype.readIgnored=function(f){return f.readUntilAfter(this.__directives_end_ignore_pattern)},m.exports.Directives=v},function(m,v,f){var o=f(12).Pattern,l={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function r(i,t){o.call(this,i,t),this.__template_pattern=null,this._disabled=Object.assign({},l),this._excluded=Object.assign({},l),t&&(this.__template_pattern=this._input.get_regexp(t.__template_pattern),this._excluded=Object.assign(this._excluded,t._excluded),this._disabled=Object.assign(this._disabled,t._disabled));var c=new o(i);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}/)}}r.prototype=new o,r.prototype._create=function(){return new r(this._input,this)},r.prototype._update=function(){this.__set_templated_pattern()},r.prototype.disable=function(i){var t=this._create();return t._disabled[i]=!0,t._update(),t},r.prototype.read_options=function(i){var t=this._create();for(var c in l)t._disabled[c]=i.templating.indexOf(c)===-1;return t._update(),t},r.prototype.exclude=function(i){var t=this._create();return t._excluded[i]=!0,t._update(),t},r.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),i+=t,t=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},r.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},r.prototype._read_template=function(){var i="",t=this._input.peek();if(t==="<"){var c=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&c==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&c==="%"&&(i=i||this.__patterns.erb.read())}else t==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},m.exports.TemplatablePattern=r},,,,function(m,v,f){var o=f(19).Beautifier,l=f(20).Options;function r(i,t,c,h){var A=new o(i,t,c,h);return A.beautify()}m.exports=r,m.exports.defaultOptions=function(){return new l}},function(m,v,f){var o=f(20).Options,l=f(2).Output,r=f(21).Tokenizer,i=f(21).TOKEN,t=/\r\n|[\r\n]/,c=/\r\n|[\r\n]/g,h=function(E,g){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new l(E,g)};h.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},h.prototype.set_space_before_token=function(E,g){this._output.space_before_token=E,this._output.non_breaking_space=g},h.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},h.prototype.add_raw_token=function(E){this._output.add_raw_token(E)},h.prototype.print_preserved_newlines=function(E){var g=0;E.type!==i.TEXT&&E.previous.type!==i.TEXT&&(g=E.newlines?1:0),this.preserve_newlines&&(g=E.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var y=0;y<g;y++)this.print_newline(y>0);return g!==0},h.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(this._output.space_before_token=!0),!0):!1},h.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},h.prototype.print_newline=function(E){this._output.add_new_line(E)},h.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},h.prototype.indent=function(){this.indent_level++},h.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var A=function(E){for(var g=null,y=E.next;y.type!==i.EOF&&E.closed!==y;){if(y.type===i.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===i.EQUALS&&y.next.next&&y.next.next.type===i.VALUE&&(g=y.next.next.text);break}y=y.next}return g},S=function(E,g){var y=null,F=null;return g.closed?(E==="script"?y="text/javascript":E==="style"&&(y="text/css"),y=A(g)||y,y.search("text/css")>-1?F="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?F="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?F="html":y.search(/test\/null/)>-1&&(F="null"),F):null};function w(E,g){return g.indexOf(E)!==-1}function O(E,g,y){this.parent=E||null,this.tag=g?g.tag_name:"",this.indent_level=y||0,this.parser_token=g||null}function R(E){this._printer=E,this._current_frame=null}R.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},R.prototype.record_tag=function(E){var g=new O(this._current_frame,E,this._printer.indent_level);this._current_frame=g},R.prototype._try_pop_frame=function(E){var g=null;return E&&(g=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),g},R.prototype._get_frame=function(E,g){for(var y=this._current_frame;y&&!(E.indexOf(y.tag)!==-1);){if(g&&g.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},R.prototype.try_pop=function(E,g){var y=this._get_frame([E],g);return this._try_pop_frame(y)},R.prototype.indent_to_tag=function(E){var g=this._get_frame(E);g&&(this._printer.indent_level=g.indent_level)};function b(E,g,y,F){this._source_text=E||"",g=g||{},this._js_beautify=y,this._css_beautify=F,this._tag_stack=null;var N=new o(g,"html");this._options=N,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"}b.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,g=this._options.eol;this._options.eol==="auto"&&(g=`
`,E&&t.test(E)&&(g=E.match(t)[0])),E=E.replace(c,`
`);var y=E.match(/^[\t ]*/)[0],F={text:"",type:""},N=new _,H=new h(this._options,y),G=new r(E,this._options).tokenize();this._tag_stack=new R(H);for(var I=null,x=G.next();x.type!==i.EOF;)x.type===i.TAG_OPEN||x.type===i.COMMENT?(I=this._handle_tag_open(H,x,N,F),N=I):x.type===i.ATTRIBUTE||x.type===i.EQUALS||x.type===i.VALUE||x.type===i.TEXT&&!N.tag_complete?I=this._handle_inside_tag(H,x,N,G):x.type===i.TAG_CLOSE?I=this._handle_tag_close(H,x,N):x.type===i.TEXT?I=this._handle_text(H,x,N):H.add_raw_token(x),F=I,x=G.next();var B=H._output.get_code(g);return B},b.prototype._handle_tag_close=function(E,g,y){var F={text:g.text,type:g.type};return E.alignment_size=0,y.tag_complete=!0,E.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),y.is_unformatted?E.add_raw_token(g):(y.tag_start_char==="<"&&(E.set_space_before_token(g.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(g)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(E.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&E.set_wrap_point(),F},b.prototype._handle_inside_tag=function(E,g,y,F){var N=y.has_wrapped_attrs,H={text:g.text,type:g.type};if(E.set_space_before_token(g.newlines||g.whitespace_before!=="",!0),y.is_unformatted)E.add_raw_token(g);else if(y.tag_start_char==="{"&&g.type===i.TEXT)E.print_preserved_newlines(g)?(g.newlines=0,E.add_raw_token(g)):E.print_token(g);else{if(g.type===i.ATTRIBUTE?(E.set_space_before_token(!0),y.attr_count+=1):(g.type===i.EQUALS||g.type===i.VALUE&&g.previous.type===i.EQUALS)&&E.set_space_before_token(!1),g.type===i.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(g),N=N||g.newlines!==0),this._is_wrap_attributes_force)){var G=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var I=!0,x=0,B;do{if(B=F.peek(x),B.type===i.ATTRIBUTE){I=!1;break}x+=1}while(x<4&&B.type!==i.EOF&&B.type!==i.TAG_CLOSE);G=!I}G&&(E.print_newline(!1),N=!0)}E.print_token(g),N=N||E.previous_token_wrapped(),y.has_wrapped_attrs=N}return H},b.prototype._handle_text=function(E,g,y){var F={text:g.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(E,g,y):y.is_unformatted||y.is_content_unformatted?E.add_raw_token(g):(E.traverse_whitespace(g),E.print_token(g)),F},b.prototype._print_custom_beatifier_text=function(E,g,y){var F=this;if(g.text!==""){var N=g.text,H,G=1,I="",x="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?H=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?H=this._css_beautify:y.custom_beautifier_name==="html"&&(H=function(xe,Pe){var Ce=new b(xe,Pe,F._js_beautify,F._css_beautify);return Ce.beautify()}),this._options.indent_scripts==="keep"?G=0:this._options.indent_scripts==="separate"&&(G=-E.indent_level);var B=E.get_full_indent(G);if(N=N.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&N[0]==="<"&&N.match(/^(<!--|<!\[CDATA\[)/)){var Y=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(N);if(!Y){E.add_raw_token(g);return}I=B+Y[1]+`
`,N=Y[4],Y[5]&&(x=B+Y[5]),N=N.replace(/\n[ \t]*$/,""),(Y[2]||Y[3].indexOf(`
`)!==-1)&&(Y=Y[3].match(/[ \t]+$/),Y&&(g.whitespace_before=Y[0]))}if(N)if(H){var re=function(){this.eol=`
`};re.prototype=this._options.raw_options;var de=new re;N=H(B+N,de)}else{var he=g.whitespace_before;he&&(N=N.replace(new RegExp(`
(`+he+")?","g"),`
`)),N=B+N.replace(/\n/g,`
`+B)}I&&(N?N=I+N+`
`+x:N=I+x),E.print_newline(!1),N&&(g.text=N,g.whitespace_before="",g.newlines=0,E.add_raw_token(g),E.print_newline(!0))}},b.prototype._handle_tag_open=function(E,g,y,F){var N=this._get_tag_open_token(g);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&g.type===i.TAG_OPEN&&g.text.indexOf("</")===0?(E.add_raw_token(g),N.start_tag_token=this._tag_stack.try_pop(N.tag_name)):(E.traverse_whitespace(g),this._set_tag_position(E,g,N,y,F),N.is_inline_element||E.set_wrap_point(),E.print_token(g)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(N.alignment_size=g.text.length+1),!N.tag_complete&&!N.is_unformatted&&(E.alignment_size=N.alignment_size),N};var _=function(E,g){if(this.parent=E||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!g)this.tag_complete=!0;else{var y;this.tag_start_char=g.text[0],this.text=g.text,this.tag_start_char==="<"?(y=g.text.match(/^<([^\s>]*)/),this.tag_check=y?y[1]:""):(y=g.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[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===i.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 F=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(F=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(F)))}};b.prototype._get_tag_open_token=function(E){var g=new _(this._tag_stack.get_parser_token(),E);return g.alignment_size=this._options.wrap_attributes_indent_size,g.is_end_tag=g.is_end_tag||w(g.tag_check,this._options.void_elements),g.is_empty_element=g.tag_complete||g.is_start_tag&&g.is_end_tag,g.is_unformatted=!g.tag_complete&&w(g.tag_check,this._options.unformatted),g.is_content_unformatted=!g.is_empty_element&&w(g.tag_check,this._options.content_unformatted),g.is_inline_element=w(g.tag_name,this._options.inline)||g.tag_name.includes("-")||g.tag_start_char==="{",g},b.prototype._set_tag_position=function(E,g,y,F,N){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=S(y.tag_check,g)))),w(y.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var H=E.current_line_has_match(/{{#if/);H||E.print_newline(!1)}y.tag_name==="!--"&&N.type===i.TAG_CLOSE&&F.is_end_tag&&y.text.indexOf(`
`)===-1||(y.is_inline_element||y.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,y))}else if(y.is_end_tag){var G=!1;G=y.start_tag_token&&y.start_tag_token.multiline_content,G=G||!y.is_inline_element&&!(F.is_inline_element||F.is_unformatted)&&!(N.type===i.TAG_CLOSE&&y.start_tag_token===F)&&N.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(G=!1),G&&E.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(N.type!=="TK_CONTENT"||y.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,y)},b.prototype._calcluate_parent_multiline=function(E,g){g.parent&&E._output.just_added_newline()&&!((g.is_inline_element||g.is_unformatted)&&g.parent.is_inline_element)&&(g.parent.multiline_content=!0)};var u=["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"],d=["a","audio","del","ins","map","noscript","video"];b.prototype._do_optional_end_element=function(E){var g=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")g=g||this._tag_stack.try_pop("head");else if(E.tag_name==="li")g=g||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")g=g||this._tag_stack.try_pop("dt",["dl"]),g=g||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&u.indexOf(E.tag_name)!==-1){var y=E.parent.parent;(!y||d.indexOf(y.tag_name)===-1)&&(g=g||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(g=g||this._tag_stack.try_pop("rt",["ruby","rtc"]),g=g||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?g=g||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?g=g||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?g=g||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("thead",["table"]),g=g||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(g=g||this._tag_stack.try_pop("caption",["table"]),g=g||this._tag_stack.try_pop("colgroup",["table"]),g=g||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(g=g||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),g=g||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),g},m.exports.Beautifier=b},function(m,v,f){var o=f(6).Options;function l(r){o.call(this,r,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}l.prototype=new o,m.exports.Options=l},function(m,v,f){var o=f(9).Tokenizer,l=f(9).TOKEN,r=f(13).Directives,i=f(14).TemplatablePattern,t=f(12).Pattern,c={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:l.START,RAW:l.RAW,EOF:l.EOF},h=new r(/<\!--/,/-->/),A=function(S,w){o.call(this,S,w),this._current_tag_name="";var O=new i(this._input).read_options(this._options),R=new t(this._input);if(this.__patterns={word:O.until(/[\n\r\t <]/),single_quote:O.until_after(/'/),double_quote:O.until_after(/"/),attribute:O.until(/[\n\r\t =>]|\/>/),element_name:O.until(/[\n\r\t >\/]/),handlebars_comment:R.starting_with(/{{!--/).until_after(/--}}/),handlebars:R.starting_with(/{{/).until_after(/}}/),handlebars_open:R.until(/[\n\r\t }]/),handlebars_raw_close:R.until(/}}/),comment:R.starting_with(/<!--/).until_after(/-->/),cdata:R.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:R.starting_with(/<!\[/).until_after(/]>/),processing:R.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 b=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=R.matching(b).until_after(b)}};A.prototype=new o,A.prototype._is_comment=function(S){return!1},A.prototype._is_opening=function(S){return S.type===c.TAG_OPEN},A.prototype._is_closing=function(S,w){return S.type===c.TAG_CLOSE&&w&&((S.text===">"||S.text==="/>")&&w.text[0]==="<"||S.text==="}}"&&w.text[0]==="{"&&w.text[1]==="{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(S,w){var O=null;this._readWhitespace();var R=this._input.peek();return R===null?this._create_token(c.EOF,""):(O=O||this._read_open_handlebars(R,w),O=O||this._read_attribute(R,S,w),O=O||this._read_close(R,w),O=O||this._read_raw_content(R,S,w),O=O||this._read_content_word(R),O=O||this._read_comment_or_cdata(R),O=O||this._read_processing(R),O=O||this._read_open(R,w),O=O||this._create_token(c.UNKNOWN,this._input.next()),O)},A.prototype._read_comment_or_cdata=function(S){var w=null,O=null,R=null;if(S==="<"){var b=this._input.peek(1);b==="!"&&(O=this.__patterns.comment.read(),O?(R=h.get_directives(O),R&&R.ignore==="start"&&(O+=h.readIgnored(this._input))):O=this.__patterns.cdata.read()),O&&(w=this._create_token(c.COMMENT,O),w.directives=R)}return w},A.prototype._read_processing=function(S){var w=null,O=null,R=null;if(S==="<"){var b=this._input.peek(1);(b==="!"||b==="?")&&(O=this.__patterns.conditional_comment.read(),O=O||this.__patterns.processing.read()),O&&(w=this._create_token(c.COMMENT,O),w.directives=R)}return w},A.prototype._read_open=function(S,w){var O=null,R=null;return w||S==="<"&&(O=this._input.next(),this._input.peek()==="/"&&(O+=this._input.next()),O+=this.__patterns.element_name.read(),R=this._create_token(c.TAG_OPEN,O)),R},A.prototype._read_open_handlebars=function(S,w){var O=null,R=null;return w||this._options.indent_handlebars&&S==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(O=this.__patterns.handlebars_comment.read(),O=O||this.__patterns.handlebars.read(),R=this._create_token(c.COMMENT,O)):(O=this.__patterns.handlebars_open.read(),R=this._create_token(c.TAG_OPEN,O))),R},A.prototype._read_close=function(S,w){var O=null,R=null;return w&&(w.text[0]==="<"&&(S===">"||S==="/"&&this._input.peek(1)===">")?(O=this._input.next(),S==="/"&&(O+=this._input.next()),R=this._create_token(c.TAG_CLOSE,O)):w.text[0]==="{"&&S==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),R=this._create_token(c.TAG_CLOSE,"}}"))),R},A.prototype._read_attribute=function(S,w,O){var R=null,b="";if(O&&O.text[0]==="<")if(S==="=")R=this._create_token(c.EQUALS,this._input.next());else if(S==='"'||S==="'"){var _=this._input.next();S==='"'?_+=this.__patterns.double_quote.read():_+=this.__patterns.single_quote.read(),R=this._create_token(c.VALUE,_)}else b=this.__patterns.attribute.read(),b&&(w.type===c.EQUALS?R=this._create_token(c.VALUE,b):R=this._create_token(c.ATTRIBUTE,b));return R},A.prototype._is_content_unformatted=function(S){return this._options.void_elements.indexOf(S)===-1&&(this._options.content_unformatted.indexOf(S)!==-1||this._options.unformatted.indexOf(S)!==-1)},A.prototype._read_raw_content=function(S,w,O){var R="";if(O&&O.text[0]==="{")R=this.__patterns.handlebars_raw_close.read();else if(w.type===c.TAG_CLOSE&&w.opened.text[0]==="<"&&w.text[0]!=="/"){var b=w.opened.text.substr(1).toLowerCase();if(b==="script"||b==="style"){var _=this._read_comment_or_cdata(S);if(_)return _.type=c.TEXT,_;R=this._input.readUntil(new RegExp("</"+b+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(b)&&(R=this._input.readUntil(new RegExp("</"+b+"[\\n\\r\\t ]*?>","ig")))}return R?this._create_token(c.TEXT,R):null},A.prototype._read_content_word=function(S){var w="";if(this._options.unformatted_content_delimiter&&(S===this._options.unformatted_content_delimiter[0]&&(w=this.__patterns.unformatted_content_delimiter.read())),w||(w=this.__patterns.word.read()),w)return this._create_token(c.TEXT,w)},m.exports.Tokenizer=A,m.exports.TOKEN=c}],X={};function k(m){var v=X[m];if(v!==void 0)return v.exports;var f=X[m]={exports:{}};return $[m](f,f.exports,k),f.exports}var D=k(18);U=D})();var ee=U;if(!0)!(oe=[z,z("6UM0"),z("TXwP")],Z=function($){var X=z("6UM0"),k=z("TXwP");return{html_beautify:function(D,m){return ee(D,m,X.js_beautify,k.css_beautify)}}}.apply(st,oe),Z!==void 0&&(Wt.exports=Z));else var W,M})()},"rAM+":function(Wt,st,z){"use strict";z.d(st,"a",function(){return Z});var oe=z("Qw5x");function Z(U,ee){var W;if(typeof Symbol=="undefined"||U[Symbol.iterator]==null){if(Array.isArray(U)||(W=Object(oe.a)(U))||ee&&U&&typeof U.length=="number"){W&&(U=W);var M=0,$=function(){};return{s:$,n:function(){return M>=U.length?{done:!0}:{done:!1,value:U[M++]}},e:function(v){throw v},f:$}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var X=!0,k=!1,D;return{s:function(){W=U[Symbol.iterator]()},n:function(){var v=W.next();return X=v.done,v},e:function(v){k=!0,D=v},f:function(){try{!X&&W.return!=null&&W.return()}finally{if(k)throw D}}}}},rUJ1:function(Wt,st){const z=/[&<>"']/,oe=/[&<>"']/g,Z=/[<>"']|&(?!#?\w+;)/,U=/[<>"']|&(?!#?\w+;)/g,ee={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},W=R=>ee[R];function M(R,b){if(b){if(z.test(R))return R.replace(oe,W)}else if(Z.test(R))return R.replace(U,W);return R}const $=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function X(R){return R.replace($,(b,_)=>(_=_.toLowerCase(),_==="colon"?":":_.charAt(0)==="#"?_.charAt(1)==="x"?String.fromCharCode(parseInt(_.substring(2),16)):String.fromCharCode(+_.substring(1)):""))}const k=/(^|[^\[])\^/g;function D(R,b){R=R.source||R,b=b||"";const _={replace:(u,d)=>(d=d.source||d,d=d.replace(k,"$1"),R=R.replace(u,d),_),getRegex:()=>new RegExp(R,b)};return _}const m=/[^\w:]/g,v=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function f(R,b,_){if(R){let u;try{u=decodeURIComponent(X(_)).replace(m,"").toLowerCase()}catch(d){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}b&&!v.test(_)&&(_=t(b,_));try{_=encodeURI(_).replace(/%25/g,"%")}catch(u){return null}return _}const o={},l=/^[^:]+:\/*[^/]*$/,r=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(R,b){o[" "+R]||(l.test(R)?o[" "+R]=R+"/":o[" "+R]=S(R,"/",!0)),R=o[" "+R];const _=R.indexOf(":")===-1;return b.substring(0,2)==="//"?_?b:R.replace(r,"$1")+b:b.charAt(0)==="/"?_?b:R.replace(i,"$1")+b:R+b}const c={exec:function(){}};function h(R){let b=1,_,u;for(;b<arguments.length;b++){_=arguments[b];for(u in _)Object.prototype.hasOwnProperty.call(_,u)&&(R[u]=_[u])}return R}function A(R,b){const _=R.replace(/\|/g,(E,g,y)=>{let F=!1,N=g;for(;--N>=0&&y[N]==="\\";)F=!F;return F?"|":" |"}),u=_.split(/ \|/);let d=0;if(u.length>b)u.splice(b);else for(;u.length<b;)u.push("");for(;d<u.length;d++)u[d]=u[d].trim().replace(/\\\|/g,"|");return u}function S(R,b,_){const u=R.length;if(u===0)return"";let d=0;for(;d<u;){const E=R.charAt(u-d-1);if(E===b&&!_)d++;else if(E!==b&&_)d++;else break}return R.substr(0,u-d)}function w(R,b){if(R.indexOf(b[1])===-1)return-1;const _=R.length;let u=0,d=0;for(;d<_;d++)if(R[d]==="\\")d++;else if(R[d]===b[0])u++;else if(R[d]===b[1]&&(u--,u<0))return d;return-1}function O(R){R&&R.sanitize&&!R.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")}Wt.exports={escape:M,unescape:X,edit:D,cleanUrl:f,resolveUrl:t,noopTest:c,merge:h,splitCells:A,rtrim:S,findClosingBracket:w,checkSanitizeDeprecation:O}},sR1s:function(Wt,st,z){"use strict";z.d(st,"b",function(){return ee}),z.d(st,"a",function(){return W}),z.d(st,"c",function(){return M}),z.d(st,"d",function(){return $});var oe=z("U8pU"),Z="RC_TABLE_KEY";function U(X){return X==null?[]:Array.isArray(X)?X:[X]}function ee(X,k){if(!k&&typeof k!="number")return X;for(var D=U(k),m=X,v=0;v<D.length;v+=1){if(!m)return null;var f=D[v];m=m[f]}return m}function W(X){var k=[],D={};return X.forEach(function(m){for(var v=m||{},f=v.key,o=v.dataIndex,l=f||U(o).join("-")||Z;D[l];)l="".concat(l,"_next");D[l]=!0,k.push(l)}),k}function M(){var X={};function k(f,o){o&&Object.keys(o).forEach(function(l){var r=o[l];r&&Object(oe.a)(r)==="object"?(f[l]=f[l]||{},k(f[l],r)):f[l]=r})}for(var D=arguments.length,m=new Array(D),v=0;v<D;v++)m[v]=arguments[v];return m.forEach(function(f){k(X,f)}),X}function $(X){return X!=null}},sZF6:function(Wt,st,z){"use strict";var oe=z("2qtc"),Z=z("kLXV"),U=z("DZo9"),ee=z("8z0m"),W=z("+L6B"),M=z("2/Rp"),$=z("tJVT"),X=z("q1tI"),k=z.n(X),D=z("xvlK"),m=z("m3rI"),v=z("1vsH"),f=z("Ty5D"),o=z("69hG"),l=z.n(o),r=function(t){var c=t.visible,h=t.onOk,A=t.onCancel,S=Object(X.useState)([]),w=Object($.a)(S,2),O=w[0],R=w[1],b=Object(X.useState)(!1),_=Object($.a)(b,2),u=_[0],d=_[1],E=Object(f.i)();Object(X.useEffect)(function(){c||(R([]),d(!1))},[c]);var g=function(){d(!0),h(O,function(){d(!1)})},y=function(){A()},F=function(){console.log(E,444);var I="".concat(m.a.API_SERVER,"/api/courses/").concat(E.coursesId,"/exercises/down_template");Object(v.x)(null,I)},N=function(I){var x={name:I.name,uid:I.uid,file:I};return R([x]),!1},H=function(){R([])};return k.a.createElement(Z.a,{title:"\u6279\u91CF\u5BFC\u5165\u8BD5\u9898",visible:c,onOk:g,centered:!0,wrapClassName:l.a.customModal,onCancel:y,width:"680px",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",confirmLoading:u},k.a.createElement("div",{className:l.a.content},k.a.createElement("aside",null,k.a.createElement("div",null,"\u6B65\u9AA41\uFF1A"),k.a.createElement("ul",null,k.a.createElement("li",null,"\u4E0B\u8F7D\xA0",k.a.createElement("span",{style:{color:"#0152d9",cursor:"pointer"},onClick:F},"\u8003\u8BD5\u8BD5\u9898\u6A21\u677F"),",\xA0\u6279\u91CF\u5BFC\u5165\u8BD5\u9898\u3002"),k.a.createElement("li",{className:"c-grey-999 mt10"},"\u6CE8\uFF1A\u76EE\u524D\u4EC5\u652F\u6301Excel\u683C\u5F0F\u6A21\u677F\uFF0C\u6BCF\u6B21\u6700\u591A\u5BFC\u5165300\u9898\u3002\u4E0D\u652F\u6301\u7F16\u7A0B\u9898\u548C\u5B9E\u8BAD\u9898\u5BFC\u5165"))),k.a.createElement("aside",{className:"mt30"},k.a.createElement("div",null,"\u6B65\u9AA42\uFF1A"),k.a.createElement("ul",{style:{flex:1}},k.a.createElement("li",null,"\u4E0A\u4F20\u586B\u5199\u597D\u7684\u8BD5\u9898\u8868"),c&&k.a.createElement(ee.a,{action:"".concat(m.a.API_SERVER,"/api/attachments.json"),beforeUpload:N,onRemove:H,withCredentials:!0,fileList:O,accept:".xls,.xlsx"},k.a.createElement(M.a,{className:l.a.upload,type:"primary",icon:k.a.createElement(D.a,null)},"\u9009\u62E9\u6587\u4EF6"))))))};st.a=r},sboe:function(Wt,st,z){"use strict";z.d(st,"a",function(){return U});var oe=z("q1tI"),Z=z.n(oe),U=oe.createContext(null)},t23M:function(Wt,st,z){"use strict";var oe=z("VTBJ"),Z=z("1OyB"),U=z("vuIU"),ee=z("Ji7U"),W=z("LK+K"),M=z("q1tI"),$=z.n(M),X=z("m+aA"),k=z("Zm9Q"),D=z("Kwbf"),m=z("c+Xe"),v=z("bdgK"),f="rc-observer-key",o=function(l){Object(ee.a)(i,l);var r=Object(W.a)(i);function i(){var t;return Object(Z.a)(this,i),t=r.apply(this,arguments),t.resizeObserver=null,t.childNode=null,t.currentElement=null,t.state={width:0,height:0,offsetHeight:0,offsetWidth:0},t.onResize=function(c){var h=t.props.onResize,A=c[0].target,S=A.getBoundingClientRect(),w=S.width,O=S.height,R=A.offsetWidth,b=A.offsetHeight,_=Math.floor(w),u=Math.floor(O);if(t.state.width!==_||t.state.height!==u||t.state.offsetWidth!==R||t.state.offsetHeight!==b){var d={width:_,height:u,offsetWidth:R,offsetHeight:b};t.setState(d),h&&Promise.resolve().then(function(){h(Object(oe.a)(Object(oe.a)({},d),{},{offsetWidth:R,offsetHeight:b}))})}},t.setChildNode=function(c){t.childNode=c},t}return Object(U.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var c=this.props.disabled;if(c){this.destroyObserver();return}var h=Object(X.a)(this.childNode||this),A=h!==this.currentElement;A&&(this.destroyObserver(),this.currentElement=h),!this.resizeObserver&&h&&(this.resizeObserver=new v.default(this.onResize),this.resizeObserver.observe(h))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var c=this.props.children,h=Object(k.a)(c);if(h.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(h.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var A=h[0];if(M.isValidElement(A)&&Object(m.c)(A)){var S=A.ref;h[0]=M.cloneElement(A,{ref:Object(m.a)(S,this.setChildNode)})}return h.length===1?h[0]:h.map(function(w,O){return!M.isValidElement(w)||"key"in w&&w.key!==null?w:M.cloneElement(w,{key:"".concat(f,"-").concat(O)})})}}]),i}(M.Component);o.displayName="ResizeObserver",st.a=o},u2Z1:function(Wt,st,z){"use strict";z.d(st,"a",function(){return S});var oe=z("miYZ"),Z=z("tsqr"),U=z("9og8"),ee=z("5NDa"),W=z("5rEg"),M=z("2qtc"),$=z("kLXV"),X=z("oBTY"),k=z("tJVT"),D=z("OaEy"),m=z("2fM7"),v=z("WmNS"),f=z.n(v),o=z("q1tI"),l=z.n(o),r=z("ErOA"),i=z("i58Z"),t=z.n(i),c=z("T1X5"),h=z.n(c),A=m.a.Option,S=function(O){var R=O.subId,b=O.value,_=O.selectvalues,u=O.disabled,d=O.knowledgeOptions,E=d===void 0?[]:d,g=O.onChange,y=g===void 0?function(){}:g,F=O.onAddKnowledgeFinish,N=F===void 0?function(){}:F,H=Object(o.useRef)(),G=Object(o.useState)([]),I=Object(k.a)(G,2),x=I[0],B=I[1];b=b||[];var Y=function(he,xe){he?(B([xe.key]),y([xe.key])):(B([]),y([]))};Object(o.useEffect)(function(){(_==null?void 0:_.length)>0&&(B(Object(X.a)(_)),y(Object(X.a)(_)))},[E]),Object(o.useEffect)(function(){var de;((de=b)===null||de===void 0?void 0:de.length)>0&&y(Object(X.a)(b))},[E]);var re=function(he){he.preventDefault(),H.current="",$.a.confirm({centered:!0,width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",icon:null,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",className:"custom-modal-divider",content:l.a.createElement("div",{className:"font14"},l.a.createElement("div",{style:{display:"flex",marginTop:"48px",marginBottom:"36px"}},l.a.createElement("img",{src:h.a,style:{width:"108px",height:"108px",marginRight:"29px"}}),"\u60A8\u586B\u5199\u7684\u77E5\u8BC6\u70B9\u6682\u65F6\u4EC5\u5BF9\u672C\u4EBA\u53EF\u89C1\uFF0C\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u540E\u5C06\u5217\u5165\u516C\u5F00\u77E5\u8BC6\u70B9\uFF0C\u5BF9\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF1B",l.a.createElement("br",null),"\u5E73\u53F0\u5BA1\u6838\u8FC7\u7A0B\u4E2D\u6709\u6743\u5220\u9664\u4E0D\u5408\u9002\u7684\u77E5\u8BC6\u70B9\uFF08\u5305\u62EC\u4F46\u4E0D\u9650\u4E8E\u9519\u8BEF\u3001\u975E\u6CD5\u3001\u4E0D\u96C5\u3001\u4E0D\u5339\u914D\u5F53\u524D\u8BFE\u7A0B\u7B49\u60C5\u5F62\uFF09\uFF0C\u5220\u9664\u540E\u53EF\u80FD\u5F71\u54CD\u60A8\u7684\u8BD5\u9898\u7684\u6B63\u5E38\u4F7F\u7528\u3002",l.a.createElement("br",null),"\u8BF7\u8BA4\u771F\u586B\u5199\u4E0E\u6559\u5B66\u5185\u5BB9\u76F8\u5173\u7684\u771F\u5B9E\u77E5\u8BC6\u70B9 ",l.a.createElement("br",null)),l.a.createElement(W.a,{className:"mt5",maxLength:20,style:{marginBottom:"42px"},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0",defaultValue:H.current,onChange:function(Pe){H.current=Pe.target.value}})),onOk:function(){return new Promise(function(){var Pe=Object(U.a)(f.a.mark(function Ce(Oe,be){var ge,te;return f.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:if(H.current){_e.next=3;break}return Z.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),_e.abrupt("return",be());case 3:if(!(H.current.length>20)){_e.next=6;break}return Z.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),_e.abrupt("return",be());case 6:return _e.next=8,Object(r.a)("/api/tag_disciplines.json",{method:"post",body:{name:H.current,sub_discipline_id:R}});case 8:return ge=_e.sent,(ge==null?void 0:ge.status)===0&&(N({id:ge.tag_discipline_id,name:H.current,type:"personal"}),te=[],te.push(ge.tag_discipline_id),y([].concat(te)),B([ge.tag_discipline_id]),y([].concat(te))),_e.abrupt("return",Oe());case 11:case"end":return _e.stop()}},Ce)}));return function(Ce,Oe){return Pe.apply(this,arguments)}}())}})};return l.a.createElement("div",{className:t.a.wrap},l.a.createElement(m.a,{disabled:!R||u,className:"mr5",style:{width:"242px"},onChange:Y,showSearch:!0,allowClear:!0,value:E==null?void 0:E.filter(function(de){return(x==null?void 0:x.includes(de==null?void 0:de.id))||(x==null?void 0:x.includes((de==null?void 0:de.id)+""))}).map(function(de){return de.name})},E==null?void 0:E.map(function(de){return l.a.createElement(A,{key:de.id,value:de.name},l.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},l.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},de.name),l.a.createElement("span",null,de.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),l.a.createElement("button",{disabled:!R,className:"".concat(t.a.addKnowledge," ").concat(R?"":t.a.disabled),onClick:re},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uK0f:function(Wt,st,z){(function(oe,Z){Wt.exports=Z()})(this,function(){"use strict";function oe(Z,U,ee){ee=ee||{},ee.childrenKeyName=ee.childrenKeyName||"children";var W=Z||[],M=[],$=0;do{var X=W.filter(function(k){return U(k,$)})[0];if(!X)break;M.push(X),W=X[ee.childrenKeyName]||[],$+=1}while(W.length>0);return M}return oe})},ulZh:function(Wt,st,z){typeof window!="undefined"&&function(Z,U){Wt.exports=U()}(this,function(){return function(oe){var Z={};function U(ee){if(Z[ee])return Z[ee].exports;var W=Z[ee]={i:ee,l:!1,exports:{}};return oe[ee].call(W.exports,W,W.exports,U),W.l=!0,W.exports}return U.m=oe,U.c=Z,U.d=function(ee,W,M){U.o(ee,W)||Object.defineProperty(ee,W,{enumerable:!0,get:M})},U.r=function(ee){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(ee,"__esModule",{value:!0})},U.t=function(ee,W){if(W&1&&(ee=U(ee)),W&8)return ee;if(W&4&&typeof ee=="object"&&ee&&ee.__esModule)return ee;var M=Object.create(null);if(U.r(M),Object.defineProperty(M,"default",{enumerable:!0,value:ee}),W&2&&typeof ee!="string")for(var $ in ee)U.d(M,$,function(X){return ee[X]}.bind(null,$));return M},U.n=function(ee){var W=ee&&ee.__esModule?function(){return ee.default}:function(){return ee};return U.d(W,"a",W),W},U.o=function(ee,W){return Object.prototype.hasOwnProperty.call(ee,W)},U.p="/dist/",U(U.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(oe,Z,U){"use strict";var ee=Object.prototype.hasOwnProperty,W="~";function M(){}Object.create&&(M.prototype=Object.create(null),new M().__proto__||(W=!1));function $(m,v,f){this.fn=m,this.context=v,this.once=f||!1}function X(m,v,f,o,l){if(typeof f!="function")throw new TypeError("The listener must be a function");var r=new $(f,o||m,l),i=W?W+v:v;return m._events[i]?m._events[i].fn?m._events[i]=[m._events[i],r]:m._events[i].push(r):(m._events[i]=r,m._eventsCount++),m}function k(m,v){--m._eventsCount===0?m._events=new M:delete m._events[v]}function D(){this._events=new M,this._eventsCount=0}D.prototype.eventNames=function(){var v=[],f,o;if(this._eventsCount===0)return v;for(o in f=this._events)ee.call(f,o)&&v.push(W?o.slice(1):o);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(f)):v},D.prototype.listeners=function(v){var f=W?W+v:v,o=this._events[f];if(!o)return[];if(o.fn)return[o.fn];for(var l=0,r=o.length,i=new Array(r);l<r;l++)i[l]=o[l].fn;return i},D.prototype.listenerCount=function(v){var f=W?W+v:v,o=this._events[f];return o?o.fn?1:o.length:0},D.prototype.emit=function(v,f,o,l,r,i){var t=W?W+v:v;if(!this._events[t])return!1;var c=this._events[t],h=arguments.length,A,S;if(c.fn){c.once&&this.removeListener(v,c.fn,void 0,!0);switch(h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,f),!0;case 3:return c.fn.call(c.context,f,o),!0;case 4:return c.fn.call(c.context,f,o,l),!0;case 5:return c.fn.call(c.context,f,o,l,r),!0;case 6:return c.fn.call(c.context,f,o,l,r,i),!0}for(S=1,A=new Array(h-1);S<h;S++)A[S-1]=arguments[S];c.fn.apply(c.context,A)}else{var w=c.length,O;for(S=0;S<w;S++){c[S].once&&this.removeListener(v,c[S].fn,void 0,!0);switch(h){case 1:c[S].fn.call(c[S].context);break;case 2:c[S].fn.call(c[S].context,f);break;case 3:c[S].fn.call(c[S].context,f,o);break;case 4:c[S].fn.call(c[S].context,f,o,l);break;default:if(!A)for(O=1,A=new Array(h-1);O<h;O++)A[O-1]=arguments[O];c[S].fn.apply(c[S].context,A)}}}return!0},D.prototype.on=function(v,f,o){return X(this,v,f,o,!1)},D.prototype.once=function(v,f,o){return X(this,v,f,o,!0)},D.prototype.removeListener=function(v,f,o,l){var r=W?W+v:v;if(!this._events[r])return this;if(!f)return k(this,r),this;var i=this._events[r];if(i.fn)i.fn===f&&(!l||i.once)&&(!o||i.context===o)&&k(this,r);else{for(var t=0,c=[],h=i.length;t<h;t++)(i[t].fn!==f||l&&!i[t].once||o&&i[t].context!==o)&&c.push(i[t]);c.length?this._events[r]=c.length===1?c[0]:c:k(this,r)}return this},D.prototype.removeAllListeners=function(v){var f;return v?(f=W?W+v:v,this._events[f]&&k(this,f)):(this._events=new M,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=W,D.EventEmitter=D,oe.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(oe,Z,U){(function(ee){var W=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,M=/^([^\/?#]*)([^]*)$/,$=/(?:\/|^)\.(?=\/)/g,X=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,k={buildAbsoluteURL:function(D,m,v){if(v=v||{},D=D.trim(),m=m.trim(),!m){if(!v.alwaysNormalize)return D;var f=k.parseURL(D);if(!f)throw new Error("Error trying to parse base URL.");return f.path=k.normalizePath(f.path),k.buildURLFromParts(f)}var o=k.parseURL(m);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return v.alwaysNormalize?(o.path=k.normalizePath(o.path),k.buildURLFromParts(o)):m;var l=k.parseURL(D);if(!l)throw new Error("Error trying to parse base URL.");if(!l.netLoc&&l.path&&l.path[0]!=="/"){var r=M.exec(l.path);l.netLoc=r[1],l.path=r[2]}l.netLoc&&!l.path&&(l.path="/");var i={scheme:l.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(i.netLoc=l.netLoc,o.path[0]!=="/"))if(!o.path)i.path=l.path,o.params||(i.params=l.params,o.query||(i.query=l.query));else{var t=l.path,c=t.substring(0,t.lastIndexOf("/")+1)+o.path;i.path=k.normalizePath(c)}return i.path===null&&(i.path=v.alwaysNormalize?k.normalizePath(o.path):o.path),k.buildURLFromParts(i)},parseURL:function(D){var m=W.exec(D);return m?{scheme:m[1]||"",netLoc:m[2]||"",path:m[3]||"",params:m[4]||"",query:m[5]||"",fragment:m[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace($,"");D.length!==(D=D.replace(X,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};oe.exports=k})(this)},"./node_modules/webworkify-webpack/index.js":function(oe,Z,U){function ee(v){var f={};function o(r){if(f[r])return f[r].exports;var i=f[r]={i:r,l:!1,exports:{}};return v[r].call(i.exports,i,i.exports,o),i.l=!0,i.exports}o.m=v,o.c=f,o.i=function(r){return r},o.d=function(r,i,t){o.o(r,i)||Object.defineProperty(r,i,{configurable:!1,enumerable:!0,get:t})},o.r=function(r){Object.defineProperty(r,"__esModule",{value:!0})},o.n=function(r){var i=r&&r.__esModule?function(){return r.default}:function(){return r};return o.d(i,"a",i),i},o.o=function(r,i){return Object.prototype.hasOwnProperty.call(r,i)},o.p="/",o.oe=function(r){throw console.error(r),r};var l=o(o.s=ENTRY_MODULE);return l.default||l}var W="[\\.|\\-|\\+|\\w|/|@]+",M="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+W+").*?\\)";function $(v){return(v+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function X(v){return!isNaN(1*v)}function k(v,f,o){var l={};l[o]=[];var r=f.toString(),i=r.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return l;for(var t=i[1],c=new RegExp("(\\\\n|\\W)"+$(t)+M,"g"),h;h=c.exec(r);){if(h[3]==="dll-reference")continue;l[o].push(h[3])}for(c=new RegExp("\\("+$(t)+'\\("(dll-reference\\s('+W+'))"\\)\\)'+M,"g");h=c.exec(r);)v[h[2]]||(l[o].push(h[1]),v[h[2]]=U(h[1]).m),l[h[2]]=l[h[2]]||[],l[h[2]].push(h[4]);for(var A=Object.keys(l),S=0;S<A.length;S++)for(var w=0;w<l[A[S]].length;w++)X(l[A[S]][w])&&(l[A[S]][w]=1*l[A[S]][w]);return l}function D(v){var f=Object.keys(v);return f.reduce(function(o,l){return o||v[l].length>0},!1)}function m(v,f){for(var o={main:[f]},l={main:[]},r={main:{}};D(o);)for(var i=Object.keys(o),t=0;t<i.length;t++){var c=i[t],h=o[c],A=h.pop();if(r[c]=r[c]||{},r[c][A]||!v[c][A])continue;r[c][A]=!0,l[c]=l[c]||[],l[c].push(A);for(var S=k(v,v[c][A],c),w=Object.keys(S),O=0;O<w.length;O++)o[w[O]]=o[w[O]]||[],o[w[O]]=o[w[O]].concat(S[w[O]])}return l}oe.exports=function(v,f){f=f||{};var o={main:U.m},l=f.all?{main:Object.keys(o.main)}:m(o,v),r="";Object.keys(l).filter(function(A){return A!=="main"}).forEach(function(A){for(var S=0;l[A][S];)S++;l[A].push(S),o[A][S]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",r=r+"var "+A+" = ("+ee.toString().replace("ENTRY_MODULE",JSON.stringify(S))+")({"+l[A].map(function(w){return""+JSON.stringify(w)+": "+o[A][w].toString()}).join(",")+`});
`}),r=r+"new (("+ee.toString().replace("ENTRY_MODULE",JSON.stringify(v))+")({"+l.main.map(function(A){return""+JSON.stringify(A)+": "+o.main[A].toString()}).join(",")+"}))(self);";var i=new window.Blob([r],{type:"text/javascript"});if(f.bare)return i;var t=window.URL||window.webkitURL||window.mozURL||window.msURL,c=t.createObjectURL(i),h=new window.Worker(c);return h.objectURL=c,h}},"./src/config.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"hlsDefaultConfig",function(){return O}),U.d(Z,"mergeConfig",function(){return b}),U.d(Z,"enableStreamingMode",function(){return _});var ee=U("./src/controller/abr-controller.ts"),W=U("./src/controller/audio-stream-controller.ts"),M=U("./src/controller/audio-track-controller.ts"),$=U("./src/controller/subtitle-stream-controller.ts"),X=U("./src/controller/subtitle-track-controller.ts"),k=U("./src/controller/buffer-controller.ts"),D=U("./src/controller/timeline-controller.ts"),m=U("./src/controller/cap-level-controller.ts"),v=U("./src/controller/fps-controller.ts"),f=U("./src/controller/eme-controller.ts"),o=U("./src/controller/cmcd-controller.ts"),l=U("./src/utils/xhr-loader.ts"),r=U("./src/utils/fetch-loader.ts"),i=U("./src/utils/cues.ts"),t=U("./src/utils/mediakeys-helper.ts"),c=U("./src/utils/logger.ts");function h(){return h=Object.assign||function(u){for(var d=1;d<arguments.length;d++){var E=arguments[d];for(var g in E)Object.prototype.hasOwnProperty.call(E,g)&&(u[g]=E[g])}return u},h.apply(this,arguments)}function A(u,d){var E=Object.keys(u);if(Object.getOwnPropertySymbols){var g=Object.getOwnPropertySymbols(u);d&&(g=g.filter(function(y){return Object.getOwnPropertyDescriptor(u,y).enumerable})),E.push.apply(E,g)}return E}function S(u){for(var d=1;d<arguments.length;d++){var E=arguments[d]!=null?arguments[d]:{};d%2?A(Object(E),!0).forEach(function(g){w(u,g,E[g])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(E)):A(Object(E)).forEach(function(g){Object.defineProperty(u,g,Object.getOwnPropertyDescriptor(E,g))})}return u}function w(u,d,E){return d in u?Object.defineProperty(u,d,{value:E,enumerable:!0,configurable:!0,writable:!0}):u[d]=E,u}var O=S(S({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:l.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:ee.default,bufferController:k.default,capLevelController:m.default,fpsController:v.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:t.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},R()),{},{subtitleStreamController:$.SubtitleStreamController,subtitleTrackController:X.default,timelineController:D.TimelineController,audioStreamController:W.default,audioTrackController:M.default,emeController:f.default,cmcdController:o.default});function R(){return{cueHandler:i.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 b(u,d){if((d.liveSyncDurationCount||d.liveMaxLatencyDurationCount)&&(d.liveSyncDuration||d.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(d.liveMaxLatencyDurationCount!==void 0&&(d.liveSyncDurationCount===void 0||d.liveMaxLatencyDurationCount<=d.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(d.liveMaxLatencyDuration!==void 0&&(d.liveSyncDuration===void 0||d.liveMaxLatencyDuration<=d.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return h({},u,d)}function _(u){var d=u.loader;if(d!==r.default&&d!==l.default)c.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),u.progressive=!1;else{var E=Object(r.fetchSupported)();E&&(u.loader=r.default,u.progressive=!0,u.enableSoftwareAES=!0,c.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/polyfills/number.ts"),W=U("./src/utils/ewma-bandwidth-estimator.ts"),M=U("./src/events.ts"),$=U("./src/utils/buffer-helper.ts"),X=U("./src/errors.ts"),k=U("./src/types/loader.ts"),D=U("./src/utils/logger.ts");function m(o,l){for(var r=0;r<l.length;r++){var i=l[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(o,i.key,i)}}function v(o,l,r){return l&&m(o.prototype,l),r&&m(o,r),o}var f=function(){function o(r){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=r;var i=r.config;this.bwEstimator=new W.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var l=o.prototype;return l.registerListeners=function(){var i=this.hls;i.on(M.Events.FRAG_LOADING,this.onFragLoading,this),i.on(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(M.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var i=this.hls;i.off(M.Events.FRAG_LOADING,this.onFragLoading,this),i.off(M.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(M.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},l.onFragLoading=function(i,t){var c=t.frag;if(c.type===k.PlaylistLevelType.MAIN&&!this.timer){var h;this.fragCurrent=c,this.partCurrent=(h=t.part)!=null?h:null,this.timer=self.setInterval(this.onCheck,100)}},l.onLevelLoaded=function(i,t){var c=this.hls.config;t.details.live?this.bwEstimator.update(c.abrEwmaSlowLive,c.abrEwmaFastLive):this.bwEstimator.update(c.abrEwmaSlowVoD,c.abrEwmaFastVoD)},l._abandonRulesCheck=function(){var i=this.fragCurrent,t=this.partCurrent,c=this.hls,h=c.autoLevelEnabled,A=c.config,S=c.media;if(!i||!S)return;var w=t?t.stats:i.stats,O=t?t.duration:i.duration;if(w.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!h||S.paused||!S.playbackRate||!S.readyState)return;var R=performance.now()-w.loading.start,b=Math.abs(S.playbackRate);if(R<=500*O/b)return;var _=c.levels,u=c.minAutoLevel,d=_[i.level],E=w.total||Math.max(w.loaded,Math.round(O*d.maxBitrate/8)),g=Math.max(1,w.bwEstimate?w.bwEstimate/8:w.loaded*1e3/R),y=(E-w.loaded)/g,F=S.currentTime,N=($.BufferHelper.bufferInfo(S,F,A.maxBufferHole).end-F)/b;if(N>=2*O/b||y<=N)return;var H=Number.POSITIVE_INFINITY,G;for(G=i.level-1;G>u;G--){var I=_[G].maxBitrate;if(H=O*I/(8*.8*g),H<N)break}if(H>=y)return;var x=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+i.sn+(t?" part "+t.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+G+`
Current BW estimate: `+(Object(ee.isFiniteNumber)(x)?(x/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+y.toFixed(3)+` s
Estimated load time for the next fragment: `+H.toFixed(3)+` s
Time to underbuffer: `+N.toFixed(3)+" s"),c.nextLoadLevel=G,this.bwEstimator.sample(R,w.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),c.trigger(M.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:t,stats:w})},l.onFragLoaded=function(i,t){var c=t.frag,h=t.part;if(c.type===k.PlaylistLevelType.MAIN&&Object(ee.isFiniteNumber)(c.sn)){var A=h?h.stats:c.stats,S=h?h.duration:c.duration;if(this.clearTimer(),this.lastLoadedFragLevel=c.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var w=this.hls.levels[c.level],O=(w.loaded?w.loaded.bytes:0)+A.loaded,R=(w.loaded?w.loaded.duration:0)+S;w.loaded={bytes:O,duration:R},w.realBitrate=Math.round(8*O/R)}if(c.bitrateTest){var b={stats:A,frag:c,part:h,id:c.type};this.onFragBuffered(M.Events.FRAG_BUFFERED,b),c.bitrateTest=!1}}},l.onFragBuffered=function(i,t){var c=t.frag,h=t.part,A=h?h.stats:c.stats;if(A.aborted)return;if(c.type!==k.PlaylistLevelType.MAIN||c.sn==="initSegment")return;var S=A.parsing.end-A.loading.start;this.bwEstimator.sample(S,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),c.bitrateTest?this.bitrateTestDelay=S/1e3:this.bitrateTestDelay=0},l.onError=function(i,t){switch(t.details){case X.ErrorDetails.FRAG_LOAD_ERROR:case X.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var i=this.fragCurrent,t=this.partCurrent,c=this.hls,h=c.maxAutoLevel,A=c.config,S=c.minAutoLevel,w=c.media,O=t?t.duration:i?i.duration:0,R=w?w.currentTime:0,b=w&&w.playbackRate!==0?Math.abs(w.playbackRate):1,_=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,u=($.BufferHelper.bufferInfo(w,R,A.maxBufferHole).end-R)/b,d=this.findBestLevel(_,S,h,u,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(d>=0)return d;D.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=O?Math.min(O,A.maxStarvationDelay):A.maxStarvationDelay,g=A.abrBandWidthFactor,y=A.abrBandWidthUpFactor;if(!u){var F=this.bitrateTestDelay;if(F){var N=O?Math.min(O,A.maxLoadingDelay):A.maxLoadingDelay;E=N-F,D.logger.trace("bitrate test took "+Math.round(1e3*F)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),g=y=1}}return d=this.findBestLevel(_,S,h,u+E,g,y),Math.max(d,0)},l.findBestLevel=function(i,t,c,h,A,S){for(var w,O=this.fragCurrent,R=this.partCurrent,b=this.lastLoadedFragLevel,_=this.hls.levels,u=_[b],d=!!(u!=null&&(w=u.details)!==null&&w!==void 0&&w.live),E=u==null?void 0:u.codecSet,g=R?R.duration:O?O.duration:0,y=c;y>=t;y--){var F=_[y];if(!F||E&&F.codecSet!==E)continue;var N=F.details,H=(R?N==null?void 0:N.partTarget:N==null?void 0:N.averagetargetduration)||g,G=void 0;y<=b?G=A*i:G=S*i;var I=_[y].maxBitrate,x=I*H/G;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(G)+"/"+I+"/"+H+"/"+h+"/"+x),G>I&&(!x||d&&!this.bitrateTestDelay||x<h))return y}return-1},v(o,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,t=this.bwEstimator;if(i!==-1&&(!t||!t.canEstimate()))return i;var c=this.getNextABRAutoLevel();return i!==-1&&(c=Math.min(i,c)),c},set:function(i){this._nextAutoLevel=i}}]),o}();Z.default=f},"./src/controller/audio-stream-controller.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/polyfills/number.ts"),W=U("./src/controller/base-stream-controller.ts"),M=U("./src/events.ts"),$=U("./src/utils/buffer-helper.ts"),X=U("./src/controller/fragment-tracker.ts"),k=U("./src/types/level.ts"),D=U("./src/types/loader.ts"),m=U("./src/loader/fragment.ts"),v=U("./src/demux/chunk-cache.ts"),f=U("./src/demux/transmuxer-interface.ts"),o=U("./src/types/transmuxer.ts"),l=U("./src/controller/fragment-finders.ts"),r=U("./src/utils/discontinuities.ts"),i=U("./src/errors.ts"),t=U("./src/utils/logger.ts");function c(){return c=Object.assign||function(O){for(var R=1;R<arguments.length;R++){var b=arguments[R];for(var _ in b)Object.prototype.hasOwnProperty.call(b,_)&&(O[_]=b[_])}return O},c.apply(this,arguments)}function h(O,R){O.prototype=Object.create(R.prototype),O.prototype.constructor=O,A(O,R)}function A(O,R){return A=Object.setPrototypeOf||function(_,u){return _.__proto__=u,_},A(O,R)}var S=100,w=function(O){h(R,O);function R(_,u){var d;return d=O.call(this,_,u,"[audio-stream-controller]")||this,d.videoBuffer=null,d.videoTrackCC=-1,d.waitingVideoCC=-1,d.audioSwitch=!1,d.trackId=-1,d.waitingData=null,d.mainDetails=null,d.bufferFlushed=!1,d._registerListeners(),d}var b=R.prototype;return b.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},b._registerListeners=function(){var u=this.hls;u.on(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.on(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(M.Events.ERROR,this.onError,this),u.on(M.Events.BUFFER_RESET,this.onBufferReset,this),u.on(M.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var u=this.hls;u.off(M.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(M.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(M.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(M.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(M.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.off(M.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(M.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(M.Events.ERROR,this.onError,this),u.off(M.Events.BUFFER_RESET,this.onBufferReset,this),u.off(M.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(M.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(M.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(M.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onInitPtsFound=function(u,d){var E=d.frag,g=d.id,y=d.initPTS;if(g==="main"){var F=E.cc;this.initPTS[E.cc]=y,this.log("InitPTS for cc: "+F+" found from main: "+y),this.videoTrackCC=F,this.state===W.State.WAITING_INIT_PTS&&this.tick()}},b.startLoad=function(u){if(!this.levels){this.startPosition=u,this.state=W.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(S),this.fragLoadError=0,d>0&&u===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=W.State.IDLE):(this.loadedmetadata=!1,this.state=W.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},b.doTick=function(){switch(this.state){case W.State.IDLE:this.doTickIdle();break;case W.State.WAITING_TRACK:{var u,d=this.levels,E=this.trackId,g=d==null||((u=d[E])===null||u===void 0)?void 0:u.details;if(g){if(this.waitForCdnTuneIn(g))break;this.state=W.State.WAITING_INIT_PTS}break}case W.State.FRAG_LOADING_WAITING_RETRY:{var y,F=performance.now(),N=this.retryDate;(!N||F>=N||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=W.State.IDLE);break}case W.State.WAITING_INIT_PTS:{var H=this.waitingData;if(H){var G=H.frag,I=H.part,x=H.cache,B=H.complete;if(this.initPTS[G.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=W.State.FRAG_LOADING;var Y=x.flush(),re={frag:G,part:I,payload:Y,networkDetails:null};this._handleFragmentLoadProgress(re),B&&O.prototype._handleFragmentLoadComplete.call(this,re)}else if(this.videoTrackCC!==this.waitingVideoCC)t.logger.log("Waiting fragment cc ("+G.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var de=this.getLoadPosition(),he=$.BufferHelper.bufferInfo(this.mediaBuffer,de,this.config.maxBufferHole),xe=Object(l.fragmentWithinToleranceTest)(he.end,this.config.maxFragLookUpTolerance,G);xe<0&&(t.logger.log("Waiting fragment cc ("+G.cc+") @ "+G.start+" cancelled because another fragment at "+he.end+" is needed"),this.clearWaitingFragment())}}else this.state=W.State.IDLE}}this.onTickEnd()},b.clearWaitingFragment=function(){var u=this.waitingData;u&&(this.fragmentTracker.removeFragment(u.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=W.State.IDLE)},b.onTickEnd=function(){var u=this.media;if(!u||!u.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:u,E=d.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=u.currentTime},b.doTickIdle=function(){var u,d,E=this.hls,g=this.levels,y=this.media,F=this.trackId,N=E.config;if(!g||!g[F])return;if(!y&&(this.startFragRequested||!N.startFragPrefetch))return;var H=g[F],G=H.details;if(!G||G.live&&this.levelLastLoaded!==F||this.waitForCdnTuneIn(G)){this.state=W.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,m.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(I===null)return;var x=I.len,B=this.getMaxBufferLength(),Y=this.audioSwitch;if(x>=B&&!Y)return;if(!Y&&this._streamEnded(I,G)){E.trigger(M.Events.BUFFER_EOS,{type:"audio"}),this.state=W.State.ENDED;return}var re=G.fragments,de=re[0].start,he=I.end;if(Y){var xe=this.getLoadPosition();he=xe,G.PTSKnown&&xe<de&&((I.end>de||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=de+.05))}var Pe=this.getNextFragment(he,G);if(!Pe){this.bufferFlushed=!0;return}((u=Pe.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((d=Pe.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(Pe,G):this.loadFragment(Pe,G,he)},b.getMaxBufferLength=function(){var u=O.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return d===null?u:Math.max(u,d.len)},b.onMediaDetaching=function(){this.videoBuffer=null,O.prototype.onMediaDetaching.call(this)},b.onAudioTracksUpdated=function(u,d){var E=d.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(g){return new k.Level(g)})},b.onAudioTrackSwitching=function(u,d){var E=!!d.url;this.trackId=d.id;var g=this.fragCurrent;g!=null&&g.loader&&g.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(S):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=W.State.IDLE):this.state=W.State.STOPPED,this.tick()},b.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},b.onLevelLoaded=function(u,d){this.mainDetails=d.details},b.onAudioTrackLoaded=function(u,d){var E,g=this.levels,y=d.details,F=d.id;if(!g){this.warn("Audio tracks were reset while loading level "+F);return}this.log("Track "+F+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var N=g[F],H=0;if(y.live||(E=N.details)!==null&&E!==void 0&&E.live){var G=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!G)return;!N.details&&y.hasProgramDateTime&&G.hasProgramDateTime?(Object(r.alignMediaPlaylistByPDT)(y,G),H=y.fragments[0].start):H=this.alignPlaylists(y,N.details)}N.details=y,this.levelLastLoaded=F,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(N.details,H),this.state===W.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=W.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(u){var d,E=u.frag,g=u.part,y=u.payload,F=this.config,N=this.trackId,H=this.levels;if(!H){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var G=H[N];console.assert(G,"Audio track is defined on fragment load progress");var I=G.details;console.assert(I,"Audio track details are defined on fragment load progress");var x=F.defaultAudioCodec||G.audioCodec||"mp4a.40.2",B=this.transmuxer;B||(B=this.transmuxer=new f.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Y=this.initPTS[E.cc],re=(d=E.initSegment)===null||d===void 0?void 0:d.data;if(Y!==void 0){var de=!1,he=g?g.index:-1,xe=he!==-1,Pe=new o.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,y.byteLength,he,xe);B.push(y,re,x,"",E,g,I.totalduration,de,Pe,Y)}else{t.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+I.startSN+" ,"+I.endSN+"],track "+N);var Ce=this.waitingData=this.waitingData||{frag:E,part:g,cache:new v.default,complete:!1},Oe=Ce.cache;Oe.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=W.State.WAITING_INIT_PTS}},b._handleFragmentLoadComplete=function(u){if(this.waitingData){this.waitingData.complete=!0;return}O.prototype._handleFragmentLoadComplete.call(this,u)},b.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},b.onBufferCreated=function(u,d){var E=d.tracks.audio;E&&(this.mediaBuffer=E.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},b.onFragBuffered=function(u,d){var E=d.frag,g=d.part;if(E.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(g?" p: "+g.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,g)},b.onError=function(u,d){switch(d.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,d);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==W.State.ERROR&&this.state!==W.State.STOPPED&&(this.state=d.fatal?W.State.ERROR:W.State.IDLE,this.warn(d.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="audio"&&(this.state===W.State.PARSING||this.state===W.State.PARSED)){var E=!0,g=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);g&&g.len>.5&&(E=!this.reduceMaxBufferLength(g.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},b.onBufferFlushed=function(u,d){var E=d.type;E===m.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(u){var d,E="audio",g=this.hls,y=u.remuxResult,F=u.chunkMeta,N=this.getCurrentContext(F);if(!N){this.warn("The loading context changed while buffering fragment "+F.sn+" of level "+F.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(F.level);return}var H=N.frag,G=N.part,I=y.audio,x=y.text,B=y.id3,Y=y.initSegment;if(this.fragContextChanged(H))return;if(this.state=W.State.PARSING,this.audioSwitch&&I&&this.completeAudioSwitch(),Y!=null&&Y.tracks&&(this._bufferInitSegment(Y.tracks,H,F),g.trigger(M.Events.FRAG_PARSING_INIT_SEGMENT,{frag:H,id:E,tracks:Y.tracks})),I){var re=I.startPTS,de=I.endPTS,he=I.startDTS,xe=I.endDTS;G&&(G.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:re,endPTS:de,startDTS:he,endDTS:xe}),H.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,re,de,he,xe),this.bufferFragmentData(I,H,G,F)}if(B!=null&&(d=B.samples)!==null&&d!==void 0&&d.length){var Pe=c({frag:H,id:E},B);g.trigger(M.Events.FRAG_PARSING_METADATA,Pe)}if(x){var Ce=c({frag:H,id:E},x);g.trigger(M.Events.FRAG_PARSING_USERDATA,Ce)}},b._bufferInitSegment=function(u,d,E){if(this.state!==W.State.PARSING)return;u.video&&delete u.video;var g=u.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(M.Events.BUFFER_CODECS,u);var y=g.initSegment;if(y!=null&&y.byteLength){var F={type:"audio",frag:d,part:null,chunkMeta:E,parent:d.type,data:y};this.hls.trigger(M.Events.BUFFER_APPENDING,F)}this.tick()},b.loadFragment=function(u,d,E){var g=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||g===X.FragmentState.NOT_LOADED||g===X.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):d.live&&!Object(ee.isFiniteNumber)(this.initPTS[u.cc])?(this.log("Waiting for video PTS in continuity counter "+u.cc+" of live stream before loading audio fragment "+u.sn+" of level "+this.trackId),this.state=W.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,u,d,E)))},b.completeAudioSwitch=function(){var u=this.hls,d=this.media,E=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),O.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,u.trigger(M.Events.AUDIO_TRACK_SWITCHED,{id:E})},R}(W.default);Z.default=w},"./src/controller/audio-track-controller.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/events.ts"),W=U("./src/errors.ts"),M=U("./src/controller/base-playlist-controller.ts"),$=U("./src/types/loader.ts");function X(f,o){for(var l=0;l<o.length;l++){var r=o[l];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(f,r.key,r)}}function k(f,o,l){return o&&X(f.prototype,o),l&&X(f,l),f}function D(f,o){f.prototype=Object.create(o.prototype),f.prototype.constructor=f,m(f,o)}function m(f,o){return m=Object.setPrototypeOf||function(r,i){return r.__proto__=i,r},m(f,o)}var v=function(f){D(o,f);function o(r){var i;return i=f.call(this,r,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var l=o.prototype;return l.registerListeners=function(){var i=this.hls;i.on(ee.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(ee.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(ee.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(ee.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(ee.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(ee.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var i=this.hls;i.off(ee.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(ee.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(ee.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(ee.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(ee.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(ee.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,f.prototype.destroy.call(this)},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},l.onManifestParsed=function(i,t){this.tracks=t.audioTracks||[]},l.onAudioTrackLoaded=function(i,t){var c=t.id,h=t.details,A=this.tracksInGroup[c];if(!A){this.warn("Invalid audio track id "+c);return}var S=A.details;A.details=t.details,this.log("audioTrack "+c+" loaded ["+h.startSN+"-"+h.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,t,S))},l.onLevelLoading=function(i,t){this.switchLevel(t.level)},l.onLevelSwitching=function(i,t){this.switchLevel(t.level)},l.switchLevel=function(i){var t=this.hls.levels[i];if(!(t!=null&&t.audioGroupIds))return;var c=t.audioGroupIds[t.urlId];if(this.groupId!==c){this.groupId=c;var h=this.tracks.filter(function(S){return!c||S.groupId===c});this.selectDefaultTrack&&!h.some(function(S){return S.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=h;var A={audioTracks:h};this.log("Updating audio tracks, "+h.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(ee.Events.AUDIO_TRACKS_UPDATED,A),this.selectInitialTrack()}},l.onError=function(i,t){if(f.prototype.onError.call(this,i,t),t.fatal||!t.context)return;t.context.type===$.PlaylistContextType.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},l.setAudioTrack=function(i){var t=this.tracksInGroup;if(i<0||i>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var c=t[this.trackId];this.log("Now switching to audio-track index "+i);var h=t[i],A=h.id,S=h.groupId,w=S===void 0?"":S,O=h.name,R=h.type,b=h.url;if(this.trackId=i,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(ee.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:w,name:O,type:R,url:b}),h.details&&!h.details.live)return;var _=this.switchParams(h.url,c==null?void 0:c.details);this.loadPlaylist(_)},l.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,c=this.findTrackId(t)||this.findTrackId();c!==-1?this.setAudioTrack(c):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(i){for(var t=this.tracksInGroup,c=0;c<t.length;c++){var h=t[c];if((!this.selectDefaultTrack||h.default)&&(!i||i===h.name))return h.id}return-1},l.loadPlaylist=function(i){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var c=t.id,h=t.groupId,A=t.url;if(i)try{A=i.addDirectives(A)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("loading audio-track playlist for id: "+c),this.clearTimer(),this.hls.trigger(ee.Events.AUDIO_TRACK_LOADING,{url:A,id:c,groupId:h,deliveryDirectives:i||null})}},k(o,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),o}(M.default);Z.default=v},"./src/controller/base-playlist-controller.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return k});var ee=U("./src/polyfills/number.ts"),W=U("./src/types/level.ts"),M=U("./src/controller/level-helper.ts"),$=U("./src/utils/logger.ts"),X=U("./src/errors.ts"),k=function(){function D(v,f){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=$.logger.log.bind($.logger,f+":"),this.warn=$.logger.warn.bind($.logger,f+":"),this.hls=v}var m=D.prototype;return m.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},m.onError=function(f,o){o.fatal&&o.type===X.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},m.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},m.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},m.stopLoad=function(){this.canLoad=!1,this.clearTimer()},m.switchParams=function(f,o){var l=o==null?void 0:o.renditionReports;if(l)for(var r=0;r<l.length;r++){var i=l[r],t=""+i.URI;if(t===f.substr(-t.length)){var c=parseInt(i["LAST-MSN"]),h=parseInt(i["LAST-PART"]);if(o&&this.hls.config.lowLatencyMode){var A=Math.min(o.age-o.partTarget,o.targetduration);h!==void 0&&A>o.partTarget&&(h+=1)}if(Object(ee.isFiniteNumber)(c))return new W.HlsUrlParameters(c,Object(ee.isFiniteNumber)(h)?h:void 0,W.HlsSkip.No)}}},m.loadPlaylist=function(f){},m.shouldLoadTrack=function(f){return this.canLoad&&f&&!!f.url&&(!f.details||f.details.live)},m.playlistLoaded=function(f,o,l){var r=this,i=o.details,t=o.stats,c=t.loading.end?Math.max(0,self.performance.now()-t.loading.end):0;if(i.advancedDateTime=Date.now()-c,i.live||l!=null&&l.live){if(i.reloaded(l),l&&this.log("live playlist "+f+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),l&&i.fragments.length>0&&Object(M.mergeDetails)(l,i),!this.canLoad||!i.live)return;var h,A=void 0,S=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var w=this.hls.config.lowLatencyMode,O=i.lastPartSn,R=i.endSN,b=i.lastPartIndex,_=b!==-1,u=O===R,d=w?0:b;_?(A=u?R+1:O,S=u?d:b+1):A=R+1;var E=i.age,g=E+i.ageHeader,y=Math.min(g-i.partTarget,i.targetduration*1.5);if(y>0){if(l&&y>l.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+l.tuneInGoal+" to: "+y+" with playlist age: "+i.age),y=0;else{var F=Math.floor(y/i.targetduration);if(A+=F,S!==void 0){var N=Math.round(y%i.targetduration/i.partTarget);S+=N}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+y+" skip sn "+F+" to part "+S)}i.tuneInGoal=y}if(h=this.getDeliveryDirectives(i,o.deliveryDirectives,A,S),w||!u){this.loadPlaylist(h);return}}else h=this.getDeliveryDirectives(i,o.deliveryDirectives,A,S);var H=Object(M.computeReloadInterval)(i,t);A!==void 0&&i.canBlockReload&&(H-=i.partTarget||1),this.log("reload live playlist "+f+" in "+Math.round(H)+" ms"),this.timer=self.setTimeout(function(){return r.loadPlaylist(h)},H)}else this.clearTimer()},m.getDeliveryDirectives=function(f,o,l,r){var i=Object(W.getSkipValue)(f,l);return o!=null&&o.skip&&f.deltaUpdateFailed&&(l=o.msn,r=o.part,i=W.HlsSkip.No),new W.HlsUrlParameters(l,r,i)},m.retryLoadingOrFail=function(f){var o=this,l=this.hls.config,r=this.retryCount<l.levelLoadingMaxRetry;if(r){var i;if(this.retryCount++,f.details.indexOf("LoadTimeOut")>-1&&(i=f.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+f.details+'"'),this.loadPlaylist();else{var t=Math.min(Math.pow(2,this.retryCount)*l.levelLoadingRetryDelay,l.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return o.loadPlaylist()},t),this.warn("retry playlist loading #"+this.retryCount+" in "+t+' ms after "'+f.details+'"')}}else this.warn('cannot recover from error "'+f.details+'"'),this.clearTimer(),f.fatal=!0;return r},D}()},"./src/controller/base-stream-controller.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"State",function(){return R}),U.d(Z,"default",function(){return b});var ee=U("./src/polyfills/number.ts"),W=U("./src/task-loop.ts"),M=U("./src/controller/fragment-tracker.ts"),$=U("./src/utils/buffer-helper.ts"),X=U("./src/utils/logger.ts"),k=U("./src/events.ts"),D=U("./src/errors.ts"),m=U("./src/types/transmuxer.ts"),v=U("./src/utils/mp4-tools.ts"),f=U("./src/utils/discontinuities.ts"),o=U("./src/controller/fragment-finders.ts"),l=U("./src/controller/level-helper.ts"),r=U("./src/loader/fragment-loader.ts"),i=U("./src/crypt/decrypter.ts"),t=U("./src/utils/time-ranges.ts"),c=U("./src/types/loader.ts");function h(_,u){for(var d=0;d<u.length;d++){var E=u[d];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(_,E.key,E)}}function A(_,u,d){return u&&h(_.prototype,u),d&&h(_,d),_}function S(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function w(_,u){_.prototype=Object.create(u.prototype),_.prototype.constructor=_,O(_,u)}function O(_,u){return O=Object.setPrototypeOf||function(E,g){return E.__proto__=g,E},O(_,u)}var R={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"},b=function(_){w(u,_);function u(E,g,y){var F;return F=_.call(this)||this,F.hls=void 0,F.fragPrevious=null,F.fragCurrent=null,F.fragmentTracker=void 0,F.transmuxer=null,F._state=R.STOPPED,F.media=void 0,F.mediaBuffer=void 0,F.config=void 0,F.bitrateTest=!1,F.lastCurrentTime=0,F.nextLoadPosition=0,F.startPosition=0,F.loadedmetadata=!1,F.fragLoadError=0,F.retryDate=0,F.levels=null,F.fragmentLoader=void 0,F.levelLastLoaded=null,F.startFragRequested=!1,F.decrypter=void 0,F.initPTS=[],F.onvseeking=null,F.onvended=null,F.logPrefix="",F.log=void 0,F.warn=void 0,F.logPrefix=y,F.log=X.logger.log.bind(X.logger,y+":"),F.warn=X.logger.warn.bind(X.logger,y+":"),F.hls=E,F.fragmentLoader=new r.default(E.config),F.fragmentTracker=g,F.config=E.config,F.decrypter=new i.default(E,E.config),E.on(k.Events.KEY_LOADED,F.onKeyLoaded,S(F)),F}var d=u.prototype;return d.doTick=function(){this.onTickEnd()},d.onTickEnd=function(){},d.startLoad=function(g){},d.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=R.STOPPED},d._streamEnded=function(g,y){var F=this.fragCurrent,N=this.fragmentTracker;if(!y.live&&F&&F.sn===y.endSN&&!g.nextStart){var H=N.getState(F);return H===M.FragmentState.PARTIAL||H===M.FragmentState.OK}return!1},d.onMediaAttached=function(g,y){var F=this.media=this.mediaBuffer=y.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),F.addEventListener("seeking",this.onvseeking),F.addEventListener("ended",this.onvended);var N=this.config;this.levels&&N.autoStartLoad&&this.state===R.STOPPED&&this.startLoad(N.startPosition)},d.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()},d.onMediaSeeking=function(){var g=this.config,y=this.fragCurrent,F=this.media,N=this.mediaBuffer,H=this.state,G=F?F.currentTime:0,I=$.BufferHelper.bufferInfo(N||F,G,g.maxBufferHole);if(this.log("media seeking to "+(Object(ee.isFiniteNumber)(G)?G.toFixed(3):G)+", state: "+H),H===R.ENDED)this.resetLoadingState();else if(y&&!I.len){var x=g.maxFragLookUpTolerance,B=y.start-x,Y=y.start+y.duration+x,re=G>Y;(G<B||re)&&(re&&y.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),y.loader.abort()),this.resetLoadingState())}F&&(this.lastCurrentTime=G),!this.loadedmetadata&&!I.len&&(this.nextLoadPosition=this.startPosition=G),this.tickImmediate()},d.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},d.onKeyLoaded=function(g,y){if(this.state!==R.KEY_LOADING||y.frag!==this.fragCurrent||!this.levels)return;this.state=R.IDLE;var F=this.levels[y.frag.level].details;F&&this.loadFragment(y.frag,F,y.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),_.prototype.onHandlerDestroying.call(this)},d.onHandlerDestroyed=function(){this.state=R.STOPPED,this.hls.off(k.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,_.prototype.onHandlerDestroyed.call(this)},d.loadKey=function(g,y){this.log("Loading key for "+g.sn+" of ["+y.startSN+"-"+y.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level),this.state=R.KEY_LOADING,this.fragCurrent=g,this.hls.trigger(k.Events.KEY_LOADING,{frag:g})},d.loadFragment=function(g,y,F){this._loadFragForPlayback(g,y,F)},d._loadFragForPlayback=function(g,y,F){var N=this,H=function(I){if(N.fragContextChanged(g)){N.warn("Fragment "+g.sn+(I.part?" p: "+I.part.index:"")+" of level "+g.level+" was dropped during download."),N.fragmentTracker.removeFragment(g);return}g.stats.chunkCount++,N._handleFragmentLoadProgress(I)};this._doFragLoad(g,y,F,H).then(function(G){if(!G)return;N.fragLoadError=0;var I=N.state;if(N.fragContextChanged(g)){(I===R.FRAG_LOADING||I===R.BACKTRACKING||!N.fragCurrent&&I===R.PARSING)&&(N.fragmentTracker.removeFragment(g),N.state=R.IDLE);return}if("payload"in G&&(N.log("Loaded fragment "+g.sn+" of level "+g.level),N.hls.trigger(k.Events.FRAG_LOADED,G),N.state===R.BACKTRACKING)){N.fragmentTracker.backtrack(g,G),N.resetFragmentLoading(g);return}N._handleFragmentLoadComplete(G)}).catch(function(G){N.warn(G),N.resetFragmentLoading(g)})},d.flushMainBuffer=function(g,y,F){if(F===void 0&&(F=null),!(g-y))return;var N={startOffset:g,endOffset:y,type:F};this.fragLoadError=0,this.hls.trigger(k.Events.BUFFER_FLUSHING,N)},d._loadInitSegment=function(g){var y=this;this._doFragLoad(g).then(function(F){if(!F||y.fragContextChanged(g)||!y.levels)throw new Error("init load aborted");return F}).then(function(F){var N=y.hls,H=F.payload,G=g.decryptdata;if(H&&H.byteLength>0&&G&&G.key&&G.iv&&G.method==="AES-128"){var I=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(H),G.key.buffer,G.iv.buffer).then(function(x){var B=self.performance.now();return N.trigger(k.Events.FRAG_DECRYPTED,{frag:g,payload:x,stats:{tstart:I,tdecrypt:B}}),F.payload=x,F})}return F}).then(function(F){var N=y.fragCurrent,H=y.hls,G=y.levels;if(!G)throw new Error("init load aborted, missing levels");var I=G[g.level].details;console.assert(I,"Level details are defined when init segment is loaded");var x=g.stats;y.state=R.IDLE,y.fragLoadError=0,g.data=new Uint8Array(F.payload),x.parsing.start=x.buffering.start=self.performance.now(),x.parsing.end=x.buffering.end=self.performance.now(),F.frag===N&&H.trigger(k.Events.FRAG_BUFFERED,{stats:x,frag:N,part:null,id:g.type}),y.tick()}).catch(function(F){y.warn(F),y.resetFragmentLoading(g)})},d.fragContextChanged=function(g){var y=this.fragCurrent;return!g||!y||g.level!==y.level||g.sn!==y.sn||g.urlId!==y.urlId},d.fragBufferedComplete=function(g,y){var F=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+g.type+" sn: "+g.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+g.level+" "+t.default.toString($.BufferHelper.getBuffered(F))),this.state=R.IDLE,this.tick()},d._handleFragmentLoadComplete=function(g){var y=this.transmuxer;if(!y)return;var F=g.frag,N=g.part,H=g.partsLoaded,G=!H||H.length===0||H.some(function(x){return!x}),I=new m.ChunkMetadata(F.level,F.sn,F.stats.chunkCount+1,0,N?N.index:-1,!G);y.flush(I)},d._handleFragmentLoadProgress=function(g){},d._doFragLoad=function(g,y,F,N){var H=this;if(F===void 0&&(F=null),!this.levels)throw new Error("frag load aborted, missing levels");if(F=Math.max(g.start,F||0),this.config.lowLatencyMode&&y){var G=y.partList;if(G&&N){F>g.end&&y.fragmentHint&&(g=y.fragmentHint);var I=this.getNextPart(G,g,F);if(I>-1){var x=G[I];return this.log("Loading part sn: "+g.sn+" p: "+x.index+" cc: "+g.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+I+"-"+(G.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(F.toFixed(3))),this.nextLoadPosition=x.start+x.duration,this.state=R.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:g,part:G[I],targetBufferTime:F}),this.doFragPartsLoad(g,G,I,N).catch(function(B){return H.handleFragLoadError(B)})}else if(!g.url||this.loadedEndOfParts(G,F))return Promise.resolve(null)}}return this.log("Loading fragment "+g.sn+" cc: "+g.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+g.level+", target: "+parseFloat(F.toFixed(3))),Object(ee.isFiniteNumber)(g.sn)&&!this.bitrateTest&&(this.nextLoadPosition=g.start+g.duration),this.state=R.FRAG_LOADING,this.hls.trigger(k.Events.FRAG_LOADING,{frag:g,targetBufferTime:F}),this.fragmentLoader.load(g,N).catch(function(B){return H.handleFragLoadError(B)})},d.doFragPartsLoad=function(g,y,F,N){var H=this;return new Promise(function(G,I){var x=[],B=function Y(re){var de=y[re];H.fragmentLoader.loadPart(g,de,N).then(function(he){x[de.index]=he;var xe=he.part;H.hls.trigger(k.Events.FRAG_LOADED,he);var Pe=y[re+1];if(Pe&&Pe.fragment===g)Y(re+1);else return G({frag:g,part:xe,partsLoaded:x})}).catch(I)};B(F)})},d.handleFragLoadError=function(g){var y=g.data;return y&&y.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(k.Events.ERROR,y),null},d._handleTransmuxerFlush=function(g){var y=this.getCurrentContext(g);if(!y||this.state!==R.PARSING){this.fragCurrent||(this.state=R.IDLE);return}var F=y.frag,N=y.part,H=y.level,G=self.performance.now();F.stats.parsing.end=G,N&&(N.stats.parsing.end=G),this.updateLevelTiming(F,N,H,g.partial)},d.getCurrentContext=function(g){var y=this.levels,F=g.level,N=g.sn,H=g.part;if(!y||!y[F])return this.warn("Levels object was unset while buffering fragment "+N+" of level "+F+". The current chunk will not be buffered."),null;var G=y[F],I=H>-1?Object(l.getPartWith)(G,N,H):null,x=I?I.fragment:Object(l.getFragmentWithSN)(G,N,this.fragCurrent);return x?{frag:x,part:I,level:G}:null},d.bufferFragmentData=function(g,y,F,N){if(!g||this.state!==R.PARSING)return;var H=g.data1,G=g.data2,I=H;if(H&&G&&(I=Object(v.appendUint8Array)(H,G)),!I||!I.length)return;var x={type:g.type,frag:y,part:F,chunkMeta:N,parent:y.type,data:I};this.hls.trigger(k.Events.BUFFER_APPENDING,x),g.dropped&&g.independent&&!F&&this.flushBufferGap(y)},d.flushBufferGap=function(g){var y=this.media;if(!y)return;if(!$.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,g.start);return}var F=y.currentTime,N=$.BufferHelper.bufferInfo(y,F,0),H=g.duration,G=Math.min(this.config.maxFragLookUpTolerance*2,H*.25),I=Math.max(Math.min(g.start-G,N.end-G),F+G);g.start-I>G&&this.flushMainBuffer(I,g.start)},d.getFwdBufferInfo=function(g,y){var F=this.config,N=this.getLoadPosition();if(!Object(ee.isFiniteNumber)(N))return null;var H=$.BufferHelper.bufferInfo(g,N,F.maxBufferHole);if(H.len===0&&H.nextStart!==void 0){var G=this.fragmentTracker.getBufferedFrag(N,y);if(G&&H.nextStart<G.end)return $.BufferHelper.bufferInfo(g,N,Math.max(H.nextStart,F.maxBufferHole))}return H},d.getMaxBufferLength=function(g){var y=this.config,F;return g?F=Math.max(8*y.maxBufferSize/g,y.maxBufferLength):F=y.maxBufferLength,Math.min(F,y.maxMaxBufferLength)},d.reduceMaxBufferLength=function(g){var y=this.config,F=g||y.maxBufferLength;return y.maxMaxBufferLength>=F?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(g,y){var F,N,H=y.fragments,G=H.length;if(!G)return null;var I=this.config,x=H[0].start,B;if(y.live){var Y=I.initialLiveManifestSize;if(G<Y)return this.warn("Not enough fragments to start playback (have: "+G+", need: "+Y+")"),null;!y.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(B=this.getInitialLiveFragment(y,H),this.startPosition=B?this.hls.liveSyncPosition||B.start:g)}else g<=x&&(B=H[0]);if(!B){var re=I.lowLatencyMode?y.partEnd:y.fragmentEnd;B=this.getFragmentAtPosition(g,re,y)}return(F=B)!==null&&F!==void 0&&F.initSegment&&!((N=B)!==null&&N!==void 0&&N.initSegment.data)&&!this.bitrateTest&&(B=B.initSegment),B},d.getNextPart=function(g,y,F){for(var N=-1,H=!1,G=!0,I=0,x=g.length;I<x;I++){var B=g[I];if(G=G&&!B.independent,N>-1&&F<B.start)break;var Y=B.loaded;!Y&&(H||B.independent||G)&&B.fragment===y&&(N=I),H=Y}return N},d.loadedEndOfParts=function(g,y){var F=g[g.length-1];return F&&y>F.start&&F.loaded},d.getInitialLiveFragment=function(g,y){var F=this.fragPrevious,N=null;if(F){if(g.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+F.programDateTime),N=Object(o.findFragmentByPDT)(y,F.endProgramDateTime,this.config.maxFragLookUpTolerance)),!N){var H=F.sn+1;if(H>=g.startSN&&H<=g.endSN){var G=y[H-g.startSN];F.cc===G.cc&&(N=G,this.log("Live playlist, switching playlist, load frag with next SN: "+N.sn))}N||(N=Object(o.findFragWithCC)(y,F.cc),N&&this.log("Live playlist, switching playlist, load frag with same CC: "+N.sn))}}else{var I=this.hls.liveSyncPosition;I!==null&&(N=this.getFragmentAtPosition(I,this.bitrateTest?g.fragmentEnd:g.edge,g))}return N},d.getFragmentAtPosition=function(g,y,F){var N=this.config,H=this.fragPrevious,G=F.fragments,I=F.endSN,x=F.fragmentHint,B=N.maxFragLookUpTolerance,Y=!!(N.lowLatencyMode&&F.partList&&x);Y&&x&&!this.bitrateTest&&(G=G.concat(x),I=x.sn);var re;if(g<y){var de=g>y-B?0:B;re=Object(o.findFragmentByPTS)(H,G,g,de)}else re=G[G.length-1];if(re){var he=re.sn-F.startSN,xe=H&&re.level===H.level,Pe=G[he+1],Ce=this.fragmentTracker.getState(re);if(Ce===M.FragmentState.BACKTRACKED){re=null;for(var Oe=he;G[Oe]&&this.fragmentTracker.getState(G[Oe])===M.FragmentState.BACKTRACKED;)H?re=G[Oe--]:re=G[--Oe];re||(re=Pe)}else H&&re.sn===H.sn&&!Y&&(xe&&(re.sn<I&&this.fragmentTracker.getState(Pe)!==M.FragmentState.OK?(this.log("SN "+re.sn+" just loaded, load next one: "+Pe.sn),re=Pe):re=null))}return re},d.synchronizeToLiveEdge=function(g){var y=this.config,F=this.media;if(!F)return;var N=this.hls.liveSyncPosition,H=F.currentTime,G=g.fragments[0].start,I=g.edge,x=H>=G-y.maxFragLookUpTolerance&&H<=I;if(N!==null&&F.duration>N&&(H<N||!x)){var B=y.liveMaxLatencyDuration!==void 0?y.liveMaxLatencyDuration:y.liveMaxLatencyDurationCount*g.targetduration;(!x&&F.readyState<4||H<I-B)&&(this.loadedmetadata||(this.nextLoadPosition=N),F.readyState&&(this.warn("Playback: "+H.toFixed(3)+" is located too far from the end of live sliding playlist: "+I+", reset currentTime to : "+N.toFixed(3)),F.currentTime=N))}},d.alignPlaylists=function(g,y){var F=this.levels,N=this.levelLastLoaded,H=this.fragPrevious,G=N!==null?F[N]:null,I=g.fragments.length;if(!I)return this.warn("No fragments in live playlist"),0;var x=g.fragments[0].start,B=!y,Y=g.alignedSliding&&Object(ee.isFiniteNumber)(x);if(B||!Y&&!x){Object(f.alignStream)(H,G,g);var re=g.fragments[0].start;return this.log("Live playlist sliding: "+re.toFixed(2)+" start-sn: "+(y?y.startSN:"na")+"->"+g.startSN+" prev-sn: "+(H?H.sn:"na")+" fragments: "+I),re}return x},d.waitForCdnTuneIn=function(g){var y=3;return g.live&&g.canBlockReload&&g.tuneInGoal>Math.max(g.partHoldBack,g.partTarget*y)},d.setStartPosition=function(g,y){var F=this.startPosition;if(F<y&&(F=-1),F===-1||this.lastCurrentTime===-1){var N=g.startTimeOffset;Object(ee.isFiniteNumber)(N)?(F=y+N,N<0&&(F+=g.totalduration),F=Math.min(Math.max(y,F),y+g.totalduration),this.log("Start time offset "+N+" found in playlist, adjust startPosition to "+F),this.startPosition=F):g.live?F=this.hls.liveSyncPosition||y:this.startPosition=F=0,this.lastCurrentTime=F}this.nextLoadPosition=F},d.getLoadPosition=function(){var g=this.media,y=0;return this.loadedmetadata&&g?y=g.currentTime:this.nextLoadPosition&&(y=this.nextLoadPosition),y},d.handleFragLoadAborted=function(g,y){this.transmuxer&&g.sn!=="initSegment"&&g.stats.aborted&&(this.warn("Fragment "+g.sn+(y?" part"+y.index:"")+" of level "+g.level+" was aborted"),this.resetFragmentLoading(g))},d.resetFragmentLoading=function(g){(!this.fragCurrent||!this.fragContextChanged(g))&&(this.state=R.IDLE)},d.onFragmentOrKeyLoadError=function(g,y){if(y.fatal)return;var F=y.frag;if(!F||F.type!==g)return;var N=this.fragCurrent;console.assert(N&&F.sn===N.sn&&F.level===N.level&&F.urlId===N.urlId,"Frag load error must match current frag to retry");var H=this.config;if(this.fragLoadError+1<=H.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(F.level))return;var G=Math.min(Math.pow(2,this.fragLoadError)*H.fragLoadingRetryDelay,H.fragLoadingMaxRetryTimeout);this.warn("Fragment "+F.sn+" of "+g+" "+F.level+" failed to load, retrying in "+G+"ms"),this.retryDate=self.performance.now()+G,this.fragLoadError++,this.state=R.FRAG_LOADING_WAITING_RETRY}else y.levelRetry?(g===c.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=R.IDLE):(X.logger.error(y.details+" reaches max retry, redispatch as fatal ..."),y.fatal=!0,this.hls.stopLoad(),this.state=R.ERROR)},d.afterBufferFlushed=function(g,y,F){if(!g)return;var N=$.BufferHelper.getBuffered(g);this.fragmentTracker.detectEvictedFragments(y,N,F),this.state===R.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=R.IDLE},d.resetLiveStartWhenNotLoaded=function(g){if(!this.loadedmetadata){this.startFragRequested=!1;var y=this.levels?this.levels[g].details:null;if(y!=null&&y.live)return this.startPosition=-1,this.setStartPosition(y,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},d.updateLevelTiming=function(g,y,F,N){var H=this,G=F.details;console.assert(!!G,"level.details must be defined");var I=Object.keys(g.elementaryStreams).reduce(function(x,B){var Y=g.elementaryStreams[B];if(Y){var re=Y.endPTS-Y.startPTS;if(re<=0)return H.warn("Could not parse fragment "+g.sn+" "+B+" duration reliably ("+re+") resetting transmuxer to fallback to playlist timing"),H.resetTransmuxer(),x||!1;var de=N?0:Object(l.updateFragPTSDTS)(G,g,Y.startPTS,Y.endPTS,Y.startDTS,Y.endDTS);return H.hls.trigger(k.Events.LEVEL_PTS_UPDATED,{details:G,level:F,drift:de,type:B,frag:g,start:Y.startPTS,end:Y.endPTS}),!0}return x},!1);I?(this.state=R.PARSED,this.hls.trigger(k.Events.FRAG_PARSED,{frag:g,part:y})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},A(u,[{key:"state",get:function(){return this._state},set:function(g){var y=this._state;y!==g&&(this._state=g,this.log(y+"->"+g))}}]),u}(W.default)},"./src/controller/buffer-controller.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return o});var ee=U("./src/polyfills/number.ts"),W=U("./src/events.ts"),M=U("./src/utils/logger.ts"),$=U("./src/errors.ts"),X=U("./src/utils/buffer-helper.ts"),k=U("./src/utils/mediasource-helper.ts"),D=U("./src/loader/fragment.ts"),m=U("./src/controller/buffer-operation-queue.ts"),v=Object(k.getMediaSource)(),f=/([ha]vc.)(?:\.[^.,]+)+/,o=function(){function l(i){var t=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 c=t.hls,h=t.media,A=t.mediaSource;M.logger.log("[buffer-controller]: Media source opened"),h&&(t.updateMediaElementDuration(),c.trigger(W.Events.MEDIA_ATTACHED,{media:h})),A&&A.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){M.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){M.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var r=l.prototype;return r.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},r.destroy=function(){this.unregisterListeners(),this.details=null},r.registerListeners=function(){var t=this.hls;t.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(W.Events.BUFFER_RESET,this.onBufferReset,this),t.on(W.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(W.Events.BUFFER_EOS,this.onBufferEos,this),t.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(W.Events.FRAG_PARSED,this.onFragParsed,this),t.on(W.Events.FRAG_CHANGED,this.onFragChanged,this)},r.unregisterListeners=function(){var t=this.hls;t.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(W.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(W.Events.BUFFER_RESET,this.onBufferReset,this),t.off(W.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(W.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(W.Events.BUFFER_EOS,this.onBufferEos,this),t.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(W.Events.FRAG_PARSED,this.onFragParsed,this),t.off(W.Events.FRAG_CHANGED,this.onFragChanged,this)},r._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new m.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},r.onManifestParsed=function(t,c){var h=2;(c.audio&&!c.video||!c.altAudio)&&(h=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=h,this.details=null,M.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},r.onMediaAttaching=function(t,c){var h=this.media=c.media;if(h&&v){var A=this.mediaSource=new v;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),h.src=self.URL.createObjectURL(A),this._objectUrl=h.src}},r.onMediaDetaching=function(){var t=this.media,c=this.mediaSource,h=this._objectUrl;if(c){if(M.logger.log("[buffer-controller]: media source detaching"),c.readyState==="open")try{c.endOfStream()}catch(A){M.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),c.removeEventListener("sourceopen",this._onMediaSourceOpen),c.removeEventListener("sourceended",this._onMediaSourceEnded),c.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(h&&self.URL.revokeObjectURL(h),t.src===h?(t.removeAttribute("src"),t.load()):M.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(W.Events.MEDIA_DETACHED,void 0)},r.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(c){var h=t.sourceBuffer[c];try{h&&(t.removeBufferListeners(c),t.mediaSource&&t.mediaSource.removeSourceBuffer(h),t.sourceBuffer[c]=void 0)}catch(A){M.logger.warn("[buffer-controller]: Failed to reset the "+c+" buffer",A)}}),this._initSourceBuffer()},r.onBufferCodecs=function(t,c){var h=this,A=this.getSourceBufferTypes().length;if(Object.keys(c).forEach(function(S){if(A){var w=h.tracks[S];if(w&&typeof w.buffer.changeType=="function"){var O=c[S],R=O.codec,b=O.levelCodec,_=O.container,u=(w.levelCodec||w.codec).replace(f,"$1"),d=(b||R).replace(f,"$1");if(u!==d){var E=_+";codecs="+(b||R);h.appendChangeType(S,E)}}}else h.pendingTracks[S]=c[S]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},r.appendChangeType=function(t,c){var h=this,A=this.operationQueue,S={execute:function(){var O=h.sourceBuffer[t];O&&(M.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+c),O.changeType(c)),A.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(O){M.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",O)}};A.append(S,t)},r.onBufferAppending=function(t,c){var h=this,A=this.hls,S=this.operationQueue,w=this.tracks,O=c.data,R=c.type,b=c.frag,_=c.part,u=c.chunkMeta,d=u.buffering[R],E=self.performance.now();d.start=E;var g=b.stats.buffering,y=_?_.stats.buffering:null;g.start===0&&(g.start=E),y&&y.start===0&&(y.start=E);var F=w.audio,N=R==="audio"&&u.id===1&&(F==null?void 0:F.container)==="audio/mpeg",H={execute:function(){if(d.executeStart=self.performance.now(),N){var I=h.sourceBuffer[R];if(I){var x=b.start-I.timestampOffset;Math.abs(x)>=.1&&(M.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+x+") sn: "+b.sn+")"),I.timestampOffset=b.start)}}h.appendExecutor(O,R)},onStart:function(){},onComplete:function(){var I=self.performance.now();d.executeEnd=d.end=I,g.first===0&&(g.first=I),y&&y.first===0&&(y.first=I);var x=h.sourceBuffer,B={};for(var Y in x)B[Y]=X.BufferHelper.getBuffered(x[Y]);h.appendError=0,h.hls.trigger(W.Events.BUFFER_APPENDED,{type:R,frag:b,part:_,chunkMeta:u,parent:b.type,timeRanges:B})},onError:function(I){M.logger.error("[buffer-controller]: Error encountered while trying to append to the "+R+" SourceBuffer",I);var x={type:$.ErrorTypes.MEDIA_ERROR,parent:b.type,details:$.ErrorDetails.BUFFER_APPEND_ERROR,err:I,fatal:!1};I.code===DOMException.QUOTA_EXCEEDED_ERR?x.details=$.ErrorDetails.BUFFER_FULL_ERROR:(h.appendError++,x.details=$.ErrorDetails.BUFFER_APPEND_ERROR,h.appendError>A.config.appendErrorMaxRetry&&(M.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),x.fatal=!0)),A.trigger(W.Events.ERROR,x)}};S.append(H,R)},r.onBufferFlushing=function(t,c){var h=this,A=this.operationQueue,S=function(O){return{execute:h.removeExecutor.bind(h,O,c.startOffset,c.endOffset),onStart:function(){},onComplete:function(){h.hls.trigger(W.Events.BUFFER_FLUSHED,{type:O})},onError:function(b){M.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",b)}}};c.type?A.append(S(c.type),c.type):this.getSourceBufferTypes().forEach(function(w){A.append(S(w),w)})},r.onFragParsed=function(t,c){var h=this,A=c.frag,S=c.part,w=[],O=S?S.elementaryStreams:A.elementaryStreams;O[D.ElementaryStreamTypes.AUDIOVIDEO]?w.push("audiovideo"):(O[D.ElementaryStreamTypes.AUDIO]&&w.push("audio"),O[D.ElementaryStreamTypes.VIDEO]&&w.push("video"));var R=function(){var _=self.performance.now();A.stats.buffering.end=_,S&&(S.stats.buffering.end=_);var u=S?S.stats:A.stats;h.hls.trigger(W.Events.FRAG_BUFFERED,{frag:A,part:S,stats:u,id:A.type})};w.length===0&&M.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(R,w)},r.onFragChanged=function(t,c){this.flushBackBuffer()},r.onBufferEos=function(t,c){var h=this,A=this.getSourceBufferTypes().reduce(function(S,w){var O=h.sourceBuffer[w];return(!c.type||c.type===w)&&(O&&!O.ended&&(O.ended=!0,M.logger.log("[buffer-controller]: "+w+" sourceBuffer now EOS"))),S&&!!(!O||O.ended)},!0);A&&this.blockBuffers(function(){var S=h.mediaSource;if(!S||S.readyState!=="open")return;S.endOfStream()})},r.onLevelUpdated=function(t,c){var h=c.details;if(!h.fragments.length)return;this.details=h,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},r.flushBackBuffer=function(){var t=this.hls,c=this.details,h=this.media,A=this.sourceBuffer;if(!h||c===null)return;var S=this.getSourceBufferTypes();if(!S.length)return;var w=c.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(ee.isFiniteNumber)(w)||w<0)return;var O=h.currentTime,R=c.levelTargetDuration,b=Math.max(w,R),_=Math.floor(O/R)*R-b;S.forEach(function(u){var d=A[u];if(d){var E=X.BufferHelper.getBuffered(d);E.length>0&&_>E.start(0)&&(t.trigger(W.Events.BACK_BUFFER_REACHED,{bufferEnd:_}),c.live&&t.trigger(W.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:_}),t.trigger(W.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:_,type:u}))}})},r.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var t=this.details,c=this.hls,h=this.media,A=this.mediaSource,S=t.fragments[0].start+t.totalduration,w=h.duration,O=Object(ee.isFiniteNumber)(A.duration)?A.duration:0;t.live&&c.config.liveDurationInfinity?(M.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(t)):(S>O&&S>w||!Object(ee.isFiniteNumber)(w))&&(M.logger.log("[buffer-controller]: Updating Media Source duration to "+S.toFixed(3)),A.duration=S)},r.updateSeekableRange=function(t){var c=this.mediaSource,h=t.fragments,A=h.length;if(A&&t.live&&c!==null&&c!==void 0&&c.setLiveSeekableRange){var S=Math.max(0,h[0].start),w=Math.max(S,S+t.totalduration);c.setLiveSeekableRange(S,w)}},r.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,c=this.operationQueue,h=this.pendingTracks,A=Object.keys(h).length;if(A&&!t||A===2){this.createSourceBuffers(h),this.pendingTracks={};var S=this.getSourceBufferTypes();if(S.length===0){this.hls.trigger(W.Events.ERROR,{type:$.ErrorTypes.MEDIA_ERROR,details:$.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}S.forEach(function(w){c.executeNext(w)})}},r.createSourceBuffers=function(t){var c=this.sourceBuffer,h=this.mediaSource;if(!h)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var S in t)if(!c[S]){var w=t[S];if(!w)throw Error("source buffer exists for track "+S+", however track does not");var O=w.levelCodec||w.codec,R=w.container+";codecs="+O;M.logger.log("[buffer-controller]: creating sourceBuffer("+R+")");try{var b=c[S]=h.addSourceBuffer(R),_=S;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.tracks[S]={buffer:b,codec:O,container:w.container,levelCodec:w.levelCodec,id:w.id},A++}catch(u){M.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(W.Events.ERROR,{type:$.ErrorTypes.MEDIA_ERROR,details:$.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:R})}}A&&this.hls.trigger(W.Events.BUFFER_CREATED,{tracks:this.tracks})},r._onSBUpdateStart=function(t){var c=this.operationQueue,h=c.current(t);h.onStart()},r._onSBUpdateEnd=function(t){var c=this.operationQueue,h=c.current(t);h.onComplete(),c.shiftAndExecuteNext(t)},r._onSBUpdateError=function(t,c){M.logger.error("[buffer-controller]: "+t+" SourceBuffer error",c),this.hls.trigger(W.Events.ERROR,{type:$.ErrorTypes.MEDIA_ERROR,details:$.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var h=this.operationQueue.current(t);h&&h.onError(c)},r.removeExecutor=function(t,c,h){var A=this.media,S=this.mediaSource,w=this.operationQueue,O=this.sourceBuffer,R=O[t];if(!A||!S||!R){M.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),w.shiftAndExecuteNext(t);return}var b=Object(ee.isFiniteNumber)(A.duration)?A.duration:Infinity,_=Object(ee.isFiniteNumber)(S.duration)?S.duration:Infinity,u=Math.max(0,c),d=Math.min(h,b,_);d>u?(M.logger.log("[buffer-controller]: Removing ["+u+","+d+"] from the "+t+" SourceBuffer"),console.assert(!R.updating,t+" sourceBuffer must not be updating"),R.remove(u,d)):w.shiftAndExecuteNext(t)},r.appendExecutor=function(t,c){var h=this.operationQueue,A=this.sourceBuffer,S=A[c];if(!S){M.logger.warn("[buffer-controller]: Attempting to append to the "+c+" SourceBuffer, but it does not exist"),h.shiftAndExecuteNext(c);return}S.ended=!1,console.assert(!S.updating,c+" sourceBuffer must not be updating"),S.appendBuffer(t)},r.blockBuffers=function(t,c){var h=this;if(c===void 0&&(c=this.getSourceBufferTypes()),!c.length){M.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var A=this.operationQueue,S=c.map(function(w){return A.appendBlocker(w)});Promise.all(S).then(function(){t(),c.forEach(function(w){var O=h.sourceBuffer[w];(!O||!O.updating)&&A.shiftAndExecuteNext(w)})})},r.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},r.addBufferListener=function(t,c,h){var A=this.sourceBuffer[t];if(!A)return;var S=h.bind(this,t);this.listeners[t].push({event:c,listener:S}),A.addEventListener(c,S)},r.removeBufferListeners=function(t){var c=this.sourceBuffer[t];if(!c)return;this.listeners[t].forEach(function(h){c.removeEventListener(h.event,h.listener)})},l}()},"./src/controller/buffer-operation-queue.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return W});var ee=U("./src/utils/logger.ts"),W=function(){function M(X){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=X}var $=M.prototype;return $.append=function(k,D){var m=this.queues[D];m.push(k),m.length===1&&this.buffers[D]&&this.executeNext(D)},$.insertAbort=function(k,D){var m=this.queues[D];m.unshift(k),this.executeNext(D)},$.appendBlocker=function(k){var D,m=new Promise(function(f){D=f}),v={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(v,k),m},$.executeNext=function(k){var D=this.buffers,m=this.queues,v=D[k],f=m[k];if(f.length){var o=f[0];try{o.execute()}catch(l){ee.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(l),(!v||!v.updating)&&(f.shift(),this.executeNext(k))}}},$.shiftAndExecuteNext=function(k){this.queues[k].shift(),this.executeNext(k)},$.current=function(k){return this.queues[k][0]},M}()},"./src/controller/cap-level-controller.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/events.ts");function W(X,k){for(var D=0;D<k.length;D++){var m=k[D];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(X,m.key,m)}}function M(X,k,D){return k&&W(X.prototype,k),D&&W(X,D),X}var $=function(){function X(D){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=D,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var k=X.prototype;return k.setStreamController=function(m){this.streamController=m},k.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},k.registerListeners=function(){var m=this.hls;m.on(ee.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.on(ee.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.on(ee.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(ee.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.on(ee.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},k.unregisterListener=function(){var m=this.hls;m.off(ee.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.off(ee.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.off(ee.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(ee.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.off(ee.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},k.onFpsDropLevelCapping=function(m,v){X.isLevelAllowed(v.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(v.droppedLevel)},k.onMediaAttaching=function(m,v){this.media=v.media instanceof HTMLVideoElement?v.media:null},k.onManifestParsed=function(m,v){var f=this.hls;this.restrictedLevels=[],this.firstLevel=v.firstLevel,f.config.capLevelToPlayerSize&&v.video&&this.startCapping()},k.onBufferCodecs=function(m,v){var f=this.hls;f.config.capLevelToPlayerSize&&v.video&&this.startCapping()},k.onMediaDetaching=function(){this.stopCapping()},k.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var m=this.hls.levels;if(m.length){var v=this.hls;v.autoLevelCapping=this.getMaxLevel(m.length-1),v.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=v.autoLevelCapping}}},k.getMaxLevel=function(m){var v=this,f=this.hls.levels;if(!f.length)return-1;var o=f.filter(function(l,r){return X.isLevelAllowed(r,v.restrictedLevels)&&r<=m});return this.clientRect=null,X.getMaxLevelByMediaSize(o,this.mediaWidth,this.mediaHeight)},k.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},k.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},k.getDimensions=function(){if(this.clientRect)return this.clientRect;var m=this.media,v={width:0,height:0};if(m){var f=m.getBoundingClientRect();v.width=f.width,v.height=f.height,!v.width&&!v.height&&(v.width=f.right-f.left||m.width||0,v.height=f.bottom-f.top||m.height||0)}return this.clientRect=v,v},X.isLevelAllowed=function(m,v){return v===void 0&&(v=[]),v.indexOf(m)===-1},X.getMaxLevelByMediaSize=function(m,v,f){if(!m||!m.length)return-1;for(var o=function(c,h){return h?c.width!==h.width||c.height!==h.height:!0},l=m.length-1,r=0;r<m.length;r+=1){var i=m[r];if((i.width>=v||i.height>=f)&&o(i,m[r+1])){l=r;break}}return l},M(X,[{key:"mediaWidth",get:function(){return this.getDimensions().width*X.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*X.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var m=1;try{m=self.devicePixelRatio}catch(v){}return m}}]),X}();Z.default=$},"./src/controller/cmcd-controller.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return o});var ee=U("./src/events.ts"),W=U("./src/types/cmcd.ts"),M=U("./src/utils/buffer-helper.ts"),$=U("./src/utils/logger.ts");function X(l,r){for(var i=0;i<r.length;i++){var t=r[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(l,t.key,t)}}function k(l,r,i){return r&&X(l.prototype,r),i&&X(l,i),l}function D(l,r){var i=typeof Symbol!="undefined"&&l[Symbol.iterator]||l["@@iterator"];if(i)return(i=i.call(l)).next.bind(i);if(Array.isArray(l)||(i=m(l))||r&&l&&typeof l.length=="number"){i&&(l=i);var t=0;return function(){return t>=l.length?{done:!0}:{done:!1,value:l[t++]}}}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 m(l,r){if(!l)return;if(typeof l=="string")return v(l,r);var i=Object.prototype.toString.call(l).slice(8,-1);if(i==="Object"&&l.constructor&&(i=l.constructor.name),i==="Map"||i==="Set")return Array.from(l);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return v(l,r)}function v(l,r){(r==null||r>l.length)&&(r=l.length);for(var i=0,t=new Array(r);i<r;i++)t[i]=l[i];return t}function f(){return f=Object.assign||function(l){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(l[t]=i[t])}return l},f.apply(this,arguments)}var o=function(){function l(i){var t=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(){t.initialized&&(t.starved=!0),t.buffering=!0},this.onPlaying=function(){t.initialized||(t.initialized=!0),t.buffering=!1},this.applyPlaylistData=function(A){try{t.apply(A,{ot:W.CMCDObjectType.MANIFEST,su:!t.initialized})}catch(S){$.logger.warn("Could not generate manifest CMCD data.",S)}},this.applyFragmentData=function(A){try{var S=A.frag,w=t.hls.levels[S.level],O=t.getObjectType(S),R={d:S.duration*1e3,ot:O};(O===W.CMCDObjectType.VIDEO||O===W.CMCDObjectType.AUDIO||O==W.CMCDObjectType.MUXED)&&(R.br=w.bitrate/1e3,R.tb=t.getTopBandwidth(O),R.bl=t.getBufferLength(O)),t.apply(A,R)}catch(b){$.logger.warn("Could not generate segment CMCD data.",b)}},this.hls=i;var c=this.config=i.config,h=c.cmcd;h!=null&&(c.pLoader=this.createPlaylistLoader(),c.fLoader=this.createFragmentLoader(),this.sid=h.sessionId||l.uuid(),this.cid=h.contentId,this.useHeaders=h.useHeaders===!0,this.registerListeners())}var r=l.prototype;return r.registerListeners=function(){var t=this.hls;t.on(ee.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(ee.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(ee.Events.BUFFER_CREATED,this.onBufferCreated,this)},r.unregisterListeners=function(){var t=this.hls;t.off(ee.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(ee.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(ee.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},r.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},r.onMediaAttached=function(t,c){this.media=c.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},r.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},r.onBufferCreated=function(t,c){var h,A;this.audioBuffer=(h=c.tracks.audio)===null||h===void 0?void 0:h.buffer,this.videoBuffer=(A=c.tracks.video)===null||A===void 0?void 0:A.buffer},r.createData=function(){var t;return{v:W.CMCDVersion,sf:W.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(t=this.media)===null||t===void 0?void 0:t.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},r.apply=function(t,c){c===void 0&&(c={}),f(c,this.createData());var h=c.ot===W.CMCDObjectType.INIT||c.ot===W.CMCDObjectType.VIDEO||c.ot===W.CMCDObjectType.MUXED;if(this.starved&&h&&(c.bs=!0,c.su=!0,this.starved=!1),c.su==null&&(c.su=this.buffering),this.useHeaders){var A=l.toHeaders(c);if(!Object.keys(A).length)return;t.headers||(t.headers={}),f(t.headers,A)}else{var S=l.toQuery(c);if(!S)return;t.url=l.appendQueryToUri(t.url,S)}},r.getObjectType=function(t){var c=t.type;return c==="subtitle"?W.CMCDObjectType.TIMED_TEXT:t.sn==="initSegment"?W.CMCDObjectType.INIT:c==="audio"?W.CMCDObjectType.AUDIO:c==="main"?this.hls.audioTracks.length?W.CMCDObjectType.VIDEO:W.CMCDObjectType.MUXED:void 0},r.getTopBandwidth=function(t){for(var c=0,h=t===W.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,A=D(h),S;!(S=A()).done;){var w=S.value;w.bitrate>c&&(c=w.bitrate)}return c>0?c:NaN},r.getBufferLength=function(t){var c=this.hls.media,h=t===W.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!h||!c)return NaN;var A=M.BufferHelper.bufferInfo(h,c.currentTime,this.config.maxBufferHole);return A.len*1e3},r.createPlaylistLoader=function(){var t=this.config.pLoader,c=this.applyPlaylistData,h=t||this.config.loader;return function(){function A(w){this.loader=void 0,this.loader=new h(w)}var S=A.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(O,R,b){c(O),this.loader.load(O,R,b)},k(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},r.createFragmentLoader=function(){var t=this.config.fLoader,c=this.applyFragmentData,h=t||this.config.loader;return function(){function A(w){this.loader=void 0,this.loader=new h(w)}var S=A.prototype;return S.destroy=function(){this.loader.destroy()},S.abort=function(){this.loader.abort()},S.load=function(O,R,b){c(O),this.loader.load(O,R,b)},k(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},l.uuid=function(){var t=URL.createObjectURL(new Blob),c=t.toString();return URL.revokeObjectURL(t),c.substr(c.lastIndexOf("/")+1)},l.serialize=function(t){for(var c=[],h=function(N){return!Number.isNaN(N)&&N!=null&&N!==""&&N!==!1},A=function(N){return Math.round(N)},S=function(N){return A(N/100)*100},w=function(N){return encodeURIComponent(N)},O={br:A,d:A,bl:S,dl:S,mtp:S,nor:w,rtp:S,tb:A},R=Object.keys(t||{}).sort(),b=D(R),_;!(_=b()).done;){var u=_.value,d=t[u];if(!h(d))continue;if(u==="v"&&d===1)continue;if(u=="pr"&&d===1)continue;var E=O[u];E&&(d=E(d));var g=typeof d,y=void 0;u==="ot"||u==="sf"||u==="st"?y=u+"="+d:g==="boolean"?y=u:g==="number"?y=u+"="+d:y=u+"="+JSON.stringify(d),c.push(y)}return c.join(",")},l.toHeaders=function(t){for(var c=Object.keys(t),h={},A=["Object","Request","Session","Status"],S=[{},{},{},{}],w={br:0,d:0,ot:0,tb:0,bl:1,dl:1,mtp:1,nor:1,nrr:1,su:1,cid:2,pr:2,sf:2,sid:2,st:2,v:2,bs:3,rtp:3},O=0,R=c;O<R.length;O++){var b=R[O],_=w[b]!=null?w[b]:1;S[_][b]=t[b]}for(var u=0;u<S.length;u++){var d=l.serialize(S[u]);d&&(h["CMCD-"+A[u]]=d)}return h},l.toQuery=function(t){return"CMCD="+encodeURIComponent(l.serialize(t))},l.appendQueryToUri=function(t,c){if(!c)return t;var h=t.includes("?")?"&":"?";return""+t+h+c},l}()},"./src/controller/eme-controller.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/events.ts"),W=U("./src/errors.ts"),M=U("./src/utils/logger.ts"),$=U("./src/utils/mediakeys-helper.ts");function X(o,l){for(var r=0;r<l.length;r++){var i=l[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(o,i.key,i)}}function k(o,l,r){return l&&X(o.prototype,l),r&&X(o,r),o}var D=3,m=function(l,r,i){var t={audioCapabilities:[],videoCapabilities:[]};return l.forEach(function(c){t.audioCapabilities.push({contentType:'audio/mp4; codecs="'+c+'"',robustness:i.audioRobustness||""})}),r.forEach(function(c){t.videoCapabilities.push({contentType:'video/mp4; codecs="'+c+'"',robustness:i.videoRobustness||""})}),[t]},v=function(l,r,i,t){switch(l){case $.KeySystems.WIDEVINE:return m(r,i,t);default:throw new Error("Unknown key-system: "+l)}},f=function(){function o(r){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=r,this._config=r.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 l=o.prototype;return l.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},l._registerListeners=function(){this.hls.on(ee.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(ee.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(ee.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l._unregisterListeners=function(){this.hls.off(ee.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(ee.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(ee.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l.getLicenseServerUrl=function(i){switch(i){case $.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},l._attemptKeySystemAccess=function(i,t,c){var h=this,A=v(i,t,c,this._drmSystemOptions);M.logger.log("Requesting encrypted media key-system access");var S=this.requestMediaKeySystemAccess(i,A);this.mediaKeysPromise=S.then(function(w){return h._onMediaKeySystemAccessObtained(i,w)}),S.catch(function(w){M.logger.error('Failed to obtain key-system "'+i+'" access:',w)})},l._onMediaKeySystemAccessObtained=function(i,t){var c=this;M.logger.log('Access for key-system "'+i+'" obtained');var h={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:i};this._mediaKeysList.push(h);var A=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(S){return h.mediaKeys=S,M.logger.log('Media-keys created for key-system "'+i+'"'),c._onMediaKeysCreated(),S});return A.catch(function(S){M.logger.error("Failed to create media-keys:",S)}),A},l._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),i._onNewMediaKeySession(t.mediaKeysSession))})},l._onNewMediaKeySession=function(i){var t=this;M.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(c){t._onKeySessionMessage(i,c.message)},!1)},l._onKeySessionMessage=function(i,t){M.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(c){M.logger.log("Received license data (length: "+(c&&c.byteLength)+"), updating key-session"),i.update(c)})},l.onMediaEncrypted=function(i){var t=this;if(M.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var c=function(A){if(!t._media)return;t._attemptSetMediaKeys(A),t._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(c).catch(c)},l._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys){M.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}M.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},l._generateRequestWithPreferredKeySession=function(i,t){var c=this,h=this._mediaKeysList[0];if(!h){M.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(h.mediaKeysSessionInitialized){M.logger.warn("Key-Session already initialized but requested again");return}var A=h.mediaKeysSession;if(!A){M.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){M.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}M.logger.log('Generating key-session request for "'+i+'" init data type'),h.mediaKeysSessionInitialized=!0,A.generateRequest(i,t).then(function(){M.logger.debug("Key-session generation succeeded")}).catch(function(S){M.logger.error("Error generating key-session request:",S),c.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},l._createLicenseXhr=function(i,t,c){var h=new XMLHttpRequest;h.responseType="arraybuffer",h.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,h,i,t,c);var A=this._licenseXhrSetup;if(A)try{A.call(this.hls,h,i),A=void 0}catch(S){M.logger.error(S)}try{h.readyState||h.open("POST",i,!0),A&&A.call(this.hls,h,i)}catch(S){throw new Error("issue setting up KeySystem license XHR "+S)}return h},l._onLicenseRequestReadyStageChange=function(i,t,c,h){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,M.logger.log("License request succeeded");var A=i.response,S=this._licenseResponseCallback;if(S)try{A=S.call(this.hls,i,t)}catch(O){M.logger.error(O)}h(A)}else{if(M.logger.error("License Request XHR failed ("+t+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var w=D-this._requestLicenseFailureCount+1;M.logger.warn("Retrying license request, "+w+" attempts left"),this._requestLicense(c,h)}break}},l._generateLicenseRequestChallenge=function(i,t){switch(i.mediaKeySystemDomain){case $.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},l._requestLicense=function(i,t){M.logger.log("Requesting content license for key-system");var c=this._mediaKeysList[0];if(!c){M.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var h=this.getLicenseServerUrl(c.mediaKeySystemDomain),A=this._createLicenseXhr(h,i,t);M.logger.log("Sending license request to URL: "+h);var S=this._generateLicenseRequestChallenge(c,i);A.send(S)}catch(w){M.logger.error("Failure requesting DRM license: "+w),this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.KEY_SYSTEM_ERROR,details:W.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},l.onMediaAttached=function(i,t){if(!this._emeEnabled)return;var c=t.media;this._media=c,c.addEventListener("encrypted",this._onMediaEncrypted)},l.onMediaDetached=function(){var i=this._media,t=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map(function(c){if(c.mediaKeysSession)return c.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},l.onManifestParsed=function(i,t){if(!this._emeEnabled)return;var c=t.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),h=t.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess($.KeySystems.WIDEVINE,c,h)},k(o,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),o}();Z.default=f},"./src/controller/fps-controller.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/events.ts"),W=U("./src/utils/logger.ts"),M=function(){function $(k){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=k,this.registerListeners()}var X=$.prototype;return X.setStreamController=function(D){this.streamController=D},X.registerListeners=function(){this.hls.on(ee.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},X.unregisterListeners=function(){this.hls.off(ee.Events.MEDIA_ATTACHING,this.onMediaAttaching)},X.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},X.onMediaAttaching=function(D,m){var v=this.hls.config;if(v.capLevelOnFPSDrop){var f=m.media instanceof self.HTMLVideoElement?m.media:null;this.media=f,f&&typeof f.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),v.fpsDroppedMonitoringPeriod)}},X.checkFPS=function(D,m,v){var f=performance.now();if(m){if(this.lastTime){var o=f-this.lastTime,l=v-this.lastDroppedFrames,r=m-this.lastDecodedFrames,i=1e3*l/o,t=this.hls;if(t.trigger(ee.Events.FPS_DROP,{currentDropped:l,currentDecoded:r,totalDroppedFrames:v}),i>0&&l>t.config.fpsDroppedMonitoringThreshold*r){var c=t.currentLevel;W.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(t.autoLevelCapping===-1||t.autoLevelCapping>=c)&&(c=c-1,t.trigger(ee.Events.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:t.currentLevel}),t.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=f,this.lastDroppedFrames=v,this.lastDecodedFrames=m}},X.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var m=D.getVideoPlaybackQuality();this.checkFPS(D,m.totalVideoFrames,m.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},$}();Z.default=M},"./src/controller/fragment-finders.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"findFragmentByPDT",function(){return M}),U.d(Z,"findFragmentByPTS",function(){return $}),U.d(Z,"fragmentWithinToleranceTest",function(){return X}),U.d(Z,"pdtWithinToleranceTest",function(){return k}),U.d(Z,"findFragWithCC",function(){return D});var ee=U("./src/polyfills/number.ts"),W=U("./src/utils/binary-search.ts");function M(m,v,f){if(v===null||!Array.isArray(m)||!m.length||!Object(ee.isFiniteNumber)(v))return null;var o=m[0].programDateTime;if(v<(o||0))return null;var l=m[m.length-1].endProgramDateTime;if(v>=(l||0))return null;f=f||0;for(var r=0;r<m.length;++r){var i=m[r];if(k(v,f,i))return i}return null}function $(m,v,f,o){f===void 0&&(f=0),o===void 0&&(o=0);var l=null;if(m?l=v[m.sn-v[0].sn+1]||null:f===0&&v[0].start===0&&(l=v[0]),l&&X(f,o,l)===0)return l;var r=W.default.search(v,X.bind(null,f,o));return r||l}function X(m,v,f){m===void 0&&(m=0),v===void 0&&(v=0);var o=Math.min(v,f.duration+(f.deltaPTS?f.deltaPTS:0));return f.start+f.duration-o<=m?1:f.start-o>m&&f.start?-1:0}function k(m,v,f){var o=Math.min(v,f.duration+(f.deltaPTS?f.deltaPTS:0))*1e3,l=f.endProgramDateTime||0;return l-o>m}function D(m,v){return W.default.search(m,function(f){return f.cc<v?1:f.cc>v?-1:0})}},"./src/controller/fragment-tracker.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"FragmentState",function(){return M}),U.d(Z,"FragmentTracker",function(){return $});var ee=U("./src/events.ts"),W=U("./src/types/loader.ts"),M;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(M||(M={}));var $=function(){function D(v){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=v,this._registerListeners()}var m=D.prototype;return m._registerListeners=function(){var f=this.hls;f.on(ee.Events.BUFFER_APPENDED,this.onBufferAppended,this),f.on(ee.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.on(ee.Events.FRAG_LOADED,this.onFragLoaded,this)},m._unregisterListeners=function(){var f=this.hls;f.off(ee.Events.BUFFER_APPENDED,this.onBufferAppended,this),f.off(ee.Events.FRAG_BUFFERED,this.onFragBuffered,this),f.off(ee.Events.FRAG_LOADED,this.onFragLoaded,this)},m.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},m.getAppendedFrag=function(f,o){if(o===W.PlaylistLevelType.MAIN){var l=this.activeFragment,r=this.activeParts;if(!l)return null;if(r)for(var i=r.length;i--;){var t=r[i],c=t?t.end:l.appendedPTS;if(t.start<=f&&c!==void 0&&f<=c)return i>9&&(this.activeParts=r.slice(i-9)),t}else if(l.start<=f&&l.appendedPTS!==void 0&&f<=l.appendedPTS)return l}return this.getBufferedFrag(f,o)},m.getBufferedFrag=function(f,o){for(var l=this.fragments,r=Object.keys(l),i=r.length;i--;){var t=l[r[i]];if((t==null?void 0:t.body.type)===o&&t.buffered){var c=t.body;if(c.start<=f&&f<=c.end)return c}}return null},m.detectEvictedFragments=function(f,o,l){var r=this;Object.keys(this.fragments).forEach(function(i){var t=r.fragments[i];if(!t)return;if(!t.buffered){t.body.type===l&&r.removeFragment(t.body);return}var c=t.range[f];if(!c)return;c.time.some(function(h){var A=!r.isTimeBuffered(h.startPTS,h.endPTS,o);return A&&r.removeFragment(t.body),A})})},m.detectPartialFragments=function(f){var o=this,l=this.timeRanges,r=f.frag,i=f.part;if(!l||r.sn==="initSegment")return;var t=k(r),c=this.fragments[t];if(!c)return;Object.keys(l).forEach(function(h){var A=r.elementaryStreams[h];if(!A)return;var S=l[h],w=i!==null||A.partial===!0;c.range[h]=o.getBufferedTimes(r,i,w,S)}),c.backtrack=c.loaded=null,Object.keys(c.range).length?c.buffered=!0:this.removeFragment(c.body)},m.fragBuffered=function(f){var o=k(f),l=this.fragments[o];l&&(l.backtrack=l.loaded=null,l.buffered=!0)},m.getBufferedTimes=function(f,o,l,r){for(var i={time:[],partial:l},t=o?o.start:f.start,c=o?o.end:f.end,h=f.minEndPTS||c,A=f.maxStartPTS||t,S=0;S<r.length;S++){var w=r.start(S)-this.bufferPadding,O=r.end(S)+this.bufferPadding;if(A>=w&&h<=O){i.time.push({startPTS:Math.max(t,r.start(S)),endPTS:Math.min(c,r.end(S))});break}else if(t<O&&c>w)i.partial=!0,i.time.push({startPTS:Math.max(t,r.start(S)),endPTS:Math.min(c,r.end(S))});else if(c<=w)break}return i},m.getPartialFragment=function(f){var o=null,l,r,i,t=0,c=this.bufferPadding,h=this.fragments;return Object.keys(h).forEach(function(A){var S=h[A];if(!S)return;X(S)&&(r=S.body.start-c,i=S.body.end+c,f>=r&&f<=i&&(l=Math.min(f-r,i-f),t<=l&&(o=S.body,t=l)))}),o},m.getState=function(f){var o=k(f),l=this.fragments[o];return l?l.buffered?X(l)?M.PARTIAL:M.OK:l.backtrack?M.BACKTRACKED:M.APPENDING:M.NOT_LOADED},m.backtrack=function(f,o){var l=k(f),r=this.fragments[l];if(!r||r.backtrack)return null;var i=r.backtrack=o||r.loaded;return r.loaded=null,i},m.getBacktrackData=function(f){var o=k(f),l=this.fragments[o];if(l){var r,i=l.backtrack;if(i!=null&&(r=i.payload)!==null&&r!==void 0&&r.byteLength)return i;this.removeFragment(f)}return null},m.isTimeBuffered=function(f,o,l){for(var r,i,t=0;t<l.length;t++){if(r=l.start(t)-this.bufferPadding,i=l.end(t)+this.bufferPadding,f>=r&&o<=i)return!0;if(o<=r)return!1}return!1},m.onFragLoaded=function(f,o){var l=o.frag,r=o.part;if(l.sn==="initSegment"||l.bitrateTest||r)return;var i=k(l);this.fragments[i]={body:l,loaded:o,backtrack:null,buffered:!1,range:Object.create(null)}},m.onBufferAppended=function(f,o){var l=this,r=o.frag,i=o.part,t=o.timeRanges;if(r.type===W.PlaylistLevelType.MAIN)if(this.activeFragment=r,i){var c=this.activeParts;c||(this.activeParts=c=[]),c.push(i)}else this.activeParts=null;this.timeRanges=t,Object.keys(t).forEach(function(h){var A=t[h];if(l.detectEvictedFragments(h,A),!i)for(var S=0;S<A.length;S++)r.appendedPTS=Math.max(A.end(S),r.appendedPTS||0)})},m.onFragBuffered=function(f,o){this.detectPartialFragments(o)},m.hasFragment=function(f){var o=k(f);return!!this.fragments[o]},m.removeFragmentsInRange=function(f,o,l){var r=this;Object.keys(this.fragments).forEach(function(i){var t=r.fragments[i];if(!t)return;if(t.buffered){var c=t.body;c.type===l&&c.start<o&&c.end>f&&r.removeFragment(c)}})},m.removeFragment=function(f){var o=k(f);f.stats.loaded=0,f.clearElementaryStreamInfo(),delete this.fragments[o]},m.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function X(D){var m,v;return D.buffered&&(((m=D.range.video)===null||m===void 0?void 0:m.partial)||((v=D.range.audio)===null||v===void 0?void 0:v.partial))}function k(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"STALL_MINIMUM_DURATION_MS",function(){return X}),U.d(Z,"MAX_START_GAP_JUMP",function(){return k}),U.d(Z,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),U.d(Z,"SKIP_BUFFER_RANGE_START",function(){return m}),U.d(Z,"default",function(){return v});var ee=U("./src/utils/buffer-helper.ts"),W=U("./src/errors.ts"),M=U("./src/events.ts"),$=U("./src/utils/logger.ts"),X=250,k=2,D=.1,m=.05,v=function(){function f(l,r,i,t){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=l,this.media=r,this.fragmentTracker=i,this.hls=t}var o=f.prototype;return o.destroy=function(){this.hls=this.fragmentTracker=this.media=null},o.poll=function(r){var i=this.config,t=this.media,c=this.stalled,h=t.currentTime,A=t.seeking,S=this.seeking&&!A,w=!this.seeking&&A;if(this.seeking=A,h!==r){if(this.moved=!0,c!==null){if(this.stallReported){var O=self.performance.now()-c;$.logger.warn("playback not stuck anymore @"+h+", after "+Math.round(O)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((w||S)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!ee.BufferHelper.getBuffered(t).length)return;var R=ee.BufferHelper.bufferInfo(t,h,0),b=R.len>0,_=R.nextStart||0;if(!b&&!_)return;if(A){var u=R.len>k,d=!_||_-h>k&&!this.fragmentTracker.getPartialFragment(h);if(u||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,g=Math.max(_,R.start||0)-h,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,F=y==null||((E=y.details)===null||E===void 0)?void 0:E.live,N=F?y.details.targetduration*2:k;if(g>0&&g<=N){this._trySkipBufferHole(null);return}}var H=self.performance.now();if(c===null){this.stalled=H;return}var G=H-c;!A&&G>=X&&this._reportStall(R.len);var I=ee.BufferHelper.bufferInfo(t,h,i.maxBufferHole);this._tryFixBufferStall(I,G)},o._tryFixBufferStall=function(r,i){var t=this.config,c=this.fragmentTracker,h=this.media,A=h.currentTime,S=c.getPartialFragment(A);if(S){var w=this._trySkipBufferHole(S);if(w)return}r.len>t.maxBufferHole&&i>t.highBufferWatchdogPeriod*1e3&&($.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},o._reportStall=function(r){var i=this.hls,t=this.media,c=this.stallReported;c||(this.stallReported=!0,$.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+r+")"),i.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:r}))},o._trySkipBufferHole=function(r){for(var i=this.config,t=this.hls,c=this.media,h=c.currentTime,A=0,S=ee.BufferHelper.getBuffered(c),w=0;w<S.length;w++){var O=S.start(w);if(h+i.maxBufferHole>=A&&h<O){var R=Math.max(O+m,c.currentTime+D);return $.logger.warn("skipping hole, adjusting currentTime from "+h+" to "+R),this.moved=!0,this.stalled=null,c.currentTime=R,r&&t.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+h+" to "+R,frag:r}),R}A=S.end(w)}return 0},o._tryNudgeBuffer=function(){var r=this.config,i=this.hls,t=this.media,c=t.currentTime,h=(this.nudgeRetry||0)+1;if(this.nudgeRetry=h,h<r.nudgeMaxRetry){var A=c+h*r.nudgeOffset;$.logger.warn("Nudging 'currentTime' from "+c+" to "+A),t.currentTime=A,i.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else $.logger.error("Playhead still not moving while enough data buffered @"+c+" after "+r.nudgeMaxRetry+" nudges"),i.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},f}()},"./src/controller/id3-track-controller.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/events.ts"),W=U("./src/utils/texttrack-utils.ts"),M=U("./src/demux/id3.ts"),$=.25,X=function(){function k(m){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=m,this._registerListeners()}var D=k.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var v=this.hls;v.on(ee.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.on(ee.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.on(ee.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),v.on(ee.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var v=this.hls;v.off(ee.Events.MEDIA_ATTACHED,this.onMediaAttached,this),v.off(ee.Events.MEDIA_DETACHING,this.onMediaDetaching,this),v.off(ee.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),v.off(ee.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(v,f){this.media=f.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(W.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(v){if(!this.media)return;for(var f=0;f<v.length;f++){var o=v[f];if(o.kind==="metadata"&&o.label==="id3")return Object(W.sendAddTrackEvent)(o,this.media),o}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(v,f){if(!this.media)return;var o=f.frag,l=f.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var r=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<l.length;i++){var t=M.getID3Frames(l[i].data);if(t){var c=l[i].pts,h=i<l.length-1?l[i+1].pts:o.end,A=h-c;A<=0&&(h=c+$);for(var S=0;S<t.length;S++){var w=t[S];if(!M.isTimeStampFrame(w)){var O=new r(c,h,"");O.value=w,this.id3Track.addCue(O)}}}}},D.onBufferFlushing=function(v,f){var o=f.startOffset,l=f.endOffset,r=f.type;if(!r||r==="audio"){var i=this.id3Track;i&&Object(W.removeCuesInRange)(i,o,l)}},k}();Z.default=X},"./src/controller/latency-controller.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return k});var ee=U("./src/errors.ts"),W=U("./src/events.ts"),M=U("./src/utils/logger.ts");function $(D,m){for(var v=0;v<m.length;v++){var f=m[v];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(D,f.key,f)}}function X(D,m,v){return m&&$(D.prototype,m),v&&$(D,v),D}var k=function(){function D(v){var f=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 f.timeupdate()},this.hls=v,this.config=v.config,this.registerListeners()}var m=D.prototype;return m.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},m.registerListeners=function(){this.hls.on(W.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(W.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(W.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){this.hls.off(W.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(W.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(W.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(W.Events.ERROR,this.onError)},m.onMediaAttached=function(f,o){this.media=o.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},m.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},m.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},m.onLevelUpdated=function(f,o){var l=o.details;this.levelDetails=l,l.advanced&&this.timeupdate(),!l.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},m.onError=function(f,o){if(o.details!==ee.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,M.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},m.timeupdate=function(){var f=this.media,o=this.levelDetails;if(!f||!o)return;this.currentTime=f.currentTime;var l=this.computeLatency();if(l===null)return;this._latency=l;var r=this.config,i=r.lowLatencyMode,t=r.maxLiveSyncPlaybackRate;if(!i||t===1)return;var c=this.targetLatency;if(c===null)return;var h=l-c,A=Math.min(this.maxLatency,c+o.targetduration),S=h<A;if(o.live&&S&&h>.05&&this.forwardBufferLength>1){var w=Math.min(2,Math.max(1,t)),O=Math.round(2/(1+Math.exp(-.75*h-this.edgeStalled))*20)/20;f.playbackRate=Math.min(w,Math.max(1,O))}else f.playbackRate!==1&&f.playbackRate!==0&&(f.playbackRate=1)},m.estimateLiveEdge=function(){var f=this.levelDetails;return f===null?null:f.edge+f.age},m.computeLatency=function(){var f=this.estimateLiveEdge();return f===null?null:f-this.currentTime},X(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var f=this.config,o=this.levelDetails;return f.liveMaxLatencyDuration!==void 0?f.liveMaxLatencyDuration:o?f.liveMaxLatencyDurationCount*o.targetduration:0}},{key:"targetLatency",get:function(){var f=this.levelDetails;if(f===null)return null;var o=f.holdBack,l=f.partHoldBack,r=f.targetduration,i=this.config,t=i.liveSyncDuration,c=i.liveSyncDurationCount,h=i.lowLatencyMode,A=this.hls.userConfig,S=h&&l||o;(A.liveSyncDuration||A.liveSyncDurationCount||S===0)&&(S=t!==void 0?t:c*r);var w=r,O=1;return S+Math.min(this.stallCount*O,w)}},{key:"liveSyncPosition",get:function(){var f=this.estimateLiveEdge(),o=this.targetLatency,l=this.levelDetails;if(f===null||o===null||l===null)return null;var r=l.edge,i=f-o-this.edgeStalled,t=r-l.totalduration,c=r-(this.config.lowLatencyMode&&l.partTarget||l.targetduration);return Math.min(Math.max(t,i),c)}},{key:"drift",get:function(){var f=this.levelDetails;return f===null?1:f.drift}},{key:"edgeStalled",get:function(){var f=this.levelDetails;if(f===null)return 0;var o=(this.config.lowLatencyMode&&f.partTarget||f.targetduration)*3;return Math.max(f.age-o,0)}},{key:"forwardBufferLength",get:function(){var f=this.media,o=this.levelDetails;if(!f||!o)return 0;var l=f.buffered.length;return l?f.buffered.end(l-1):o.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return i});var ee=U("./src/types/level.ts"),W=U("./src/events.ts"),M=U("./src/errors.ts"),$=U("./src/utils/codecs.ts"),X=U("./src/controller/level-helper.ts"),k=U("./src/controller/base-playlist-controller.ts"),D=U("./src/types/loader.ts");function m(){return m=Object.assign||function(t){for(var c=1;c<arguments.length;c++){var h=arguments[c];for(var A in h)Object.prototype.hasOwnProperty.call(h,A)&&(t[A]=h[A])}return t},m.apply(this,arguments)}function v(t,c){for(var h=0;h<c.length;h++){var A=c[h];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(t,A.key,A)}}function f(t,c,h){return c&&v(t.prototype,c),h&&v(t,h),t}function o(t,c){t.prototype=Object.create(c.prototype),t.prototype.constructor=t,l(t,c)}function l(t,c){return l=Object.setPrototypeOf||function(A,S){return A.__proto__=S,A},l(t,c)}var r=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(t){o(c,t);function c(A){var S;return S=t.call(this,A,"[level-controller]")||this,S._levels=[],S._firstLevel=-1,S._startLevel=void 0,S.currentLevelIndex=-1,S.manualLevelIndex=-1,S.onParsedComplete=void 0,S._registerListeners(),S}var h=c.prototype;return h._registerListeners=function(){var S=this.hls;S.on(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.on(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.on(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.on(W.Events.FRAG_LOADED,this.onFragLoaded,this),S.on(W.Events.ERROR,this.onError,this)},h._unregisterListeners=function(){var S=this.hls;S.off(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),S.off(W.Events.LEVEL_LOADED,this.onLevelLoaded,this),S.off(W.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),S.off(W.Events.FRAG_LOADED,this.onFragLoaded,this),S.off(W.Events.ERROR,this.onError,this)},h.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},h.startLoad=function(){var S=this._levels;S.forEach(function(w){w.loadError=0}),t.prototype.startLoad.call(this)},h.onManifestLoaded=function(S,w){var O=[],R=[],b=[],_,u={},d,E=!1,g=!1,y=!1;if(w.levels.forEach(function(G){var I=G.attrs;E=E||!!(G.width&&G.height),g=g||!!G.videoCodec,y=y||!!G.audioCodec,r&&G.audioCodec&&G.audioCodec.indexOf("mp4a.40.34")!==-1&&(G.audioCodec=void 0);var x=G.bitrate+"-"+G.attrs.RESOLUTION+"-"+G.attrs.CODECS;d=u[x],d?d.url.push(G.url):(d=new ee.Level(G),u[x]=d,O.push(d)),I&&(I.AUDIO&&Object(X.addGroupId)(d,"audio",I.AUDIO),I.SUBTITLES&&Object(X.addGroupId)(d,"text",I.SUBTITLES))}),(E||g)&&y&&(O=O.filter(function(G){var I=G.videoCodec,x=G.width,B=G.height;return!!I||!!(x&&B)})),O=O.filter(function(G){var I=G.audioCodec,x=G.videoCodec;return(!I||Object($.isCodecSupportedInMp4)(I,"audio"))&&(!x||Object($.isCodecSupportedInMp4)(x,"video"))}),w.audioTracks&&(R=w.audioTracks.filter(function(G){return!G.audioCodec||Object($.isCodecSupportedInMp4)(G.audioCodec,"audio")}),Object(X.assignTrackIdsByGroup)(R)),w.subtitles&&(b=w.subtitles,Object(X.assignTrackIdsByGroup)(b)),O.length>0){_=O[0].bitrate,O.sort(function(G,I){return G.bitrate-I.bitrate}),this._levels=O;for(var F=0;F<O.length;F++)if(O[F].bitrate===_){this._firstLevel=F,this.log("manifest loaded, "+O.length+" level(s) found, first bitrate: "+_);break}var N=y&&!g,H={levels:O,audioTracks:R,subtitleTracks:b,firstLevel:this._firstLevel,stats:w.stats,audio:y,video:g,altAudio:!N&&R.some(function(G){return!!G.url})};this.hls.trigger(W.Events.MANIFEST_PARSED,H),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(W.Events.ERROR,{type:M.ErrorTypes.MEDIA_ERROR,details:M.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:w.url,reason:"no level with compatible codecs found in manifest"})},h.onError=function(S,w){if(t.prototype.onError.call(this,S,w),w.fatal)return;var O=w.context,R=this._levels[this.currentLevelIndex];if(O&&(O.type===D.PlaylistContextType.AUDIO_TRACK&&R.audioGroupIds&&O.groupId===R.audioGroupIds[R.urlId]||O.type===D.PlaylistContextType.SUBTITLE_TRACK&&R.textGroupIds&&O.groupId===R.textGroupIds[R.urlId])){this.redundantFailover(this.currentLevelIndex);return}var b=!1,_=!0,u;switch(w.details){case M.ErrorDetails.FRAG_LOAD_ERROR:case M.ErrorDetails.FRAG_LOAD_TIMEOUT:case M.ErrorDetails.KEY_LOAD_ERROR:case M.ErrorDetails.KEY_LOAD_TIMEOUT:if(w.frag){var d=this._levels[w.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(u=w.frag.level)):u=w.frag.level}break;case M.ErrorDetails.LEVEL_LOAD_ERROR:case M.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(_=!1),u=O.level),b=!0;break;case M.ErrorDetails.REMUX_ALLOC_ERROR:u=w.level,b=!0;break}u!==void 0&&this.recoverLevel(w,u,b,_)},h.recoverLevel=function(S,w,O,R){var b=S.details,_=this._levels[w];if(_.loadError++,O){var u=this.retryLoadingOrFail(S);if(u)S.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(R){var d=_.url.length;if(d>1&&_.loadError<d)S.levelRetry=!0,this.redundantFailover(w);else if(this.manualLevelIndex===-1){var E=w===0?this._levels.length-1:w-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(b+": switch to "+E),S.levelRetry=!0,this.hls.nextAutoLevel=E)}}},h.redundantFailover=function(S){var w=this._levels[S],O=w.url.length;if(O>1){var R=(w.urlId+1)%O;this.warn("Switching to redundant URL-id "+R),this._levels.forEach(function(b){b.urlId=R}),this.level=S}},h.onFragLoaded=function(S,w){var O=w.frag;if(O!==void 0&&O.type===D.PlaylistLevelType.MAIN){var R=this._levels[O.level];R!==void 0&&(R.fragmentError=0,R.loadError=0)}},h.onLevelLoaded=function(S,w){var O,R=w.level,b=w.details,_=this._levels[R];if(!_){var u;this.warn("Invalid level index "+R),(u=w.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(b.deltaUpdateFailed=!0);return}R===this.currentLevelIndex?(_.fragmentError===0&&(_.loadError=0,this.retryCount=0),this.playlistLoaded(R,w,_.details)):(O=w.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(b.deltaUpdateFailed=!0)},h.onAudioTrackSwitched=function(S,w){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var R=-1,b=this.hls.audioTracks[w.id].groupId,_=0;_<O.audioGroupIds.length;_++)if(O.audioGroupIds[_]===b){R=_;break}R!==O.urlId&&(O.urlId=R,this.startLoad())}},h.loadPlaylist=function(S){var w=this.currentLevelIndex,O=this._levels[w];if(this.canLoad&&O&&O.url.length>0){var R=O.urlId,b=O.url[R];if(S)try{b=S.addDirectives(b)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Attempt loading level index "+w+(S?" at sn "+S.msn+" part "+S.part:"")+" with URL-id "+R+" "+b),this.clearTimer(),this.hls.trigger(W.Events.LEVEL_LOADING,{url:b,level:w,id:R,deliveryDirectives:S||null})}},h.removeLevel=function(S,w){var O=function(_,u){return u!==w},R=this._levels.filter(function(b,_){return _!==S?!0:b.url.length>1&&w!==void 0?(b.url=b.url.filter(O),b.audioGroupIds&&(b.audioGroupIds=b.audioGroupIds.filter(O)),b.textGroupIds&&(b.textGroupIds=b.textGroupIds.filter(O)),b.urlId=0,!0):!1}).map(function(b,_){var u=b.details;return u!=null&&u.fragments&&u.fragments.forEach(function(d){d.level=_}),b});this._levels=R,this.hls.trigger(W.Events.LEVELS_UPDATED,{levels:R})},f(c,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(S){var w,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===S&&(w=O[S])!==null&&w!==void 0&&w.details)return;if(S<0||S>=O.length){var R=S<0;if(this.hls.trigger(W.Events.ERROR,{type:M.ErrorTypes.OTHER_ERROR,details:M.ErrorDetails.LEVEL_SWITCH_ERROR,level:S,fatal:R,reason:"invalid level idx"}),R)return;S=Math.min(S,O.length-1)}this.clearTimer();var b=this.currentLevelIndex,_=O[b],u=O[S];this.log("switching to level "+S+" from "+b),this.currentLevelIndex=S;var d=m({},u,{level:S,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete d._urlId,this.hls.trigger(W.Events.LEVEL_SWITCHING,d);var E=u.details;if(!E||E.live){var g=this.switchParams(u.uri,_==null?void 0:_.details);this.loadPlaylist(g)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(S){this.manualLevelIndex=S,this._startLevel===void 0&&(this._startLevel=S),S!==-1&&(this.level=S)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(S){this._firstLevel=S}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var S=this.hls.config.startLevel;return S!==void 0?S:this._firstLevel}else return this._startLevel},set:function(S){this._startLevel=S}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(S){this.level=S,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=S)}}]),c}(k.default)},"./src/controller/level-helper.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"addGroupId",function(){return M}),U.d(Z,"assignTrackIdsByGroup",function(){return $}),U.d(Z,"updatePTS",function(){return X}),U.d(Z,"updateFragPTSDTS",function(){return D}),U.d(Z,"mergeDetails",function(){return m}),U.d(Z,"mapPartIntersection",function(){return v}),U.d(Z,"mapFragmentIntersection",function(){return f}),U.d(Z,"adjustSliding",function(){return o}),U.d(Z,"addSliding",function(){return l}),U.d(Z,"computeReloadInterval",function(){return r}),U.d(Z,"getFragmentWithSN",function(){return i}),U.d(Z,"getPartWith",function(){return t});var ee=U("./src/polyfills/number.ts"),W=U("./src/utils/logger.ts");function M(c,h,A){switch(h){case"audio":c.audioGroupIds||(c.audioGroupIds=[]),c.audioGroupIds.push(A);break;case"text":c.textGroupIds||(c.textGroupIds=[]),c.textGroupIds.push(A);break}}function $(c){var h={};c.forEach(function(A){var S=A.groupId||"";A.id=h[S]=h[S]||0,h[S]++})}function X(c,h,A){var S=c[h],w=c[A];k(S,w)}function k(c,h){var A=h.startPTS;if(Object(ee.isFiniteNumber)(A)){var S=0,w;h.sn>c.sn?(S=A-c.start,w=c):(S=c.start-A,w=h),w.duration!==S&&(w.duration=S)}else if(h.sn>c.sn){var O=c.cc===h.cc;O&&c.minEndPTS?h.start=c.start+(c.minEndPTS-c.start):h.start=c.start+c.duration}else h.start=Math.max(c.start-h.duration,0)}function D(c,h,A,S,w,O){var R=S-A;R<=0&&(W.logger.warn("Fragment should have a positive duration",h),S=A+h.duration,O=w+h.duration);var b=A,_=S,u=h.startPTS,d=h.endPTS;if(Object(ee.isFiniteNumber)(u)){var E=Math.abs(u-A);Object(ee.isFiniteNumber)(h.deltaPTS)?h.deltaPTS=Math.max(E,h.deltaPTS):h.deltaPTS=E,b=Math.max(A,u),A=Math.min(A,u),w=Math.min(w,h.startDTS),_=Math.min(S,d),S=Math.max(S,d),O=Math.max(O,h.endDTS)}h.duration=S-A;var g=A-h.start;h.appendedPTS=S,h.start=h.startPTS=A,h.maxStartPTS=b,h.startDTS=w,h.endPTS=S,h.minEndPTS=_,h.endDTS=O;var y=h.sn;if(!c||y<c.startSN||y>c.endSN)return 0;var F,N=y-c.startSN,H=c.fragments;for(H[N]=h,F=N;F>0;F--)k(H[F],H[F-1]);for(F=N;F<H.length-1;F++)k(H[F],H[F+1]);return c.fragmentHint&&k(H[H.length-1],c.fragmentHint),c.PTSKnown=c.alignedSliding=!0,g}function m(c,h){for(var A=null,S=c.fragments,w=S.length-1;w>=0;w--){var O=S[w].initSegment;if(O){A=O;break}}c.fragmentHint&&delete c.fragmentHint.endPTS;var R=0,b;if(f(c,h,function(F,N){F.relurl&&(R=F.cc-N.cc),Object(ee.isFiniteNumber)(F.startPTS)&&Object(ee.isFiniteNumber)(F.endPTS)&&(N.start=N.startPTS=F.startPTS,N.startDTS=F.startDTS,N.appendedPTS=F.appendedPTS,N.maxStartPTS=F.maxStartPTS,N.endPTS=F.endPTS,N.endDTS=F.endDTS,N.minEndPTS=F.minEndPTS,N.duration=F.endPTS-F.startPTS,N.duration&&(b=N),h.PTSKnown=h.alignedSliding=!0),N.elementaryStreams=F.elementaryStreams,N.loader=F.loader,N.stats=F.stats,N.urlId=F.urlId,F.initSegment&&(N.initSegment=F.initSegment,A=F.initSegment)}),A){var _=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;_.forEach(function(F){var N;(!F.initSegment||F.initSegment.relurl===((N=A)===null||N===void 0?void 0:N.relurl))&&(F.initSegment=A)})}if(h.skippedSegments&&(h.deltaUpdateFailed=h.fragments.some(function(F){return!F}),h.deltaUpdateFailed)){W.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=h.skippedSegments;u--;)h.fragments.shift();h.startSN=h.fragments[0].sn,h.startCC=h.fragments[0].cc}var d=h.fragments;if(R){W.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<d.length;E++)d[E].cc+=R}h.skippedSegments&&(h.startCC=h.fragments[0].cc),v(c.partList,h.partList,function(F,N){N.elementaryStreams=F.elementaryStreams,N.stats=F.stats}),b?D(h,b,b.startPTS,b.endPTS,b.startDTS,b.endDTS):o(c,h),d.length&&(h.totalduration=h.edge-d[0].start),h.driftStartTime=c.driftStartTime,h.driftStart=c.driftStart;var g=h.advancedDateTime;if(h.advanced&&g){var y=h.edge;h.driftStart||(h.driftStartTime=g,h.driftStart=y),h.driftEndTime=g,h.driftEnd=y}else h.driftEndTime=c.driftEndTime,h.driftEnd=c.driftEnd,h.advancedDateTime=c.advancedDateTime}function v(c,h,A){if(c&&h)for(var S=0,w=0,O=c.length;w<=O;w++){var R=c[w],b=h[w+S];R&&b&&R.index===b.index&&R.fragment.sn===b.fragment.sn?A(R,b):S--}}function f(c,h,A){for(var S=h.skippedSegments,w=Math.max(c.startSN,h.startSN)-h.startSN,O=(c.fragmentHint?1:0)+(S?h.endSN:Math.min(c.endSN,h.endSN))-h.startSN,R=h.startSN-c.startSN,b=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments,_=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,u=w;u<=O;u++){var d=_[R+u],E=b[u];S&&!E&&u<S&&(E=h.fragments[u]=d),d&&E&&A(d,E)}}function o(c,h){var A=h.startSN+h.skippedSegments-c.startSN,S=c.fragments;if(A<0||A>=S.length)return;l(h,S[A].start)}function l(c,h){if(h){for(var A=c.fragments,S=c.skippedSegments;S<A.length;S++)A[S].start+=h;c.fragmentHint&&(c.fragmentHint.start+=h)}}function r(c,h){var A=1e3*c.levelTargetDuration,S=A/2,w=c.age,O=w>0&&w<A*3,R=h.loading.end-h.loading.start,b,_=c.availabilityDelay;if(c.updated===!1)if(O){var u=333*c.misses;b=Math.max(Math.min(S,R*2),u),c.availabilityDelay=(c.availabilityDelay||0)+b}else b=S;else O?(_=Math.min(_||A/2,w),c.availabilityDelay=_,b=_+A-w):b=A-R;return Math.round(b)}function i(c,h,A){if(!c||!c.details)return null;var S=c.details,w=S.fragments[h-S.startSN];return w||(w=S.fragmentHint,w&&w.sn===h?w:h<S.startSN&&A&&A.sn===h?A:null)}function t(c,h,A){if(!c||!c.details)return null;var S=c.details.partList;if(S)for(var w=S.length;w--;){var O=S[w];if(O.index===A&&O.fragment.sn===h)return O}return null}},"./src/controller/stream-controller.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return S});var ee=U("./src/polyfills/number.ts"),W=U("./src/controller/base-stream-controller.ts"),M=U("./src/is-supported.ts"),$=U("./src/events.ts"),X=U("./src/utils/buffer-helper.ts"),k=U("./src/controller/fragment-tracker.ts"),D=U("./src/types/loader.ts"),m=U("./src/loader/fragment.ts"),v=U("./src/demux/transmuxer-interface.ts"),f=U("./src/types/transmuxer.ts"),o=U("./src/controller/gap-controller.ts"),l=U("./src/errors.ts"),r=U("./src/utils/logger.ts");function i(w,O){for(var R=0;R<O.length;R++){var b=O[R];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,b.key,b)}}function t(w,O,R){return O&&i(w.prototype,O),R&&i(w,R),w}function c(w,O){w.prototype=Object.create(O.prototype),w.prototype.constructor=w,h(w,O)}function h(w,O){return h=Object.setPrototypeOf||function(b,_){return b.__proto__=_,b},h(w,O)}var A=100,S=function(w){c(O,w);function O(b,_){var u;return u=w.call(this,b,_,"[stream-controller]")||this,u.audioCodecSwap=!1,u.gapController=null,u.level=-1,u._forceStartLoad=!1,u.altAudio=!1,u.audioOnly=!1,u.fragPlaying=null,u.onvplaying=null,u.onvseeked=null,u.fragLastKbps=0,u.stalled=!1,u.couldBacktrack=!1,u.audioCodecSwitch=!1,u.videoBuffer=null,u._registerListeners(),u}var R=O.prototype;return R._registerListeners=function(){var _=this.hls;_.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),_.on($.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on($.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.on($.Events.ERROR,this.onError,this),_.on($.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.on($.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on($.Events.BUFFER_CREATED,this.onBufferCreated,this),_.on($.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.on($.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.on($.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R._unregisterListeners=function(){var _=this.hls;_.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off($.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off($.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.off($.Events.ERROR,this.onError,this),_.off($.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.off($.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off($.Events.BUFFER_CREATED,this.onBufferCreated,this),_.off($.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.off($.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.off($.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},R.startLoad=function(_){if(this.levels){var u=this.lastCurrentTime,d=this.hls;if(this.stopLoad(),this.setInterval(A),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=d.startLevel;E===-1&&(d.config.testBandwidth?(E=0,this.bitrateTest=!0):E=d.nextAutoLevel),this.level=d.nextLoadLevel=E,this.loadedmetadata=!1}u>0&&_===-1&&(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),_=u),this.state=W.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()}else this._forceStartLoad=!0,this.state=W.State.STOPPED},R.stopLoad=function(){this._forceStartLoad=!1,w.prototype.stopLoad.call(this)},R.doTick=function(){switch(this.state){case W.State.IDLE:this.doTickIdle();break;case W.State.WAITING_LEVEL:{var _,u=this.levels,d=this.level,E=u==null||((_=u[d])===null||_===void 0)?void 0:_.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=W.State.IDLE;break}break}case W.State.FRAG_LOADING_WAITING_RETRY:{var g,y=self.performance.now(),F=this.retryDate;(!F||y>=F||(g=this.media)!==null&&g!==void 0&&g.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=W.State.IDLE)}break;default:break}this.onTickEnd()},R.onTickEnd=function(){w.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},R.doTickIdle=function(){var _,u,d=this.hls,E=this.levelLastLoaded,g=this.levels,y=this.media,F=d.config,N=d.nextLoadLevel;if(E===null||!y&&(this.startFragRequested||!F.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!g||!g[N])return;var H=g[N];this.level=d.nextLoadLevel=N;var G=H.details;if(!G||this.state===W.State.WAITING_LEVEL||G.live&&this.levelLastLoaded!==N){this.state=W.State.WAITING_LEVEL;return}var I=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,D.PlaylistLevelType.MAIN);if(I===null)return;var x=I.len,B=this.getMaxBufferLength(H.maxBitrate);if(x>=B)return;if(this._streamEnded(I,G)){var Y={};this.altAudio&&(Y.type="video"),this.hls.trigger($.Events.BUFFER_EOS,Y),this.state=W.State.ENDED;return}var re=I.end,de=this.getNextFragment(re,G);if(this.couldBacktrack&&!this.fragPrevious&&de&&de.sn!=="initSegment"){var he=de.sn-G.startSN;he>1&&(de=G.fragments[he-1],this.fragmentTracker.removeFragment(de))}if(de&&this.fragmentTracker.getState(de)===k.FragmentState.OK&&this.nextLoadPosition>re){var xe=this.audioOnly&&!this.altAudio?m.ElementaryStreamTypes.AUDIO:m.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,xe,D.PlaylistLevelType.MAIN),de=this.getNextFragment(this.nextLoadPosition,G)}if(!de)return;de.initSegment&&!de.initSegment.data&&!this.bitrateTest&&(de=de.initSegment),((_=de.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((u=de.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(de,G):this.loadFragment(de,G,re)},R.loadFragment=function(_,u,d){var E,g=this.fragmentTracker.getState(_);if(this.fragCurrent=_,g===k.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(_);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else g=k.FragmentState.NOT_LOADED}g===k.FragmentState.NOT_LOADED||g===k.FragmentState.PARTIAL?_.sn==="initSegment"?this._loadInitSegment(_):this.bitrateTest?(_.bitrateTest=!0,this.log("Fragment "+_.sn+" of level "+_.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(_)):(this.startFragRequested=!0,w.prototype.loadFragment.call(this,_,u,d)):g===k.FragmentState.APPENDING?this.reduceMaxBufferLength(_.duration)&&this.fragmentTracker.removeFragment(_):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},R.getAppendedFrag=function(_){var u=this.fragmentTracker.getAppendedFrag(_,D.PlaylistLevelType.MAIN);return u&&"fragment"in u?u.fragment:u},R.getBufferedFrag=function(_){return this.fragmentTracker.getBufferedFrag(_,D.PlaylistLevelType.MAIN)},R.followingBufferedFrag=function(_){return _?this.getBufferedFrag(_.end+.5):null},R.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},R.nextLevelSwitch=function(){var _=this.levels,u=this.media;if(u!=null&&u.readyState){var d,E=this.getAppendedFrag(u.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!u.paused&&_){var g=this.hls.nextLoadLevel,y=_[g],F=this.fragLastKbps;F&&this.fragCurrent?d=this.fragCurrent.duration*y.maxBitrate/(1e3*F)+1:d=0}else d=0;var N=this.getBufferedFrag(u.currentTime+d);if(N){var H=this.followingBufferedFrag(N);if(H){this.abortCurrentFrag();var G=H.maxStartPTS?H.maxStartPTS:H.start,I=H.duration,x=Math.max(N.end,G+Math.min(Math.max(I-this.config.maxFragLookUpTolerance,I*.5),I*.75));this.flushMainBuffer(x,Number.POSITIVE_INFINITY)}}}},R.abortCurrentFrag=function(){var _=this.fragCurrent;this.fragCurrent=null,_!=null&&_.loader&&_.loader.abort(),this.state===W.State.KEY_LOADING&&(this.state=W.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},R.flushMainBuffer=function(_,u){w.prototype.flushMainBuffer.call(this,_,u,this.altAudio?"video":null)},R.onMediaAttached=function(_,u){w.prototype.onMediaAttached.call(this,_,u);var d=u.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),d.addEventListener("playing",this.onvplaying),d.addEventListener("seeked",this.onvseeked),this.gapController=new o.default(this.config,d,this.fragmentTracker,this.hls)},R.onMediaDetaching=function(){var _=this.media;_&&(_.removeEventListener("playing",this.onvplaying),_.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),w.prototype.onMediaDetaching.call(this)},R.onMediaPlaying=function(){this.tick()},R.onMediaSeeked=function(){var _=this.media,u=_?_.currentTime:null;Object(ee.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},R.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger($.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},R.onManifestParsed=function(_,u){var d=!1,E=!1,g;u.levels.forEach(function(y){g=y.audioCodec,g&&(g.indexOf("mp4a.40.2")!==-1&&(d=!0),g.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=d&&E&&!Object(M.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=u.levels,this.startFragRequested=!1},R.onLevelLoading=function(_,u){var d=this.levels;if(!d||this.state!==W.State.IDLE)return;var E=d[u.level];(!E.details||E.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(E.details))&&(this.state=W.State.WAITING_LEVEL)},R.onLevelLoaded=function(_,u){var d,E=this.levels,g=u.level,y=u.details,F=y.totalduration;if(!E){this.warn("Levels were reset while loading level "+g);return}this.log("Level "+g+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+F);var N=this.fragCurrent;N&&(this.state===W.State.FRAG_LOADING||this.state===W.State.FRAG_LOADING_WAITING_RETRY)&&(N.level!==u.level&&N.loader&&(this.state=W.State.IDLE,N.loader.abort()));var H=E[g],G=0;if(y.live||(d=H.details)!==null&&d!==void 0&&d.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;G=this.alignPlaylists(y,H.details)}if(H.details=y,this.levelLastLoaded=g,this.hls.trigger($.Events.LEVEL_UPDATED,{details:y,level:g}),this.state===W.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=W.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,G),this.tick()},R._handleFragmentLoadProgress=function(_){var u,d=_.frag,E=_.part,g=_.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var F=y[d.level],N=F.details;if(!N){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var H=F.videoCodec,G=N.PTSKnown||!N.live,I=(u=d.initSegment)===null||u===void 0?void 0:u.data,x=this._getAudioCodec(F),B=this.transmuxer=this.transmuxer||new v.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Y=E?E.index:-1,re=Y!==-1,de=new f.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,g.byteLength,Y,re),he=this.initPTS[d.cc];B.push(g,I,x,H,d,E,N.totalduration,G,de,he)},R.onAudioTrackSwitching=function(_,u){var d=this.altAudio,E=!!u.url,g=u.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var F=this.hls;d&&F.trigger($.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),F.trigger($.Events.AUDIO_TRACK_SWITCHED,{id:g})}},R.onAudioTrackSwitched=function(_,u){var d=u.id,E=!!this.hls.audioTracks[d].url;if(E){var g=this.videoBuffer;g&&this.mediaBuffer!==g&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=g)}this.altAudio=E,this.tick()},R.onBufferCreated=function(_,u){var d=u.tracks,E,g,y=!1;for(var F in d){var N=d[F];if(N.id==="main"){if(g=F,E=N,F==="video"){var H=d[F];H&&(this.videoBuffer=H.buffer)}}else y=!0}y&&E?(this.log("Alternate track found, use "+g+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},R.onFragBuffered=function(_,u){var d=u.frag,E=u.part;if(d&&d.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(E?" p: "+E.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===W.State.PARSED&&(this.state=W.State.IDLE);return}var g=E?E.stats:d.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,E)},R.onError=function(_,u){switch(u.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,u);break;case l.ErrorDetails.LEVEL_LOAD_ERROR:case l.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==W.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=W.State.ERROR):!u.levelRetry&&this.state===W.State.WAITING_LEVEL&&(this.state=W.State.IDLE));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===W.State.PARSING||this.state===W.State.PARSED)){var d=!0,E=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);E&&E.len>.5&&(d=!this.reduceMaxBufferLength(E.len)),d&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},R.checkBuffer=function(){var _=this.media,u=this.gapController;if(!_||!u||!_.readyState)return;var d=X.BufferHelper.getBuffered(_);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):u.poll(this.lastCurrentTime),this.lastCurrentTime=_.currentTime},R.onFragLoadEmergencyAborted=function(){this.state=W.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},R.onBufferFlushed=function(_,u){var d=u.type;if(d!==m.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(d===m.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,d,D.PlaylistLevelType.MAIN)}},R.onLevelsUpdated=function(_,u){this.levels=u.levels},R.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},R.seekToStartPos=function(){var _=this.media,u=_.currentTime,d=this.startPosition;if(d>=0&&u<d){if(_.seeking){r.logger.log("could not seek to "+d+", already seeking at "+u);return}var E=X.BufferHelper.getBuffered(_),g=E.length?E.start(0):0,y=g-d;y>0&&(y<this.config.maxBufferHole||y<this.config.maxFragLookUpTolerance)&&(r.logger.log("adjusting start position by "+y+" to match buffer start"),d+=y,this.startPosition=d),this.log("seek to target start position "+d+" from current time "+u),_.currentTime=d}},R._getAudioCodec=function(_){var u=this.config.defaultAudioCodec||_.audioCodec;return this.audioCodecSwap&&u&&(this.log("Swapping audio codec"),u.indexOf("mp4a.40.5")!==-1?u="mp4a.40.2":u="mp4a.40.5"),u},R._loadBitrateTestFrag=function(_){var u=this;this._doFragLoad(_).then(function(d){var E=u.hls;if(!d||E.nextLoadLevel||u.fragContextChanged(_))return;u.fragLoadError=0,u.state=W.State.IDLE,u.startFragRequested=!1,u.bitrateTest=!1;var g=_.stats;g.parsing.start=g.parsing.end=g.buffering.start=g.buffering.end=self.performance.now(),E.trigger($.Events.FRAG_LOADED,d)})},R._handleTransmuxComplete=function(_){var u,d="main",E=this.hls,g=_.remuxResult,y=_.chunkMeta,F=this.getCurrentContext(y);if(!F){this.warn("The loading context changed while buffering fragment "+y.sn+" of level "+y.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(y.level);return}var N=F.frag,H=F.part,G=F.level,I=g.video,x=g.text,B=g.id3,Y=g.initSegment,re=this.altAudio?void 0:g.audio;if(this.fragContextChanged(N))return;if(this.state=W.State.PARSING,Y){Y.tracks&&(this._bufferInitSegment(G,Y.tracks,N,y),E.trigger($.Events.FRAG_PARSING_INIT_SEGMENT,{frag:N,id:d,tracks:Y.tracks}));var de=Y.initPTS,he=Y.timescale;Object(ee.isFiniteNumber)(de)&&(this.initPTS[N.cc]=de,E.trigger($.Events.INIT_PTS_FOUND,{frag:N,id:d,initPTS:de,timescale:he}))}if(I&&g.independent!==!1){if(G.details){var xe=I.startPTS,Pe=I.endPTS,Ce=I.startDTS,Oe=I.endDTS;if(H)H.elementaryStreams[I.type]={startPTS:xe,endPTS:Pe,startDTS:Ce,endDTS:Oe};else if(I.firstKeyFrame&&I.independent&&(this.couldBacktrack=!0),I.dropped&&I.independent){var be=this.getLoadPosition()+this.config.maxBufferHole;if(be<xe){this.backtrack(N);return}N.setElementaryStreamInfo(I.type,N.start,Pe,N.start,Oe,!0)}N.setElementaryStreamInfo(I.type,xe,Pe,Ce,Oe),this.bufferFragmentData(I,N,H,y)}}else if(g.independent===!1){this.backtrack(N);return}if(re){var ge=re.startPTS,te=re.endPTS,fe=re.startDTS,_e=re.endDTS;H&&(H.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:ge,endPTS:te,startDTS:fe,endDTS:_e}),N.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,ge,te,fe,_e),this.bufferFragmentData(re,N,H,y)}if(B!=null&&(u=B.samples)!==null&&u!==void 0&&u.length){var Le={frag:N,id:d,samples:B.samples};E.trigger($.Events.FRAG_PARSING_METADATA,Le)}if(x){var $e={frag:N,id:d,samples:x.samples};E.trigger($.Events.FRAG_PARSING_USERDATA,$e)}},R._bufferInitSegment=function(_,u,d,E){var g=this;if(this.state!==W.State.PARSING)return;this.audioOnly=!!u.audio&&!u.video,this.altAudio&&!this.audioOnly&&delete u.audio;var y=u.audio,F=u.video,N=u.audiovideo;if(y){var H=_.audioCodec,G=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(H&&(H.indexOf("mp4a.40.5")!==-1?H="mp4a.40.2":H="mp4a.40.5"),y.metadata.channelCount!==1&&G.indexOf("firefox")===-1&&(H="mp4a.40.5")),G.indexOf("android")!==-1&&y.container!=="audio/mpeg"&&(H="mp4a.40.2",this.log("Android: force audio codec to "+H)),_.audioCodec&&_.audioCodec!==H&&this.log('Swapping manifest audio codec "'+_.audioCodec+'" for "'+H+'"'),y.levelCodec=H,y.id="main",this.log("Init audio buffer, container:"+y.container+", codecs[selected/level/parsed]=["+(H||"")+"/"+(_.audioCodec||"")+"/"+y.codec+"]")}F&&(F.levelCodec=_.videoCodec,F.id="main",this.log("Init video buffer, container:"+F.container+", codecs[level/parsed]=["+(_.videoCodec||"")+"/"+F.codec+"]")),N&&this.log("Init audiovideo buffer, container:"+N.container+", codecs[level/parsed]=["+(_.attrs.CODECS||"")+"/"+N.codec+"]"),this.hls.trigger($.Events.BUFFER_CODECS,u),Object.keys(u).forEach(function(I){var x=u[I],B=x.initSegment;B!=null&&B.byteLength&&g.hls.trigger($.Events.BUFFER_APPENDING,{type:I,data:B,frag:d,part:null,chunkMeta:E,parent:d.type})}),this.tick()},R.backtrack=function(_){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(_);var u=this.fragmentTracker.backtrack(_);this.fragPrevious=null,this.nextLoadPosition=_.start,u?this.resetFragmentLoading(_):this.state=W.State.BACKTRACKING},R.checkFragmentChanged=function(){var _=this.media,u=null;if(_&&_.readyState>1&&_.seeking===!1){var d=_.currentTime;if(X.BufferHelper.isBuffered(_,d)?u=this.getAppendedFrag(d):X.BufferHelper.isBuffered(_,d+.1)&&(u=this.getAppendedFrag(d+.1)),u){var E=this.fragPlaying,g=u.level;(!E||u.sn!==E.sn||E.level!==g||u.urlId!==E.urlId)&&(this.hls.trigger($.Events.FRAG_CHANGED,{frag:u}),(!E||E.level!==g)&&this.hls.trigger($.Events.LEVEL_SWITCHED,{level:g}),this.fragPlaying=u)}}},t(O,[{key:"nextLevel",get:function(){var _=this.nextBufferedFrag;return _?_.level:-1}},{key:"currentLevel",get:function(){var _=this.media;if(_){var u=this.getAppendedFrag(_.currentTime);if(u)return u.level}return-1}},{key:"nextBufferedFrag",get:function(){var _=this.media;if(_){var u=this.getAppendedFrag(_.currentTime);return this.followingBufferedFrag(u)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),O}(W.default)},"./src/controller/subtitle-stream-controller.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"SubtitleStreamController",function(){return c});var ee=U("./src/events.ts"),W=U("./src/utils/logger.ts"),M=U("./src/utils/buffer-helper.ts"),$=U("./src/controller/fragment-finders.ts"),X=U("./src/utils/discontinuities.ts"),k=U("./src/controller/level-helper.ts"),D=U("./src/controller/fragment-tracker.ts"),m=U("./src/controller/base-stream-controller.ts"),v=U("./src/types/loader.ts"),f=U("./src/types/level.ts");function o(h,A){for(var S=0;S<A.length;S++){var w=A[S];w.enumerable=w.enumerable||!1,w.configurable=!0,"value"in w&&(w.writable=!0),Object.defineProperty(h,w.key,w)}}function l(h,A,S){return A&&o(h.prototype,A),S&&o(h,S),h}function r(h,A){h.prototype=Object.create(A.prototype),h.prototype.constructor=h,i(h,A)}function i(h,A){return i=Object.setPrototypeOf||function(w,O){return w.__proto__=O,w},i(h,A)}var t=500,c=function(h){r(A,h);function A(w,O){var R;return R=h.call(this,w,O,"[subtitle-stream-controller]")||this,R.levels=[],R.currentTrackId=-1,R.tracksBuffered=[],R.mainDetails=null,R._registerListeners(),R}var S=A.prototype;return S.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},S._registerListeners=function(){var O=this.hls;O.on(ee.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(ee.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(ee.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(ee.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(ee.Events.ERROR,this.onError,this),O.on(ee.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.on(ee.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.on(ee.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.on(ee.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.on(ee.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S._unregisterListeners=function(){var O=this.hls;O.off(ee.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(ee.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(ee.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(ee.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(ee.Events.ERROR,this.onError,this),O.off(ee.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.off(ee.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.off(ee.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.off(ee.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.off(ee.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},S.startLoad=function(){this.stopLoad(),this.state=m.State.IDLE,this.setInterval(t),this.tick()},S.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},S.onLevelLoaded=function(O,R){this.mainDetails=R.details},S.onSubtitleFragProcessed=function(O,R){var b=R.frag,_=R.success;if(this.fragPrevious=b,this.state=m.State.IDLE,!_)return;var u=this.tracksBuffered[this.currentTrackId];if(!u)return;for(var d,E=b.start,g=0;g<u.length;g++)if(E>=u[g].start&&E<=u[g].end){d=u[g];break}var y=b.start+b.duration;d?d.end=y:(d={start:E,end:y},u.push(d)),this.fragmentTracker.fragBuffered(b)},S.onBufferFlushing=function(O,R){var b=R.startOffset,_=R.endOffset;if(b===0&&_!==Number.POSITIVE_INFINITY){var u=this.currentTrackId,d=this.levels;if(!d.length||!d[u]||!d[u].details)return;var E=d[u].details,g=E.targetduration,y=_-g;if(y<=0)return;R.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(F){for(var N=0;N<F.length;){if(F[N].end<=y){F.shift();continue}else if(F[N].start<y)F[N].start=y;else break;N++}}),this.fragmentTracker.removeFragmentsInRange(b,y,v.PlaylistLevelType.SUBTITLE)}},S.onError=function(O,R){var b,_=R.frag;if(!_||_.type!==v.PlaylistLevelType.SUBTITLE)return;(b=this.fragCurrent)!==null&&b!==void 0&&b.loader&&this.fragCurrent.loader.abort(),this.state=m.State.IDLE},S.onSubtitleTracksUpdated=function(O,R){var b=this,_=R.subtitleTracks;this.tracksBuffered=[],this.levels=_.map(function(u){return new f.Level(u)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(u){b.tracksBuffered[u.id]=[]}),this.mediaBuffer=null},S.onSubtitleTrackSwitch=function(O,R){if(this.currentTrackId=R.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var b=this.levels[this.currentTrackId];b!=null&&b.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,b&&this.setInterval(t)},S.onSubtitleTrackLoaded=function(O,R){var b,_=R.details,u=R.id,d=this.currentTrackId,E=this.levels;if(!E.length)return;var g=E[d];if(u>=E.length||u!==d||!g)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,_.live||(b=g.details)!==null&&b!==void 0&&b.live){var y=this.mainDetails;if(_.deltaUpdateFailed||!y)return;var F=y.fragments[0];if(!g.details)_.hasProgramDateTime&&y.hasProgramDateTime?Object(X.alignMediaPlaylistByPDT)(_,y):F&&Object(k.addSliding)(_,F.start);else{var N=this.alignPlaylists(_,g.details);N===0&&F&&Object(k.addSliding)(_,F.start)}}if(g.details=_,this.levelLastLoaded=u,this.tick(),_.live&&!this.fragCurrent&&this.media&&this.state===m.State.IDLE){var H=Object($.findFragmentByPTS)(null,_.fragments,this.media.currentTime,0);H||(this.warn("Subtitle playlist not aligned with playback"),g.details=void 0)}},S._handleFragmentLoadComplete=function(O){var R=O.frag,b=O.payload,_=R.decryptdata,u=this.hls;if(this.fragContextChanged(R))return;if(b&&b.byteLength>0&&_&&_.key&&_.iv&&_.method==="AES-128"){var d=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(b),_.key.buffer,_.iv.buffer).then(function(E){var g=performance.now();u.trigger(ee.Events.FRAG_DECRYPTED,{frag:R,payload:E,stats:{tstart:d,tdecrypt:g}})})}},S.doTick=function(){if(!this.media){this.state=m.State.IDLE;return}if(this.state===m.State.IDLE){var O,R=this.currentTrackId,b=this.levels;if(!b.length||!b[R]||!b[R].details)return;var _=b[R].details,u=_.targetduration,d=this.config,E=this.media,g=M.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-u,d.maxBufferHole),y=g.end,F=g.len,N=this.getMaxBufferLength()+u;if(F>N)return;console.assert(_,"Subtitle track details are defined on idle subtitle stream controller tick");var H=_.fragments,G=H.length,I=_.edge,x,B=this.fragPrevious;if(y<I){var Y=d.maxFragLookUpTolerance;B&&_.hasProgramDateTime&&(x=Object($.findFragmentByPDT)(H,B.endProgramDateTime,Y)),x||(x=Object($.findFragmentByPTS)(B,H,y,Y),!x&&B&&B.start<H[0].start&&(x=H[0]))}else x=H[G-1];(O=x)!==null&&O!==void 0&&O.encrypted?(W.logger.log("Loading key for "+x.sn),this.state=m.State.KEY_LOADING,this.hls.trigger(ee.Events.KEY_LOADING,{frag:x})):x&&this.fragmentTracker.getState(x)===D.FragmentState.NOT_LOADED&&this.loadFragment(x,_,y)}},S.loadFragment=function(O,R,b){this.fragCurrent=O,h.prototype.loadFragment.call(this,O,R,b)},l(A,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),A}(m.default)},"./src/controller/subtitle-track-controller.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/events.ts"),W=U("./src/utils/texttrack-utils.ts"),M=U("./src/controller/base-playlist-controller.ts"),$=U("./src/types/loader.ts");function X(o,l){for(var r=0;r<l.length;r++){var i=l[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(o,i.key,i)}}function k(o,l,r){return l&&X(o.prototype,l),r&&X(o,r),o}function D(o,l){o.prototype=Object.create(l.prototype),o.prototype.constructor=o,m(o,l)}function m(o,l){return m=Object.setPrototypeOf||function(i,t){return i.__proto__=t,i},m(o,l)}var v=function(o){D(l,o);function l(i){var t;return t=o.call(this,i,"[subtitle-track-controller]")||this,t.media=null,t.tracks=[],t.groupId=null,t.tracksInGroup=[],t.trackId=-1,t.selectDefaultTrack=!0,t.queuedDefaultTrack=-1,t.trackChangeListener=function(){return t.onTextTracksChanged()},t.asyncPollTrackChange=function(){return t.pollTrackChange(0)},t.useTextTrackPolling=!1,t.subtitlePollingInterval=-1,t.subtitleDisplay=!0,t.registerListeners(),t}var r=l.prototype;return r.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,o.prototype.destroy.call(this)},r.registerListeners=function(){var t=this.hls;t.on(ee.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(ee.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(ee.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(ee.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(ee.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(ee.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(ee.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(ee.Events.ERROR,this.onError,this)},r.unregisterListeners=function(){var t=this.hls;t.off(ee.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(ee.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(ee.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(ee.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(ee.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(ee.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(ee.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(ee.Events.ERROR,this.onError,this)},r.onMediaAttached=function(t,c){if(this.media=c.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)},r.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},r.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var t=f(this.media.textTracks);t.forEach(function(c){Object(W.clearCurrentCues)(c)}),this.subtitleTrack=-1,this.media=null},r.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},r.onManifestParsed=function(t,c){this.tracks=c.subtitleTracks},r.onSubtitleTrackLoaded=function(t,c){var h=c.id,A=c.details,S=this.trackId,w=this.tracksInGroup[S];if(!w){this.warn("Invalid subtitle track id "+h);return}var O=w.details;w.details=c.details,this.log("subtitle track "+h+" loaded ["+A.startSN+"-"+A.endSN+"]"),h===this.trackId&&(this.retryCount=0,this.playlistLoaded(h,c,O))},r.onLevelLoading=function(t,c){this.switchLevel(c.level)},r.onLevelSwitching=function(t,c){this.switchLevel(c.level)},r.switchLevel=function(t){var c=this.hls.levels[t];if(!(c!=null&&c.textGroupIds))return;var h=c.textGroupIds[c.urlId];if(this.groupId!==h){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,S=this.tracks.filter(function(R){return!h||R.groupId===h});this.tracksInGroup=S;var w=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=h;var O={subtitleTracks:S};this.log("Updating subtitle tracks, "+S.length+' track(s) found in "'+h+'" group-id'),this.hls.trigger(ee.Events.SUBTITLE_TRACKS_UPDATED,O),w!==-1&&this.setSubtitleTrack(w,A)}},r.findTrackId=function(t){for(var c=this.tracksInGroup,h=0;h<c.length;h++){var A=c[h];if((!this.selectDefaultTrack||A.default)&&(!t||t===A.name))return A.id}return-1},r.onError=function(t,c){if(o.prototype.onError.call(this,t,c),c.fatal||!c.context)return;c.context.type===$.PlaylistContextType.SUBTITLE_TRACK&&c.context.id===this.trackId&&c.context.groupId===this.groupId&&this.retryLoadingOrFail(c)},r.loadPlaylist=function(t){var c=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(c)){var h=c.id,A=c.groupId,S=c.url;if(t)try{S=t.addDirectives(S)}catch(w){this.warn("Could not construct new URL with HLS Delivery Directives: "+w)}this.log("Loading subtitle playlist for id "+h),this.hls.trigger(ee.Events.SUBTITLE_TRACK_LOADING,{url:S,id:h,groupId:A,deliveryDirectives:t||null})}},r.toggleTrackModes=function(t){var c=this,h=this.media,A=this.subtitleDisplay,S=this.trackId;if(!h)return;var w=f(h.textTracks),O=w.filter(function(_){return _.groupId===c.groupId});if(t===-1)[].slice.call(w).forEach(function(_){_.mode="disabled"});else{var R=O[S];R&&(R.mode="disabled")}var b=O[t];b&&(b.mode=A?"showing":"hidden")},r.setSubtitleTrack=function(t,c){var h,A=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(h=A[t])!==null&&h!==void 0&&h.details)||t<-1||t>=A.length)return;this.clearTimer();var S=A[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,S){var w=S.id,O=S.groupId,R=O===void 0?"":O,b=S.name,_=S.type,u=S.url;this.hls.trigger(ee.Events.SUBTITLE_TRACK_SWITCH,{id:w,groupId:R,name:b,type:_,url:u});var d=this.switchParams(S.url,c==null?void 0:c.details);this.loadPlaylist(d)}else this.hls.trigger(ee.Events.SUBTITLE_TRACK_SWITCH,{id:t})},r.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var t=-1,c=f(this.media.textTracks),h=0;h<c.length;h++)if(c[h].mode==="hidden")t=h;else if(c[h].mode==="showing"){t=h;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)},k(l,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var c=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,c)}}]),l}(M.default);function f(o){for(var l=[],r=0;r<o.length;r++){var i=o[r];i.kind==="subtitles"&&i.label&&l.push(o[r])}return l}Z.default=v},"./src/controller/timeline-controller.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"TimelineController",function(){return f});var ee=U("./src/polyfills/number.ts"),W=U("./src/events.ts"),M=U("./src/utils/cea-608-parser.ts"),$=U("./src/utils/output-filter.ts"),X=U("./src/utils/webvtt-parser.ts"),k=U("./src/utils/texttrack-utils.ts"),D=U("./src/utils/imsc1-ttml-parser.ts"),m=U("./src/types/loader.ts"),v=U("./src/utils/logger.ts"),f=function(){function i(c){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=r(),this.captionsProperties=void 0,this.hls=c,this.config=c.config,this.Cues=c.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 h=new $.default(this,"textTrack1"),A=new $.default(this,"textTrack2"),S=new $.default(this,"textTrack3"),w=new $.default(this,"textTrack4");this.cea608Parser1=new M.default(1,h,A),this.cea608Parser2=new M.default(3,S,w)}c.on(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.on(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.on(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),c.on(W.Events.FRAG_LOADING,this.onFragLoading,this),c.on(W.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(W.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),c.on(W.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),c.on(W.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.on(W.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),c.on(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=i.prototype;return t.destroy=function(){var h=this.hls;h.off(W.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(W.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(W.Events.MANIFEST_LOADED,this.onManifestLoaded,this),h.off(W.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),h.off(W.Events.FRAG_LOADING,this.onFragLoading,this),h.off(W.Events.FRAG_LOADED,this.onFragLoaded,this),h.off(W.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),h.off(W.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),h.off(W.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(W.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),h.off(W.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(h,A,S,w,O){for(var R=!1,b=O.length;b--;){var _=O[b],u=l(_[0],_[1],A,S);if(u>=0&&(_[0]=Math.min(_[0],A),_[1]=Math.max(_[1],S),R=!0,u/(S-A)>.5))return}if(R||O.push([A,S]),this.config.renderTextTracksNatively){var d=this.captionsTracks[h];this.Cues.newCue(d,A,S,w)}else{var E=this.Cues.newCue(null,A,S,w);this.hls.trigger(W.Events.CUES_PARSED,{type:"captions",cues:E,track:h})}},t.onInitPtsFound=function(h,A){var S=this,w=A.frag,O=A.id,R=A.initPTS,b=A.timescale,_=this.unparsedVttFrags;O==="main"&&(this.initPTS[w.cc]=R,this.timescale[w.cc]=b),_.length&&(this.unparsedVttFrags=[],_.forEach(function(u){S.onFragLoaded(W.Events.FRAG_LOADED,u)}))},t.getExistingTrack=function(h){var A=this.media;if(A)for(var S=0;S<A.textTracks.length;S++){var w=A.textTracks[S];if(w[h])return w}return null},t.createCaptionsTrack=function(h){this.config.renderTextTracksNatively?this.createNativeTrack(h):this.createNonNativeTrack(h)},t.createNativeTrack=function(h){if(this.captionsTracks[h])return;var A=this.captionsProperties,S=this.captionsTracks,w=this.media,O=A[h],R=O.label,b=O.languageCode,_=this.getExistingTrack(h);if(_)S[h]=_,Object(k.clearCurrentCues)(S[h]),Object(k.sendAddTrackEvent)(S[h],w);else{var u=this.createTextTrack("captions",R,b);u&&(u[h]=!0,S[h]=u)}},t.createNonNativeTrack=function(h){if(this.nonNativeCaptionsTracks[h])return;var A=this.captionsProperties[h];if(!A)return;var S=A.label,w={_id:h,label:S,kind:"captions",default:A.media?!!A.media.default:!1,closedCaptions:A.media};this.nonNativeCaptionsTracks[h]=w,this.hls.trigger(W.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[w]})},t.createTextTrack=function(h,A,S){var w=this.media;return w?w.addTextTrack(h,A,S):void 0},t.onMediaAttaching=function(h,A){this.media=A.media,this._cleanTracks()},t.onMediaDetaching=function(){var h=this.captionsTracks;Object.keys(h).forEach(function(A){Object(k.clearCurrentCues)(h[A]),delete h[A]}),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=r(),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())},t._cleanTracks=function(){var h=this.media;if(!h)return;var A=h.textTracks;if(A)for(var S=0;S<A.length;S++)Object(k.clearCurrentCues)(A[S])},t.onSubtitleTracksUpdated=function(h,A){var S=this;this.textTracks=[];var w=A.subtitleTracks||[],O=w.some(function(u){return u.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||O&&this.config.enableIMSC1){var R=this.tracks&&w&&this.tracks.length===w.length;if(this.tracks=w||[],this.config.renderTextTracksNatively){var b=this.media?this.media.textTracks:[];this.tracks.forEach(function(u,d){var E;if(d<b.length){for(var g=null,y=0;y<b.length;y++)if(o(b[y],u)){g=b[y];break}g&&(E=g)}E?Object(k.clearCurrentCues)(E):(E=S.createTextTrack("subtitles",u.name,u.lang),E&&(E.mode="disabled")),E&&(E.groupId=u.groupId,S.textTracks.push(E))})}else if(!R&&this.tracks&&this.tracks.length){var _=this.tracks.map(function(u){return{label:u.name,kind:u.type.toLowerCase(),default:u.default,subtitleTrack:u}});this.hls.trigger(W.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:_})}}},t.onManifestLoaded=function(h,A){var S=this;this.config.enableCEA708Captions&&A.captions&&A.captions.forEach(function(w){var O=/(?:CC|SERVICE)([1-4])/.exec(w.instreamId);if(!O)return;var R="textTrack"+O[1],b=S.captionsProperties[R];if(!b)return;b.label=w.name,w.lang&&(b.languageCode=w.lang),b.media=w})},t.onFragLoading=function(h,A){var S=this.cea608Parser1,w=this.cea608Parser2,O=this.lastSn,R=this.lastPartIndex;if(!this.enabled||!(S&&w))return;if(A.frag.type===m.PlaylistLevelType.MAIN){var b,_,u=A.frag.sn,d=(b=A==null||((_=A.part)===null||_===void 0)?void 0:_.index)!=null?b:-1;u===O+1||u===O&&d===R+1||(S.reset(),w.reset()),this.lastSn=u,this.lastPartIndex=d}},t.onFragLoaded=function(h,A){var S=A.frag,w=A.payload,O=this.initPTS,R=this.unparsedVttFrags;if(S.type===m.PlaylistLevelType.SUBTITLE)if(w.byteLength){if(!Object(ee.isFiniteNumber)(O[S.cc])){R.push(A),O.length&&this.hls.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Missing initial subtitle PTS")});return}var b=S.decryptdata;if(b==null||b.key==null||b.method!=="AES-128"){var _=this.tracks[S.level],u=this.vttCCs;u[S.cc]||(u[S.cc]={start:S.start,prevCC:this.prevCC,new:!0},this.prevCC=S.cc),_&&_.textCodec===D.IMSC1_CODEC?this._parseIMSC1(S,w):this._parseVTTs(S,w,u)}}else this.hls.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(h,A){var S=this,w=this.hls;Object(D.parseIMSC1)(A,this.initPTS[h.cc],this.timescale[h.cc],function(O){S._appendCues(O,h.level),w.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(O){v.logger.log("Failed to parse IMSC1: "+O),w.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:O})})},t._parseVTTs=function(h,A,S){var w=this,O=this.hls;Object(X.parseWebVTT)(A,this.initPTS[h.cc],this.timescale[h.cc],S,h.cc,h.start,function(R){w._appendCues(R,h.level),O.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:h})},function(R){w._fallbackToIMSC1(h,A),v.logger.log("Failed to parse VTT cue: "+R),O.trigger(W.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:h,error:R})})},t._fallbackToIMSC1=function(h,A){var S=this,w=this.tracks[h.level];w.textCodec||Object(D.parseIMSC1)(A,this.initPTS[h.cc],this.timescale[h.cc],function(){w.textCodec=D.IMSC1_CODEC,S._parseIMSC1(h,A)},function(){w.textCodec="wvtt"})},t._appendCues=function(h,A){var S=this.hls;if(this.config.renderTextTracksNatively){var w=this.textTracks[A];if(w.mode==="disabled")return;h.forEach(function(b){return Object(k.addCueToTrack)(w,b)})}else{var O=this.tracks[A],R=O.default?"default":"subtitles"+A;S.trigger(W.Events.CUES_PARSED,{type:"subtitles",cues:h,track:R})}},t.onFragDecrypted=function(h,A){var S=A.frag;if(S.type===m.PlaylistLevelType.SUBTITLE){if(!Object(ee.isFiniteNumber)(this.initPTS[S.cc])){this.unparsedVttFrags.push(A);return}this.onFragLoaded(W.Events.FRAG_LOADED,A)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(h,A){var S=this.cea608Parser1,w=this.cea608Parser2;if(!this.enabled||!(S&&w))return;for(var O=0;O<A.samples.length;O++){var R=A.samples[O].bytes;if(R){var b=this.extractCea608Data(R);S.addData(A.samples[O].pts,b[0]),w.addData(A.samples[O].pts,b[1])}}},t.onBufferFlushing=function(h,A){var S=A.startOffset,w=A.endOffset,O=A.endOffsetSubtitles,R=A.type,b=this.media;if(!b||b.currentTime<w)return;if(!R||R==="video"){var _=this.captionsTracks;Object.keys(_).forEach(function(d){return Object(k.removeCuesInRange)(_[d],S,w)})}if(this.config.renderTextTracksNatively&&(S===0&&O!==void 0)){var u=this.textTracks;Object.keys(u).forEach(function(d){return Object(k.removeCuesInRange)(u[d],S,O)})}},t.extractCea608Data=function(h){for(var A=h[0]&31,S=2,w=[[],[]],O=0;O<A;O++){var R=h[S++],b=127&h[S++],_=127&h[S++],u=(4&R)!==0,d=3&R;if(b===0&&_===0)continue;u&&((d===0||d===1)&&(w[d].push(b),w[d].push(_)))}return w},i}();function o(i,t){return i&&i.label===t.name&&!(i.textTrack1||i.textTrack2)}function l(i,t,c,h){return Math.min(t,h)-Math.max(i,c)}function r(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return ee});var ee=function(){function W($,X){this.subtle=void 0,this.aesIV=void 0,this.subtle=$,this.aesIV=X}var M=W.prototype;return M.decrypt=function(X,k){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},k,X)},W}()},"./src/crypt/aes-decryptor.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"removePadding",function(){return W}),U.d(Z,"default",function(){return M});var ee=U("./src/utils/typed-array.ts");function W($){var X=$.byteLength,k=X&&new DataView($.buffer).getUint8(X-1);return k?Object(ee.sliceUint8)($,0,X-k):$}var M=function(){function $(){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 X=$.prototype;return X.uint8ArrayToUint32Array_=function(D){for(var m=new DataView(D),v=new Uint32Array(4),f=0;f<4;f++)v[f]=m.getUint32(f*4);return v},X.initTable=function(){var D=this.sBox,m=this.invSBox,v=this.subMix,f=v[0],o=v[1],l=v[2],r=v[3],i=this.invSubMix,t=i[0],c=i[1],h=i[2],A=i[3],S=new Uint32Array(256),w=0,O=0,R=0;for(R=0;R<256;R++)R<128?S[R]=R<<1:S[R]=R<<1^283;for(R=0;R<256;R++){var b=O^O<<1^O<<2^O<<3^O<<4;b=b>>>8^b&255^99,D[w]=b,m[b]=w;var _=S[w],u=S[_],d=S[u],E=S[b]*257^b*16843008;f[w]=E<<24|E>>>8,o[w]=E<<16|E>>>16,l[w]=E<<8|E>>>24,r[w]=E,E=d*16843009^u*65537^_*257^w*16843008,t[b]=E<<24|E>>>8,c[b]=E<<16|E>>>16,h[b]=E<<8|E>>>24,A[b]=E,w?(w=_^S[S[S[d^_]]],O^=S[S[O]]):w=O=1}},X.expandKey=function(D){for(var m=this.uint8ArrayToUint32Array_(D),v=!0,f=0;f<m.length&&v;)v=m[f]===this.key[f],f++;if(v)return;this.key=m;var o=this.keySize=m.length;if(o!==4&&o!==6&&o!==8)throw new Error("Invalid aes key size="+o);var l=this.ksRows=(o+6+1)*4,r,i,t=this.keySchedule=new Uint32Array(l),c=this.invKeySchedule=new Uint32Array(l),h=this.sBox,A=this.rcon,S=this.invSubMix,w=S[0],O=S[1],R=S[2],b=S[3],_,u;for(r=0;r<l;r++){if(r<o){_=t[r]=m[r];continue}u=_,r%o===0?(u=u<<8|u>>>24,u=h[u>>>24]<<24|h[u>>>16&255]<<16|h[u>>>8&255]<<8|h[u&255],u^=A[r/o|0]<<24):o>6&&r%o===4&&(u=h[u>>>24]<<24|h[u>>>16&255]<<16|h[u>>>8&255]<<8|h[u&255]),t[r]=_=(t[r-o]^u)>>>0}for(i=0;i<l;i++)r=l-i,i&3?u=t[r]:u=t[r-4],i<4||r<=4?c[i]=u:c[i]=w[h[u>>>24]]^O[h[u>>>16&255]]^R[h[u>>>8&255]]^b[h[u&255]],c[i]=c[i]>>>0},X.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},X.decrypt=function(D,m,v){for(var f=this.keySize+6,o=this.invKeySchedule,l=this.invSBox,r=this.invSubMix,i=r[0],t=r[1],c=r[2],h=r[3],A=this.uint8ArrayToUint32Array_(v),S=A[0],w=A[1],O=A[2],R=A[3],b=new Int32Array(D),_=new Int32Array(b.length),u,d,E,g,y,F,N,H,G,I,x,B,Y,re,de=this.networkToHostOrderSwap;m<b.length;){for(G=de(b[m]),I=de(b[m+1]),x=de(b[m+2]),B=de(b[m+3]),y=G^o[0],F=B^o[1],N=x^o[2],H=I^o[3],Y=4,re=1;re<f;re++)u=i[y>>>24]^t[F>>16&255]^c[N>>8&255]^h[H&255]^o[Y],d=i[F>>>24]^t[N>>16&255]^c[H>>8&255]^h[y&255]^o[Y+1],E=i[N>>>24]^t[H>>16&255]^c[y>>8&255]^h[F&255]^o[Y+2],g=i[H>>>24]^t[y>>16&255]^c[F>>8&255]^h[N&255]^o[Y+3],y=u,F=d,N=E,H=g,Y=Y+4;u=l[y>>>24]<<24^l[F>>16&255]<<16^l[N>>8&255]<<8^l[H&255]^o[Y],d=l[F>>>24]<<24^l[N>>16&255]<<16^l[H>>8&255]<<8^l[y&255]^o[Y+1],E=l[N>>>24]<<24^l[H>>16&255]<<16^l[y>>8&255]<<8^l[F&255]^o[Y+2],g=l[H>>>24]<<24^l[y>>16&255]<<16^l[F>>8&255]<<8^l[N&255]^o[Y+3],_[m]=de(u^S),_[m+1]=de(g^w),_[m+2]=de(E^O),_[m+3]=de(d^R),S=G,w=I,O=x,R=B,m=m+4}return _.buffer},$}()},"./src/crypt/decrypter.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return m});var ee=U("./src/crypt/aes-crypto.ts"),W=U("./src/crypt/fast-aes-key.ts"),M=U("./src/crypt/aes-decryptor.ts"),$=U("./src/utils/logger.ts"),X=U("./src/utils/mp4-tools.ts"),k=U("./src/utils/typed-array.ts"),D=16,m=function(){function v(o,l,r){var i=r===void 0?{}:r,t=i.removePKCS7Padding,c=t===void 0?!0:t;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=o,this.config=l,this.removePKCS7Padding=c,c)try{var h=self.crypto;h&&(this.subtle=h.subtle||h.webkitSubtle)}catch(A){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var f=v.prototype;return f.destroy=function(){this.observer=null},f.isSync=function(){return this.config.enableSoftwareAES},f.flush=function(){var l=this.currentResult;if(!l){this.reset();return}var r=new Uint8Array(l);return this.reset(),this.removePKCS7Padding?Object(M.removePadding)(r):r},f.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},f.decrypt=function(l,r,i,t){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(l),r,i);var c=this.flush();c&&t(c.buffer)}else this.webCryptoDecrypt(new Uint8Array(l),r,i).then(t)},f.softwareDecrypt=function(l,r,i){var t=this.currentIV,c=this.currentResult,h=this.remainderData;this.logOnce("JS AES decrypt"),h&&(l=Object(X.appendUint8Array)(h,l),this.remainderData=null);var A=this.getValidChunk(l);if(!A.length)return null;t&&(i=t);var S=this.softwareDecrypter;S||(S=this.softwareDecrypter=new M.default),S.expandKey(r);var w=c;return this.currentResult=S.decrypt(A.buffer,0,i),this.currentIV=Object(k.sliceUint8)(A,-16).buffer,w||null},f.webCryptoDecrypt=function(l,r,i){var t=this,c=this.subtle;return(this.key!==r||!this.fastAesKey)&&(this.key=r,this.fastAesKey=new W.default(c,r)),this.fastAesKey.expandKey().then(function(h){if(!c)return Promise.reject(new Error("web crypto not initialized"));var A=new ee.default(c,i);return A.decrypt(l.buffer,h)}).catch(function(h){return t.onWebCryptoError(h,l,r,i)})},f.onWebCryptoError=function(l,r,i,t){return $.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",l),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(r,i,t)},f.getValidChunk=function(l){var r=l,i=l.length-l.length%D;return i!==l.length&&(r=Object(k.sliceUint8)(l,0,i),this.remainderData=Object(k.sliceUint8)(l,i)),r},f.logOnce=function(l){if(!this.logEnabled)return;$.logger.log("[decrypter.ts]: "+l),this.logEnabled=!1},v}()},"./src/crypt/fast-aes-key.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return ee});var ee=function(){function W($,X){this.subtle=void 0,this.key=void 0,this.subtle=$,this.key=X}var M=W.prototype;return M.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},W}()},"./src/demux/aacdemuxer.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/demux/base-audio-demuxer.ts"),W=U("./src/demux/adts.ts"),M=U("./src/utils/logger.ts"),$=U("./src/demux/id3.ts");function X(m,v){m.prototype=Object.create(v.prototype),m.prototype.constructor=m,k(m,v)}function k(m,v){return k=Object.setPrototypeOf||function(o,l){return o.__proto__=l,o},k(m,v)}var D=function(m){X(v,m);function v(o,l){var r;return r=m.call(this)||this,r.observer=void 0,r.config=void 0,r.observer=o,r.config=l,r}var f=v.prototype;return f.resetInitSegment=function(l,r,i){m.prototype.resetInitSegment.call(this,l,r,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:l,duration:i,inputTimeScale:9e4,dropped:0}},v.probe=function(l){if(!l)return!1;for(var r=$.getID3Data(l,0)||[],i=r.length,t=l.length;i<t;i++)if(W.probe(l,i))return M.logger.log("ADTS sync word found !"),!0;return!1},f.canParse=function(l,r){return W.canParse(l,r)},f.appendFrame=function(l,r,i){W.initTrackConfig(l,this.observer,r,i,l.manifestCodec);var t=W.appendFrame(l,r,i,this.initPTS,this.frameIndex);if(t&&t.missing===0)return t},v}(ee.default);D.minProbeByteLength=9,Z.default=D},"./src/demux/adts.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"getAudioConfig",function(){return $}),U.d(Z,"isHeaderPattern",function(){return X}),U.d(Z,"getHeaderLength",function(){return k}),U.d(Z,"getFullFrameLength",function(){return D}),U.d(Z,"canGetFrameLength",function(){return m}),U.d(Z,"isHeader",function(){return v}),U.d(Z,"canParse",function(){return f}),U.d(Z,"probe",function(){return o}),U.d(Z,"initTrackConfig",function(){return l}),U.d(Z,"getFrameDuration",function(){return r}),U.d(Z,"parseFrameHeader",function(){return i}),U.d(Z,"appendFrame",function(){return t});var ee=U("./src/utils/logger.ts"),W=U("./src/errors.ts"),M=U("./src/events.ts");function $(c,h,A,S){var w,O,R,b,_=navigator.userAgent.toLowerCase(),u=S,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];w=((h[A+2]&192)>>>6)+1;var E=(h[A+2]&60)>>>2;if(E>d.length-1){c.trigger(M.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return R=(h[A+2]&1)<<2,R|=(h[A+3]&192)>>>6,ee.logger.log("manifest codec:"+S+", ADTS type:"+w+", samplingIndex:"+E),/firefox/i.test(_)?E>=6?(w=5,b=new Array(4),O=E-3):(w=2,b=new Array(2),O=E):_.indexOf("android")!==-1?(w=2,b=new Array(2),O=E):(w=5,b=new Array(4),S&&(S.indexOf("mp4a.40.29")!==-1||S.indexOf("mp4a.40.5")!==-1)||!S&&E>=6?O=E-3:((S&&S.indexOf("mp4a.40.2")!==-1&&(E>=6&&R===1||/vivaldi/i.test(_))||!S&&R===1)&&(w=2,b=new Array(2)),O=E)),b[0]=w<<3,b[0]|=(E&14)>>1,b[1]|=(E&1)<<7,b[1]|=R<<3,w===5&&(b[1]|=(O&14)>>1,b[2]=(O&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:d[E],channelCount:R,codec:"mp4a.40."+w,manifestCodec:u}}function X(c,h){return c[h]===255&&(c[h+1]&246)===240}function k(c,h){return c[h+1]&1?7:9}function D(c,h){return(c[h+3]&3)<<11|c[h+4]<<3|(c[h+5]&224)>>>5}function m(c,h){return h+5<c.length}function v(c,h){return h+1<c.length&&X(c,h)}function f(c,h){return m(c,h)&&X(c,h)&&D(c,h)<=c.length-h}function o(c,h){if(v(c,h)){var A=k(c,h);if(h+A>=c.length)return!1;var S=D(c,h);if(S<=A)return!1;var w=h+S;return w===c.length||v(c,w)}return!1}function l(c,h,A,S,w){if(!c.samplerate){var O=$(h,A,S,w);if(!O)return;c.config=O.config,c.samplerate=O.samplerate,c.channelCount=O.channelCount,c.codec=O.codec,c.manifestCodec=O.manifestCodec,ee.logger.log("parsed codec:"+c.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function r(c){return 1024*9e4/c}function i(c,h,A,S,w){var O=k(c,h),R=D(c,h);if(R-=O,R>0){var b=A+S*w;return{headerLength:O,frameLength:R,stamp:b}}}function t(c,h,A,S,w){var O=r(c.samplerate),R=i(h,A,S,w,O);if(R){var b=R.frameLength,_=R.headerLength,u=R.stamp,d=_+b,E=Math.max(0,A+d-h.length),g;E?(g=new Uint8Array(d-_),g.set(h.subarray(A+_,h.length),0)):g=h.subarray(A+_,A+d);var y={unit:g,pts:u};return E||c.samples.push(y),{sample:y,length:d,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"initPTSFn",function(){return D});var ee=U("./src/polyfills/number.ts"),W=U("./src/demux/id3.ts"),M=U("./src/demux/dummy-demuxed-track.ts"),$=U("./src/utils/mp4-tools.ts"),X=U("./src/utils/typed-array.ts"),k=function(){function m(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var v=m.prototype;return v.resetInitSegment=function(o,l,r){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},v.resetTimeStamp=function(){},v.resetContiguity=function(){},v.canParse=function(o,l){return!1},v.appendFrame=function(o,l,r){},v.demux=function(o,l){this.cachedData&&(o=Object($.appendUint8Array)(this.cachedData,o),this.cachedData=null);var r=W.getID3Data(o,0),i=r?r.length:0,t,c,h=this._audioTrack,A=this._id3Track,S=r?W.getTimeStamp(r):void 0,w=o.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(S,l)),r&&r.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:r}),c=this.initPTS;i<w;){if(this.canParse(o,i)){var O=this.appendFrame(h,o,i);O?(this.frameIndex++,c=O.sample.pts,i+=O.length,t=i):i=w}else W.canParse(o,i)?(r=W.getID3Data(o,i),A.samples.push({pts:c,dts:c,data:r}),i+=r.length,t=i):i++;if(i===w&&t!==w){var R=Object(X.sliceUint8)(o,t);this.cachedData?this.cachedData=Object($.appendUint8Array)(this.cachedData,R):this.cachedData=R}}return{audioTrack:h,avcTrack:Object(M.dummyTrack)(),id3Track:A,textTrack:Object(M.dummyTrack)()}},v.demuxSampleAes=function(o,l,r){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},v.flush=function(o){var l=this.cachedData;return l&&(this.cachedData=null,this.demux(l,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(M.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(M.dummyTrack)()}},v.destroy=function(){},m}(),D=function(v,f){return Object(ee.isFiniteNumber)(v)?v*90:f*9e4};Z.default=k},"./src/demux/chunk-cache.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return ee});var ee=function(){function M(){this.chunks=[],this.dataLength=0}var $=M.prototype;return $.push=function(k){this.chunks.push(k),this.dataLength+=k.length},$.flush=function(){var k=this.chunks,D=this.dataLength,m;if(k.length)k.length===1?m=k[0]:m=W(k,D);else return new Uint8Array(0);return this.reset(),m},$.reset=function(){this.chunks.length=0,this.dataLength=0},M}();function W(M,$){for(var X=new Uint8Array($),k=0,D=0;D<M.length;D++){var m=M[D];X.set(m,k),k+=m.length}return X}},"./src/demux/dummy-demuxed-track.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"dummyTrack",function(){return ee});function ee(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/utils/logger.ts"),W=function(){function M(X){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=X,this.bytesAvailable=X.byteLength,this.word=0,this.bitsAvailable=0}var $=M.prototype;return $.loadWord=function(){var k=this.data,D=this.bytesAvailable,m=k.byteLength-D,v=new Uint8Array(4),f=Math.min(4,D);if(f===0)throw new Error("no bytes available");v.set(k.subarray(m,m+f)),this.word=new DataView(v.buffer).getUint32(0),this.bitsAvailable=f*8,this.bytesAvailable-=f},$.skipBits=function(k){var D;this.bitsAvailable>k?(this.word<<=k,this.bitsAvailable-=k):(k-=this.bitsAvailable,D=k>>3,k-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=k,this.bitsAvailable-=k)},$.readBits=function(k){var D=Math.min(this.bitsAvailable,k),m=this.word>>>32-D;return k>32&&ee.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=k-D,D>0&&this.bitsAvailable?m<<D|this.readBits(D):m},$.skipLZ=function(){var k;for(k=0;k<this.bitsAvailable;++k)if((this.word&2147483648>>>k)!==0)return this.word<<=k,this.bitsAvailable-=k,k;return this.loadWord(),k+this.skipLZ()},$.skipUEG=function(){this.skipBits(1+this.skipLZ())},$.skipEG=function(){this.skipBits(1+this.skipLZ())},$.readUEG=function(){var k=this.skipLZ();return this.readBits(k+1)-1},$.readEG=function(){var k=this.readUEG();return 1&k?1+k>>>1:-1*(k>>>1)},$.readBoolean=function(){return this.readBits(1)===1},$.readUByte=function(){return this.readBits(8)},$.readUShort=function(){return this.readBits(16)},$.readUInt=function(){return this.readBits(32)},$.skipScalingList=function(k){for(var D=8,m=8,v,f=0;f<k;f++)m!==0&&(v=this.readEG(),m=(D+v+256)%256),D=m===0?D:m},$.readSPS=function(){var k=0,D=0,m=0,v=0,f,o,l,r=this.readUByte.bind(this),i=this.readBits.bind(this),t=this.readUEG.bind(this),c=this.readBoolean.bind(this),h=this.skipBits.bind(this),A=this.skipEG.bind(this),S=this.skipUEG.bind(this),w=this.skipScalingList.bind(this);r();var O=r();if(i(5),h(3),r(),S(),O===100||O===110||O===122||O===244||O===44||O===83||O===86||O===118||O===128){var R=t();if(R===3&&h(1),S(),S(),h(1),c())for(o=R!==3?8:12,l=0;l<o;l++)c()&&(l<6?w(16):w(64))}S();var b=t();if(b===0)t();else if(b===1)for(h(1),A(),A(),f=t(),l=0;l<f;l++)A();S(),h(1);var _=t(),u=t(),d=i(1);d===0&&h(1),h(1),c()&&(k=t(),D=t(),m=t(),v=t());var E=[1,1];if(c()&&c()){var g=r();switch(g){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[r()<<8|r(),r()<<8|r()];break}}}return{width:Math.ceil((_+1)*16-k*2-D*2),height:(2-d)*(u+1)*16-(d?2:4)*(m+v),pixelRatio:E}},$.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},M}();Z.default=W},"./src/demux/id3.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"isHeader",function(){return ee}),U.d(Z,"isFooter",function(){return W}),U.d(Z,"getID3Data",function(){return M}),U.d(Z,"canParse",function(){return X}),U.d(Z,"getTimeStamp",function(){return k}),U.d(Z,"isTimeStampFrame",function(){return D}),U.d(Z,"getID3Frames",function(){return v}),U.d(Z,"decodeFrame",function(){return f}),U.d(Z,"utf8ArrayToStr",function(){return t}),U.d(Z,"testables",function(){return c});var ee=function(w,O){return O+10<=w.length&&(w[O]===73&&w[O+1]===68&&w[O+2]===51&&(w[O+3]<255&&w[O+4]<255&&(w[O+6]<128&&w[O+7]<128&&w[O+8]<128&&w[O+9]<128)))},W=function(w,O){return O+10<=w.length&&(w[O]===51&&w[O+1]===68&&w[O+2]===73&&(w[O+3]<255&&w[O+4]<255&&(w[O+6]<128&&w[O+7]<128&&w[O+8]<128&&w[O+9]<128)))},M=function(w,O){for(var R=O,b=0;ee(w,O);){b+=10;var _=$(w,O+6);b+=_,W(w,O+10)&&(b+=10),O+=b}return b>0?w.subarray(R,R+b):void 0},$=function(w,O){var R=0;return R=(w[O]&127)<<21,R|=(w[O+1]&127)<<14,R|=(w[O+2]&127)<<7,R|=w[O+3]&127,R},X=function(w,O){return ee(w,O)&&$(w,O+6)+10<=w.length-O},k=function(w){for(var O=v(w),R=0;R<O.length;R++){var b=O[R];if(D(b))return i(b)}return},D=function(w){return w&&w.key==="PRIV"&&w.info==="com.apple.streaming.transportStreamTimestamp"},m=function(w){var O=String.fromCharCode(w[0],w[1],w[2],w[3]),R=$(w,4),b=10;return{type:O,size:R,data:w.subarray(b,b+R)}},v=function(w){for(var O=0,R=[];ee(w,O);){var b=$(w,O+6);O+=10;for(var _=O+b;O+8<_;){var u=m(w.subarray(O)),d=f(u);d&&R.push(d),O+=u.size+10}W(w,O)&&(O+=10)}return R},f=function(w){return w.type==="PRIV"?o(w):w.type[0]==="W"?r(w):l(w)},o=function(w){if(w.size<2)return;var O=t(w.data,!0),R=new Uint8Array(w.data.subarray(O.length+1));return{key:w.type,info:O,data:R.buffer}},l=function(w){if(w.size<2)return;if(w.type==="TXXX"){var O=1,R=t(w.data.subarray(O),!0);O+=R.length+1;var b=t(w.data.subarray(O));return{key:w.type,info:R,data:b}}var _=t(w.data.subarray(1));return{key:w.type,data:_}},r=function(w){if(w.type==="WXXX"){if(w.size<2)return;var O=1,R=t(w.data.subarray(O),!0);O+=R.length+1;var b=t(w.data.subarray(O));return{key:w.type,info:R,data:b}}var _=t(w.data);return{key:w.type,data:_}},i=function(w){if(w.data.byteLength===8){var O=new Uint8Array(w.data),R=O[3]&1,b=(O[4]<<23)+(O[5]<<15)+(O[6]<<7)+O[7];return b/=45,R&&(b+=4772185884e-2),Math.round(b)}return},t=function(w,O){O===void 0&&(O=!1);var R=A();if(R){var b=R.decode(w);if(O){var _=b.indexOf("\0");return _!==-1?b.substring(0,_):b}return b.replace(/\0/g,"")}for(var u=w.length,d,E,g,y="",F=0;F<u;){if(d=w[F++],d===0&&O)return y;if(d===0||d===3)continue;switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(d);break;case 12:case 13:E=w[F++],y+=String.fromCharCode((d&31)<<6|E&63);break;case 14:E=w[F++],g=w[F++],y+=String.fromCharCode((d&15)<<12|(E&63)<<6|(g&63)<<0);break;default:}}return y},c={decodeTextFrame:l},h;function A(){return!h&&typeof self.TextDecoder!="undefined"&&(h=new self.TextDecoder("utf-8")),h}},"./src/demux/mp3demuxer.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/demux/base-audio-demuxer.ts"),W=U("./src/demux/id3.ts"),M=U("./src/utils/logger.ts"),$=U("./src/demux/mpegaudio.ts");function X(m,v){m.prototype=Object.create(v.prototype),m.prototype.constructor=m,k(m,v)}function k(m,v){return k=Object.setPrototypeOf||function(o,l){return o.__proto__=l,o},k(m,v)}var D=function(m){X(v,m);function v(){return m.apply(this,arguments)||this}var f=v.prototype;return f.resetInitSegment=function(l,r,i){m.prototype.resetInitSegment.call(this,l,r,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:l,duration:i,inputTimeScale:9e4,dropped:0}},v.probe=function(l){if(!l)return!1;for(var r=W.getID3Data(l,0)||[],i=r.length,t=l.length;i<t;i++)if($.probe(l,i))return M.logger.log("MPEG Audio sync word found !"),!0;return!1},f.canParse=function(l,r){return $.canParse(l,r)},f.appendFrame=function(l,r,i){return this.initPTS===null?void 0:$.appendFrame(l,r,i,this.initPTS,this.frameIndex)},v}(ee.default);D.minProbeByteLength=4,Z.default=D},"./src/demux/mp4demuxer.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/utils/mp4-tools.ts"),W=U("./src/demux/dummy-demuxed-track.ts"),M=function(){function $(k,D){this.remainderData=null,this.config=void 0,this.config=D}var X=$.prototype;return X.resetTimeStamp=function(){},X.resetInitSegment=function(){},X.resetContiguity=function(){},$.probe=function(D){return Object(ee.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},X.demux=function(D){var m=D,v=Object(W.dummyTrack)();if(this.config.progressive){this.remainderData&&(m=Object(ee.appendUint8Array)(this.remainderData,D));var f=Object(ee.segmentValidRange)(m);this.remainderData=f.remainder,v.samples=f.valid||new Uint8Array}else v.samples=m;return{audioTrack:Object(W.dummyTrack)(),avcTrack:v,id3Track:Object(W.dummyTrack)(),textTrack:Object(W.dummyTrack)()}},X.flush=function(){var D=Object(W.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(W.dummyTrack)(),avcTrack:D,id3Track:Object(W.dummyTrack)(),textTrack:Object(W.dummyTrack)()}},X.demuxSampleAes=function(D,m,v){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},X.destroy=function(){},$}();M.minProbeByteLength=1024,Z.default=M},"./src/demux/mpegaudio.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"appendFrame",function(){return k}),U.d(Z,"parseHeader",function(){return D}),U.d(Z,"isHeaderPattern",function(){return m}),U.d(Z,"isHeader",function(){return v}),U.d(Z,"canParse",function(){return f}),U.d(Z,"probe",function(){return o});var ee=null,W=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],M=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],$=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],X=[0,1,1,4];function k(l,r,i,t,c){if(i+24>r.length)return;var h=D(r,i);if(h&&i+h.frameLength<=r.length){var A=h.samplesPerFrame*9e4/h.sampleRate,S=t+c*A,w={unit:r.subarray(i,i+h.frameLength),pts:S,dts:S};return l.config=[],l.channelCount=h.channelCount,l.samplerate=h.sampleRate,l.samples.push(w),{sample:w,length:h.frameLength,missing:0}}}function D(l,r){var i=l[r+1]>>3&3,t=l[r+1]>>1&3,c=l[r+2]>>4&15,h=l[r+2]>>2&3;if(i!==1&&c!==0&&c!==15&&h!==3){var A=l[r+2]>>1&1,S=l[r+3]>>6,w=i===3?3-t:t===3?3:4,O=W[w*14+c-1]*1e3,R=i===3?0:i===2?1:2,b=M[R*3+h],_=S===3?1:2,u=$[i][t],d=X[t],E=u*8*d,g=Math.floor(u*O/b+A)*d;if(ee===null){var y=navigator.userAgent||"",F=y.match(/Chrome\/(\d+)/i);ee=F?parseInt(F[1]):0}var N=!!ee&&ee<=87;return N&&t===2&&O>=224e3&&S===0&&(l[r+3]=l[r+3]|128),{sampleRate:b,channelCount:_,frameLength:g,samplesPerFrame:E}}}function m(l,r){return l[r]===255&&(l[r+1]&224)===224&&(l[r+1]&6)!==0}function v(l,r){return r+1<l.length&&m(l,r)}function f(l,r){var i=4;return m(l,r)&&i<=l.length-r}function o(l,r){if(r+1<l.length&&m(l,r)){var i=4,t=D(l,r),c=i;t!=null&&t.frameLength&&(c=t.frameLength);var h=r+c;return h===l.length||v(l,h)}return!1}},"./src/demux/sample-aes.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/crypt/decrypter.ts"),W=U("./src/demux/tsdemuxer.ts"),M=function(){function $(k,D,m){this.keyData=void 0,this.decrypter=void 0,this.keyData=m,this.decrypter=new ee.default(k,D,{removePKCS7Padding:!1})}var X=$.prototype;return X.decryptBuffer=function(D,m){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,m)},X.decryptAacSample=function(D,m,v,f){var o=D[m].unit,l=o.subarray(16,o.length-o.length%16),r=l.buffer.slice(l.byteOffset,l.byteOffset+l.length),i=this;this.decryptBuffer(r,function(t){var c=new Uint8Array(t);o.set(c,16),f||i.decryptAacSamples(D,m+1,v)})},X.decryptAacSamples=function(D,m,v){for(;;m++){if(m>=D.length){v();return}if(D[m].unit.length<32)continue;var f=this.decrypter.isSync();if(this.decryptAacSample(D,m,v,f),!f)return}},X.getAvcEncryptedData=function(D){for(var m=Math.floor((D.length-48)/160)*16+16,v=new Int8Array(m),f=0,o=32;o<=D.length-16;o+=160,f+=16)v.set(D.subarray(o,o+16),f);return v},X.getAvcDecryptedUnit=function(D,m){for(var v=new Uint8Array(m),f=0,o=32;o<=D.length-16;o+=160,f+=16)D.set(v.subarray(f,f+16),o);return D},X.decryptAvcSample=function(D,m,v,f,o,l){var r=Object(W.discardEPB)(o.data),i=this.getAvcEncryptedData(r),t=this;this.decryptBuffer(i.buffer,function(c){o.data=t.getAvcDecryptedUnit(r,c),l||t.decryptAvcSamples(D,m,v+1,f)})},X.decryptAvcSamples=function(D,m,v,f){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;m++,v=0){if(m>=D.length){f();return}for(var o=D[m].units;!(v>=o.length);v++){var l=o[v];if(l.data.length<=48||l.type!==1&&l.type!==5)continue;var r=this.decrypter.isSync();if(this.decryptAvcSample(D,m,v,f,l,r),!r)return}}},$}();Z.default=M},"./src/demux/transmuxer-interface.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return o});var ee=U("./node_modules/webworkify-webpack/index.js"),W=U.n(ee),M=U("./src/events.ts"),$=U("./src/demux/transmuxer.ts"),X=U("./src/utils/logger.ts"),k=U("./src/errors.ts"),D=U("./src/utils/mediasource-helper.ts"),m=U("./node_modules/eventemitter3/index.js"),v=U.n(m),f=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},o=function(){function l(i,t,c,h){var A=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=i,this.id=t,this.onTransmuxComplete=c,this.onFlush=h;var S=i.config,w=function(u,d){d=d||{},d.frag=A.frag,d.id=A.id,i.trigger(u,d)};this.observer=new m.EventEmitter,this.observer.on(M.Events.FRAG_DECRYPTED,w),this.observer.on(M.Events.ERROR,w);var O={mp4:f.isTypeSupported("video/mp4"),mpeg:f.isTypeSupported("audio/mpeg"),mp3:f.isTypeSupported('audio/mp4; codecs="mp3"')},R=navigator.vendor;if(S.enableWorker&&typeof Worker!="undefined"){X.logger.log("demuxing in webworker");var b;try{b=this.worker=ee("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(_){i.trigger(M.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(_.message+" ("+_.filename+":"+_.lineno+")")})},b.postMessage({cmd:"init",typeSupported:O,vendor:R,id:t,config:JSON.stringify(S)})}catch(_){X.logger.warn("Error in worker:",_),X.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new $.default(this.observer,O,S,R,t),this.worker=null}}else this.transmuxer=new $.default(this.observer,O,S,R,t)}var r=l.prototype;return r.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var c=this.transmuxer;c&&(c.destroy(),this.transmuxer=null)}var h=this.observer;h&&h.removeAllListeners(),this.observer=null},r.push=function(t,c,h,A,S,w,O,R,b,_){var u=this;b.transmuxing.start=self.performance.now();var d=this.transmuxer,E=this.worker,g=w?w.start:S.start,y=S.decryptdata,F=this.frag,N=!(F&&S.cc===F.cc),H=!(F&&b.level===F.level),G=F?b.sn-F.sn:-1,I=this.part?b.part-this.part.index:1,x=!H&&(G===1||G===0&&I===1),B=self.performance.now();(H||G||S.stats.parsing.start===0)&&(S.stats.parsing.start=B),w&&(I||!x)&&(w.stats.parsing.start=B);var Y=new $.TransmuxState(N,x,R,H,g);if(!x||N){X.logger.log("[transmuxer-interface, "+S.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+`
discontinuity: `+N+`
trackSwitch: `+H+`
contiguous: `+x+`
accurateTimeOffset: `+R+`
timeOffset: `+g);var re=new $.TransmuxConfig(h,A,c,O,_);this.configureTransmuxer(re)}if(this.frag=S,this.part=w,E)E.postMessage({cmd:"demux",data:t,decryptdata:y,chunkMeta:b,state:Y},t instanceof ArrayBuffer?[t]:[]);else if(d){var de=d.push(t,y,b,Y);Object($.isPromise)(de)?de.then(function(he){u.handleTransmuxComplete(he)}):this.handleTransmuxComplete(de)}},r.flush=function(t){var c=this;t.transmuxing.start=self.performance.now();var h=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:t});else if(h){var S=h.flush(t);Object($.isPromise)(S)?S.then(function(w){c.handleFlushResult(w,t)}):this.handleFlushResult(S,t)}},r.handleFlushResult=function(t,c){var h=this;t.forEach(function(A){h.handleTransmuxComplete(A)}),this.onFlush(c)},r.onWorkerMessage=function(t){var c=t.data,h=this.hls;switch(c.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(c.data);break}case"flush":{this.onFlush(c.data);break}default:{c.data=c.data||{},c.data.frag=this.frag,c.data.id=this.id,h.trigger(c.event,c.data);break}}},r.configureTransmuxer=function(t){var c=this.worker,h=this.transmuxer;c?c.postMessage({cmd:"configure",config:t}):h&&h.configure(t)},r.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},l}()},"./src/demux/transmuxer-worker.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return k});var ee=U("./src/demux/transmuxer.ts"),W=U("./src/events.ts"),M=U("./src/utils/logger.ts"),$=U("./node_modules/eventemitter3/index.js"),X=U.n($);function k(o){var l=new $.EventEmitter,r=function(t,c){o.postMessage({event:t,data:c})};l.on(W.Events.FRAG_DECRYPTED,r),l.on(W.Events.ERROR,r),o.addEventListener("message",function(i){var t=i.data;switch(t.cmd){case"init":{var c=JSON.parse(t.config);o.transmuxer=new ee.default(l,t.typeSupported,c,t.vendor,t.id),Object(M.enableLogs)(c.debug),r("init",null);break}case"configure":{o.transmuxer.configure(t.config);break}case"demux":{var h=o.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state);Object(ee.isPromise)(h)?h.then(function(w){D(o,w)}):D(o,h);break}case"flush":{var A=t.chunkMeta,S=o.transmuxer.flush(A);Object(ee.isPromise)(S)?S.then(function(w){v(o,w,A)}):v(o,S,A);break}default:break}})}function D(o,l){if(f(l.remuxResult))return;var r=[],i=l.remuxResult,t=i.audio,c=i.video;t&&m(r,t),c&&m(r,c),o.postMessage({event:"transmuxComplete",data:l},r)}function m(o,l){l.data1&&o.push(l.data1.buffer),l.data2&&o.push(l.data2.buffer)}function v(o,l,r){l.forEach(function(i){D(o,i)}),o.postMessage({event:"flush",data:r})}function f(o){return!o.audio&&!o.video&&!o.text&&!o.id3&&!o.initSegment}},"./src/demux/transmuxer.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return c}),U.d(Z,"isPromise",function(){return S}),U.d(Z,"TransmuxConfig",function(){return w}),U.d(Z,"TransmuxState",function(){return O});var ee=U("./src/events.ts"),W=U("./src/errors.ts"),M=U("./src/crypt/decrypter.ts"),$=U("./src/demux/aacdemuxer.ts"),X=U("./src/demux/mp4demuxer.ts"),k=U("./src/demux/tsdemuxer.ts"),D=U("./src/demux/mp3demuxer.ts"),m=U("./src/remux/mp4-remuxer.ts"),v=U("./src/remux/passthrough-remuxer.ts"),f=U("./src/demux/chunk-cache.ts"),o=U("./src/utils/mp4-tools.ts"),l=U("./src/utils/logger.ts"),r;try{r=self.performance.now.bind(self.performance)}catch(R){l.logger.debug("Unable to use Performance API on this environment"),r=self.Date.now}var i=[{demux:k.default,remux:m.default},{demux:X.default,remux:v.default},{demux:$.default,remux:m.default},{demux:D.default,remux:m.default}],t=1024;i.forEach(function(R){var b=R.demux;t=Math.max(t,b.minProbeByteLength)});var c=function(){function R(_,u,d,E,g){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new f.default,this.observer=_,this.typeSupported=u,this.config=d,this.vendor=E,this.id=g}var b=R.prototype;return b.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},b.push=function(u,d,E,g){var y=this,F=E.transmuxing;F.executeStart=r();var N=new Uint8Array(u),H=this.cache,G=this.config,I=this.currentTransmuxState,x=this.transmuxConfig;g&&(this.currentTransmuxState=g);var B=h(N,d);if(B&&B.method==="AES-128"){var Y=this.getDecrypter();if(G.enableSoftwareAES){var re=Y.softwareDecrypt(N,B.key.buffer,B.iv.buffer);if(!re)return F.executeEnd=r(),A(E);N=new Uint8Array(re)}else return this.decryptionPromise=Y.webCryptoDecrypt(N,B.key.buffer,B.iv.buffer).then(function(at){var ft=y.push(at,null,E);return y.decryptionPromise=null,ft}),this.decryptionPromise}var de=g||I,he=de.contiguous,xe=de.discontinuity,Pe=de.trackSwitch,Ce=de.accurateTimeOffset,Oe=de.timeOffset,be=x.audioCodec,ge=x.videoCodec,te=x.defaultInitPts,fe=x.duration,_e=x.initSegmentData;if((xe||Pe)&&this.resetInitSegment(_e,be,ge,fe),xe&&this.resetInitialTimestamp(te),he||this.resetContiguity(),this.needsProbing(N,xe,Pe)){if(H.dataLength){var Le=H.flush();N=Object(o.appendUint8Array)(Le,N)}this.configureTransmuxer(N,x)}var $e=this.transmux(N,B,Oe,Ce,E),Ue=this.currentTransmuxState;return Ue.contiguous=!0,Ue.discontinuity=!1,Ue.trackSwitch=!1,F.executeEnd=r(),$e},b.flush=function(u){var d=this,E=u.transmuxing;E.executeStart=r();var g=this.decrypter,y=this.cache,F=this.currentTransmuxState,N=this.decryptionPromise;if(N)return N.then(function(){return d.flush(u)});var H=[],G=F.timeOffset;if(g){var I=g.flush();I&&H.push(this.push(I,null,u))}var x=y.dataLength;y.reset();var B=this.demuxer,Y=this.remuxer;if(!B||!Y)return x>=t&&this.observer.emit(ee.Events.ERROR,ee.Events.ERROR,{type:W.ErrorTypes.MEDIA_ERROR,details:W.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=r(),[A(u)];var re=B.flush(G);return S(re)?re.then(function(de){return d.flushRemux(H,de,u),H}):(this.flushRemux(H,re,u),H)},b.flushRemux=function(u,d,E){var g=d.audioTrack,y=d.avcTrack,F=d.id3Track,N=d.textTrack,H=this.currentTransmuxState,G=H.accurateTimeOffset,I=H.timeOffset;l.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var x=this.remuxer.remux(g,y,F,N,I,G,!0,this.id);u.push({remuxResult:x,chunkMeta:E}),E.transmuxing.executeEnd=r()},b.resetInitialTimestamp=function(u){var d=this.demuxer,E=this.remuxer;if(!d||!E)return;d.resetTimeStamp(u),E.resetTimeStamp(u)},b.resetContiguity=function(){var u=this.demuxer,d=this.remuxer;if(!u||!d)return;u.resetContiguity(),d.resetNextTimestamp()},b.resetInitSegment=function(u,d,E,g){var y=this.demuxer,F=this.remuxer;if(!y||!F)return;y.resetInitSegment(d,E,g),F.resetInitSegment(u,d,E)},b.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},b.transmux=function(u,d,E,g,y){var F;return d&&d.method==="SAMPLE-AES"?F=this.transmuxSampleAes(u,d,E,g,y):F=this.transmuxUnencrypted(u,E,g,y),F},b.transmuxUnencrypted=function(u,d,E,g){var y=this.demuxer.demux(u,d,!1,!this.config.progressive),F=y.audioTrack,N=y.avcTrack,H=y.id3Track,G=y.textTrack,I=this.remuxer.remux(F,N,H,G,d,E,!1,this.id);return{remuxResult:I,chunkMeta:g}},b.transmuxSampleAes=function(u,d,E,g,y){var F=this;return this.demuxer.demuxSampleAes(u,d,E).then(function(N){var H=F.remuxer.remux(N.audioTrack,N.avcTrack,N.id3Track,N.textTrack,E,g,!1,F.id);return{remuxResult:H,chunkMeta:y}})},b.configureTransmuxer=function(u,d){for(var E=this.config,g=this.observer,y=this.typeSupported,F=this.vendor,N=d.audioCodec,H=d.defaultInitPts,G=d.duration,I=d.initSegmentData,x=d.videoCodec,B,Y=0,re=i.length;Y<re;Y++)if(i[Y].demux.probe(u)){B=i[Y];break}B||(l.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),B={demux:X.default,remux:v.default});var de=this.demuxer,he=this.remuxer,xe=B.remux,Pe=B.demux;(!he||!(he instanceof xe))&&(this.remuxer=new xe(g,E,y,F)),(!de||!(de instanceof Pe))&&(this.demuxer=new Pe(g,E,y),this.probe=Pe.probe),this.resetInitSegment(I,N,x,G),this.resetInitialTimestamp(H)},b.needsProbing=function(u,d,E){return!this.demuxer||!this.remuxer||d||E},b.getDecrypter=function(){var u=this.decrypter;return u||(u=this.decrypter=new M.default(this.observer,this.config)),u},R}();function h(R,b){var _=null;return R.byteLength>0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(_=b),_}var A=function(b){return{remuxResult:{},chunkMeta:b}};function S(R){return"then"in R&&R.then instanceof Function}var w=function(b,_,u,d,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=b,this.videoCodec=_,this.initSegmentData=u,this.duration=d,this.defaultInitPts=E},O=function(b,_,u,d,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=b,this.contiguous=_,this.accurateTimeOffset=u,this.trackSwitch=d,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"discardEPB",function(){return A});var ee=U("./src/demux/adts.ts"),W=U("./src/demux/mpegaudio.ts"),M=U("./src/demux/exp-golomb.ts"),$=U("./src/demux/id3.ts"),X=U("./src/demux/sample-aes.ts"),k=U("./src/events.ts"),D=U("./src/utils/mp4-tools.ts"),m=U("./src/utils/logger.ts"),v=U("./src/errors.ts"),f={video:1,audio:2,id3:3,text:4},o=function(){function S(O,R,b){this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.sampleAes=null,this.pmtParsed=!1,this.audioCodec=void 0,this.videoCodec=void 0,this._duration=0,this.aacLastPTS=null,this._initPTS=null,this._initDTS=null,this._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=O,this.config=R,this.typeSupported=b}S.probe=function(R){var b=S.syncOffset(R);return b<0?!1:(b&&m.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},S.syncOffset=function(R){for(var b=Math.min(1e3,R.length-3*188),_=0;_<b;){if(R[_]===71&&R[_+188]===71&&R[_+2*188]===71)return _;_++}return-1},S.createTrack=function(R,b){return{container:R==="video"||R==="audio"?"video/mp2t":void 0,type:R,id:f[R],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:R==="audio"?b:void 0}};var w=S.prototype;return w.resetInitSegment=function(R,b,_){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=S.createTrack("video",_),this._audioTrack=S.createTrack("audio",_),this._id3Track=S.createTrack("id3",_),this._txtTrack=S.createTrack("text",_),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=R,this.videoCodec=b,this._duration=_},w.resetTimeStamp=function(){},w.resetContiguity=function(){var R=this._audioTrack,b=this._avcTrack,_=this._id3Track;R&&(R.pesData=null),b&&(b.pesData=null),_&&(_.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},w.demux=function(R,b,_,u){_===void 0&&(_=!1),u===void 0&&(u=!1),_||(this.sampleAes=null);var d,E=this._avcTrack,g=this._audioTrack,y=this._id3Track,F=E.pid,N=E.pesData,H=g.pid,G=y.pid,I=g.pesData,x=y.pesData,B=!1,Y=this.pmtParsed,re=this._pmtId,de=R.length;if(this.remainderData&&(R=Object(D.appendUint8Array)(this.remainderData,R),de=R.length,this.remainderData=null),de<188&&!u)return this.remainderData=R,{audioTrack:g,avcTrack:E,id3Track:y,textTrack:this._txtTrack};var he=Math.max(0,S.syncOffset(R));de-=(de+he)%188,de<R.byteLength&&!u&&(this.remainderData=new Uint8Array(R.buffer,de,R.buffer.byteLength-de));for(var xe=he;xe<de;xe+=188)if(R[xe]===71){var Pe=!!(R[xe+1]&64),Ce=((R[xe+1]&31)<<8)+R[xe+2],Oe=(R[xe+3]&48)>>4,be=void 0;if(Oe>1){if(be=xe+5+R[xe+4],be===xe+188)continue}else be=xe+4;switch(Ce){case F:Pe&&(N&&(d=t(N))&&this.parseAVCPES(d,!1),N={data:[],size:0}),N&&(N.data.push(R.subarray(be,xe+188)),N.size+=xe+188-be);break;case H:Pe&&(I&&(d=t(I))&&(g.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),I={data:[],size:0}),I&&(I.data.push(R.subarray(be,xe+188)),I.size+=xe+188-be);break;case G:Pe&&(x&&(d=t(x))&&this.parseID3PES(d),x={data:[],size:0}),x&&(x.data.push(R.subarray(be,xe+188)),x.size+=xe+188-be);break;case 0:Pe&&(be+=R[be]+1),re=this._pmtId=r(R,be);break;case re:{Pe&&(be+=R[be]+1);var ge=i(R,be,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,_);F=ge.avc,F>0&&(E.pid=F),H=ge.audio,H>0&&(g.pid=H,g.isAAC=ge.isAAC),G=ge.id3,G>0&&(y.pid=G),B&&!Y&&(m.logger.log("reparse from beginning"),B=!1,xe=he-188),Y=this.pmtParsed=!0;break}case 17:case 8191:break;default:B=!0;break}}else this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=N,g.pesData=I,y.pesData=x;var te={audioTrack:g,avcTrack:E,id3Track:y,textTrack:this._txtTrack};return u&&this.extractRemainingSamples(te),te},w.flush=function(){var R=this.remainderData;this.remainderData=null;var b;return R?b=this.demux(R,-1,!1,!0):b={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(b),this.sampleAes?this.decrypt(b,this.sampleAes):b},w.extractRemainingSamples=function(R){var b=R.audioTrack,_=R.avcTrack,u=R.id3Track,d=_.pesData,E=b.pesData,g=u.pesData,y;d&&(y=t(d))?(this.parseAVCPES(y,!0),_.pesData=null):_.pesData=d,E&&(y=t(E))?(b.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),b.pesData=null):(E!=null&&E.size&&m.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=E),g&&(y=t(g))?(this.parseID3PES(y),u.pesData=null):u.pesData=g},w.demuxSampleAes=function(R,b,_){var u=this.demux(R,_,!0,!this.config.progressive),d=this.sampleAes=new X.default(this.observer,this.config,b);return this.decrypt(u,d)},w.decrypt=function(R,b){return new Promise(function(_){var u=R.audioTrack,d=R.avcTrack;u.samples&&u.isAAC?b.decryptAacSamples(u.samples,0,function(){d.samples?b.decryptAvcSamples(d.samples,0,0,function(){_(R)}):_(R)}):d.samples&&b.decryptAvcSamples(d.samples,0,0,function(){_(R)})})},w.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},w.parseAVCPES=function(R,b){var _=this,u=this._avcTrack,d=this.parseAVCNALu(R.data),E=!1,g=this.avcSample,y,F=!1;R.data=null,g&&d.length&&!u.audFound&&(c(g,u),g=this.avcSample=l(!1,R.pts,R.dts,"")),d.forEach(function(N){switch(N.type){case 1:{y=!0,g||(g=_.avcSample=l(!0,R.pts,R.dts,"")),E&&(g.debug+="NDR "),g.frame=!0;var H=N.data;if(F&&H.length>4){var G=new M.default(H).readSliceType();(G===2||G===4||G===7||G===9)&&(g.key=!0)}break}case 5:y=!0,g||(g=_.avcSample=l(!0,R.pts,R.dts,"")),E&&(g.debug+="IDR "),g.key=!0,g.frame=!0;break;case 6:{y=!0,E&&g&&(g.debug+="SEI ");var I=new M.default(A(N.data));I.readUByte();for(var x=0,B=0,Y=!1,re=0;!Y&&I.bytesAvailable>1;){x=0;do re=I.readUByte(),x+=re;while(re===255);B=0;do re=I.readUByte(),B+=re;while(re===255);if(x===4&&I.bytesAvailable!==0){Y=!0;var de=I.readUByte();if(de===181){var he=I.readUShort();if(he===49){var xe=I.readUInt();if(xe===1195456820){var Pe=I.readUByte();if(Pe===3){for(var Ce=I.readUByte(),Oe=I.readUByte(),be=31&Ce,ge=[Ce,Oe],te=0;te<be;te++)ge.push(I.readUByte()),ge.push(I.readUByte()),ge.push(I.readUByte());h(_._txtTrack.samples,{type:3,pts:R.pts,bytes:ge})}}}}}else if(x===5&&I.bytesAvailable!==0){if(Y=!0,B>16){for(var fe=[],_e=0;_e<16;_e++)fe.push(I.readUByte().toString(16)),(_e===3||_e===5||_e===7||_e===9)&&fe.push("-");for(var Le=B-16,$e=new Uint8Array(Le),Ue=0;Ue<Le;Ue++)$e[Ue]=I.readUByte();h(_._txtTrack.samples,{pts:R.pts,payloadType:x,uuid:fe.join(""),userData:Object($.utf8ArrayToStr)($e),userDataBytes:$e})}}else if(B<I.bytesAvailable)for(var at=0;at<B;at++)I.readUByte()}break}case 7:if(y=!0,F=!0,E&&g&&(g.debug+="SPS "),!u.sps){var ft=new M.default(N.data),Ct=ft.readSPS();u.width=Ct.width,u.height=Ct.height,u.pixelRatio=Ct.pixelRatio,u.sps=[N.data],u.duration=_._duration;for(var yt=N.data.subarray(1,4),_t="avc1.",lt=0;lt<3;lt++){var Ft=yt[lt].toString(16);Ft.length<2&&(Ft="0"+Ft),_t+=Ft}u.codec=_t}break;case 8:y=!0,E&&g&&(g.debug+="PPS "),u.pps||(u.pps=[N.data]);break;case 9:y=!1,u.audFound=!0,g&&c(g,u),g=_.avcSample=l(!1,R.pts,R.dts,E?"AUD ":"");break;case 12:y=!1;break;default:y=!1,g&&(g.debug+="unknown NAL "+N.type+" ");break}if(g&&y){var Xt=g.units;Xt.push(N)}}),b&&g&&(c(g,u),this.avcSample=null)},w.getLastNalUnit=function(){var R,b=this.avcSample,_;if(!b||b.units.length===0){var u=this._avcTrack.samples;b=u[u.length-1]}if((R=b)!==null&&R!==void 0&&R.units){var d=b.units;_=d[d.length-1]}return _},w.parseAVCNALu=function(R){var b=R.byteLength,_=this._avcTrack,u=_.naluState||0,d=u,E=[],g=0,y,F,N,H=-1,G=0;for(u===-1&&(H=0,G=R[0]&31,u=0,g=1);g<b;){if(y=R[g++],!u){u=y?0:1;continue}if(u===1){u=y?0:2;continue}if(!y)u=3;else if(y===1){if(H>=0){var I={data:R.subarray(H,g-u-1),type:G};E.push(I)}else{var x=this.getLastNalUnit();if(x&&(d&&g<=4-d&&(x.state&&(x.data=x.data.subarray(0,x.data.byteLength-d))),F=g-u-1,F>0)){var B=new Uint8Array(x.data.byteLength+F);B.set(x.data,0),B.set(R.subarray(0,F),x.data.byteLength),x.data=B,x.state=0}}g<b?(N=R[g]&31,H=g,G=N,u=0):u=-1}else u=0}if(H>=0&&u>=0){var Y={data:R.subarray(H,b),type:G,state:u};E.push(Y)}if(E.length===0){var re=this.getLastNalUnit();if(re){var de=new Uint8Array(re.data.byteLength+R.byteLength);de.set(re.data,0),de.set(R,re.data.byteLength),re.data=de}}return _.naluState=u,E},w.parseAACPES=function(R){var b=0,_=this._audioTrack,u=this.aacOverFlow,d=R.data;if(u){this.aacOverFlow=null;var E=u.sample.unit.byteLength,g=Math.min(u.missing,E),y=E-g;u.sample.unit.set(d.subarray(0,g),y),_.samples.push(u.sample),b=u.missing}var F,N;for(F=b,N=d.length;F<N-1&&!ee.isHeader(d,F);F++);if(F!==b){var H,G;if(F<N-1?(H="AAC PES did not start with ADTS header,offset:"+F,G=!1):(H="no ADTS header found in AAC PES",G=!0),m.logger.warn("parsing error:"+H),this.observer.emit(k.Events.ERROR,k.Events.ERROR,{type:v.ErrorTypes.MEDIA_ERROR,details:v.ErrorDetails.FRAG_PARSING_ERROR,fatal:G,reason:H}),G)return}ee.initTrackConfig(_,this.observer,d,F,this.audioCodec);var I;if(R.pts!==void 0)I=R.pts;else if(u){var x=ee.getFrameDuration(_.samplerate);I=u.sample.pts+x}else{m.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var B=0;F<N;)if(ee.isHeader(d,F)){if(F+5<N){var Y=ee.appendFrame(_,d,F,I,B);if(Y)if(Y.missing)this.aacOverFlow=Y;else{F+=Y.length,B++;continue}}break}else F++},w.parseMPEGPES=function(R){var b=R.data,_=b.length,u=0,d=0,E=R.pts;if(E===void 0){m.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<_;)if(W.isHeader(b,d)){var g=W.appendFrame(this._audioTrack,b,d,E,u);if(g)d+=g.length,u++;else break}else d++},w.parseID3PES=function(R){if(R.pts===void 0){m.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(R)},S}();o.minProbeByteLength=188;function l(S,w,O,R){return{key:S,frame:!1,pts:w,dts:O,units:[],debug:R,length:0}}function r(S,w){return(S[w+10]&31)<<8|S[w+11]}function i(S,w,O,R){var b={audio:-1,avc:-1,id3:-1,isAAC:!0},_=(S[w+1]&15)<<8|S[w+2],u=w+3+_-4,d=(S[w+10]&15)<<8|S[w+11];for(w+=12+d;w<u;){var E=(S[w+1]&31)<<8|S[w+2];switch(S[w]){case 207:if(!R){m.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:b.audio===-1&&(b.audio=E);break;case 21:b.id3===-1&&(b.id3=E);break;case 219:if(!R){m.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:b.avc===-1&&(b.avc=E);break;case 3:case 4:O?b.audio===-1&&(b.audio=E,b.isAAC=!1):m.logger.log("MPEG audio found, not supported in this browser");break;case 36:m.logger.warn("Unsupported HEVC stream type found");break;default:break}w+=((S[w+3]&15)<<8|S[w+4])+5}return b}function t(S){var w=0,O,R,b,_,u,d=S.data;if(!S||S.size===0)return null;for(;d[0].length<19&&d.length>1;){var E=new Uint8Array(d[0].length+d[1].length);E.set(d[0]),E.set(d[1],d[0].length),d[0]=E,d.splice(1,1)}O=d[0];var g=(O[0]<<16)+(O[1]<<8)+O[2];if(g===1){if(R=(O[4]<<8)+O[5],R&&R>S.size-6)return null;var y=O[7];y&192&&(_=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,y&64?(u=(O[14]&14)*536870912+(O[15]&255)*4194304+(O[16]&254)*16384+(O[17]&255)*128+(O[18]&254)/2,_-u>60*9e4&&(m.logger.warn(Math.round((_-u)/9e4)+"s delta between PTS and DTS, align them"),_=u)):u=_),b=O[8];var F=b+9;if(S.size<=F)return null;S.size-=F;for(var N=new Uint8Array(S.size),H=0,G=d.length;H<G;H++){O=d[H];var I=O.byteLength;if(F)if(F>I){F-=I;continue}else O=O.subarray(F),I-=F,F=0;N.set(O,w),w+=I}return R&&(R-=b+3),{data:N,pts:_,dts:u,len:R}}return null}function c(S,w){if(S.units.length&&S.frame){if(S.pts===void 0){var O=w.samples,R=O.length;if(R){var b=O[R-1];S.pts=b.pts,S.dts=b.dts}else{w.dropped++;return}}w.samples.push(S)}S.debug.length&&m.logger.log(S.pts+"/"+S.dts+":"+S.debug)}function h(S,w){var O=S.length;if(O>0){if(w.pts>=S[O-1].pts)S.push(w);else for(var R=O-1;R>=0;R--)if(w.pts<S[R].pts){S.splice(R,0,w);break}}else S.push(w)}function A(S){for(var w=S.byteLength,O=[],R=1;R<w-2;)S[R]===0&&S[R+1]===0&&S[R+2]===3?(O.push(R+2),R+=2):R++;if(O.length===0)return S;var b=w-O.length,_=new Uint8Array(b),u=0;for(R=0;R<b;u++,R++)u===O[0]&&(u++,O.shift()),_[R]=S[u];return _}Z.default=o},"./src/errors.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"ErrorTypes",function(){return ee}),U.d(Z,"ErrorDetails",function(){return W});var ee;(function(M){M.NETWORK_ERROR="networkError",M.MEDIA_ERROR="mediaError",M.KEY_SYSTEM_ERROR="keySystemError",M.MUX_ERROR="muxError",M.OTHER_ERROR="otherError"})(ee||(ee={}));var W;(function(M){M.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",M.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",M.KEY_SYSTEM_NO_SESSION="keySystemNoSession",M.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",M.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",M.MANIFEST_LOAD_ERROR="manifestLoadError",M.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",M.MANIFEST_PARSING_ERROR="manifestParsingError",M.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",M.LEVEL_EMPTY_ERROR="levelEmptyError",M.LEVEL_LOAD_ERROR="levelLoadError",M.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",M.LEVEL_SWITCH_ERROR="levelSwitchError",M.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",M.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",M.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",M.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",M.FRAG_LOAD_ERROR="fragLoadError",M.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",M.FRAG_DECRYPT_ERROR="fragDecryptError",M.FRAG_PARSING_ERROR="fragParsingError",M.REMUX_ALLOC_ERROR="remuxAllocError",M.KEY_LOAD_ERROR="keyLoadError",M.KEY_LOAD_TIMEOUT="keyLoadTimeOut",M.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",M.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",M.BUFFER_APPEND_ERROR="bufferAppendError",M.BUFFER_APPENDING_ERROR="bufferAppendingError",M.BUFFER_STALLED_ERROR="bufferStalledError",M.BUFFER_FULL_ERROR="bufferFullError",M.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",M.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",M.INTERNAL_EXCEPTION="internalException",M.INTERNAL_ABORTED="aborted",M.UNKNOWN="unknown"})(W||(W={}))},"./src/events.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"Events",function(){return ee});var ee;(function(W){W.MEDIA_ATTACHING="hlsMediaAttaching",W.MEDIA_ATTACHED="hlsMediaAttached",W.MEDIA_DETACHING="hlsMediaDetaching",W.MEDIA_DETACHED="hlsMediaDetached",W.BUFFER_RESET="hlsBufferReset",W.BUFFER_CODECS="hlsBufferCodecs",W.BUFFER_CREATED="hlsBufferCreated",W.BUFFER_APPENDING="hlsBufferAppending",W.BUFFER_APPENDED="hlsBufferAppended",W.BUFFER_EOS="hlsBufferEos",W.BUFFER_FLUSHING="hlsBufferFlushing",W.BUFFER_FLUSHED="hlsBufferFlushed",W.MANIFEST_LOADING="hlsManifestLoading",W.MANIFEST_LOADED="hlsManifestLoaded",W.MANIFEST_PARSED="hlsManifestParsed",W.LEVEL_SWITCHING="hlsLevelSwitching",W.LEVEL_SWITCHED="hlsLevelSwitched",W.LEVEL_LOADING="hlsLevelLoading",W.LEVEL_LOADED="hlsLevelLoaded",W.LEVEL_UPDATED="hlsLevelUpdated",W.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",W.LEVELS_UPDATED="hlsLevelsUpdated",W.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",W.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",W.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",W.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",W.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",W.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",W.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",W.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",W.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",W.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",W.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",W.CUES_PARSED="hlsCuesParsed",W.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",W.INIT_PTS_FOUND="hlsInitPtsFound",W.FRAG_LOADING="hlsFragLoading",W.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",W.FRAG_LOADED="hlsFragLoaded",W.FRAG_DECRYPTED="hlsFragDecrypted",W.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",W.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",W.FRAG_PARSING_METADATA="hlsFragParsingMetadata",W.FRAG_PARSED="hlsFragParsed",W.FRAG_BUFFERED="hlsFragBuffered",W.FRAG_CHANGED="hlsFragChanged",W.FPS_DROP="hlsFpsDrop",W.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",W.ERROR="hlsError",W.DESTROYING="hlsDestroying",W.KEY_LOADING="hlsKeyLoading",W.KEY_LOADED="hlsKeyLoaded",W.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",W.BACK_BUFFER_REACHED="hlsBackBufferReached"})(ee||(ee={}))},"./src/hls.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return S});var ee=U("./node_modules/url-toolkit/src/url-toolkit.js"),W=U.n(ee),M=U("./src/loader/playlist-loader.ts"),$=U("./src/loader/key-loader.ts"),X=U("./src/controller/id3-track-controller.ts"),k=U("./src/controller/latency-controller.ts"),D=U("./src/controller/level-controller.ts"),m=U("./src/controller/fragment-tracker.ts"),v=U("./src/controller/stream-controller.ts"),f=U("./src/is-supported.ts"),o=U("./src/utils/logger.ts"),l=U("./src/config.ts"),r=U("./node_modules/eventemitter3/index.js"),i=U.n(r),t=U("./src/events.ts"),c=U("./src/errors.ts");function h(w,O){for(var R=0;R<O.length;R++){var b=O[R];b.enumerable=b.enumerable||!1,b.configurable=!0,"value"in b&&(b.writable=!0),Object.defineProperty(w,b.key,b)}}function A(w,O,R){return O&&h(w.prototype,O),R&&h(w,R),w}var S=function(){w.isSupported=function(){return Object(f.isSupported)()};function w(R){R===void 0&&(R={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new r.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 b=this.config=Object(l.mergeConfig)(w.DefaultConfig,R);this.userConfig=R,Object(o.enableLogs)(b.debug),this._autoLevelCapping=-1,b.progressive&&Object(l.enableStreamingMode)(b);var _=b.abrController,u=b.bufferController,d=b.capLevelController,E=b.fpsController,g=this.abrController=new _(this),y=this.bufferController=new u(this),F=this.capLevelController=new d(this),N=new E(this),H=new M.default(this),G=new $.default(this),I=new X.default(this),x=this.levelController=new D.default(this),B=new m.FragmentTracker(this),Y=this.streamController=new v.default(this,B);F.setStreamController(Y),N.setStreamController(Y);var re=[x,Y];this.networkControllers=re;var de=[H,G,g,y,F,N,I,B];this.audioTrackController=this.createController(b.audioTrackController,null,re),this.createController(b.audioStreamController,B,re),this.subtitleTrackController=this.createController(b.subtitleTrackController,null,re),this.createController(b.subtitleStreamController,B,re),this.createController(b.timelineController,null,de),this.emeController=this.createController(b.emeController,null,de),this.cmcdController=this.createController(b.cmcdController,null,de),this.latencyController=this.createController(k.default,null,de),this.coreComponents=de}var O=w.prototype;return O.createController=function(b,_,u){if(b){var d=_?new b(this,_):new b(this);return u&&u.push(d),d}return null},O.on=function(b,_,u){u===void 0&&(u=this),this._emitter.on(b,_,u)},O.once=function(b,_,u){u===void 0&&(u=this),this._emitter.once(b,_,u)},O.removeAllListeners=function(b){this._emitter.removeAllListeners(b)},O.off=function(b,_,u,d){u===void 0&&(u=this),this._emitter.off(b,_,u,d)},O.listeners=function(b){return this._emitter.listeners(b)},O.emit=function(b,_,u){return this._emitter.emit(b,_,u)},O.trigger=function(b,_){if(this.config.debug)return this.emit(b,b,_);try{return this.emit(b,b,_)}catch(u){o.logger.error("An internal error happened while handling event "+b+'. Error message: "'+u.message+'". Here is a stacktrace:',u),this.trigger(t.Events.ERROR,{type:c.ErrorTypes.OTHER_ERROR,details:c.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:b,error:u})}return!1},O.listenerCount=function(b){return this._emitter.listenerCount(b)},O.destroy=function(){o.logger.log("destroy"),this.trigger(t.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(b){return b.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(b){return b.destroy()}),this.coreComponents.length=0},O.attachMedia=function(b){o.logger.log("attachMedia"),this._media=b,this.trigger(t.Events.MEDIA_ATTACHING,{media:b})},O.detachMedia=function(){o.logger.log("detachMedia"),this.trigger(t.Events.MEDIA_DETACHING,void 0),this._media=null},O.loadSource=function(b){this.stopLoad();var _=this.media,u=this.url,d=this.url=ee.buildAbsoluteURL(self.location.href,b,{alwaysNormalize:!0});o.logger.log("loadSource:"+d),_&&u&&u!==d&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(_)),this.trigger(t.Events.MANIFEST_LOADING,{url:b})},O.startLoad=function(b){b===void 0&&(b=-1),o.logger.log("startLoad("+b+")"),this.networkControllers.forEach(function(_){_.startLoad(b)})},O.stopLoad=function(){o.logger.log("stopLoad"),this.networkControllers.forEach(function(b){b.stopLoad()})},O.swapAudioCodec=function(){o.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},O.recoverMediaError=function(){o.logger.log("recoverMediaError");var b=this._media;this.detachMedia(),b&&this.attachMedia(b)},O.removeLevel=function(b,_){_===void 0&&(_=0),this.levelController.removeLevel(b,_)},A(w,[{key:"levels",get:function(){var b=this.levelController.levels;return b||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(b){o.logger.log("set currentLevel:"+b),this.loadLevel=b,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(b){o.logger.log("set nextLevel:"+b),this.levelController.manualLevel=b,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(b){o.logger.log("set loadLevel:"+b),this.levelController.manualLevel=b}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(b){this.levelController.nextLoadLevel=b}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(b){o.logger.log("set firstLevel:"+b),this.levelController.firstLevel=b}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(b){o.logger.log("set startLevel:"+b),b!==-1&&(b=Math.max(b,this.minAutoLevel)),this.levelController.startLevel=b}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(b){var _=!!b;_!==this.config.capLevelToPlayerSize&&(_?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=_)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(b){this._autoLevelCapping!==b&&(o.logger.log("set autoLevelCapping:"+b),this._autoLevelCapping=b)}},{key:"bandwidthEstimate",get:function(){var b=this.abrController.bwEstimator;return b?b.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var b=this.levels,_=this.config.minAutoBitrate;if(!b)return 0;for(var u=b.length,d=0;d<u;d++)if(b[d].maxBitrate>_)return d;return 0}},{key:"maxAutoLevel",get:function(){var b=this.levels,_=this.autoLevelCapping,u;return _===-1&&b&&b.length?u=b.length-1:u=_,u}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(b){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,b)}},{key:"audioTracks",get:function(){var b=this.audioTrackController;return b?b.audioTracks:[]}},{key:"audioTrack",get:function(){var b=this.audioTrackController;return b?b.audioTrack:-1},set:function(b){var _=this.audioTrackController;_&&(_.audioTrack=b)}},{key:"subtitleTracks",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var b=this.subtitleTrackController;return b?b.subtitleTrack:-1},set:function(b){var _=this.subtitleTrackController;_&&(_.subtitleTrack=b)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var b=this.subtitleTrackController;return b?b.subtitleDisplay:!1},set:function(b){var _=this.subtitleTrackController;_&&(_.subtitleDisplay=b)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(b){this.config.lowLatencyMode=b}},{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 t.Events}},{key:"ErrorTypes",get:function(){return c.ErrorTypes}},{key:"ErrorDetails",get:function(){return c.ErrorDetails}},{key:"DefaultConfig",get:function(){return w.defaultConfig?w.defaultConfig:l.hlsDefaultConfig},set:function(b){w.defaultConfig=b}}]),w}();S.defaultConfig=void 0},"./src/is-supported.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"isSupported",function(){return M}),U.d(Z,"changeTypeSupported",function(){return $});var ee=U("./src/utils/mediasource-helper.ts");function W(){return self.SourceBuffer||self.WebKitSourceBuffer}function M(){var X=Object(ee.getMediaSource)();if(!X)return!1;var k=W(),D=X&&typeof X.isTypeSupported=="function"&&X.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),m=!k||k.prototype&&typeof k.prototype.appendBuffer=="function"&&typeof k.prototype.remove=="function";return!!D&&!!m}function $(){var X,k=W();return typeof(k==null||((X=k.prototype)===null||X===void 0)?void 0:X.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return o}),U.d(Z,"LoadError",function(){return r});var ee=U("./src/polyfills/number.ts"),W=U("./src/errors.ts");function M(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,m(i,t)}function $(i){var t=typeof Map=="function"?new Map:void 0;return $=function(h){if(h===null||!D(h))return h;if(typeof h!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(h))return t.get(h);t.set(h,A)}function A(){return X(h,arguments,v(this).constructor)}return A.prototype=Object.create(h.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),m(A,h)},$(i)}function X(i,t,c){return k()?X=Reflect.construct:X=function(A,S,w){var O=[null];O.push.apply(O,S);var R=Function.bind.apply(A,O),b=new R;return w&&m(b,w.prototype),b},X.apply(null,arguments)}function k(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function D(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function m(i,t){return m=Object.setPrototypeOf||function(h,A){return h.__proto__=A,h},m(i,t)}function v(i){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},v(i)}var f=Math.pow(2,17),o=function(){function i(c){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=c}var t=i.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(h,A){var S=this,w=h.url;if(!w)return Promise.reject(new r({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,networkDetails:null},"Fragment does not have a "+(w?"part list":"url")));this.abort();var O=this.config,R=O.fLoader,b=O.loader;return new Promise(function(_,u){S.loader&&S.loader.destroy();var d=S.loader=h.loader=R?new R(O):new b(O),E=l(h),g={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:f};h.stats=d.stats,d.load(E,g,{onSuccess:function(F,N,H,G){S.resetLoader(h,d),_({frag:h,part:null,payload:F.data,networkDetails:G})},onError:function(F,N,H){S.resetLoader(h,d),u(new r({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,response:F,networkDetails:H}))},onAbort:function(F,N,H){S.resetLoader(h,d),u(new r({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,networkDetails:H}))},onTimeout:function(F,N,H){S.resetLoader(h,d),u(new r({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,networkDetails:H}))},onProgress:function(F,N,H,G){A&&A({frag:h,part:null,payload:H,networkDetails:G})}})})},t.loadPart=function(h,A,S){var w=this;this.abort();var O=this.config,R=O.fLoader,b=O.loader;return new Promise(function(_,u){w.loader&&w.loader.destroy();var d=w.loader=h.loader=R?new R(O):new b(O),E=l(h,A),g={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:f};A.stats=d.stats,d.load(E,g,{onSuccess:function(F,N,H,G){w.resetLoader(h,d),w.updateStatsFromPart(h,A);var I={frag:h,part:A,payload:F.data,networkDetails:G};S(I),_(I)},onError:function(F,N,H){w.resetLoader(h,d),u(new r({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:h,part:A,response:F,networkDetails:H}))},onAbort:function(F,N,H){h.stats.aborted=A.stats.aborted,w.resetLoader(h,d),u(new r({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:h,part:A,networkDetails:H}))},onTimeout:function(F,N,H){w.resetLoader(h,d),u(new r({type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:h,part:A,networkDetails:H}))}})})},t.updateStatsFromPart=function(h,A){var S=h.stats,w=A.stats,O=w.total;if(S.loaded+=w.loaded,O){var R=Math.round(h.duration/A.duration),b=Math.min(Math.round(S.loaded/O),R),_=R-b,u=_*Math.round(S.loaded/b);S.total=S.loaded+u}else S.total=Math.max(S.loaded,S.total);var d=S.loading,E=w.loading;d.start?d.first+=E.first-E.start:(d.start=E.start,d.first=E.first),d.end=E.end},t.resetLoader=function(h,A){h.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},i}();function l(i,t){t===void 0&&(t=null);var c=t||i,h={frag:i,part:t,responseType:"arraybuffer",url:c.url,headers:{},rangeStart:0,rangeEnd:0},A=c.byteRangeStartOffset,S=c.byteRangeEndOffset;return Object(ee.isFiniteNumber)(A)&&Object(ee.isFiniteNumber)(S)&&(h.rangeStart=A,h.rangeEnd=S),h}var r=function(i){M(t,i);function t(c){for(var h,A=arguments.length,S=new Array(A>1?A-1:0),w=1;w<A;w++)S[w-1]=arguments[w];return h=i.call.apply(i,[this].concat(S))||this,h.data=void 0,h.data=c,h}return t}($(Error))},"./src/loader/fragment.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"ElementaryStreamTypes",function(){return o}),U.d(Z,"BaseSegment",function(){return l}),U.d(Z,"Fragment",function(){return r}),U.d(Z,"Part",function(){return i});var ee=U("./src/polyfills/number.ts"),W=U("./node_modules/url-toolkit/src/url-toolkit.js"),M=U.n(W),$=U("./src/utils/logger.ts"),X=U("./src/loader/level-key.ts"),k=U("./src/loader/load-stats.ts");function D(t,c){t.prototype=Object.create(c.prototype),t.prototype.constructor=t,m(t,c)}function m(t,c){return m=Object.setPrototypeOf||function(A,S){return A.__proto__=S,A},m(t,c)}function v(t,c){for(var h=0;h<c.length;h++){var A=c[h];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(t,A.key,A)}}function f(t,c,h){return c&&v(t.prototype,c),h&&v(t,h),t}var o;(function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"})(o||(o={}));var l=function(){function t(h){var A;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(A={},A[o.AUDIO]=null,A[o.VIDEO]=null,A[o.AUDIOVIDEO]=null,A),this.baseurl=h}var c=t.prototype;return c.setByteRange=function(A,S){var w=A.split("@",2),O=[];w.length===1?O[0]=S?S.byteRangeEndOffset:0:O[0]=parseInt(w[1]),O[1]=parseInt(w[0])+O[0],this._byteRange=O},f(t,[{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(W.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(A){this._url=A}}]),t}(),r=function(t){D(c,t);function c(A,S){var w;return w=t.call(this,S)||this,w._decryptdata=null,w.rawProgramDateTime=null,w.programDateTime=null,w.tagList=[],w.duration=0,w.sn=0,w.levelkey=void 0,w.type=void 0,w.loader=null,w.level=-1,w.cc=0,w.startPTS=void 0,w.endPTS=void 0,w.appendedPTS=void 0,w.startDTS=void 0,w.endDTS=void 0,w.start=0,w.deltaPTS=void 0,w.maxStartPTS=void 0,w.minEndPTS=void 0,w.stats=new k.LoadStats,w.urlId=0,w.data=void 0,w.bitrateTest=!1,w.title=null,w.initSegment=null,w.type=A,w}var h=c.prototype;return h.createInitializationVector=function(S){for(var w=new Uint8Array(16),O=12;O<16;O++)w[O]=S>>8*(15-O)&255;return w},h.setDecryptDataFromLevelKey=function(S,w){var O=S;return(S==null?void 0:S.method)==="AES-128"&&S.uri&&!S.iv&&(O=X.LevelKey.fromURI(S.uri),O.method=S.method,O.iv=this.createInitializationVector(w),O.keyFormat="identity"),O},h.setElementaryStreamInfo=function(S,w,O,R,b,_){_===void 0&&(_=!1);var u=this.elementaryStreams,d=u[S];if(!d){u[S]={startPTS:w,endPTS:O,startDTS:R,endDTS:b,partial:_};return}d.startPTS=Math.min(d.startPTS,w),d.endPTS=Math.max(d.endPTS,O),d.startDTS=Math.min(d.startDTS,R),d.endDTS=Math.max(d.endDTS,b)},h.clearElementaryStreamInfo=function(){var S=this.elementaryStreams;S[o.AUDIO]=null,S[o.VIDEO]=null,S[o.AUDIOVIDEO]=null},f(c,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var S=this.sn;typeof S!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&$.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),S=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,S)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(ee.isFiniteNumber)(this.programDateTime))return null;var S=Object(ee.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+S*1e3}},{key:"encrypted",get:function(){var S;return!!((S=this.decryptdata)!==null&&S!==void 0&&S.keyFormat&&this.decryptdata.uri)}}]),c}(l),i=function(t){D(c,t);function c(h,A,S,w,O){var R;R=t.call(this,S)||this,R.fragOffset=0,R.duration=0,R.gap=!1,R.independent=!1,R.relurl=void 0,R.fragment=void 0,R.index=void 0,R.stats=new k.LoadStats,R.duration=h.decimalFloatingPoint("DURATION"),R.gap=h.bool("GAP"),R.independent=h.bool("INDEPENDENT"),R.relurl=h.enumeratedString("URI"),R.fragment=A,R.index=w;var b=h.enumeratedString("BYTERANGE");return b&&R.setByteRange(b,O),O&&(R.fragOffset=O.fragOffset+O.duration),R}return f(c,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),c}(l)},"./src/loader/key-loader.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return $});var ee=U("./src/events.ts"),W=U("./src/errors.ts"),M=U("./src/utils/logger.ts"),$=function(){function X(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var k=X.prototype;return k._registerListeners=function(){this.hls.on(ee.Events.KEY_LOADING,this.onKeyLoading,this)},k._unregisterListeners=function(){this.hls.off(ee.Events.KEY_LOADING,this.onKeyLoading)},k.destroy=function(){this._unregisterListeners();for(var m in this.loaders){var v=this.loaders[m];v&&v.destroy()}this.loaders={}},k.onKeyLoading=function(m,v){var f=v.frag,o=f.type,l=this.loaders[o];if(!f.decryptdata){M.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var r=f.decryptdata.uri;if(r!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(l&&(M.logger.warn("abort previous key loader for type:"+o),l.abort()),!r){M.logger.warn("key uri is falsy");return}var t=i.loader,c=f.loader=this.loaders[o]=new t(i);this.decrypturl=r,this.decryptkey=null;var h={url:r,frag:f,responseType:"arraybuffer"},A={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},S={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(h,A,S)}else this.decryptkey&&(f.decryptdata.key=this.decryptkey,this.hls.trigger(ee.Events.KEY_LOADED,{frag:f}))},k.loadsuccess=function(m,v,f){var o=f.frag;if(!o.decryptdata){M.logger.error("after key load, decryptdata unset");return}this.decryptkey=o.decryptdata.key=new Uint8Array(m.data),o.loader=null,delete this.loaders[o.type],this.hls.trigger(ee.Events.KEY_LOADED,{frag:o})},k.loaderror=function(m,v){var f=v.frag,o=f.loader;o&&o.abort(),delete this.loaders[f.type],this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:f,response:m})},k.loadtimeout=function(m,v){var f=v.frag,o=f.loader;o&&o.abort(),delete this.loaders[f.type],this.hls.trigger(ee.Events.ERROR,{type:W.ErrorTypes.NETWORK_ERROR,details:W.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:f})},X}()},"./src/loader/level-details.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"LevelDetails",function(){return X});var ee=U("./src/polyfills/number.ts");function W(k,D){for(var m=0;m<D.length;m++){var v=D[m];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(k,v.key,v)}}function M(k,D,m){return D&&W(k.prototype,D),m&&W(k,m),k}var $=10,X=function(){function k(m){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=m}var D=k.prototype;return D.reloaded=function(v){if(!v){this.advanced=!0,this.updated=!0;return}var f=this.lastPartSn-v.lastPartSn,o=this.lastPartIndex-v.lastPartIndex;this.updated=this.endSN!==v.endSN||!!o||!!f,this.advanced=this.endSN>v.endSN||f>0||f===0&&o>0,this.updated||this.advanced?this.misses=Math.floor(v.misses*.6):this.misses=v.misses+1,this.availabilityDelay=v.availabilityDelay},M(k,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(ee.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||$}},{key:"drift",get:function(){var v=this.driftEndTime-this.driftStartTime;if(v>0){var f=this.driftEnd-this.driftStart;return f*1e3/v}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var v;return(v=this.fragments)!==null&&v!==void 0&&v.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 v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var v;return(v=this.partList)!==null&&v!==void 0&&v.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),k}()},"./src/loader/level-key.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"LevelKey",function(){return X});var ee=U("./node_modules/url-toolkit/src/url-toolkit.js"),W=U.n(ee);function M(k,D){for(var m=0;m<D.length;m++){var v=D[m];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(k,v.key,v)}}function $(k,D,m){return D&&M(k.prototype,D),m&&M(k,m),k}var X=function(){k.fromURL=function(m,v){return new k(m,v)},k.fromURI=function(m){return new k(m)};function k(D,m){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,m?this._uri=Object(ee.buildAbsoluteURL)(D,m,{alwaysNormalize:!0}):this._uri=D}return $(k,[{key:"uri",get:function(){return this._uri}}]),k}()},"./src/loader/load-stats.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"LoadStats",function(){return ee});var ee=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(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return c});var ee=U("./src/polyfills/number.ts"),W=U("./node_modules/url-toolkit/src/url-toolkit.js"),M=U.n(W),$=U("./src/loader/fragment.ts"),X=U("./src/loader/level-details.ts"),k=U("./src/loader/level-key.ts"),D=U("./src/utils/attr-list.ts"),m=U("./src/utils/logger.ts"),v=U("./src/utils/codecs.ts"),f=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,o=/#EXT-X-MEDIA:(.*)/g,l=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),r=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("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function t(O){var R,b;return i.test((R=(b=W.parseURL(O))===null||b===void 0?void 0:b.path)!=null?R:"")}var c=function(){function O(){}return O.findGroup=function(b,_){for(var u=0;u<b.length;u++){var d=b[u];if(d.id===_)return d}},O.convertAVC1ToAVCOTI=function(b){var _=b.split(".");if(_.length>2){var u=_.shift()+".";return u+=parseInt(_.shift()).toString(16),u+=("000"+parseInt(_.shift()).toString(16)).substr(-4),u}return b},O.resolve=function(b,_){return W.buildAbsoluteURL(_,b,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(b,_){var u=[],d={},E=!1;f.lastIndex=0;for(var g;(g=f.exec(b))!=null;)if(g[1]){var y=new D.AttrList(g[1]),F={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:O.resolve(g[2],_)},N=y.decimalResolution("RESOLUTION");N&&(F.width=N.width,F.height=N.height),h((y.CODECS||"").split(/[ ,]+/).filter(function(G){return G}),F),F.videoCodec&&F.videoCodec.indexOf("avc1")!==-1&&(F.videoCodec=O.convertAVC1ToAVCOTI(F.videoCodec)),u.push(F)}else if(g[3]){var H=new D.AttrList(g[3]);H["DATA-ID"]&&(E=!0,d[H["DATA-ID"]]=H)}return{levels:u,sessionData:E?d:null}},O.parseMasterPlaylistMedia=function(b,_,u,d){d===void 0&&(d=[]);var E,g=[],y=0;for(o.lastIndex=0;(E=o.exec(b))!==null;){var F=new D.AttrList(E[1]);if(F.TYPE===u){var N={attrs:F,bitrate:0,id:y++,groupId:F["GROUP-ID"],instreamId:F["INSTREAM-ID"],name:F.NAME||F.LANGUAGE||"",type:u,default:F.bool("DEFAULT"),autoselect:F.bool("AUTOSELECT"),forced:F.bool("FORCED"),lang:F.LANGUAGE,url:F.URI?O.resolve(F.URI,_):""};if(d.length){var H=O.findGroup(d,N.groupId)||d[0];A(N,H,"audioCodec"),A(N,H,"textCodec")}g.push(N)}}return g},O.parseLevelPlaylist=function(b,_,u,d,E){var g=new X.LevelDetails(_),y=g.fragments,F=null,N=0,H=0,G=0,I=0,x=null,B=new $.Fragment(d,_),Y,re,de,he=-1,xe=!1;for(l.lastIndex=0,g.m3u8=b;(Y=l.exec(b))!==null;){xe&&(xe=!1,B=new $.Fragment(d,_),B.start=G,B.sn=N,B.cc=I,B.level=u,F&&(B.initSegment=F,B.rawProgramDateTime=F.rawProgramDateTime));var Pe=Y[1];if(Pe){B.duration=parseFloat(Pe);var Ce=(" "+Y[2]).slice(1);B.title=Ce||null,B.tagList.push(Ce?["INF",Pe,Ce]:["INF",Pe])}else if(Y[3])Object(ee.isFiniteNumber)(B.duration)&&(B.start=G,de&&(B.levelkey=de),B.sn=N,B.level=u,B.cc=I,B.urlId=E,y.push(B),B.relurl=(" "+Y[3]).slice(1),w(B,x),x=B,G+=B.duration,N++,H=0,xe=!0);else if(Y[4]){var Oe=(" "+Y[4]).slice(1);x?B.setByteRange(Oe,x):B.setByteRange(Oe)}else if(Y[5])B.rawProgramDateTime=(" "+Y[5]).slice(1),B.tagList.push(["PROGRAM-DATE-TIME",B.rawProgramDateTime]),he===-1&&(he=y.length);else{if(Y=Y[0].match(r),!Y){m.logger.warn("No matches on slow regex match for level playlist!");continue}for(re=1;re<Y.length&&!(typeof Y[re]!="undefined");re++);var be=(" "+Y[re]).slice(1),ge=(" "+Y[re+1]).slice(1),te=Y[re+2]?(" "+Y[re+2]).slice(1):"";switch(be){case"PLAYLIST-TYPE":g.type=ge.toUpperCase();break;case"MEDIA-SEQUENCE":N=g.startSN=parseInt(ge);break;case"SKIP":{var fe=new D.AttrList(ge),_e=fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(ee.isFiniteNumber)(_e)){g.skippedSegments=_e;for(var Le=_e;Le--;)y.unshift(null);N+=_e}var $e=fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");$e&&(g.recentlyRemovedDateranges=$e.split(" "));break}case"TARGETDURATION":g.targetduration=parseFloat(ge);break;case"VERSION":g.version=parseInt(ge);break;case"EXTM3U":break;case"ENDLIST":g.live=!1;break;case"#":(ge||te)&&B.tagList.push(te?[ge,te]:[ge]);break;case"DIS":I++;case"GAP":B.tagList.push([be]);break;case"BITRATE":B.tagList.push([be,ge]);break;case"DISCONTINUITY-SEQ":I=parseInt(ge);break;case"KEY":{var Ue,at=new D.AttrList(ge),ft=at.enumeratedString("METHOD"),Ct=at.URI,yt=at.hexadecimalInteger("IV"),_t=at.enumeratedString("KEYFORMATVERSIONS"),lt=at.enumeratedString("KEYID"),Ft=(Ue=at.enumeratedString("KEYFORMAT"))!=null?Ue:"identity",Xt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(Xt.indexOf(Ft)>-1){m.logger.warn("Keyformat "+Ft+" is not supported from the manifest");continue}else if(Ft!=="identity")continue;ft&&(de=k.LevelKey.fromURL(_,Ct),Ct&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ft)>=0&&(de.method=ft,de.keyFormat=Ft,lt&&(de.keyID=lt),_t&&(de.keyFormatVersions=_t),de.iv=yt));break}case"START":{var Jt=new D.AttrList(ge),rn=Jt.decimalFloatingPoint("TIME-OFFSET");Object(ee.isFiniteNumber)(rn)&&(g.startTimeOffset=rn);break}case"MAP":{var En=new D.AttrList(ge);B.relurl=En.URI,En.BYTERANGE&&B.setByteRange(En.BYTERANGE),B.level=u,B.sn="initSegment",de&&(B.levelkey=de),B.initSegment=null,F=B,xe=!0;break}case"SERVER-CONTROL":{var mn=new D.AttrList(ge);g.canBlockReload=mn.bool("CAN-BLOCK-RELOAD"),g.canSkipUntil=mn.optionalFloat("CAN-SKIP-UNTIL",0),g.canSkipDateRanges=g.canSkipUntil>0&&mn.bool("CAN-SKIP-DATERANGES"),g.partHoldBack=mn.optionalFloat("PART-HOLD-BACK",0),g.holdBack=mn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ye=new D.AttrList(ge);g.partTarget=Ye.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Xe=g.partList;Xe||(Xe=g.partList=[]);var Ot=H>0?Xe[Xe.length-1]:void 0,Et=H++,Je=new $.Part(new D.AttrList(ge),B,_,Et,Ot);Xe.push(Je),B.duration+=Je.duration;break}case"PRELOAD-HINT":{var mt=new D.AttrList(ge);g.preloadHint=mt;break}case"RENDITION-REPORT":{var Be=new D.AttrList(ge);g.renditionReports=g.renditionReports||[],g.renditionReports.push(Be);break}default:m.logger.warn("line parsed but not handled: "+Y);break}}}x&&!x.relurl?(y.pop(),G-=x.duration,g.partList&&(g.fragmentHint=x)):g.partList&&(w(B,x),B.cc=I,g.fragmentHint=B);var Ie=y.length,ke=y[0],me=y[Ie-1];if(G+=g.skippedSegments*g.targetduration,G>0&&Ie&&me){g.averagetargetduration=G/Ie;var ye=me.sn;g.endSN=ye!=="initSegment"?ye:0,ke&&(g.startCC=ke.cc,ke.initSegment||g.fragments.every(function(Re){return Re.relurl&&t(Re.relurl)})&&(m.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),B=new $.Fragment(d,_),B.relurl=me.relurl,B.level=u,B.sn="initSegment",ke.initSegment=B,g.needSidxRanges=!0))}else g.endSN=0,g.startCC=0;return g.fragmentHint&&(G+=g.fragmentHint.duration),g.totalduration=G,g.endCC=I,he>0&&S(y,he),g},O}();function h(O,R){["video","audio","text"].forEach(function(b){var _=O.filter(function(d){return Object(v.isCodecType)(d,b)});if(_.length){var u=_.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});R[b+"Codec"]=u.length>0?u[0]:_[0],O=O.filter(function(d){return _.indexOf(d)===-1})}}),R.unknownCodecs=O}function A(O,R,b){var _=R[b];_&&(O[b]=_)}function S(O,R){for(var b=O[R],_=R;_--;){var u=O[_];if(!u)return;u.programDateTime=b.programDateTime-u.duration*1e3,b=u}}function w(O,R){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):R!=null&&R.programDateTime&&(O.programDateTime=R.endProgramDateTime),Object(ee.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/polyfills/number.ts"),W=U("./src/events.ts"),M=U("./src/errors.ts"),$=U("./src/utils/logger.ts"),X=U("./src/utils/mp4-tools.ts"),k=U("./src/loader/m3u8-parser.ts"),D=U("./src/types/loader.ts"),m=U("./src/utils/attr-list.ts");function v(l){var r=l.type;switch(r){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function f(l,r){var i=l.url;return(i===void 0||i.indexOf("data:")===0)&&(i=r.url),i}var o=function(){function l(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var r=l.prototype;return r.registerListeners=function(){var t=this.hls;t.on(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(W.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(W.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(W.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},r.unregisterListeners=function(){var t=this.hls;t.off(W.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(W.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(W.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(W.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},r.createInternalLoader=function(t){var c=this.hls.config,h=c.pLoader,A=c.loader,S=h||A,w=new S(c);return t.loader=w,this.loaders[t.type]=w,w},r.getInternalLoader=function(t){return this.loaders[t.type]},r.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},r.destroyInternalLoaders=function(){for(var t in this.loaders){var c=this.loaders[t];c&&c.destroy(),this.resetInternalLoader(t)}},r.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},r.onManifestLoading=function(t,c){var h=c.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:h,deliveryDirectives:null})},r.onLevelLoading=function(t,c){var h=c.id,A=c.level,S=c.url,w=c.deliveryDirectives;this.load({id:h,groupId:null,level:A,responseType:"text",type:D.PlaylistContextType.LEVEL,url:S,deliveryDirectives:w})},r.onAudioTrackLoading=function(t,c){var h=c.id,A=c.groupId,S=c.url,w=c.deliveryDirectives;this.load({id:h,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:S,deliveryDirectives:w})},r.onSubtitleTrackLoading=function(t,c){var h=c.id,A=c.groupId,S=c.url,w=c.deliveryDirectives;this.load({id:h,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:S,deliveryDirectives:w})},r.load=function(t){var c,h=this.hls.config,A=this.getInternalLoader(t);if(A){var S=A.context;if(S&&S.url===t.url){$.logger.trace("[playlist-loader]: playlist request ongoing");return}$.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),A.abort()}var w,O,R,b;switch(t.type){case D.PlaylistContextType.MANIFEST:w=h.manifestLoadingMaxRetry,O=h.manifestLoadingTimeOut,R=h.manifestLoadingRetryDelay,b=h.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:w=0,O=h.levelLoadingTimeOut;break;default:w=h.levelLoadingMaxRetry,O=h.levelLoadingTimeOut,R=h.levelLoadingRetryDelay,b=h.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(t),(c=t.deliveryDirectives)!==null&&c!==void 0&&c.part){var _;if(t.type===D.PlaylistContextType.LEVEL&&t.level!==null?_=this.hls.levels[t.level].details:t.type===D.PlaylistContextType.AUDIO_TRACK&&t.id!==null?_=this.hls.audioTracks[t.id].details:t.type===D.PlaylistContextType.SUBTITLE_TRACK&&t.id!==null&&(_=this.hls.subtitleTracks[t.id].details),_){var u=_.partTarget,d=_.targetduration;u&&d&&(O=Math.min(Math.max(u*3,d*.8)*1e3,O))}}var E={timeout:O,maxRetry:w,retryDelay:R,maxRetryDelay:b,highWaterMark:0},g={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(t,E,g)},r.loadsuccess=function(t,c,h,A){if(A===void 0&&(A=null),h.isSidxRequest){this.handleSidxRequest(t,h),this.handlePlaylistLoaded(t,c,h,A);return}this.resetInternalLoader(h.type);var S=t.data;if(S.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,h,"no EXTM3U delimiter",A);return}c.parsing.start=performance.now(),S.indexOf("#EXTINF:")>0||S.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,c,h,A):this.handleMasterPlaylist(t,c,h,A)},r.loaderror=function(t,c,h){h===void 0&&(h=null),this.handleNetworkError(c,h,!1,t)},r.loadtimeout=function(t,c,h){h===void 0&&(h=null),this.handleNetworkError(c,h,!0)},r.handleMasterPlaylist=function(t,c,h,A){var S=this.hls,w=t.data,O=f(t,h),R=k.default.parseMasterPlaylist(w,O),b=R.levels,_=R.sessionData;if(!b.length){this.handleManifestParsingError(t,h,"no level found in manifest",A);return}var u=b.map(function(N){return{id:N.attrs.AUDIO,audioCodec:N.audioCodec}}),d=b.map(function(N){return{id:N.attrs.SUBTITLES,textCodec:N.textCodec}}),E=k.default.parseMasterPlaylistMedia(w,O,"AUDIO",u),g=k.default.parseMasterPlaylistMedia(w,O,"SUBTITLES",d),y=k.default.parseMasterPlaylistMedia(w,O,"CLOSED-CAPTIONS");if(E.length){var F=E.some(function(N){return!N.url});!F&&b[0].audioCodec&&!b[0].attrs.AUDIO&&($.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new m.AttrList({}),bitrate:0,url:""}))}S.trigger(W.Events.MANIFEST_LOADED,{levels:b,audioTracks:E,subtitles:g,captions:y,url:O,stats:c,networkDetails:A,sessionData:_})},r.handleTrackOrLevelPlaylist=function(t,c,h,A){var S=this.hls,w=h.id,O=h.level,R=h.type,b=f(t,h),_=Object(ee.isFiniteNumber)(w)?w:0,u=Object(ee.isFiniteNumber)(O)?O:_,d=v(h),E=k.default.parseLevelPlaylist(t.data,b,u,d,_);if(!E.fragments.length){S.trigger(W.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof h.level=="number"?h.level:void 0});return}if(R===D.PlaylistContextType.MANIFEST){var g={attrs:new m.AttrList({}),bitrate:0,details:E,name:"",url:b};S.trigger(W.Events.MANIFEST_LOADED,{levels:[g],audioTracks:[],url:b,stats:c,networkDetails:A,sessionData:null})}if(c.parsing.end=performance.now(),E.needSidxRanges){var y,F=(y=E.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:F,isSidxRequest:!0,type:R,level:O,levelDetails:E,id:w,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}h.levelDetails=E,this.handlePlaylistLoaded(t,c,h,A)},r.handleSidxRequest=function(t,c){var h=Object(X.parseSegmentIndex)(new Uint8Array(t.data));if(!h)return;var A=h.references,S=c.levelDetails;A.forEach(function(w,O){var R=w.info,b=S.fragments[O];b.byteRange.length===0&&b.setByteRange(String(1+R.end-R.start)+"@"+String(R.start)),b.initSegment&&b.initSegment.setByteRange(String(h.moovEndOffset)+"@0")})},r.handleManifestParsingError=function(t,c,h,A){this.hls.trigger(W.Events.ERROR,{type:M.ErrorTypes.NETWORK_ERROR,details:M.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:c.type===D.PlaylistContextType.MANIFEST,url:t.url,reason:h,response:t,context:c,networkDetails:A})},r.handleNetworkError=function(t,c,h,A){h===void 0&&(h=!1),$.logger.warn("[playlist-loader]: A network "+(h?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var S=M.ErrorDetails.UNKNOWN,w=!1,O=this.getInternalLoader(t);switch(t.type){case D.PlaylistContextType.MANIFEST:S=h?M.ErrorDetails.MANIFEST_LOAD_TIMEOUT:M.ErrorDetails.MANIFEST_LOAD_ERROR,w=!0;break;case D.PlaylistContextType.LEVEL:S=h?M.ErrorDetails.LEVEL_LOAD_TIMEOUT:M.ErrorDetails.LEVEL_LOAD_ERROR,w=!1;break;case D.PlaylistContextType.AUDIO_TRACK:S=h?M.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:M.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,w=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:S=h?M.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:M.ErrorDetails.SUBTITLE_LOAD_ERROR,w=!1;break}O&&this.resetInternalLoader(t.type);var R={type:M.ErrorTypes.NETWORK_ERROR,details:S,fatal:w,url:t.url,loader:O,context:t,networkDetails:c};A&&(R.response=A),this.hls.trigger(W.Events.ERROR,R)},r.handlePlaylistLoaded=function(t,c,h,A){var S=h.type,w=h.level,O=h.id,R=h.groupId,b=h.loader,_=h.levelDetails,u=h.deliveryDirectives;if(!(_!=null&&_.targetduration)){this.handleManifestParsingError(t,h,"invalid target duration",A);return}if(!b)return;_.live&&(b.getCacheAge&&(_.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(_.ageHeader))&&(_.ageHeader=0));switch(S){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(W.Events.LEVEL_LOADED,{details:_,level:w||0,id:O||0,stats:c,networkDetails:A,deliveryDirectives:u});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(W.Events.AUDIO_TRACK_LOADED,{details:_,id:O||0,groupId:R||"",stats:c,networkDetails:A,deliveryDirectives:u});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(W.Events.SUBTITLE_TRACK_LOADED,{details:_,id:O||0,groupId:R||"",stats:c,networkDetails:A,deliveryDirectives:u});break}},l}();Z.default=o},"./src/polyfills/number.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"isFiniteNumber",function(){return ee}),U.d(Z,"MAX_SAFE_INTEGER",function(){return W});var ee=Number.isFinite||function(M){return typeof M=="number"&&isFinite(M)},W=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=function(){function W(){}return W.getSilentFrame=function($,X){switch($){case"mp4a.40.2":if(X===1)return new Uint8Array([0,200,0,128,35,128]);if(X===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(X===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(X===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(X===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(X===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(X===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(X===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(X===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},W}();Z.default=ee},"./src/remux/mp4-generator.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=Math.pow(2,32)-1,W=function(){function M(){}return M.init=function(){M.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};var X;for(X in M.types)M.types.hasOwnProperty(X)&&(M.types[X]=[X.charCodeAt(0),X.charCodeAt(1),X.charCodeAt(2),X.charCodeAt(3)]);var k=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),D=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);M.HDLR_TYPES={video:k,audio:D};var m=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),v=new Uint8Array([0,0,0,0,0,0,0,0]);M.STTS=M.STSC=M.STCO=v,M.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),M.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),M.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),M.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var f=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);M.FTYP=M.box(M.types.ftyp,f,l,f,o),M.DINF=M.box(M.types.dinf,M.box(M.types.dref,m))},M.box=function(X){for(var k=8,D=arguments.length,m=new Array(D>1?D-1:0),v=1;v<D;v++)m[v-1]=arguments[v];for(var f=m.length,o=f;f--;)k+=m[f].byteLength;var l=new Uint8Array(k);for(l[0]=k>>24&255,l[1]=k>>16&255,l[2]=k>>8&255,l[3]=k&255,l.set(X,4),f=0,k=8;f<o;f++)l.set(m[f],k),k+=m[f].byteLength;return l},M.hdlr=function(X){return M.box(M.types.hdlr,M.HDLR_TYPES[X])},M.mdat=function(X){return M.box(M.types.mdat,X)},M.mdhd=function(X,k){k*=X;var D=Math.floor(k/(ee+1)),m=Math.floor(k%(ee+1));return M.box(M.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,X>>24&255,X>>16&255,X>>8&255,X&255,D>>24,D>>16&255,D>>8&255,D&255,m>>24,m>>16&255,m>>8&255,m&255,85,196,0,0]))},M.mdia=function(X){return M.box(M.types.mdia,M.mdhd(X.timescale,X.duration),M.hdlr(X.type),M.minf(X))},M.mfhd=function(X){return M.box(M.types.mfhd,new Uint8Array([0,0,0,0,X>>24,X>>16&255,X>>8&255,X&255]))},M.minf=function(X){return X.type==="audio"?M.box(M.types.minf,M.box(M.types.smhd,M.SMHD),M.DINF,M.stbl(X)):M.box(M.types.minf,M.box(M.types.vmhd,M.VMHD),M.DINF,M.stbl(X))},M.moof=function(X,k,D){return M.box(M.types.moof,M.mfhd(X),M.traf(D,k))},M.moov=function(X){for(var k=X.length,D=[];k--;)D[k]=M.trak(X[k]);return M.box.apply(null,[M.types.moov,M.mvhd(X[0].timescale,X[0].duration)].concat(D).concat(M.mvex(X)))},M.mvex=function(X){for(var k=X.length,D=[];k--;)D[k]=M.trex(X[k]);return M.box.apply(null,[M.types.mvex].concat(D))},M.mvhd=function(X,k){k*=X;var D=Math.floor(k/(ee+1)),m=Math.floor(k%(ee+1)),v=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,X>>24&255,X>>16&255,X>>8&255,X&255,D>>24,D>>16&255,D>>8&255,D&255,m>>24,m>>16&255,m>>8&255,m&255,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return M.box(M.types.mvhd,v)},M.sdtp=function(X){var k=X.samples||[],D=new Uint8Array(4+k.length),m,v;for(m=0;m<k.length;m++)v=k[m].flags,D[m+4]=v.dependsOn<<4|v.isDependedOn<<2|v.hasRedundancy;return M.box(M.types.sdtp,D)},M.stbl=function(X){return M.box(M.types.stbl,M.stsd(X),M.box(M.types.stts,M.STTS),M.box(M.types.stsc,M.STSC),M.box(M.types.stsz,M.STSZ),M.box(M.types.stco,M.STCO))},M.avc1=function(X){var k=[],D=[],m,v,f;for(m=0;m<X.sps.length;m++)v=X.sps[m],f=v.byteLength,k.push(f>>>8&255),k.push(f&255),k=k.concat(Array.prototype.slice.call(v));for(m=0;m<X.pps.length;m++)v=X.pps[m],f=v.byteLength,D.push(f>>>8&255),D.push(f&255),D=D.concat(Array.prototype.slice.call(v));var o=M.box(M.types.avcC,new Uint8Array([1,k[3],k[4],k[5],252|3,224|X.sps.length].concat(k).concat([X.pps.length]).concat(D))),l=X.width,r=X.height,i=X.pixelRatio[0],t=X.pixelRatio[1];return M.box(M.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,l>>8&255,l&255,r>>8&255,r&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,M.box(M.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),M.box(M.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,t>>24,t>>16&255,t>>8&255,t&255])))},M.esds=function(X){var k=X.config.length;return new Uint8Array([0,0,0,0,3,23+k,0,1,0,4,15+k,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([k]).concat(X.config).concat([6,1,2]))},M.mp4a=function(X){var k=X.samplerate;return M.box(M.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,X.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]),M.box(M.types.esds,M.esds(X)))},M.mp3=function(X){var k=X.samplerate;return M.box(M.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,X.channelCount,0,16,0,0,0,0,k>>8&255,k&255,0,0]))},M.stsd=function(X){return X.type==="audio"?!X.isAAC&&X.codec==="mp3"?M.box(M.types.stsd,M.STSD,M.mp3(X)):M.box(M.types.stsd,M.STSD,M.mp4a(X)):M.box(M.types.stsd,M.STSD,M.avc1(X))},M.tkhd=function(X){var k=X.id,D=X.duration*X.timescale,m=X.width,v=X.height,f=Math.floor(D/(ee+1)),o=Math.floor(D%(ee+1));return M.box(M.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,k>>24&255,k>>16&255,k>>8&255,k&255,0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,o>>24,o>>16&255,o>>8&255,o&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,m>>8&255,m&255,0,0,v>>8&255,v&255,0,0]))},M.traf=function(X,k){var D=M.sdtp(X),m=X.id,v=Math.floor(k/(ee+1)),f=Math.floor(k%(ee+1));return M.box(M.types.traf,M.box(M.types.tfhd,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255])),M.box(M.types.tfdt,new Uint8Array([1,0,0,0,v>>24,v>>16&255,v>>8&255,v&255,f>>24,f>>16&255,f>>8&255,f&255])),M.trun(X,D.length+16+20+8+16+8+8),D)},M.trak=function(X){return X.duration=X.duration||4294967295,M.box(M.types.trak,M.tkhd(X),M.mdia(X))},M.trex=function(X){var k=X.id;return M.box(M.types.trex,new Uint8Array([0,0,0,0,k>>24,k>>16&255,k>>8&255,k&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},M.trun=function(X,k){var D=X.samples||[],m=D.length,v=12+16*m,f=new Uint8Array(v),o,l,r,i,t,c;for(k+=8+v,f.set([0,0,15,1,m>>>24&255,m>>>16&255,m>>>8&255,m&255,k>>>24&255,k>>>16&255,k>>>8&255,k&255],0),o=0;o<m;o++)l=D[o],r=l.duration,i=l.size,t=l.flags,c=l.cts,f.set([r>>>24&255,r>>>16&255,r>>>8&255,r&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&240<<8,t.degradPrio&15,c>>>24&255,c>>>16&255,c>>>8&255,c&255],12+16*o);return M.box(M.types.trun,f)},M.initSegment=function(X){M.types||M.init();var k=M.moov(X),D=new Uint8Array(M.FTYP.byteLength+k.byteLength);return D.set(M.FTYP),D.set(k,M.FTYP.byteLength),D},M}();W.types=void 0,W.HDLR_TYPES=void 0,W.STTS=void 0,W.STSC=void 0,W.STCO=void 0,W.STSZ=void 0,W.VMHD=void 0,W.SMHD=void 0,W.STSD=void 0,W.FTYP=void 0,W.DINF=void 0,Z.default=W},"./src/remux/mp4-remuxer.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return c}),U.d(Z,"normalizePts",function(){return h});var ee=U("./src/polyfills/number.ts"),W=U("./src/remux/aac-helper.ts"),M=U("./src/remux/mp4-generator.ts"),$=U("./src/events.ts"),X=U("./src/errors.ts"),k=U("./src/utils/logger.ts"),D=U("./src/types/loader.ts"),m=U("./src/utils/timescale-conversion.ts");function v(){return v=Object.assign||function(O){for(var R=1;R<arguments.length;R++){var b=arguments[R];for(var _ in b)Object.prototype.hasOwnProperty.call(b,_)&&(O[_]=b[_])}return O},v.apply(this,arguments)}var f=10*1e3,o=1024,l=1152,r=null,i=null,t=!1,c=function(){function O(b,_,u,d){if(d===void 0&&(d=""),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=b,this.config=_,this.typeSupported=u,this.ISGenerated=!1,r===null){var E=navigator.userAgent||"",g=E.match(/Chrome\/(\d+)/i);r=g?parseInt(g[1]):0}if(i===null){var y=navigator.userAgent.match(/Safari\/(\d+)/i);i=y?parseInt(y[1]):0}t=!!r&&r<75||!!i&&i<600}var R=O.prototype;return R.destroy=function(){},R.resetTimeStamp=function(_){k.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=_},R.resetNextTimestamp=function(){k.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},R.resetInitSegment=function(){k.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},R.getVideoStartPts=function(_){var u=!1,d=_.reduce(function(E,g){var y=g.pts-E;return y<-4294967296?(u=!0,h(E,g.pts)):y>0?E:g.pts},_[0].pts);return u&&k.logger.debug("PTS rollover detected"),d},R.remux=function(_,u,d,E,g,y,F,N){var H,G,I,x,B,Y,re=g,de=g,he=_.pid>-1,xe=u.pid>-1,Pe=u.samples.length,Ce=_.samples.length>0,Oe=Pe>1,be=(!he||Ce)&&(!xe||Oe)||this.ISGenerated||F;if(be){this.ISGenerated||(I=this.generateIS(_,u,g));var ge=this.isVideoContiguous,te=-1;if(Oe&&(te=A(u.samples),!ge&&this.config.forceKeyFrameOnDiscontinuity))if(Y=!0,te>0){k.logger.warn("[mp4-remuxer]: Dropped "+te+" out of "+Pe+" video samples due to a missing keyframe");var fe=this.getVideoStartPts(u.samples);u.samples=u.samples.slice(te),u.dropped+=te,de+=(u.samples[0].pts-fe)/(u.timescale||9e4)}else te===-1&&(k.logger.warn("[mp4-remuxer]: No keyframe found out of "+Pe+" video samples"),Y=!1);if(this.ISGenerated){if(Ce&&Oe){var _e=this.getVideoStartPts(u.samples),Le=h(_.samples[0].pts,_e)-_e,$e=Le/u.inputTimeScale;re+=Math.max(0,$e),de+=Math.max(0,-$e)}if(Ce){if(_.samplerate||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),I=this.generateIS(_,u,g)),G=this.remuxAudio(_,re,this.isAudioContiguous,y,xe||Oe||N===D.PlaylistLevelType.AUDIO?de:void 0),Oe){var Ue=G?G.endPTS-G.startPTS:0;u.inputTimeScale||(k.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),I=this.generateIS(_,u,g)),H=this.remuxVideo(u,de,ge,Ue)}}else Oe&&(H=this.remuxVideo(u,de,ge,0));H&&(H.firstKeyFrame=te,H.independent=te!==-1)}}return this.ISGenerated&&(d.samples.length&&(B=this.remuxID3(d,g)),E.samples.length&&(x=this.remuxText(E,g))),{audio:G,video:H,initSegment:I,independent:Y,text:x,id3:B}},R.generateIS=function(_,u,d){var E=_.samples,g=u.samples,y=this.typeSupported,F={},N=!Object(ee.isFiniteNumber)(this._initPTS),H="audio/mp4",G,I,x;if(N&&(G=I=Infinity),_.config&&E.length&&(_.timescale=_.samplerate,_.isAAC||(y.mpeg?(H="audio/mpeg",_.codec=""):y.mp3&&(_.codec="mp3")),F.audio={id:"audio",container:H,codec:_.codec,initSegment:!_.isAAC&&y.mpeg?new Uint8Array(0):M.default.initSegment([_]),metadata:{channelCount:_.channelCount}},N&&(x=_.inputTimeScale,G=I=E[0].pts-Math.round(x*d))),u.sps&&u.pps&&g.length&&(u.timescale=u.inputTimeScale,F.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:M.default.initSegment([u]),metadata:{width:u.width,height:u.height}},N)){x=u.inputTimeScale;var B=this.getVideoStartPts(g),Y=Math.round(x*d);I=Math.min(I,h(g[0].dts,B)-Y),G=Math.min(G,B-Y)}if(Object.keys(F).length)return this.ISGenerated=!0,N&&(this._initPTS=G,this._initDTS=I),{tracks:F,initPTS:G,timescale:x}},R.remuxVideo=function(_,u,d,E){var g=_.inputTimeScale,y=_.samples,F=[],N=y.length,H=this._initPTS,G=this.nextAvcDts,I=8,x,B,Y,re=Number.POSITIVE_INFINITY,de=Number.NEGATIVE_INFINITY,he=0,xe=!1;if(!d||G===null){var Pe=u*g,Ce=y[0].pts-h(y[0].dts,y[0].pts);G=Pe-Ce}for(var Oe=0;Oe<N;Oe++){var be=y[Oe];if(be.pts=h(be.pts-H,G),be.dts=h(be.dts-H,G),be.dts>be.pts){var ge=9e4*.2;he=Math.max(Math.min(he,be.pts-be.dts),-1*ge)}be.dts<y[Oe>0?Oe-1:Oe].dts&&(xe=!0)}xe&&y.sort(function(ei,gn){var an=ei.dts-gn.dts,dn=ei.pts-gn.pts;return an||dn}),B=y[0].dts,Y=y[y.length-1].dts;var te=Math.round((Y-B)/(N-1));if(he<0){if(he<te*-2){k.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(m.toMsFromMpegTsClock)(-te,!0)+" ms");for(var fe=he,_e=0;_e<N;_e++)y[_e].dts=fe=Math.max(fe,y[_e].pts-te),y[_e].pts=Math.max(fe,y[_e].pts)}else{k.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(m.toMsFromMpegTsClock)(he,!0)+" ms to overcome this issue");for(var Le=0;Le<N;Le++)y[Le].dts=y[Le].dts+he}B=y[0].dts}if(d){var $e=B-G,Ue=$e>te,at=$e<-1;if(Ue||at){Ue?k.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)($e,!0)+" ms ("+$e+"dts) hole between fragments detected, filling it"):k.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(-$e,!0)+" ms ("+$e+"dts) overlapping between fragments detected"),B=G;var ft=y[0].pts-$e;y[0].dts=B,y[0].pts=ft,k.logger.log("Video: First PTS/DTS adjusted: "+Object(m.toMsFromMpegTsClock)(ft,!0)+"/"+Object(m.toMsFromMpegTsClock)(B,!0)+", delta: "+Object(m.toMsFromMpegTsClock)($e,!0)+" ms")}}t&&(B=Math.max(0,B));for(var Ct=0,yt=0,_t=0;_t<N;_t++){for(var lt=y[_t],Ft=lt.units,Xt=Ft.length,Jt=0,rn=0;rn<Xt;rn++)Jt+=Ft[rn].data.length;yt+=Jt,Ct+=Xt,lt.length=Jt,lt.dts=Math.max(lt.dts,B),lt.pts=Math.max(lt.pts,lt.dts,0),re=Math.min(lt.pts,re),de=Math.max(lt.pts,de)}Y=y[N-1].dts;var En=yt+4*Ct+8,mn;try{mn=new Uint8Array(En)}catch(ei){this.observer.emit($.Events.ERROR,$.Events.ERROR,{type:X.ErrorTypes.MUX_ERROR,details:X.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:En,reason:"fail allocating video mdat "+En});return}var Ye=new DataView(mn.buffer);Ye.setUint32(0,En),mn.set(M.default.types.mdat,4);for(var Xe=0;Xe<N;Xe++){for(var Ot=y[Xe],Et=Ot.units,Je=0,mt=0,Be=Et.length;mt<Be;mt++){var Ie=Et[mt],ke=Ie.data,me=Ie.data.byteLength;Ye.setUint32(I,me),I+=4,mn.set(ke,I),I+=me,Je+=4+me}if(Xe<N-1)x=y[Xe+1].dts-Ot.dts;else{var ye=this.config,Re=Ot.dts-y[Xe>0?Xe-1:Xe].dts;if(ye.stretchShortVideoTrack&&this.nextAudioPts!==null){var ce=Math.floor(ye.maxBufferHole*g),Me=(E?re+E*g:this.nextAudioPts)-Ot.pts;Me>ce?(x=Me-Re,x<0&&(x=Re),k.logger.log("[mp4-remuxer]: It is approximately "+Me/90+" ms to the next segment; using duration "+x/90+" ms for the last video frame.")):x=Re}else x=Re}var tt=Math.round(Ot.pts-Ot.dts);F.push(new S(Ot.key,x,Je,tt))}if(F.length&&r&&r<70){var bt=F[0].flags;bt.dependsOn=2,bt.isNonSync=0}console.assert(x!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=G=Y+x,this.isVideoContiguous=!0;var Kt=M.default.moof(_.sequenceNumber++,B,v({},_,{samples:F})),Gt="video",$t={data1:Kt,data2:mn,startPTS:re/g,endPTS:(de+x)/g,startDTS:B/g,endDTS:G/g,type:Gt,hasAudio:!1,hasVideo:!0,nb:F.length,dropped:_.dropped};return _.samples=[],_.dropped=0,console.assert(mn.length,"MDAT length must not be zero"),$t},R.remuxAudio=function(_,u,d,E,g){var y=_.inputTimeScale,F=_.samplerate?_.samplerate:y,N=y/F,H=_.isAAC?o:l,G=H*N,I=this._initPTS,x=!_.isAAC&&this.typeSupported.mpeg,B=[],Y=_.samples,re=x?0:8,de=this.nextAudioPts||-1,he=u*y;if(this.isAudioContiguous=d=d||Y.length&&de>0&&(E&&Math.abs(he-de)<9e3||Math.abs(h(Y[0].pts-I,he)-de)<20*G),Y.forEach(function(ke){ke.pts=h(ke.pts-I,he)}),!d||de<0){if(Y=Y.filter(function(ke){return ke.pts>=0}),!Y.length)return;g===0?de=0:E?de=Math.max(0,he):de=Y[0].pts}if(_.isAAC)for(var xe=g!==void 0,Pe=this.config.maxAudioFramesDrift,Ce=0,Oe=de;Ce<Y.length;Ce++){var be=Y[Ce],ge=be.pts,te=ge-Oe,fe=Math.abs(1e3*te/y);if(te<=-Pe*G&&xe)Ce===0&&(k.logger.warn("Audio frame @ "+(ge/y).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*te/y)+" ms."),this.nextAudioPts=de=Oe=ge);else if(te>=Pe*G&&fe<f&&xe){var _e=Math.round(te/G);Oe=ge-_e*G,Oe<0&&(_e--,Oe+=G),Ce===0&&(this.nextAudioPts=de=Oe),k.logger.warn("[mp4-remuxer]: Injecting "+_e+" audio frame @ "+(Oe/y).toFixed(3)+"s due to "+Math.round(1e3*te/y)+" ms gap.");for(var Le=0;Le<_e;Le++){var $e=Math.max(Oe,0),Ue=W.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);Ue||(k.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ue=be.unit.subarray()),Y.splice(Ce,0,{unit:Ue,pts:$e}),Oe+=G,Ce++}}be.pts=Oe,Oe+=G}for(var at=null,ft=null,Ct,yt=0,_t=Y.length;_t--;)yt+=Y[_t].unit.byteLength;for(var lt=0,Ft=Y.length;lt<Ft;lt++){var Xt=Y[lt],Jt=Xt.unit,rn=Xt.pts;if(ft!==null){var En=B[lt-1];En.duration=Math.round((rn-ft)/N)}else if(d&&_.isAAC&&(rn=de),at=rn,yt>0){yt+=re;try{Ct=new Uint8Array(yt)}catch(ke){this.observer.emit($.Events.ERROR,$.Events.ERROR,{type:X.ErrorTypes.MUX_ERROR,details:X.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:yt,reason:"fail allocating audio mdat "+yt});return}if(!x){var mn=new DataView(Ct.buffer);mn.setUint32(0,yt),Ct.set(M.default.types.mdat,4)}}else return;Ct.set(Jt,re);var Ye=Jt.byteLength;re+=Ye,B.push(new S(!0,H,Ye,0)),ft=rn}var Xe=B.length;if(!Xe)return;var Ot=B[B.length-1];this.nextAudioPts=de=ft+N*Ot.duration;var Et=x?new Uint8Array(0):M.default.moof(_.sequenceNumber++,at/N,v({},_,{samples:B}));_.samples=[];var Je=at/y,mt=de/y,Be="audio",Ie={data1:Et,data2:Ct,startPTS:Je,endPTS:mt,startDTS:Je,endDTS:mt,type:Be,hasAudio:!0,hasVideo:!1,nb:Xe};return this.isAudioContiguous=!0,console.assert(Ct.length,"MDAT length must not be zero"),Ie},R.remuxEmptyAudio=function(_,u,d,E){var g=_.inputTimeScale,y=_.samplerate?_.samplerate:g,F=g/y,N=this.nextAudioPts,H=(N!==null?N:E.startDTS*g)+this._initDTS,G=E.endDTS*g+this._initDTS,I=F*o,x=Math.ceil((G-H)/I),B=W.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);if(k.logger.warn("[mp4-remuxer]: remux empty Audio"),!B){k.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Y=[],re=0;re<x;re++){var de=H+re*I;Y.push({unit:B,pts:de,dts:de})}return _.samples=Y,this.remuxAudio(_,u,d,!1)},R.remuxID3=function(_,u){var d=_.samples.length;if(!d)return;for(var E=_.inputTimeScale,g=this._initPTS,y=this._initDTS,F=0;F<d;F++){var N=_.samples[F];N.pts=h(N.pts-g,u*E)/E,N.dts=h(N.dts-y,u*E)/E}var H=_.samples;return _.samples=[],{samples:H}},R.remuxText=function(_,u){var d=_.samples.length;if(!d)return;for(var E=_.inputTimeScale,g=this._initPTS,y=0;y<d;y++){var F=_.samples[y];F.pts=h(F.pts-g,u*E)/E}_.samples.sort(function(H,G){return H.pts-G.pts});var N=_.samples;return _.samples=[],{samples:N}},O}();function h(O,R){var b;if(R===null)return O;for(R<O?b=-8589934592:b=8589934592;Math.abs(O-R)>4294967296;)O+=b;return O}function A(O){for(var R=0;R<O.length;R++)if(O[R].key)return R;return-1}var S=function(R,b,_,u){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=b,this.size=_,this.cts=u,this.flags=new w(R)},w=function(R){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=R?2:1,this.isNonSync=R?0:1}},"./src/remux/passthrough-remuxer.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/polyfills/number.ts"),W=U("./src/utils/mp4-tools.ts"),M=U("./src/loader/fragment.ts"),$=U("./src/utils/logger.ts"),X=function(){function m(){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 v=m.prototype;return v.destroy=function(){},v.resetTimeStamp=function(o){this.initPTS=o,this.lastEndDTS=null},v.resetNextTimestamp=function(){this.lastEndDTS=null},v.resetInitSegment=function(o,l,r){this.audioCodec=l,this.videoCodec=r,this.generateInitSegment(o),this.emitInitSegment=!0},v.generateInitSegment=function(o){var l=this.audioCodec,r=this.videoCodec;if(!o||!o.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(W.parseInitSegment)(o);l||(l=D(i.audio,M.ElementaryStreamTypes.AUDIO)),r||(r=D(i.video,M.ElementaryStreamTypes.VIDEO));var t={};i.audio&&i.video?t.audiovideo={container:"video/mp4",codec:l+","+r,initSegment:o,id:"main"}:i.audio?t.audio={container:"audio/mp4",codec:l,initSegment:o,id:"audio"}:i.video?t.video={container:"video/mp4",codec:r,initSegment:o,id:"main"}:$.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=t},v.remux=function(o,l,r,i,t){var c=this.initPTS,h=this.lastEndDTS,A={audio:void 0,video:void 0,text:i,id3:r,initSegment:void 0};Object(ee.isFiniteNumber)(h)||(h=this.lastEndDTS=t||0);var S=l.samples;if(!S||!S.length)return A;var w={initPTS:void 0,timescale:1},O=this.initData;if((!O||!O.length)&&(this.generateInitSegment(S),O=this.initData),!O||!O.length)return $.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),A;this.emitInitSegment&&(w.tracks=this.initTracks,this.emitInitSegment=!1),Object(ee.isFiniteNumber)(c)||(this.initPTS=w.initPTS=c=k(O,S,h));var R=Object(W.getDuration)(S,O),b=h,_=R+b;Object(W.offsetStartDTS)(O,S,c),R>0?this.lastEndDTS=_:($.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!O.audio,d=!!O.video,E="";u&&(E+="audio"),d&&(E+="video");var g={data1:S,startPTS:b,startDTS:b,endPTS:_,endDTS:_,type:E,hasAudio:u,hasVideo:d,nb:1,dropped:0};return A.audio=g.type==="audio"?g:void 0,A.video=g.type!=="audio"?g:void 0,A.text=i,A.id3=r,A.initSegment=w,A},m}(),k=function(v,f,o){return Object(W.getStartDTS)(v,f)-o};function D(m,v){var f=m==null?void 0:m.codec;return f&&f.length>4?f:f==="hvc1"?"hvc1.1.c.L120.90":f==="av01"?"av01.0.04M.08":f==="avc1"||v===M.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Z.default=X},"./src/task-loop.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return ee});var ee=function(){function W(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var M=W.prototype;return M.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},M.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},M.onHandlerDestroyed=function(){},M.hasInterval=function(){return!!this._tickInterval},M.hasNextTick=function(){return!!this._tickTimer},M.setInterval=function(X){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,X),!0)},M.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},M.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},M.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},M.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},M.doTick=function(){},W}()},"./src/types/cmcd.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"CMCDVersion",function(){return ee}),U.d(Z,"CMCDObjectType",function(){return W}),U.d(Z,"CMCDStreamingFormat",function(){return M}),U.d(Z,"CMCDStreamType",function(){return $});var ee=1,W;(function(X){X.MANIFEST="m",X.AUDIO="a",X.VIDEO="v",X.MUXED="av",X.INIT="i",X.CAPTION="c",X.TIMED_TEXT="tt",X.KEY="k",X.OTHER="o"})(W||(W={}));var M;(function(X){X.DASH="d",X.HLS="h",X.SMOOTH="s",X.OTHER="o"})(M||(M={}));var $;(function(X){X.VOD="v",X.LIVE="l"})($||($={}))},"./src/types/level.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"HlsSkip",function(){return M}),U.d(Z,"getSkipValue",function(){return $}),U.d(Z,"HlsUrlParameters",function(){return X}),U.d(Z,"Level",function(){return k});function ee(D,m){for(var v=0;v<m.length;v++){var f=m[v];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(D,f.key,f)}}function W(D,m,v){return m&&ee(D.prototype,m),v&&ee(D,v),D}var M;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(M||(M={}));function $(D,m){var v=D.canSkipUntil,f=D.canSkipDateRanges,o=D.endSN,l=m!==void 0?m-o:0;return v&&l<v?f?M.v2:M.Yes:M.No}var X=function(){function D(v,f,o){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=v,this.part=f,this.skip=o}var m=D.prototype;return m.addDirectives=function(f){var o=new self.URL(f);return this.msn!==void 0&&o.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&o.searchParams.set("_HLS_part",this.part.toString()),this.skip&&o.searchParams.set("_HLS_skip",this.skip),o.toString()},D}(),k=function(){function D(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=[m.url],this.attrs=m.attrs,this.bitrate=m.bitrate,m.details&&(this.details=m.details),this.id=m.id||0,this.name=m.name,this.width=m.width||0,this.height=m.height||0,this.audioCodec=m.audioCodec,this.videoCodec=m.videoCodec,this.unknownCodecs=m.unknownCodecs,this.codecSet=[m.videoCodec,m.audioCodec].filter(function(v){return v}).join(",").replace(/\.[^.,]+/g,"")}return W(D,[{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(v){var f=v%this.url.length;this._urlId!==f&&(this.details=void 0,this._urlId=f)}}]),D}()},"./src/types/loader.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"PlaylistContextType",function(){return ee}),U.d(Z,"PlaylistLevelType",function(){return W});var ee;(function(M){M.MANIFEST="manifest",M.LEVEL="level",M.AUDIO_TRACK="audioTrack",M.SUBTITLE_TRACK="subtitleTrack"})(ee||(ee={}));var W;(function(M){M.MAIN="main",M.AUDIO="audio",M.SUBTITLE="subtitle"})(W||(W={}))},"./src/types/transmuxer.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"ChunkMetadata",function(){return ee});var ee=function($,X,k,D,m,v){D===void 0&&(D=0),m===void 0&&(m=-1),v===void 0&&(v=!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=W(),this.buffering={audio:W(),video:W(),audiovideo:W()},this.level=$,this.sn=X,this.id=k,this.size=D,this.part=m,this.partial=v};function W(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"AttrList",function(){return M});var ee=/^(\d+)x(\d+)$/,W=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,M=function(){function $(k){typeof k=="string"&&(k=$.parseAttrList(k));for(var D in k)k.hasOwnProperty(D)&&(this[D]=k[D])}var X=$.prototype;return X.decimalInteger=function(D){var m=parseInt(this[D],10);return m>Number.MAX_SAFE_INTEGER?Infinity:m},X.hexadecimalInteger=function(D){if(this[D]){var m=(this[D]||"0x").slice(2);m=(m.length&1?"0":"")+m;for(var v=new Uint8Array(m.length/2),f=0;f<m.length/2;f++)v[f]=parseInt(m.slice(f*2,f*2+2),16);return v}else return null},X.hexadecimalIntegerAsNumber=function(D){var m=parseInt(this[D],16);return m>Number.MAX_SAFE_INTEGER?Infinity:m},X.decimalFloatingPoint=function(D){return parseFloat(this[D])},X.optionalFloat=function(D,m){var v=this[D];return v?parseFloat(v):m},X.enumeratedString=function(D){return this[D]},X.bool=function(D){return this[D]==="YES"},X.decimalResolution=function(D){var m=ee.exec(this[D]);return m===null?void 0:{width:parseInt(m[1],10),height:parseInt(m[2],10)}},$.parseAttrList=function(D){var m,v={},f='"';for(W.lastIndex=0;(m=W.exec(D))!==null;){var o=m[2];o.indexOf(f)===0&&o.lastIndexOf(f)===o.length-1&&(o=o.slice(1,-1)),v[m[1]]=o}return v},$}()},"./src/utils/binary-search.ts":function(oe,Z,U){"use strict";U.r(Z);var ee={search:function(M,$){for(var X=0,k=M.length-1,D=null,m=null;X<=k;){D=(X+k)/2|0,m=M[D];var v=$(m);if(v>0)X=D+1;else if(v<0)k=D-1;else return m}return null}};Z.default=ee},"./src/utils/buffer-helper.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"BufferHelper",function(){return M});var ee=U("./src/utils/logger.ts"),W={length:0,start:function(){return 0},end:function(){return 0}},M=function(){function $(){}return $.isBuffered=function(k,D){try{if(k){for(var m=$.getBuffered(k),v=0;v<m.length;v++)if(D>=m.start(v)&&D<=m.end(v))return!0}}catch(f){}return!1},$.bufferInfo=function(k,D,m){try{if(k){var v=$.getBuffered(k),f=[],o;for(o=0;o<v.length;o++)f.push({start:v.start(o),end:v.end(o)});return this.bufferedInfo(f,D,m)}}catch(l){}return{len:0,start:D,end:D,nextStart:void 0}},$.bufferedInfo=function(k,D,m){D=Math.max(0,D),k.sort(function(w,O){var R=w.start-O.start;return R||O.end-w.end});var v=[];if(m)for(var f=0;f<k.length;f++){var o=v.length;if(o){var l=v[o-1].end;k[f].start-l<m?k[f].end>l&&(v[o-1].end=k[f].end):v.push(k[f])}else v.push(k[f])}else v=k;for(var r=0,i,t=D,c=D,h=0;h<v.length;h++){var A=v[h].start,S=v[h].end;if(D+m>=A&&D<S)t=A,c=S,r=c-D;else if(D+m<A){i=A;break}}return{len:r,start:t||0,end:c||0,nextStart:i}},$.getBuffered=function(k){try{return k.buffered}catch(D){return ee.logger.log("failed to get media.buffered",D),W}},$}()},"./src/utils/cea-608-parser.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"Row",function(){return c}),U.d(Z,"CaptionScreen",function(){return h});var ee=U("./src/utils/logger.ts"),W={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},M=function(_){var u=_;return W.hasOwnProperty(_)&&(u=W[_]),String.fromCharCode(u)},$=15,X=100,k={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},D={17:2,18:4,21:6,22:8,23:10,19:13,20:15},m={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},v={25:2,26:4,29:6,30:8,31:10,27:13,28:15},f=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],o;(function(b){b[b.ERROR=0]="ERROR",b[b.TEXT=1]="TEXT",b[b.WARNING=2]="WARNING",b[b.INFO=2]="INFO",b[b.DEBUG=3]="DEBUG",b[b.DATA=3]="DATA"})(o||(o={}));var l=function(){function b(){this.time=null,this.verboseLevel=o.ERROR}var _=b.prototype;return _.log=function(d,E){this.verboseLevel>=d&&ee.logger.log(this.time+" ["+d+"] "+E)},b}(),r=function(_){for(var u=[],d=0;d<_.length;d++)u.push(_[d].toString(16));return u},i=function(){function b(u,d,E,g,y){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=u||"white",this.underline=d||!1,this.italics=E||!1,this.background=g||"black",this.flash=y||!1}var _=b.prototype;return _.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},_.setStyles=function(d){for(var E=["foreground","underline","italics","background","flash"],g=0;g<E.length;g++){var y=E[g];d.hasOwnProperty(y)&&(this[y]=d[y])}},_.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},_.equals=function(d){return this.foreground===d.foreground&&this.underline===d.underline&&this.italics===d.italics&&this.background===d.background&&this.flash===d.flash},_.copy=function(d){this.foreground=d.foreground,this.underline=d.underline,this.italics=d.italics,this.background=d.background,this.flash=d.flash},_.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},b}(),t=function(){function b(u,d,E,g,y,F){this.uchar=void 0,this.penState=void 0,this.uchar=u||" ",this.penState=new i(d,E,g,y,F)}var _=b.prototype;return _.reset=function(){this.uchar=" ",this.penState.reset()},_.setChar=function(d,E){this.uchar=d,this.penState.copy(E)},_.setPenState=function(d){this.penState.copy(d)},_.equals=function(d){return this.uchar===d.uchar&&this.penState.equals(d.penState)},_.copy=function(d){this.uchar=d.uchar,this.penState.copy(d.penState)},_.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},b}(),c=function(){function b(u){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var d=0;d<X;d++)this.chars.push(new t);this.logger=u,this.pos=0,this.currPenState=new i}var _=b.prototype;return _.equals=function(d){for(var E=!0,g=0;g<X;g++)if(!this.chars[g].equals(d.chars[g])){E=!1;break}return E},_.copy=function(d){for(var E=0;E<X;E++)this.chars[E].copy(d.chars[E])},_.isEmpty=function(){for(var d=!0,E=0;E<X;E++)if(!this.chars[E].isEmpty()){d=!1;break}return d},_.setCursor=function(d){this.pos!==d&&(this.pos=d),this.pos<0?(this.logger.log(o.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>X&&(this.logger.log(o.DEBUG,"Too large cursor position "+this.pos),this.pos=X)},_.moveCursor=function(d){var E=this.pos+d;if(d>1)for(var g=this.pos+1;g<E+1;g++)this.chars[g].setPenState(this.currPenState);this.setCursor(E)},_.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},_.insertChar=function(d){d>=144&&this.backSpace();var E=M(d);if(this.pos>=X){this.logger.log(o.ERROR,"Cannot insert "+d.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},_.clearFromPos=function(d){var E;for(E=d;E<X;E++)this.chars[E].reset()},_.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},_.clearToEndOfRow=function(){this.clearFromPos(this.pos)},_.getTextString=function(){for(var d=[],E=!0,g=0;g<X;g++){var y=this.chars[g].uchar;y!==" "&&(E=!1),d.push(y)}return E?"":d.join("")},_.setPenStyles=function(d){this.currPenState.setStyles(d);var E=this.chars[this.pos];E.setPenState(this.currPenState)},b}(),h=function(){function b(u){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var d=0;d<$;d++)this.rows.push(new c(u));this.logger=u,this.currRow=$-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var _=b.prototype;return _.reset=function(){for(var d=0;d<$;d++)this.rows[d].clear();this.currRow=$-1},_.equals=function(d){for(var E=!0,g=0;g<$;g++)if(!this.rows[g].equals(d.rows[g])){E=!1;break}return E},_.copy=function(d){for(var E=0;E<$;E++)this.rows[E].copy(d.rows[E])},_.isEmpty=function(){for(var d=!0,E=0;E<$;E++)if(!this.rows[E].isEmpty()){d=!1;break}return d},_.backSpace=function(){var d=this.rows[this.currRow];d.backSpace()},_.clearToEndOfRow=function(){var d=this.rows[this.currRow];d.clearToEndOfRow()},_.insertChar=function(d){var E=this.rows[this.currRow];E.insertChar(d)},_.setPen=function(d){var E=this.rows[this.currRow];E.setPenStyles(d)},_.moveCursor=function(d){var E=this.rows[this.currRow];E.moveCursor(d)},_.setCursor=function(d){this.logger.log(o.INFO,"setCursor: "+d);var E=this.rows[this.currRow];E.setCursor(d)},_.setPAC=function(d){this.logger.log(o.INFO,"pacData = "+JSON.stringify(d));var E=d.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var g=0;g<$;g++)this.rows[g].clear();var y=this.currRow+1-this.nrRollUpRows,F=this.lastOutputScreen;if(F){var N=F.rows[y].cueStartTime,H=this.logger.time;if(N&&H!==null&&N<H)for(var G=0;G<this.nrRollUpRows;G++)this.rows[E-this.nrRollUpRows+G+1].copy(F.rows[y+G])}}this.currRow=E;var I=this.rows[this.currRow];if(d.indent!==null){var x=d.indent,B=Math.max(x-1,0);I.setCursor(d.indent),d.color=I.chars[B].penState.foreground}var Y={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(Y)},_.setBkgData=function(d){this.logger.log(o.INFO,"bkgData = "+JSON.stringify(d)),this.backSpace(),this.setPen(d),this.insertChar(32)},_.setRollUpRows=function(d){this.nrRollUpRows=d},_.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(o.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(o.TEXT,this.getDisplayText());var d=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(d,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(o.INFO,"Rolling up")},_.getDisplayText=function(d){d=d||!1;for(var E=[],g="",y=-1,F=0;F<$;F++){var N=this.rows[F].getTextString();N&&(y=F+1,d?E.push("Row "+y+": '"+N+"'"):E.push(N.trim()))}return E.length>0&&(d?g="["+E.join(" | ")+"]":g=E.join(`
`)),g},_.getTextAndFormat=function(){return this.rows},b}(),A=function(){function b(u,d,E){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=u,this.outputFilter=d,this.mode=null,this.verbose=0,this.displayedMemory=new h(E),this.nonDisplayedMemory=new h(E),this.lastOutputScreen=new h(E),this.currRollUpRow=this.displayedMemory.rows[$-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var _=b.prototype;return _.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[$-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},_.getHandler=function(){return this.outputFilter},_.setHandler=function(d){this.outputFilter=d},_.setPAC=function(d){this.writeScreen.setPAC(d)},_.setBkgData=function(d){this.writeScreen.setBkgData(d)},_.setMode=function(d){if(d===this.mode)return;this.mode=d,this.logger.log(o.INFO,"MODE="+d),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=d},_.insertChars=function(d){for(var E=0;E<d.length;E++)this.writeScreen.insertChar(d[E]);var g=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(o.INFO,g+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(o.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},_.ccRCL=function(){this.logger.log(o.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},_.ccBS=function(){if(this.logger.log(o.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},_.ccAOF=function(){},_.ccAON=function(){},_.ccDER=function(){this.logger.log(o.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},_.ccRU=function(d){this.logger.log(o.INFO,"RU("+d+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(d)},_.ccFON=function(){this.logger.log(o.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},_.ccRDC=function(){this.logger.log(o.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},_.ccTR=function(){this.logger.log(o.INFO,"TR"),this.setMode("MODE_TEXT")},_.ccRTD=function(){this.logger.log(o.INFO,"RTD"),this.setMode("MODE_TEXT")},_.ccEDM=function(){this.logger.log(o.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},_.ccCR=function(){this.logger.log(o.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},_.ccENM=function(){this.logger.log(o.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},_.ccEOC=function(){if(this.logger.log(o.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var d=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=d,this.writeScreen=this.nonDisplayedMemory,this.logger.log(o.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},_.ccTO=function(d){this.logger.log(o.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},_.ccMIDROW=function(d){var E={flash:!1};if(E.underline=d%2===1,E.italics=d>=46,E.italics)E.foreground="white";else{var g=Math.floor(d/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=y[g]}this.logger.log(o.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},_.outputDataUpdate=function(d){d===void 0&&(d=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},_.cueSplitAtTime=function(d){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,d,this.displayedMemory),this.cueStartTime=d))},b}(),S=function(){function b(u,d,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var g=new l;this.channels=[null,new A(u,d,g),new A(u+1,E,g)],this.cmdHistory=R(),this.logger=g}var _=b.prototype;return _.getHandler=function(d){return this.channels[d].getHandler()},_.setHandler=function(d,E){this.channels[d].setHandler(E)},_.addData=function(d,E){var g,y,F,N=!1;this.logger.time=d;for(var H=0;H<E.length;H+=2){if(y=E[H]&127,F=E[H+1]&127,y===0&&F===0)continue;if(this.logger.log(o.DATA,"["+r([E[H],E[H+1]])+"] -> ("+r([y,F])+")"),g=this.parseCmd(y,F),g||(g=this.parseMidrow(y,F)),g||(g=this.parsePAC(y,F)),g||(g=this.parseBackgroundAttributes(y,F)),!g&&(N=this.parseChars(y,F),N)){var G=this.currentChannel;if(G&&G>0){var I=this.channels[G];I.insertChars(N)}else this.logger.log(o.WARNING,"No channel found yet. TEXT-MODE?")}!g&&!N&&this.logger.log(o.WARNING,"Couldn't parse cleaned data "+r([y,F])+" orig: "+r([E[H],E[H+1]]))}},_.parseCmd=function(d,E){var g=this.cmdHistory,y=(d===20||d===28||d===21||d===29)&&E>=32&&E<=47,F=(d===23||d===31)&&E>=33&&E<=35;if(!(y||F))return!1;if(O(d,E,g))return w(null,null,g),this.logger.log(o.DEBUG,"Repeated command ("+r([d,E])+") is dropped"),!0;var N=d===20||d===21||d===23?1:2,H=this.channels[N];return d===20||d===21||d===28||d===29?E===32?H.ccRCL():E===33?H.ccBS():E===34?H.ccAOF():E===35?H.ccAON():E===36?H.ccDER():E===37?H.ccRU(2):E===38?H.ccRU(3):E===39?H.ccRU(4):E===40?H.ccFON():E===41?H.ccRDC():E===42?H.ccTR():E===43?H.ccRTD():E===44?H.ccEDM():E===45?H.ccCR():E===46?H.ccENM():E===47&&H.ccEOC():H.ccTO(E-32),w(d,E,g),this.currentChannel=N,!0},_.parseMidrow=function(d,E){var g=0;if((d===17||d===25)&&E>=32&&E<=47){if(d===17?g=1:g=2,g!==this.currentChannel)return this.logger.log(o.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[g];return y?(y.ccMIDROW(E),this.logger.log(o.DEBUG,"MIDROW ("+r([d,E])+")"),!0):!1}return!1},_.parsePAC=function(d,E){var g,y=this.cmdHistory,F=(d>=17&&d<=23||d>=25&&d<=31)&&E>=64&&E<=127,N=(d===16||d===24)&&E>=64&&E<=95;if(!(F||N))return!1;if(O(d,E,y))return w(null,null,y),!0;var H=d<=23?1:2;E>=64&&E<=95?g=H===1?k[d]:m[d]:g=H===1?D[d]:v[d];var G=this.channels[H];return G?(G.setPAC(this.interpretPAC(g,E)),w(d,E,y),this.currentChannel=H,!0):!1},_.interpretPAC=function(d,E){var g,y={color:null,italics:!1,indent:null,underline:!1,row:d};return E>95?g=E-96:g=E-64,y.underline=(g&1)===1,g<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(g/2)]:g<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((g-16)/2)*4,y},_.parseChars=function(d,E){var g,y=null,F=null;if(d>=25?(g=2,F=d-8):(g=1,F=d),F>=17&&F<=19){var N;F===17?N=E+80:F===18?N=E+112:N=E+144,this.logger.log(o.INFO,"Special char '"+M(N)+"' in channel "+g),y=[N]}else d>=32&&d<=127&&(y=E===0?[d]:[d,E]);if(y){var H=r(y);this.logger.log(o.DEBUG,"Char codes = "+H.join(",")),w(d,E,this.cmdHistory)}return y},_.parseBackgroundAttributes=function(d,E){var g=(d===16||d===24)&&E>=32&&E<=47,y=(d===23||d===31)&&E>=45&&E<=47;if(!(g||y))return!1;var F,N={};d===16||d===24?(F=Math.floor((E-32)/2),N.background=f[F],E%2===1&&(N.background=N.background+"_semi")):E===45?N.background="transparent":(N.foreground="black",E===47&&(N.underline=!0));var H=d<=23?1:2,G=this.channels[H];return G.setBkgData(N),w(d,E,this.cmdHistory),!0},_.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var E=this.channels[d];E&&E.reset()}this.cmdHistory=R()},_.cueSplitAtTime=function(d){for(var E=0;E<this.channels.length;E++){var g=this.channels[E];g&&g.cueSplitAtTime(d)}},b}();function w(b,_,u){u.a=b,u.b=_}function O(b,_,u){return u.a===b&&u.b===_}function R(){return{a:null,b:null}}Z.default=S},"./src/utils/codecs.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"isCodecType",function(){return W}),U.d(Z,"isCodecSupportedInMp4",function(){return M});var ee={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 W($,X){var k=ee[X];return!!k&&k[$.slice(0,4)]===!0}function M($,X){return MediaSource.isTypeSupported((X||"video")+'/mp4;codecs="'+$+'"')}},"./src/utils/cues.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/utils/vttparser.ts"),W=U("./src/utils/webvtt-parser.ts"),M=U("./src/utils/texttrack-utils.ts"),$=/\s/,X={newCue:function(D,m,v,f){for(var o=[],l,r,i,t,c,h=self.VTTCue||self.TextTrackCue,A=0;A<f.rows.length;A++)if(l=f.rows[A],i=!0,t=0,c="",!l.isEmpty()){for(var S=0;S<l.chars.length;S++)$.test(l.chars[S].uchar)&&i?t++:(c+=l.chars[S].uchar,i=!1);l.cueStartTime=m,m===v&&(v+=1e-4),t>=16?t--:t++;var w=Object(ee.fixLineBreaks)(c.trim()),O=Object(W.generateCueId)(m,v,w);(!D||!D.cues||!D.cues.getCueById(O))&&(r=new h(m,v,w),r.id=O,r.line=A+1,r.align="left",r.position=10+Math.min(80,Math.floor(t*8/32)*10),o.push(r))}return D&&o.length&&(o.sort(function(R,b){return R.line==="auto"||b.line==="auto"?0:R.line>8&&b.line>8?b.line-R.line:R.line-b.line}),o.forEach(function(R){return Object(M.addCueToTrack)(D,R)})),o}};Z.default=X},"./src/utils/discontinuities.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"findFirstFragWithCC",function(){return $}),U.d(Z,"shouldAlignOnDiscontinuities",function(){return X}),U.d(Z,"findDiscontinuousReferenceFrag",function(){return k}),U.d(Z,"adjustSlidingStart",function(){return m}),U.d(Z,"alignStream",function(){return v}),U.d(Z,"alignPDT",function(){return o}),U.d(Z,"alignFragmentByPDTDelta",function(){return l}),U.d(Z,"alignMediaPlaylistByPDT",function(){return r});var ee=U("./src/polyfills/number.ts"),W=U("./src/utils/logger.ts"),M=U("./src/controller/level-helper.ts");function $(i,t){for(var c=null,h=0,A=i.length;h<A;h++){var S=i[h];if(S&&S.cc===t){c=S;break}}return c}function X(i,t,c){return!!(t.details&&(c.endCC>c.startCC||i&&i.cc<c.startCC))}function k(i,t){var c=i.fragments,h=t.fragments;if(!h.length||!c.length){W.logger.log("No fragments to align");return}var A=$(c,h[0].cc);if(!A||A&&!A.startPTS){W.logger.log("No frag in previous level to align on");return}return A}function D(i,t){if(i){var c=i.start+t;i.start=i.startPTS=c,i.endPTS=c+i.duration}}function m(i,t){for(var c=t.fragments,h=0,A=c.length;h<A;h++)D(c[h],i);t.fragmentHint&&D(t.fragmentHint,i),t.alignedSliding=!0}function v(i,t,c){if(!t)return;f(i,c,t),!c.alignedSliding&&t.details&&o(c,t.details),!c.alignedSliding&&t.details&&!c.skippedSegments&&Object(M.adjustSliding)(t.details,c)}function f(i,t,c){if(X(i,c,t)){var h=k(c.details,t);h&&Object(ee.isFiniteNumber)(h.start)&&(W.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),m(h.start,t))}}function o(i,t){if(!t.fragments.length||!i.hasProgramDateTime||!t.hasProgramDateTime)return;var c=t.fragments[0].programDateTime,h=i.fragments[0].programDateTime,A=(h-c)/1e3+t.fragments[0].start;A&&Object(ee.isFiniteNumber)(A)&&(W.logger.log("Adjusting PTS using programDateTime delta "+(h-c)+"ms, sliding:"+A.toFixed(3)+" "+i.url+" "),m(A,i))}function l(i,t){var c=i.programDateTime;if(!c)return;var h=(c-t)/1e3;i.start=i.startPTS=h,i.endPTS=h+i.duration}function r(i,t){if(!t.fragments.length||!i.hasProgramDateTime||!t.hasProgramDateTime)return;var c=t.fragments[0].programDateTime,h=t.fragments[0].start,A=c-h*1e3;i.fragments.forEach(function(S){l(S,A)}),i.fragmentHint&&l(i.fragmentHint,A),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/utils/ewma.ts"),W=function(){function M(X,k,D){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=D,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new ee.default(X),this.fast_=new ee.default(k)}var $=M.prototype;return $.update=function(k,D){var m=this.slow_,v=this.fast_;this.slow_.halfLife!==k&&(this.slow_=new ee.default(k,m.getEstimate(),m.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new ee.default(D,v.getEstimate(),v.getTotalWeight()))},$.sample=function(k,D){k=Math.max(k,this.minDelayMs_);var m=8*D,v=k/1e3,f=m/v;this.fast_.sample(v,f),this.slow_.sample(v,f)},$.canEstimate=function(){var k=this.fast_;return k&&k.getTotalWeight()>=this.minWeight_},$.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},$.destroy=function(){},M}();Z.default=W},"./src/utils/ewma.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=function(){function W($,X,k){X===void 0&&(X=0),k===void 0&&(k=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=$,this.alpha_=$?Math.exp(Math.log(.5)/$):0,this.estimate_=X,this.totalWeight_=k}var M=W.prototype;return M.sample=function(X,k){var D=Math.pow(this.alpha_,X);this.estimate_=k*(1-D)+D*this.estimate_,this.totalWeight_+=X},M.getTotalWeight=function(){return this.totalWeight_},M.getEstimate=function(){if(this.alpha_){var X=1-Math.pow(this.alpha_,this.totalWeight_);if(X)return this.estimate_/X}return this.estimate_},W}();Z.default=ee},"./src/utils/fetch-loader.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"fetchSupported",function(){return l});var ee=U("./src/polyfills/number.ts"),W=U("./src/loader/load-stats.ts"),M=U("./src/demux/chunk-cache.ts");function $(h,A){h.prototype=Object.create(A.prototype),h.prototype.constructor=h,v(h,A)}function X(h){var A=typeof Map=="function"?new Map:void 0;return X=function(w){if(w===null||!m(w))return w;if(typeof w!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(w))return A.get(w);A.set(w,O)}function O(){return k(w,arguments,f(this).constructor)}return O.prototype=Object.create(w.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),v(O,w)},X(h)}function k(h,A,S){return D()?k=Reflect.construct:k=function(O,R,b){var _=[null];_.push.apply(_,R);var u=Function.bind.apply(O,_),d=new u;return b&&v(d,b.prototype),d},k.apply(null,arguments)}function D(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(h){return!1}}function m(h){return Function.toString.call(h).indexOf("[native code]")!==-1}function v(h,A){return v=Object.setPrototypeOf||function(w,O){return w.__proto__=O,w},v(h,A)}function f(h){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(S){return S.__proto__||Object.getPrototypeOf(S)},f(h)}function o(){return o=Object.assign||function(h){for(var A=1;A<arguments.length;A++){var S=arguments[A];for(var w in S)Object.prototype.hasOwnProperty.call(S,w)&&(h[w]=S[w])}return h},o.apply(this,arguments)}function l(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(h){}return!1}var r=function(){function h(S){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=S.fetchSetup||t,this.controller=new self.AbortController,this.stats=new W.LoadStats}var A=h.prototype;return A.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},A.abortInternal=function(){var w=this.response;(!w||!w.ok)&&(this.stats.aborted=!0,this.controller.abort())},A.abort=function(){var w;this.abortInternal(),(w=this.callbacks)!==null&&w!==void 0&&w.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},A.load=function(w,O,R){var b=this,_=this.stats;if(_.loading.start)throw new Error("Loader can only be used once.");_.loading.start=self.performance.now();var u=i(w,this.controller.signal),d=R.onProgress,E=w.responseType==="arraybuffer",g=E?"byteLength":"length";this.context=w,this.config=O,this.callbacks=R,this.request=this.fetchSetup(w,u),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){b.abortInternal(),R.onTimeout(_,w,b.response)},O.timeout),self.fetch(this.request).then(function(y){if(b.response=b.loader=y,!y.ok){var F=y.status,N=y.statusText;throw new c(N||"fetch, bad network response",F,y)}return _.loading.first=Math.max(self.performance.now(),_.loading.start),_.total=parseInt(y.headers.get("Content-Length")||"0"),d&&Object(ee.isFiniteNumber)(O.highWaterMark)?b.loadProgressively(y,_,w,O.highWaterMark,d):E?y.arrayBuffer():y.text()}).then(function(y){var F=b.response;self.clearTimeout(b.requestTimeout),_.loading.end=Math.max(self.performance.now(),_.loading.first),_.loaded=_.total=y[g];var N={url:F.url,data:y};d&&!Object(ee.isFiniteNumber)(O.highWaterMark)&&d(_,w,y,F),R.onSuccess(N,_,w,F)}).catch(function(y){if(self.clearTimeout(b.requestTimeout),_.aborted)return;var F=y.code||0;R.onError({code:F,text:y.message},w,y.details)})},A.getCacheAge=function(){var w=null;if(this.response){var O=this.response.headers.get("age");w=O?parseFloat(O):null}return w},A.loadProgressively=function(w,O,R,b,_){b===void 0&&(b=0);var u=new M.default,d=w.body.getReader(),E=function g(){return d.read().then(function(y){if(y.done)return u.dataLength&&_(O,R,u.flush(),w),Promise.resolve(new ArrayBuffer(0));var F=y.value,N=F.length;return O.loaded+=N,N<b||u.dataLength?(u.push(F),u.dataLength>=b&&_(O,R,u.flush(),w)):_(O,R,F,w),g()}).catch(function(){return Promise.reject()})};return E()},h}();function i(h,A){var S={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(o({},h.headers))};return h.rangeEnd&&S.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),S}function t(h,A){return new self.Request(h.url,A)}var c=function(h){$(A,h);function A(S,w,O){var R;return R=h.call(this,S)||this,R.code=void 0,R.details=void 0,R.code=w,R.details=O,R}return A}(X(Error));Z.default=r},"./src/utils/imsc1-ttml-parser.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"IMSC1_CODEC",function(){return m}),U.d(Z,"parseIMSC1",function(){return l});var ee=U("./src/utils/mp4-tools.ts"),W=U("./src/utils/vttparser.ts"),M=U("./src/utils/vttcue.ts"),$=U("./src/demux/id3.ts"),X=U("./src/utils/timescale-conversion.ts"),k=U("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(b){for(var _=1;_<arguments.length;_++){var u=arguments[_];for(var d in u)Object.prototype.hasOwnProperty.call(u,d)&&(b[d]=u[d])}return b},D.apply(this,arguments)}var m="stpp.ttml.im1t",v=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,f=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,o={left:"start",center:"center",right:"end",start:"start",end:"end"};function l(b,_,u,d,E){var g=Object(ee.findBox)(new Uint8Array(b),["mdat"]);if(g.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var y=g[0],F=Object($.utf8ArrayToStr)(new Uint8Array(b,y.start,y.end-y.start)),N=Object(X.toTimescaleFromScale)(_,1,u);try{d(r(F,N))}catch(H){E(H)}}function r(b,_){var u=new DOMParser,d=u.parseFromString(b,"text/xml"),E=d.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var g={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},y=Object.keys(g).reduce(function(I,x){return I[x]=E.getAttribute("ttp:"+x)||g[x],I},{}),F=E.getAttribute("xml:space")!=="preserve",N=t(i(E,"styling","style")),H=t(i(E,"layout","region")),G=i(E,"body","[begin]");return[].map.call(G,function(I){var x=c(I,F);if(!x||!I.hasAttribute("begin"))return null;var B=w(I.getAttribute("begin"),y),Y=w(I.getAttribute("dur"),y),re=w(I.getAttribute("end"),y);if(B===null)throw S(I);if(re===null){if(Y===null)throw S(I);re=B+Y}var de=new M.default(B-_,re-_,x);de.id=Object(k.generateCueId)(de.startTime,de.endTime,de.text);var he=H[I.getAttribute("region")],xe=N[I.getAttribute("style")];de.position=10,de.size=80;var Pe=h(he,xe),Ce=Pe.textAlign;if(Ce){var Oe=o[Ce];Oe&&(de.lineAlign=Oe),de.align=Ce}return D(de,Pe),de}).filter(function(I){return I!==null})}function i(b,_,u){var d=b.getElementsByTagName(_)[0];return d?[].slice.call(d.querySelectorAll(u)):[]}function t(b){return b.reduce(function(_,u){var d=u.getAttribute("xml:id");return d&&(_[d]=u),_},{})}function c(b,_){return[].slice.call(b.childNodes).reduce(function(u,d,E){var g;return d.nodeName==="br"&&E?u+`
`:(g=d.childNodes)!==null&&g!==void 0&&g.length?c(d,_):_?u+d.textContent.trim().replace(/\s+/g," "):u+d.textContent},"")}function h(b,_){var u="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(E,g){var y=A(_,u,g)||A(b,u,g);return y&&(E[g]=y),E},{})}function A(b,_,u){return b.hasAttributeNS(_,u)?b.getAttributeNS(_,u):null}function S(b){return new Error("Could not parse ttml timestamp "+b)}function w(b,_){if(!b)return null;var u=Object(W.parseTimeStamp)(b);return u===null&&(v.test(b)?u=O(b,_):f.test(b)&&(u=R(b,_))),u}function O(b,_){var u=v.exec(b),d=(u[4]|0)+(u[5]|0)/_.subFrameRate;return(u[1]|0)*3600+(u[2]|0)*60+(u[3]|0)+d/_.frameRate}function R(b,_){var u=f.exec(b),d=Number(u[1]),E=u[2];switch(E){case"h":return d*3600;case"m":return d*60;case"ms":return d*1e3;case"f":return d/_.frameRate;case"t":return d/_.tickRate}return d}},"./src/utils/logger.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"enableLogs",function(){return k}),U.d(Z,"logger",function(){return D});var ee=function(){},W={trace:ee,debug:ee,log:ee,warn:ee,info:ee,error:ee},M=W;function $(m){var v=self.console[m];return v?v.bind(self.console,"["+m+"] >"):ee}function X(m){for(var v=arguments.length,f=new Array(v>1?v-1:0),o=1;o<v;o++)f[o-1]=arguments[o];f.forEach(function(l){M[l]=m[l]?m[l].bind(m):$(l)})}function k(m){if(self.console&&m===!0||typeof m=="object"){X(m,"debug","log","info","warn","error");try{M.log()}catch(v){M=W}}else M=W}var D=M},"./src/utils/mediakeys-helper.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"KeySystems",function(){return ee}),U.d(Z,"requestMediaKeySystemAccess",function(){return W});var ee;(function(M){M.WIDEVINE="com.widevine.alpha",M.PLAYREADY="com.microsoft.playready"})(ee||(ee={}));var W=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"getMediaSource",function(){return ee});function ee(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"bin2str",function(){return X}),U.d(Z,"readUint16",function(){return k}),U.d(Z,"readUint32",function(){return D}),U.d(Z,"writeUint32",function(){return m}),U.d(Z,"findBox",function(){return v}),U.d(Z,"parseSegmentIndex",function(){return f}),U.d(Z,"parseInitSegment",function(){return o}),U.d(Z,"getStartDTS",function(){return l}),U.d(Z,"getDuration",function(){return r}),U.d(Z,"computeRawDurationFromSamples",function(){return i}),U.d(Z,"offsetStartDTS",function(){return t}),U.d(Z,"segmentValidRange",function(){return c}),U.d(Z,"appendUint8Array",function(){return h});var ee=U("./src/utils/typed-array.ts"),W=U("./src/loader/fragment.ts"),M=Math.pow(2,32)-1,$=[].push;function X(A){return String.fromCharCode.apply(null,A)}function k(A,S){"data"in A&&(S+=A.start,A=A.data);var w=A[S]<<8|A[S+1];return w<0?65536+w:w}function D(A,S){"data"in A&&(S+=A.start,A=A.data);var w=A[S]<<24|A[S+1]<<16|A[S+2]<<8|A[S+3];return w<0?4294967296+w:w}function m(A,S,w){"data"in A&&(S+=A.start,A=A.data),A[S]=w>>24,A[S+1]=w>>16&255,A[S+2]=w>>8&255,A[S+3]=w&255}function v(A,S){var w=[];if(!S.length)return w;var O,R,b;"data"in A?(O=A.data,R=A.start,b=A.end):(O=A,R=0,b=O.byteLength);for(var _=R;_<b;){var u=D(O,_),d=X(O.subarray(_+4,_+8)),E=u>1?_+u:b;if(d===S[0])if(S.length===1)w.push({data:O,start:_+8,end:E});else{var g=v({data:O,start:_+8,end:E},S.slice(1));g.length&&$.apply(w,g)}_=E}return w}function f(A){var S=v(A,["moov"]),w=S[0],O=w?w.end:null,R=v(A,["sidx"]);if(!R||!R[0])return null;var b=[],_=R[0],u=_.data[0],d=u===0?8:16,E=D(_,d);d+=4;var g=0,y=0;u===0?d+=8:d+=16,d+=2;var F=_.end+y,N=k(_,d);d+=2;for(var H=0;H<N;H++){var G=d,I=D(_,G);G+=4;var x=I&2147483647,B=(I&2147483648)>>>31;if(B===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Y=D(_,G);G+=4,b.push({referenceSize:x,subsegmentDuration:Y,info:{duration:Y/E,start:F,end:F+x-1}}),F+=x,G+=4,d=G}return{earliestPresentationTime:g,timescale:E,version:u,referencesCount:N,references:b,moovEndOffset:O}}function o(A){for(var S=[],w=v(A,["moov","trak"]),O=0;O<w.length;O++){var R=w[O],b=v(R,["tkhd"])[0];if(b){var _=b.data[b.start],u=_===0?12:20,d=D(b,u),E=v(R,["mdia","mdhd"])[0];if(E){_=E.data[E.start],u=_===0?12:20;var g=D(E,u),y=v(R,["mdia","hdlr"])[0];if(y){var F=X(y.data.subarray(y.start+8,y.start+12)),N={soun:W.ElementaryStreamTypes.AUDIO,vide:W.ElementaryStreamTypes.VIDEO}[F];if(N){var H=v(R,["mdia","minf","stbl","stsd"])[0],G=void 0;H&&(G=X(H.data.subarray(H.start+12,H.start+16))),S[d]={timescale:g,type:N},S[N]={timescale:g,id:d,codec:G}}}}}}var I=v(A,["moov","mvex","trex"]);return I.forEach(function(x){var B=D(x,4),Y=S[B];Y&&(Y.default={duration:D(x,12),flags:D(x,20)})}),S}function l(A,S){return v(S,["moof","traf"]).reduce(function(w,O){var R=v(O,["tfdt"])[0],b=R.data[R.start],_=v(O,["tfhd"]).reduce(function(u,d){var E=D(d,4),g=A[E];if(g){var y=D(R,4);b===1&&(y*=Math.pow(2,32),y+=D(R,8));var F=g.timescale||9e4,N=y/F;if(isFinite(N)&&(u===null||N<u))return N}return u},null);return _!==null&&isFinite(_)&&(w===null||_<w)?_:w},null)||0}function r(A,S){for(var w=0,O=0,R=0,b=v(A,["moof","traf"]),_=0;_<b.length;_++){var u=b[_],d=v(u,["tfhd"])[0],E=D(d,4),g=S[E];if(!g)continue;var y=g.default,F=D(d,0)|(y==null?void 0:y.flags),N=y==null?void 0:y.duration;F&8&&(F&2?N=D(d,12):N=D(d,8));for(var H=g.timescale||9e4,G=v(u,["trun"]),I=0;I<G.length;I++){if(N){var x=D(G[I],4);w=N*x}else w=i(G[I]);g.type===W.ElementaryStreamTypes.VIDEO?O+=w/H:g.type===W.ElementaryStreamTypes.AUDIO&&(R+=w/H)}}if(O===0&&R===0){var B=f(A);if(B!=null&&B.references)return B.references.reduce(function(Y,re){return Y+re.info.duration||0},0)}return O||R}function i(A){var S=D(A,0),w=8;S&1&&(w+=4),S&4&&(w+=4);for(var O=0,R=D(A,4),b=0;b<R;b++){if(S&256){var _=D(A,w);O+=_,w+=4}S&512&&(w+=4),S&1024&&(w+=4),S&2048&&(w+=4)}return O}function t(A,S,w){v(S,["moof","traf"]).forEach(function(O){v(O,["tfhd"]).forEach(function(R){var b=D(R,4),_=A[b];if(!_)return;var u=_.timescale||9e4;v(O,["tfdt"]).forEach(function(d){var E=d.data[d.start],g=D(d,4);if(E===0)m(d,4,g-w*u);else{g*=Math.pow(2,32),g+=D(d,8),g-=w*u,g=Math.max(g,0);var y=Math.floor(g/(M+1)),F=Math.floor(g%(M+1));m(d,4,y),m(d,8,F)}})})})}function c(A){var S={valid:null,remainder:null},w=v(A,["moof"]);if(w){if(w.length<2)return S.remainder=A,S}else return S;var O=w[w.length-1];return S.valid=Object(ee.sliceUint8)(A,0,O.start-8),S.remainder=Object(ee.sliceUint8)(A,O.start-8),S}function h(A,S){var w=new Uint8Array(A.length+S.length);return w.set(A),w.set(S,A.length),w}},"./src/utils/output-filter.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"default",function(){return ee});var ee=function(){function W($,X){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=$,this.trackName=X}var M=W.prototype;return M.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},M.newCue=function(X,k,D){(this.startTime===null||this.startTime>X)&&(this.startTime=X),this.endTime=k,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},M.reset=function(){this.cueRanges=[]},W}()},"./src/utils/texttrack-utils.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"sendAddTrackEvent",function(){return W}),U.d(Z,"addCueToTrack",function(){return M}),U.d(Z,"clearCurrentCues",function(){return $}),U.d(Z,"removeCuesInRange",function(){return X}),U.d(Z,"getCuesInRange",function(){return D});var ee=U("./src/utils/logger.ts");function W(m,v){var f;try{f=new Event("addtrack")}catch(o){f=document.createEvent("Event"),f.initEvent("addtrack",!1,!1)}f.track=m,v.dispatchEvent(f)}function M(m,v){var f=m.mode;if(f==="disabled"&&(m.mode="hidden"),m.cues&&!m.cues.getCueById(v.id))try{if(m.addCue(v),!m.cues.getCueById(v.id))throw new Error("addCue is failed for: "+v)}catch(l){ee.logger.debug("[texttrack-utils]: "+l);var o=new self.TextTrackCue(v.startTime,v.endTime,v.text);o.id=v.id,m.addCue(o)}f==="disabled"&&(m.mode=f)}function $(m){var v=m.mode;if(v==="disabled"&&(m.mode="hidden"),m.cues)for(var f=m.cues.length;f--;)m.removeCue(m.cues[f]);v==="disabled"&&(m.mode=v)}function X(m,v,f){var o=m.mode;if(o==="disabled"&&(m.mode="hidden"),m.cues&&m.cues.length>0)for(var l=D(m.cues,v,f),r=0;r<l.length;r++)m.removeCue(l[r]);o==="disabled"&&(m.mode=o)}function k(m,v){if(v<m[0].startTime)return 0;var f=m.length-1;if(v>m[f].endTime)return-1;for(var o=0,l=f;o<=l;){var r=Math.floor((l+o)/2);if(v<m[r].startTime)l=r-1;else if(v>m[r].startTime&&o<f)o=r+1;else return r}return m[o].startTime-v<v-m[l].startTime?o:l}function D(m,v,f){var o=[],l=k(m,v);if(l>-1)for(var r=l,i=m.length;r<i;r++){var t=m[r];if(t.startTime>=v&&t.endTime<=f)o.push(t);else if(t.startTime>f)return o}return o}},"./src/utils/time-ranges.ts":function(oe,Z,U){"use strict";U.r(Z);var ee={toString:function(M){for(var $="",X=M.length,k=0;k<X;k++)$+="["+M.start(k).toFixed(3)+","+M.end(k).toFixed(3)+"]";return $}};Z.default=ee},"./src/utils/timescale-conversion.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"toTimescaleFromBase",function(){return W}),U.d(Z,"toTimescaleFromScale",function(){return M}),U.d(Z,"toMsFromMpegTsClock",function(){return $}),U.d(Z,"toMpegTsClockFromTimescale",function(){return X});var ee=9e4;function W(k,D,m,v){m===void 0&&(m=1),v===void 0&&(v=!1);var f=k*D*m;return v?Math.round(f):f}function M(k,D,m,v){return m===void 0&&(m=1),v===void 0&&(v=!1),W(k,D,1/m,v)}function $(k,D){return D===void 0&&(D=!1),W(k,1e3,1/ee,D)}function X(k,D){return D===void 0&&(D=1),W(k,ee,1/D)}},"./src/utils/typed-array.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"sliceUint8",function(){return ee});function ee(W,M,$){return Uint8Array.prototype.slice?W.slice(M,$):new Uint8Array(Array.prototype.slice.call(W,M,$))}},"./src/utils/vttcue.ts":function(oe,Z,U){"use strict";U.r(Z),Z.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var ee=["","lr","rl"],W=["start","middle","end","left","right"];function M(m,v){if(typeof v!="string")return!1;if(!Array.isArray(m))return!1;var f=v.toLowerCase();return~m.indexOf(f)?f:!1}function $(m){return M(ee,m)}function X(m){return M(W,m)}function k(m){for(var v=arguments.length,f=new Array(v>1?v-1:0),o=1;o<v;o++)f[o-1]=arguments[o];for(var l=1;l<arguments.length;l++){var r=arguments[l];for(var i in r)m[i]=r[i]}return m}function D(m,v,f){var o=this,l={enumerable:!0};o.hasBeenReset=!1;var r="",i=!1,t=m,c=v,h=f,A=null,S="",w=!0,O="auto",R="start",b=50,_="middle",u=50,d="middle";Object.defineProperty(o,"id",k({},l,{get:function(){return r},set:function(g){r=""+g}})),Object.defineProperty(o,"pauseOnExit",k({},l,{get:function(){return i},set:function(g){i=!!g}})),Object.defineProperty(o,"startTime",k({},l,{get:function(){return t},set:function(g){if(typeof g!="number")throw new TypeError("Start time must be set to a number.");t=g,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",k({},l,{get:function(){return c},set:function(g){if(typeof g!="number")throw new TypeError("End time must be set to a number.");c=g,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",k({},l,{get:function(){return h},set:function(g){h=""+g,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",k({},l,{get:function(){return A},set:function(g){A=g,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",k({},l,{get:function(){return S},set:function(g){var y=$(g);if(y===!1)throw new SyntaxError("An invalid or illegal string was specified.");S=y,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",k({},l,{get:function(){return w},set:function(g){w=!!g,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",k({},l,{get:function(){return O},set:function(g){if(typeof g!="number"&&g!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");O=g,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",k({},l,{get:function(){return R},set:function(g){var y=X(g);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");R=y,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",k({},l,{get:function(){return b},set:function(g){if(g<0||g>100)throw new Error("Position must be between 0 and 100.");b=g,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",k({},l,{get:function(){return _},set:function(g){var y=X(g);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");_=y,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",k({},l,{get:function(){return u},set:function(g){if(g<0||g>100)throw new Error("Size must be between 0 and 100.");u=g,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",k({},l,{get:function(){return d},set:function(g){var y=X(g);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");d=y,this.hasBeenReset=!0}})),o.displayState=void 0}return D.prototype.getCueAsHTML=function(){var m=self.WebVTT;return m.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"parseTimeStamp",function(){return M}),U.d(Z,"fixLineBreaks",function(){return v}),U.d(Z,"VTTParser",function(){return f});var ee=U("./src/utils/vttcue.ts"),W=function(){function o(){}var l=o.prototype;return l.decode=function(i,t){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},o}();function M(o){function l(i,t,c,h){return(i|0)*3600+(t|0)*60+(c|0)+parseFloat(h||0)}var r=o.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return r?parseFloat(r[2])>59?l(r[2],r[3],0,r[4]):l(r[1],r[2],r[3],r[4]):null}var $=function(){function o(){this.values=Object.create(null)}var l=o.prototype;return l.set=function(i,t){!this.get(i)&&t!==""&&(this.values[i]=t)},l.get=function(i,t,c){return c?this.has(i)?this.values[i]:t[c]:this.has(i)?this.values[i]:t},l.has=function(i){return i in this.values},l.alt=function(i,t,c){for(var h=0;h<c.length;++h)if(t===c[h]){this.set(i,t);break}},l.integer=function(i,t){/^-?\d+$/.test(t)&&this.set(i,parseInt(t,10))},l.percent=function(i,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var c=parseFloat(t);if(c>=0&&c<=100)return this.set(i,c),!0}return!1},o}();function X(o,l,r,i){var t=i?o.split(i):[o];for(var c in t){if(typeof t[c]!="string")continue;var h=t[c].split(r);if(h.length!==2)continue;var A=h[0],S=h[1];l(A,S)}}var k=new ee.default(0,0,""),D=k.align==="middle"?"middle":"center";function m(o,l,r){var i=o;function t(){var A=M(o);if(A===null)throw new Error("Malformed timestamp: "+i);return o=o.replace(/^[^\sa-zA-Z-]+/,""),A}function c(A,S){var w=new $;X(A,function(b,_){var u;switch(b){case"region":for(var d=r.length-1;d>=0;d--)if(r[d].id===_){w.set(b,r[d].region);break}break;case"vertical":w.alt(b,_,["rl","lr"]);break;case"line":u=_.split(","),w.integer(b,u[0]),w.percent(b,u[0])&&w.set("snapToLines",!1),w.alt(b,u[0],["auto"]),u.length===2&&w.alt("lineAlign",u[1],["start",D,"end"]);break;case"position":u=_.split(","),w.percent(b,u[0]),u.length===2&&w.alt("positionAlign",u[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":w.percent(b,_);break;case"align":w.alt(b,_,["start",D,"end","left","right"]);break}},/:/,/\s/),S.region=w.get("region",null),S.vertical=w.get("vertical","");var O=w.get("line","auto");O==="auto"&&k.line===-1&&(O=-1),S.line=O,S.lineAlign=w.get("lineAlign","start"),S.snapToLines=w.get("snapToLines",!0),S.size=w.get("size",100),S.align=w.get("align",D);var R=w.get("position","auto");R==="auto"&&k.position===50&&(R=S.align==="start"||S.align==="left"?0:S.align==="end"||S.align==="right"?100:50),S.position=R}function h(){o=o.replace(/^\s+/,"")}if(h(),l.startTime=t(),h(),o.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);o=o.substr(3),h(),l.endTime=t(),h(),c(o,l)}function v(o){return o.replace(/<br(?: \/)?>/gi,`
`)}var f=function(){function o(){this.state="INITIAL",this.buffer="",this.decoder=new W,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var l=o.prototype;return l.parse=function(i){var t=this;i&&(t.buffer+=t.decoder.decode(i,{stream:!0}));function c(){var R=t.buffer,b=0;for(R=v(R);b<R.length&&R[b]!=="\r"&&R[b]!==`
`;)++b;var _=R.substr(0,b);return R[b]==="\r"&&++b,R[b]===`
`&&++b,t.buffer=R.substr(b),_}function h(R){X(R,function(b,_){},/:/)}try{var A="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;A=c();var S=A.match(/^()?WEBVTT([ \t].*)?$/);if(!S||!S[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var w=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;w?w=!1:A=c();switch(t.state){case"HEADER":/:/.test(A)?h(A):A||(t.state="ID");continue;case"NOTE":A||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(A)){t.state="NOTE";break}if(!A)continue;if(t.cue=new ee.default(0,0,""),t.state="CUE",A.indexOf("-->")===-1){t.cue.id=A;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{m(A,t.cue,t.regionList)}catch(R){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var O=A.indexOf("-->")!==-1;if(!A||O&&(w=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
`),t.cue.text+=A}continue;case"BADCUE":A||(t.state="ID")}}}catch(R){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},l.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){i.onparsingerror&&i.onparsingerror(t)}return i.onflush&&i.onflush(),this},o}()},"./src/utils/webvtt-parser.ts":function(oe,Z,U){"use strict";U.r(Z),U.d(Z,"generateCueId",function(){return f}),U.d(Z,"parseWebVTT",function(){return l});var ee=U("./src/polyfills/number.ts"),W=U("./src/utils/vttparser.ts"),M=U("./src/demux/id3.ts"),$=U("./src/utils/timescale-conversion.ts"),X=U("./src/remux/mp4-remuxer.ts"),k=/\r\n|\n\r|\n|\r/g,D=function(i,t,c){return c===void 0&&(c=0),i.substr(c,t.length)===t},m=function(i){var t=parseInt(i.substr(-3)),c=parseInt(i.substr(-6,2)),h=parseInt(i.substr(-9,2)),A=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(ee.isFiniteNumber)(t)||!Object(ee.isFiniteNumber)(c)||!Object(ee.isFiniteNumber)(h)||!Object(ee.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return t+=1e3*c,t+=60*1e3*h,t+=60*60*1e3*A,t},v=function(i){for(var t=5381,c=i.length;c;)t=t*33^i.charCodeAt(--c);return(t>>>0).toString()};function f(r,i,t){return v(r.toString())+v(i.toString())+v(t)}var o=function(i,t,c){var h=i[t],A=i[h.prevCC];if(!A||!A.new&&h.new){i.ccOffset=i.presentationOffset=h.start,h.new=!1;return}for(;(S=A)!==null&&S!==void 0&&S.new;){var S;i.ccOffset+=h.start-A.start,h.new=!1,h=A,A=i[h.prevCC]}i.presentationOffset=c};function l(r,i,t,c,h,A,S,w){var O=new W.VTTParser,R=Object(M.utf8ArrayToStr)(new Uint8Array(r)).trim().replace(k,`
`).split(`
`),b=[],_=Object($.toMpegTsClockFromTimescale)(i,t),u="00:00.000",d=0,E=0,g,y=!0,F=!1;O.oncue=function(N){var H=c[h],G=c.ccOffset,I=(d-_)/9e4;if(H!=null&&H.new&&(E!==void 0?G=c.ccOffset=H.start:o(c,h,I)),I&&(G=I-c.presentationOffset),F){var x=N.endTime-N.startTime,B=Object(X.normalizePts)((N.startTime+G-E)*9e4,A*9e4)/9e4;N.startTime=B,N.endTime=B+x}var Y=N.text.trim();N.text=decodeURIComponent(encodeURIComponent(Y)),N.id||(N.id=f(N.startTime,N.endTime,Y)),N.endTime>0&&b.push(N)},O.onparsingerror=function(N){g=N},O.onflush=function(){if(g){w(g);return}S(b)},R.forEach(function(N){if(y)if(D(N,"X-TIMESTAMP-MAP=")){y=!1,F=!0,N.substr(16).split(",").forEach(function(H){D(H,"LOCAL:")?u=H.substr(6):D(H,"MPEGTS:")&&(d=parseInt(H.substr(7)))});try{E=m(u)/1e3}catch(H){F=!1,g=H}return}else N===""&&(y=!1);O.parse(N+`
`)}),O.flush()}},"./src/utils/xhr-loader.ts":function(oe,Z,U){"use strict";U.r(Z);var ee=U("./src/utils/logger.ts"),W=U("./src/loader/load-stats.ts"),M=/^age:\s*[\d.]+\s*$/m,$=function(){function X(D){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=void 0,this.loader=null,this.stats=void 0,this.xhrSetup=D?D.xhrSetup:null,this.stats=new W.LoadStats,this.retryDelay=0}var k=X.prototype;return k.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},k.abortInternal=function(){var m=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),m&&(m.onreadystatechange=null,m.onprogress=null,m.readyState!==4&&(this.stats.aborted=!0,m.abort()))},k.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},k.load=function(m,v,f){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=m,this.config=v,this.callbacks=f,this.retryDelay=v.retryDelay,this.loadInternal()},k.loadInternal=function(){var m=this.config,v=this.context;if(!m)return;var f=this.loader=new self.XMLHttpRequest,o=this.stats;o.loading.first=0,o.loaded=0;var l=this.xhrSetup;try{if(l)try{l(f,v.url)}catch(t){f.open("GET",v.url,!0),l(f,v.url)}f.readyState||f.open("GET",v.url,!0);var r=this.context.headers;if(r)for(var i in r)f.setRequestHeader(i,r[i])}catch(t){this.callbacks.onError({code:f.status,text:t.message},v,f);return}v.rangeEnd&&f.setRequestHeader("Range","bytes="+v.rangeStart+"-"+(v.rangeEnd-1)),f.onreadystatechange=this.readystatechange.bind(this),f.onprogress=this.loadprogress.bind(this),f.responseType=v.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout),f.send()},k.readystatechange=function(){var m=this.context,v=this.loader,f=this.stats;if(!m||!v)return;var o=v.readyState,l=this.config;if(f.aborted)return;if(o>=2)if(self.clearTimeout(this.requestTimeout),f.loading.first===0&&(f.loading.first=Math.max(self.performance.now(),f.loading.start)),o===4){v.onreadystatechange=null,v.onprogress=null;var r=v.status;if(r>=200&&r<300){f.loading.end=Math.max(self.performance.now(),f.loading.first);var i,t;if(m.responseType==="arraybuffer"?(i=v.response,t=i.byteLength):(i=v.responseText,t=i.length),f.loaded=f.total=t,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(f,m,i,v),!this.callbacks)return;var h={url:v.responseURL,data:i};this.callbacks.onSuccess(h,f,m,v)}else f.retry>=l.maxRetry||r>=400&&r<499?(ee.logger.error(r+" while loading "+m.url),this.callbacks.onError({code:r,text:v.statusText},m,v)):(ee.logger.warn(r+" while loading "+m.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,l.maxRetryDelay),f.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.timeout)},k.loadtimeout=function(){ee.logger.warn("timeout while loading "+this.context.url);var m=this.callbacks;m&&(this.abortInternal(),m.onTimeout(this.stats,this.context,this.loader))},k.loadprogress=function(m){var v=this.stats;v.loaded=m.loaded,m.lengthComputable&&(v.total=m.total)},k.getCacheAge=function(){var m=null;if(this.loader&&M.test(this.loader.getAllResponseHeaders())){var v=this.loader.getResponseHeader("age");m=v?parseFloat(v):null}return m},X}();Z.default=$}}).default})},vHTk:function(Wt,st,z){Wt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Wt,st,z){"use strict";z.d(st,"a",function(){return Jt});var oe=z("rePB"),Z=z("VTBJ"),U=z("KQm4"),ee=z("U8pU"),W=z("ODXe"),M=z("q1tI"),$=z("TSYQ"),X=z.n($),k=z("Gytx"),D=z.n(k),m=z("Kwbf"),v=z("t23M"),f=z("qx4F"),o=z("6eGT"),l=z("IBYe"),r=z("Ff2n"),i=z("c+Xe"),t=z("fyJ8"),c=z("biw7");function h(Ye,Xe,Ot,Et,Je){var mt=Ot[Ye]||{},Be=Ot[Xe]||{},Ie,ke;mt.fixed==="left"?Ie=Et.left[Ye]:Be.fixed==="right"&&(ke=Et.right[Xe]);var me=!1,ye=!1,Re=!1,ce=!1,Me=Ot[Xe+1],tt=Ot[Ye-1];if(Je==="rtl"){if(Ie!==void 0){var bt=tt&&tt.fixed==="left";ce=!bt}else if(ke!==void 0){var Kt=Me&&Me.fixed==="right";Re=!Kt}}else if(Ie!==void 0){var Gt=Me&&Me.fixed==="left";me=!Gt}else if(ke!==void 0){var $t=tt&&tt.fixed==="right";ye=!$t}return{fixLeft:Ie,fixRight:ke,lastFixLeft:me,firstFixRight:ye,lastFixRight:Re,firstFixLeft:ce,isSticky:Et.isSticky}}var A=z("sR1s");function S(Ye){var Xe=Ye.cells,Ot=Ye.stickyOffsets,Et=Ye.flattenColumns,Je=Ye.rowComponent,mt=Ye.cellComponent,Be=Ye.onHeaderRow,Ie=Ye.index,ke=M.useContext(c.a),me=ke.prefixCls,ye=ke.direction,Re;Be&&(Re=Be(Xe.map(function(Me){return Me.column}),Ie));var ce=Object(A.a)(Xe.map(function(Me){return Me.column}));return M.createElement(Je,Object.assign({},Re),Xe.map(function(Me,tt){var bt=Me.column,Kt=h(Me.colStart,Me.colEnd,Et,Ot,ye),Gt;return bt&&bt.onHeaderCell&&(Gt=Me.column.onHeaderCell(bt)),M.createElement(t.a,Object.assign({},Me,{ellipsis:bt.ellipsis,align:bt.align,component:mt,prefixCls:me,key:ce[tt]},Kt,{additionalProps:Gt,rowType:"header"}))}))}S.displayName="HeaderRow";var w=S;function O(Ye){var Xe=[];function Ot(Be,Ie){var ke=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Xe[ke]=Xe[ke]||[];var me=Ie,ye=Be.filter(Boolean).map(function(Re){var ce={key:Re.key,className:Re.className||"",children:Re.title,column:Re,colStart:me},Me=1,tt=Re.children;return tt&&tt.length>0&&(Me=Ot(tt,me,ke+1).reduce(function(bt,Kt){return bt+Kt},0),ce.hasSubColumns=!0),"colSpan"in Re&&(Me=Re.colSpan),"rowSpan"in Re&&(ce.rowSpan=Re.rowSpan),ce.colSpan=Me,ce.colEnd=ce.colStart+Me-1,Xe[ke].push(ce),me+=Me,Me});return ye}Ot(Ye,0);for(var Et=Xe.length,Je=function(Ie){Xe[Ie].forEach(function(ke){!("rowSpan"in ke)&&!ke.hasSubColumns&&(ke.rowSpan=Et-Ie)})},mt=0;mt<Et;mt+=1)Je(mt);return Xe}function R(Ye){var Xe=Ye.stickyOffsets,Ot=Ye.columns,Et=Ye.flattenColumns,Je=Ye.onHeaderRow,mt=M.useContext(c.a),Be=mt.prefixCls,Ie=mt.getComponent,ke=M.useMemo(function(){return O(Ot)},[Ot]),me=Ie(["header","wrapper"],"thead"),ye=Ie(["header","row"],"tr"),Re=Ie(["header","cell"],"th");return M.createElement(me,{className:"".concat(Be,"-thead")},ke.map(function(ce,Me){var tt=M.createElement(w,{key:Me,flattenColumns:Et,cells:ce,stickyOffsets:Xe,rowComponent:ye,cellComponent:Re,onHeaderRow:Je,index:Me});return tt}))}var b=R,_=z("hW8S");function u(Ye){for(var Xe=Ye.colWidths,Ot=Ye.columns,Et=Ye.columCount,Je=[],mt=Et||Ot.length,Be=!1,Ie=mt-1;Ie>=0;Ie-=1){var ke=Xe[Ie],me=Ot&&Ot[Ie],ye=me&&me[_.a];(ke||ye||Be)&&(Je.unshift(M.createElement("col",Object.assign({key:Ie,style:{width:ke,minWidth:ke}},ye))),Be=!0)}return M.createElement("colgroup",null,Je)}var d=u;function E(Ye,Xe){return Object(M.useMemo)(function(){for(var Ot=[],Et=0;Et<Xe;Et+=1){var Je=Ye[Et];if(Je!==void 0)Ot[Et]=Je;else return null}return Ot},[Ye.join("_"),Xe])}var g=M.forwardRef(function(Ye,Xe){var Ot=Ye.noData,Et=Ye.columns,Je=Ye.flattenColumns,mt=Ye.colWidths,Be=Ye.columCount,Ie=Ye.stickyOffsets,ke=Ye.direction,me=Ye.fixHeader,ye=Ye.offsetHeader,Re=Ye.stickyClassName,ce=Ye.onScroll,Me=Object(r.a)(Ye,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),tt=M.useContext(c.a),bt=tt.prefixCls,Kt=tt.scrollbarSize,Gt=tt.isSticky,$t=Gt&&!me?0:Kt,ei=M.useRef(null),gn=M.useCallback(function(_i){Object(i.b)(Xe,_i),Object(i.b)(ei,_i)},[]);M.useEffect(function(){var _i;function Si(At){var Wn=At.currentTarget,hi=At.deltaX;hi&&(ce({currentTarget:Wn,scrollLeft:Wn.scrollLeft+hi}),At.preventDefault())}return(_i=ei.current)===null||_i===void 0||_i.addEventListener("wheel",Si),function(){var At;(At=ei.current)===null||At===void 0||At.removeEventListener("wheel",Si)}},[]);var an=Je[Je.length-1],dn={fixed:an?an.fixed:null,onHeaderCell:function(){return{className:"".concat(bt,"-cell-scrollbar")}}},zn=Object(M.useMemo)(function(){return $t?[].concat(Object(U.a)(Et),[dn]):Et},[$t,Et]),pi=Object(M.useMemo)(function(){return $t?[].concat(Object(U.a)(Je),[dn]):Je},[$t,Je]),mi=Object(M.useMemo)(function(){var _i=Ie.right,Si=Ie.left;return Object(Z.a)(Object(Z.a)({},Ie),{},{left:ke==="rtl"?[].concat(Object(U.a)(Si.map(function(At){return At+$t})),[0]):Si,right:ke==="rtl"?_i:[].concat(Object(U.a)(_i.map(function(At){return At+$t})),[0]),isSticky:Gt})},[$t,Ie,Gt]),ri=E(mt,Be);return M.createElement("div",{style:Object(Z.a)({overflow:"hidden"},Gt?{top:ye}:{}),ref:gn,className:X()("".concat(bt,"-header"),Object(oe.a)({},Re,!!Re))},M.createElement("table",{style:{tableLayout:"fixed",visibility:Ot||ri?null:"hidden"}},M.createElement(d,{colWidths:ri?[].concat(Object(U.a)(ri),[$t]):[],columCount:Be+1,columns:pi}),M.createElement(b,Object.assign({},Me,{stickyOffsets:mi,columns:zn,flattenColumns:pi}))))});g.displayName="FixedHeader";var y=g,F=M.createContext(null),N=F;function H(Ye){var Xe=Ye.prefixCls,Ot=Ye.children,Et=Ye.component,Je=Ye.cellComponent,mt=Ye.fixHeader,Be=Ye.fixColumn,Ie=Ye.horizonScroll,ke=Ye.className,me=Ye.expanded,ye=Ye.componentWidth,Re=Ye.colSpan,ce=M.useContext(c.a),Me=ce.scrollbarSize;return M.useMemo(function(){var tt=Ot;return Be&&(tt=M.createElement("div",{style:{width:ye-(mt?Me:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Xe,"-expanded-row-fixed")},tt)),M.createElement(Et,{className:ke,style:{display:me?null:"none"}},M.createElement(t.a,{component:Je,prefixCls:Xe,colSpan:Re},tt))},[Ot,Et,mt,Ie,ke,me,ye,Re,Me])}var G=H;function I(Ye){var Xe=Ye.className,Ot=Ye.style,Et=Ye.record,Je=Ye.index,mt=Ye.rowKey,Be=Ye.getRowKey,Ie=Ye.rowExpandable,ke=Ye.expandedKeys,me=Ye.onRow,ye=Ye.indent,Re=ye===void 0?0:ye,ce=Ye.rowComponent,Me=Ye.cellComponent,tt=Ye.childrenColumnName,bt=M.useContext(c.a),Kt=bt.prefixCls,Gt=bt.fixedInfoList,$t=M.useContext(N),ei=$t.fixHeader,gn=$t.fixColumn,an=$t.horizonScroll,dn=$t.componentWidth,zn=$t.flattenColumns,pi=$t.expandableType,mi=$t.expandRowByClick,ri=$t.onTriggerExpand,_i=$t.rowClassName,Si=$t.expandedRowClassName,At=$t.indentSize,Wn=$t.expandIcon,hi=$t.expandedRowRender,ti=$t.expandIconColumnIndex,Oi=M.useState(!1),Ai=Object(W.a)(Oi,2),Ni=Ai[0],wi=Ai[1],ct=ke&&ke.has(Ye.recordKey);M.useEffect(function(){ct&&wi(!0)},[ct]);var je=pi==="row"&&(!Ie||Ie(Et)),It=pi==="nest",Ne=tt&&Et&&Et[tt],Ee=je||It,ve;me&&(ve=me(Et,Je));var di=function(C){if(mi&&Ee&&ri(Et,C),ve&&ve.onClick){for(var L,V=arguments.length,ae=new Array(V>1?V-1:0),Q=1;Q<V;Q++)ae[Q-1]=arguments[Q];(L=ve).onClick.apply(L,[C].concat(ae))}},en;typeof _i=="string"?en=_i:typeof _i=="function"&&(en=_i(Et,Je,Re));var De=Object(A.a)(zn),ht=M.createElement(ce,Object.assign({},ve,{"data-row-key":mt,className:X()(Xe,"".concat(Kt,"-row"),"".concat(Kt,"-row-level-").concat(Re),en,ve&&ve.className),style:Object(Z.a)(Object(Z.a)({},Ot),ve?ve.style:null),onClick:di}),zn.map(function(q,C){var L=q.render,V=q.dataIndex,ae=q.className,Q=De[C],Ae=Gt[C],nt;C===(ti||0)&&It&&(nt=M.createElement(M.Fragment,null,M.createElement("span",{style:{paddingLeft:"".concat(At*Re,"px")},className:"".concat(Kt,"-row-indent indent-level-").concat(Re)}),Wn({prefixCls:Kt,expanded:ct,expandable:Ne,record:Et,onExpand:ri})));var xt;return q.onCell&&(xt=q.onCell(Et,Je)),M.createElement(t.a,Object.assign({className:ae,ellipsis:q.ellipsis,align:q.align,component:Me,prefixCls:Kt,key:Q,record:Et,index:Je,dataIndex:V,render:L,shouldCellUpdate:q.shouldCellUpdate},Ae,{appendNode:nt,additionalProps:xt}))})),we;if(je&&(Ni||ct)){var un=hi(Et,Je,Re+1,ct),fi=Si&&Si(Et,Je,Re);we=M.createElement(G,{expanded:ct,className:X()("".concat(Kt,"-expanded-row"),"".concat(Kt,"-expanded-row-level-").concat(Re+1),fi),prefixCls:Kt,fixHeader:ei,fixColumn:gn,horizonScroll:an,component:ce,componentWidth:dn,cellComponent:Me,colSpan:zn.length},un)}var gi;return Ne&&ct&&(gi=(Et[tt]||[]).map(function(q,C){var L=Be(q,C);return M.createElement(I,Object.assign({},Ye,{key:L,rowKey:L,record:q,recordKey:L,index:C,indent:Re+1}))})),M.createElement(M.Fragment,null,ht,we,gi)}I.displayName="BodyRow";var x=I,B=M.createContext(null),Y=B;function re(Ye){var Xe=Ye.columnKey,Ot=Ye.onColumnResize,Et=M.useRef();return M.useEffect(function(){Et.current&&Ot(Xe,Et.current.offsetWidth)},[]),M.createElement(v.a,{onResize:function(mt){var Be=mt.offsetWidth;Ot(Xe,Be)}},M.createElement("td",{ref:Et,style:{padding:0,border:0,height:0}},M.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function de(Ye){var Xe=Ye.data,Ot=Ye.getRowKey,Et=Ye.measureColumnWidth,Je=Ye.expandedKeys,mt=Ye.onRow,Be=Ye.rowExpandable,Ie=Ye.emptyNode,ke=Ye.childrenColumnName,me=M.useContext(Y),ye=me.onColumnResize,Re=M.useContext(c.a),ce=Re.prefixCls,Me=Re.getComponent,tt=M.useContext(N),bt=tt.fixHeader,Kt=tt.horizonScroll,Gt=tt.flattenColumns,$t=tt.componentWidth;return M.useMemo(function(){var ei=Me(["body","wrapper"],"tbody"),gn=Me(["body","row"],"tr"),an=Me(["body","cell"],"td"),dn;Xe.length?dn=Xe.map(function(pi,mi){var ri=Ot(pi,mi);return M.createElement(x,{key:ri,rowKey:ri,record:pi,recordKey:ri,index:mi,rowComponent:gn,cellComponent:an,expandedKeys:Je,onRow:mt,getRowKey:Ot,rowExpandable:Be,childrenColumnName:ke})}):dn=M.createElement(G,{expanded:!0,className:"".concat(ce,"-placeholder"),prefixCls:ce,fixHeader:bt,fixColumn:Kt,horizonScroll:Kt,component:gn,componentWidth:$t,cellComponent:an,colSpan:Gt.length},Ie);var zn=Object(A.a)(Gt);return M.createElement(ei,{className:"".concat(ce,"-tbody")},Et&&M.createElement("tr",{"aria-hidden":"true",className:"".concat(ce,"-measure-row"),style:{height:0}},zn.map(function(pi){return M.createElement(re,{key:pi,columnKey:pi,onColumnResize:ye})})),dn)},[Xe,ce,mt,Et,Je,Ot,Me,$t,Ie,Gt])}var he=M.memo(de);he.displayName="Body";var xe=he,Pe=z("wRmb"),Ce=z("xEkU"),Oe=z.n(Ce);function be(Ye){var Xe=Object(M.useRef)(Ye),Ot=Object(M.useState)({}),Et=Object(W.a)(Ot,2),Je=Et[1],mt=Object(M.useRef)(null),Be=Object(M.useRef)([]);function Ie(ke){mt.current===null&&(Be.current=[],mt.current=Oe()(function(){Be.current.forEach(function(me){Xe.current=me(Xe.current)}),mt.current=null,Je({})})),Be.current.push(ke)}return Object(M.useEffect)(function(){return function(){Oe.a.cancel(mt.current)}},[]),[Xe.current,Ie]}function ge(Ye){var Xe=Object(M.useRef)(Ye),Ot=Object(M.useRef)(null);function Et(){window.clearTimeout(Ot.current)}function Je(Be){Xe.current=Be,Et(),Ot.current=window.setTimeout(function(){Xe.current=null,Ot.current=null},100)}function mt(){return Xe.current}return Object(M.useEffect)(function(){return Et},[]),[Je,mt]}function te(Ye,Xe,Ot){var Et=Object(M.useMemo)(function(){for(var Je=[],mt=[],Be=0,Ie=0,ke=0;ke<Xe;ke+=1)if(Ot==="rtl"){mt[ke]=Ie,Ie+=Ye[ke]||0;var me=Xe-ke-1;Je[me]=Be,Be+=Ye[me]||0}else{Je[ke]=Be,Be+=Ye[ke]||0;var ye=Xe-ke-1;mt[ye]=Ie,Ie+=Ye[ye]||0}return{left:Je,right:mt}},[Ye,Xe,Ot]);return Et}var fe=te;function _e(Ye){var Xe=Ye.className,Ot=Ye.children;return M.createElement("div",{className:Xe},Ot)}var Le=_e,$e=z("n6Qo");function Ue(Ye){var Xe,Ot=Ye.prefixCls,Et=Ye.record,Je=Ye.onExpand,mt=Ye.expanded,Be=Ye.expandable,Ie="".concat(Ot,"-row-expand-icon");if(!Be)return M.createElement("span",{className:X()(Ie,"".concat(Ot,"-row-spaced"))});var ke=function(ye){Je(Et,ye),ye.stopPropagation()};return M.createElement("span",{className:X()(Ie,(Xe={},Object(oe.a)(Xe,"".concat(Ot,"-row-expanded"),mt),Object(oe.a)(Xe,"".concat(Ot,"-row-collapsed"),!mt),Xe)),onClick:ke})}function at(Ye,Xe,Ot){var Et=[];function Je(mt){(mt||[]).forEach(function(Be,Ie){Et.push(Xe(Be,Ie)),Je(Be[Ot])})}return Je(Ye),Et}var ft=z("zT1h"),Ct=z("y0+3"),yt=function(Xe,Ot){var Et,Je,mt=Xe.scrollBodyRef,Be=Xe.onScroll,Ie=Xe.offsetScroll,ke=M.useContext(c.a),me=ke.prefixCls,ye=((Et=mt.current)===null||Et===void 0?void 0:Et.scrollWidth)||0,Re=((Je=mt.current)===null||Je===void 0?void 0:Je.clientWidth)||0,ce=ye&&Re*(Re/ye),Me=M.useRef(),tt=be({scrollLeft:0,isHiddenScrollBar:!1}),bt=Object(W.a)(tt,2),Kt=bt[0],Gt=bt[1],$t=M.useRef({delta:0,x:0}),ei=M.useState(!1),gn=Object(W.a)(ei,2),an=gn[0],dn=gn[1],zn=function(){dn(!1)},pi=function(At){At.persist(),$t.current.delta=At.pageX-Kt.scrollLeft,$t.current.x=0,dn(!0),At.preventDefault()},mi=function(At){var Wn,hi=At||((Wn=window)===null||Wn===void 0?void 0:Wn.event),ti=hi.buttons;if(!an||ti===0){an&&dn(!1);return}var Oi=$t.current.x+At.pageX-$t.current.x-$t.current.delta;Oi<=0&&(Oi=0),Oi+ce>=Re&&(Oi=Re-ce),Be({scrollLeft:Oi/Re*(ye+2)}),$t.current.x=At.pageX},ri=function(){var At=Object(Ct.b)(mt.current).top,Wn=At+mt.current.offsetHeight,hi=document.documentElement.scrollTop+window.innerHeight;Wn-Object(f.a)()<=hi||At>=hi-Ie?Gt(function(ti){return Object(Z.a)(Object(Z.a)({},ti),{},{isHiddenScrollBar:!0})}):Gt(function(ti){return Object(Z.a)(Object(Z.a)({},ti),{},{isHiddenScrollBar:!1})})},_i=function(At){Gt(function(Wn){return Object(Z.a)(Object(Z.a)({},Wn),{},{scrollLeft:At/ye*Re||0})})};return M.useImperativeHandle(Ot,function(){return{setScrollLeft:_i}}),M.useEffect(function(){var Si=Object(ft.a)(document.body,"mouseup",zn,!1),At=Object(ft.a)(document.body,"mousemove",mi,!1);return ri(),function(){Si.remove(),At.remove()}},[ce,an]),M.useEffect(function(){var Si=Object(ft.a)(window,"scroll",ri,!1),At=Object(ft.a)(window,"resize",ri,!1);return function(){Si.remove(),At.remove()}},[]),M.useEffect(function(){Kt.isHiddenScrollBar||Gt(function(Si){var At,Wn;return Object(Z.a)(Object(Z.a)({},Si),{},{scrollLeft:mt.current.scrollLeft/((At=mt.current)===null||At===void 0?void 0:At.scrollWidth)*((Wn=mt.current)===null||Wn===void 0?void 0:Wn.clientWidth)})})},[Kt.isHiddenScrollBar]),ye<=Re||!ce||Kt.isHiddenScrollBar?null:M.createElement("div",{style:{height:Object(f.a)(),width:Re,bottom:Ie},className:"".concat(me,"-sticky-scroll")},M.createElement("div",{onMouseDown:pi,ref:Me,className:X()("".concat(me,"-sticky-scroll-bar"),Object(oe.a)({},"".concat(me,"-sticky-scroll-bar-active"),an)),style:{width:"".concat(ce,"px"),transform:"translate3d(".concat(Kt.scrollLeft,"px, 0, 0)")}}))},_t=M.forwardRef(yt);function lt(Ye,Xe){return M.useMemo(function(){var Ot=!!Ye;return{isSticky:Ot,stickyClassName:Ot?"".concat(Xe,"-sticky-header"):"",offsetHeader:Object(ee.a)(Ye)==="object"&&Ye.offsetHeader||0,offsetScroll:Object(ee.a)(Ye)==="object"&&Ye.offsetScroll||0}},[Ye,Xe])}var Ft=[],Xt={},Jt="rc-table-internal-hook",rn=M.memo(function(Ye){var Xe=Ye.children;return Xe},function(Ye,Xe){return D()(Ye.props,Xe.props)?Ye.pingLeft!==Xe.pingLeft||Ye.pingRight!==Xe.pingRight:!1});function En(Ye){var Xe,Ot=Ye.prefixCls,Et=Ye.className,Je=Ye.rowClassName,mt=Ye.style,Be=Ye.data,Ie=Ye.rowKey,ke=Ye.scroll,me=Ye.tableLayout,ye=Ye.direction,Re=Ye.title,ce=Ye.footer,Me=Ye.summary,tt=Ye.id,bt=Ye.showHeader,Kt=Ye.components,Gt=Ye.emptyText,$t=Ye.onRow,ei=Ye.onHeaderRow,gn=Ye.internalHooks,an=Ye.transformColumns,dn=Ye.internalRefs,zn=Ye.sticky,pi=Be||Ft,mi=!!pi.length,ri=M.useState(0),_i=Object(W.a)(ri,2),Si=_i[0],At=_i[1];M.useEffect(function(){At(Object(f.a)())});var Wn=M.useMemo(function(){return Object(A.c)(Kt,{})},[Kt]),hi=M.useCallback(function(Jn,Zn){return Object(A.b)(Wn,Jn)||Zn},[Wn]),ti=M.useMemo(function(){return typeof Ie=="function"?Ie:function(Jn){var Zn=Jn&&Jn[Ie];return Zn}},[Ie]),Oi=Object(_.c)(Ye),Ai=Oi.expandIcon,Ni=Oi.expandedRowKeys,wi=Oi.defaultExpandedRowKeys,ct=Oi.defaultExpandAllRows,je=Oi.expandedRowRender,It=Oi.onExpand,Ne=Oi.onExpandedRowsChange,Ee=Oi.expandRowByClick,ve=Oi.rowExpandable,di=Oi.expandIconColumnIndex,en=Oi.expandedRowClassName,De=Oi.childrenColumnName,ht=Oi.indentSize,we=Ai||Ue,un=De||"children",fi=M.useMemo(function(){return je?"row":Ye.expandable&&gn===Jt&&Ye.expandable.__PARENT_RENDER_ICON__||pi.some(function(Jn){return Jn&&Object(ee.a)(Jn)==="object"&&Jn[un]})?"nest":!1},[!!je,pi]),gi=M.useState(function(){return wi||(ct?at(pi,ti,un):[])}),q=Object(W.a)(gi,2),C=q[0],L=q[1],V=M.useMemo(function(){return new Set(Ni||C||[])},[Ni,C]),ae=M.useCallback(function(Jn){var Zn=ti(Jn,pi.indexOf(Jn)),Yt,Sn=V.has(Zn);Sn?(V.delete(Zn),Yt=Object(U.a)(V)):Yt=[].concat(Object(U.a)(V),[Zn]),L(Yt),It&&It(!Sn,Jn),Ne&&Ne(Yt)},[ti,V,pi,It,Ne]),Q=M.useState(0),Ae=Object(W.a)(Q,2),nt=Ae[0],xt=Ae[1],Dt=Object(Pe.b)(Object(Z.a)(Object(Z.a)(Object(Z.a)({},Ye),Oi),{},{expandable:!!je,expandedKeys:V,getRowKey:ti,onTriggerExpand:ae,expandIcon:we,expandIconColumnIndex:di,direction:ye}),gn===Jt?an:null),ot=Object(W.a)(Dt,2),vt=ot[0],Lt=ot[1],wn=M.useMemo(function(){return{columns:vt,flattenColumns:Lt}},[vt,Lt]),Xn=M.useRef(),jn=M.useRef(),cn=M.useRef(),jt=M.useState(!1),nn=Object(W.a)(jt,2),qt=nn[0],Nt=nn[1],$n=M.useState(!1),Un=Object(W.a)($n,2),xn=Un[0],Yn=Un[1],hn=be(new Map),Tn=Object(W.a)(hn,2),ln=Tn[0],Mn=Tn[1],Vn=Object(A.a)(Lt),ni=Vn.map(function(Jn){return ln.get(Jn)}),Pn=M.useMemo(function(){return ni},[ni.join("_")]),Hn=fe(Pn,Lt.length,ye),tn=ke&&Object(A.d)(ke.y),vn=ke&&Object(A.d)(ke.x),Ln=vn&&Lt.some(function(Jn){var Zn=Jn.fixed;return Zn}),Cn=M.useRef(),Qn=lt(zn,Ot),_n=Qn.isSticky,Gn=Qn.offsetHeader,qn=Qn.offsetScroll,In=Qn.stickyClassName,Dn,kn,An;tn&&(kn={overflowY:"scroll",maxHeight:ke.y}),vn&&(Dn={overflowX:"auto"},tn||(kn={overflowY:"hidden"}),An={width:ke.x===!0?"auto":ke.x,minWidth:"100%"});var sn=M.useCallback(function(Jn,Zn){Mn(function(Yt){var Sn=new Map(Yt);return Sn.set(Jn,Zn),Sn})},[]),Mt=ge(null),zt=Object(W.a)(Mt,2),Vt=zt[0],Bt=zt[1];function Zt(Jn,Zn){if(!Zn)return;typeof Zn=="function"?Zn(Jn):Zn.scrollLeft!==Jn&&(Zn.scrollLeft=Jn)}var yn=function(Zn){var Yt=Zn.currentTarget,Sn=Zn.scrollLeft,Kn=typeof Sn=="number"?Sn:Yt.scrollLeft,ii=Yt||Xt;if(!Bt()||Bt()===ii){var On;Vt(ii),Zt(Kn,jn.current),Zt(Kn,cn.current),Zt(Kn,(On=Cn.current)===null||On===void 0?void 0:On.setScrollLeft)}if(Yt){var Li=Yt.scrollWidth,ji=Yt.clientWidth;Nt(Kn>0),Yn(Kn<Li-ji)}},pn=function(){cn.current&&yn({currentTarget:cn.current})},gt=function(Zn){var Yt=Zn.width;pn(),xt(Xn.current?Xn.current.offsetWidth:Yt)};M.useEffect(function(){return pn},[]),M.useEffect(function(){vn&&pn()},[vn]),M.useEffect(function(){gn===Jt&&dn&&(dn.body.current=cn.current)});var it=hi(["table"],"table"),Ve=M.useMemo(function(){return me||(Ln?ke.x==="max-content"?"auto":"fixed":tn||Lt.some(function(Jn){var Zn=Jn.ellipsis;return Zn})?"fixed":"auto")},[tn,Ln,Lt,me]),qe,We={colWidths:Pn,columCount:Lt.length,stickyOffsets:Hn,onHeaderRow:ei,fixHeader:tn},dt=M.useMemo(function(){return mi?null:typeof Gt=="function"?Gt():Gt},[mi,Gt]),Ze=M.createElement(xe,{data:pi,measureColumnWidth:tn||vn||_n,expandedKeys:V,rowExpandable:ve,getRowKey:ti,onRow:$t,emptyNode:dt,childrenColumnName:un}),wt=M.createElement(d,{colWidths:Lt.map(function(Jn){var Zn=Jn.width;return Zn}),columns:Lt}),kt=Me&&M.createElement($e.b,null,Me(pi)),Tt=hi(["body"]);if(tn||_n){var Ht;typeof Tt=="function"?(Ht=Tt(pi,{scrollbarSize:Si,ref:cn,onScroll:yn}),We.colWidths=Lt.map(function(Jn,Zn){var Yt=Jn.width,Sn=Zn===vt.length-1?Yt-Si:Yt;return typeof Sn=="number"&&!Number.isNaN(Sn)?Sn:(Object(m.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Ht=M.createElement("div",{style:Object(Z.a)(Object(Z.a)({},Dn),kn),onScroll:yn,ref:cn,className:X()("".concat(Ot,"-body"))},M.createElement(it,{style:Object(Z.a)(Object(Z.a)({},An),{},{tableLayout:Ve})},wt,Ze,kt),_n&&M.createElement(_t,{ref:Cn,offsetScroll:qn,scrollBodyRef:cn,onScroll:yn})),qe=M.createElement(M.Fragment,null,bt!==!1&&M.createElement(y,Object.assign({noData:!pi.length},We,wn,{direction:ye,offsetHeader:Gn,stickyClassName:In,ref:jn,onScroll:yn})),Ht)}else qe=M.createElement("div",{style:Object(Z.a)(Object(Z.a)({},Dn),kn),className:X()("".concat(Ot,"-content")),onScroll:yn,ref:cn},M.createElement(it,{style:Object(Z.a)(Object(Z.a)({},An),{},{tableLayout:Ve})},wt,bt!==!1&&M.createElement(b,Object.assign({},We,wn)),Ze,kt));var St=Object(_.b)(Ye),Pt=M.createElement("div",Object.assign({className:X()(Ot,Et,(Xe={},Object(oe.a)(Xe,"".concat(Ot,"-rtl"),ye==="rtl"),Object(oe.a)(Xe,"".concat(Ot,"-ping-left"),qt),Object(oe.a)(Xe,"".concat(Ot,"-ping-right"),xn),Object(oe.a)(Xe,"".concat(Ot,"-layout-fixed"),me==="fixed"),Object(oe.a)(Xe,"".concat(Ot,"-fixed-header"),tn),Object(oe.a)(Xe,"".concat(Ot,"-fixed-column"),Ln),Object(oe.a)(Xe,"".concat(Ot,"-scroll-horizontal"),vn),Object(oe.a)(Xe,"".concat(Ot,"-has-fix-left"),Lt[0]&&Lt[0].fixed),Object(oe.a)(Xe,"".concat(Ot,"-has-fix-right"),Lt[Lt.length-1]&&Lt[Lt.length-1].fixed==="right"),Xe)),style:mt,id:tt,ref:Xn},St),M.createElement(rn,{pingLeft:qt,pingRight:xn,props:Object(Z.a)(Object(Z.a)({},Ye),{},{stickyOffsets:Hn,mergedExpandedKeys:V})},Re&&M.createElement(Le,{className:"".concat(Ot,"-title")},Re(pi)),M.createElement("div",{className:"".concat(Ot,"-container")},qe),ce&&M.createElement(Le,{className:"".concat(Ot,"-footer")},ce(pi))));vn&&(Pt=M.createElement(v.a,{onResize:gt},Pt));var bn=M.useMemo(function(){return{prefixCls:Ot,getComponent:hi,scrollbarSize:Si,direction:ye,fixedInfoList:Lt.map(function(Jn,Zn){return h(Zn,Zn,Lt,Hn,ye)}),isSticky:_n}},[Ot,hi,Si,ye,Lt,Hn,ye,_n]),on=M.useMemo(function(){return Object(Z.a)(Object(Z.a)({},wn),{},{tableLayout:Ve,rowClassName:Je,expandedRowClassName:en,componentWidth:nt,fixHeader:tn,fixColumn:Ln,horizonScroll:vn,expandIcon:we,expandableType:fi,expandRowByClick:Ee,expandedRowRender:je,onTriggerExpand:ae,expandIconColumnIndex:di,indentSize:ht})},[wn,Ve,Je,en,nt,tn,Ln,vn,we,fi,Ee,je,ae,di,ht]),vi=M.useMemo(function(){return{onColumnResize:sn}},[sn]);return M.createElement(c.a.Provider,{value:bn},M.createElement(N.Provider,{value:on},M.createElement(Y.Provider,{value:vi},Pt)))}En.Column=l.a,En.ColumnGroup=o.a,En.Summary=$e.a,En.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var mn=st.b=En},wRmb:function(Wt,st,z){"use strict";z.d(st,"a",function(){return D});var oe=z("rePB"),Z=z("KQm4"),U=z("VTBJ"),ee=z("Ff2n"),W=z("q1tI"),M=z.n(W),$=z("Kwbf"),X=z("Zm9Q"),k=z("hW8S");function D(l){return Object(X.a)(l).filter(function(r){return W.isValidElement(r)}).map(function(r){var i=r.key,t=r.props,c=t.children,h=Object(ee.a)(t,["children"]),A=Object(U.a)({key:i},h);return c&&(A.children=D(c)),A})}function m(l){return l.reduce(function(r,i){var t=i.fixed,c=t===!0?"left":t,h=i.children;return h&&h.length>0?[].concat(Object(Z.a)(r),Object(Z.a)(m(h).map(function(A){return Object(U.a)({fixed:c},A)}))):[].concat(Object(Z.a)(r),[Object(U.a)(Object(U.a)({},i),{},{fixed:c})])},[])}function v(l){for(var r=!0,i=0;i<l.length;i+=1){var t=l[i];if(r&&t.fixed!=="left")r=!1;else if(!r&&t.fixed==="left"){Object($.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var c=!0,h=l.length-1;h>=0;h-=1){var A=l[h];if(c&&A.fixed!=="right")c=!1;else if(!c&&A.fixed==="right"){Object($.a)(!1,"Index ".concat(h+1," of `columns` missing `fixed='right'` prop."));break}}}function f(l){return l.map(function(r){var i=r.fixed,t=Object(ee.a)(r,["fixed"]),c=i;return i==="left"?c="right":i==="right"&&(c="left"),Object(U.a)({fixed:c},t)})}function o(l,r){var i=l.prefixCls,t=l.columns,c=l.children,h=l.expandable,A=l.expandedKeys,S=l.getRowKey,w=l.onTriggerExpand,O=l.expandIcon,R=l.rowExpandable,b=l.expandIconColumnIndex,_=l.direction,u=l.expandRowByClick,d=W.useMemo(function(){return t||D(c)},[t,c]),E=W.useMemo(function(){if(h){var F,N=b||0,H=d[N],G=(F={},Object(oe.a)(F,k.a,{className:"".concat(i,"-expand-icon-col")}),Object(oe.a)(F,"title",""),Object(oe.a)(F,"fixed",H?H.fixed:null),Object(oe.a)(F,"className","".concat(i,"-row-expand-icon-cell")),Object(oe.a)(F,"render",function(B,Y,re){var de=S(Y,re),he=A.has(de),xe=R?R(Y):!0,Pe=O({prefixCls:i,expanded:he,expandable:xe,record:Y,onExpand:w});return u?W.createElement("span",{onClick:function(Oe){return Oe.stopPropagation()}},Pe):Pe}),F),I=d.slice();return N>=0&&I.splice(N,0,G),I}return d},[h,d,S,A,O,_]),g=W.useMemo(function(){var F=E;return r&&(F=r(F)),F.length||(F=[{render:function(){return null}}]),F},[r,E,_]),y=W.useMemo(function(){return _==="rtl"?f(m(g)):m(g)},[g,_]);return[g,y]}st.b=o},"y0+3":function(Wt,st,z){"use strict";z.d(st,"a",function(){return m}),z.d(st,"b",function(){return f});var oe=/margin|padding|width|height|max|min|offset/,Z={left:!0,top:!0},U={cssFloat:1,styleFloat:1,float:1};function ee(o){return o.nodeType===1?o.ownerDocument.defaultView.getComputedStyle(o,null):{}}function W(o,l,r){if(l=l.toLowerCase(),r==="auto"){if(l==="height")return o.offsetHeight;if(l==="width")return o.offsetWidth}return l in Z||(Z[l]=oe.test(l)),Z[l]?parseFloat(r)||0:r}function M(o,l){var r=arguments.length,i=ee(o);return l=U[l]?"cssFloat"in o.style?"cssFloat":"styleFloat":l,r===1?i:W(o,l,i[l]||o.style[l])}function $(o,l,r){var i=arguments.length;if(l=U[l]?"cssFloat"in o.style?"cssFloat":"styleFloat":l,i===3)return typeof r=="number"&&oe.test(l)&&(r="".concat(r,"px")),o.style[l]=r,r;for(var t in l)l.hasOwnProperty(t)&&$(o,t,l[t]);return ee(o)}function X(o){return o===document.body?document.documentElement.clientWidth:o.offsetWidth}function k(o){return o===document.body?window.innerHeight||document.documentElement.clientHeight:o.offsetHeight}function D(){var o=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),l=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:o,height:l}}function m(){var o=document.documentElement.clientWidth,l=window.innerHeight||document.documentElement.clientHeight;return{width:o,height:l}}function v(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function f(o){var l=o.getBoundingClientRect(),r=document.documentElement;return{left:l.left+(window.pageXOffset||r.scrollLeft)-(r.clientLeft||document.body.clientLeft||0),top:l.top+(window.pageYOffset||r.scrollTop)-(r.clientTop||document.body.clientTop||0)}}},"yTi+":function(Wt,st,z){Wt.exports=z.p+"static/AssistantCode3.fdd8db3c.jpeg"},zWo0:function(Wt,st,z){Wt.exports={flex_box_center:"flex_box_center___3zJMe",flex_space_between:"flex_space_between___13piC",flex_box_vertical_center:"flex_box_vertical_center___1Z05H",flex_box_center_end:"flex_box_center_end___3Vv0l",flex_box_column:"flex_box_column___3GJ6D",bg:"bg___1hpKT",containerTitle:"containerTitle___3ViW8",containerDesc:"containerDesc___X72Fr",d1:"d1___4bBm6",name:"name___2KzoA",diff:"diff___1fPyD",time:"time___3N9-e",d2:"d2___1kqjn",listItem:"listItem___1lLy6",info:"info___2vCxA",title:"title___bqOOF",titleLeft:"titleLeft___1gE5Z",titleRight:"titleRight___3_pXb",acitons:"acitons___3AN6t",formWrap:"formWrap___2GMGM",button:"button___KOTNG"}}}]);