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

277 lines
1.3 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[193,5,6,7,8,20],{"+BqJ":function(Rt,Ze,K){Rt.exports={wrap:"wrap___25UhO",img:"img___2akIE",table:"table___3IRHj",totalScore:"totalScore___2JN2k",people:"people___1rT7q",glassSeal:"glassSeal___2gAyY"}},"+NIl":function(Rt,Ze,K){(function(ee){ee(K("VrN/"))})(function(ee){"use strict";ee.defineMode("stex",function($,k){"use strict";function Q(o,l){o.cmdState.push(l)}function B(o){return o.cmdState.length>0?o.cmdState[o.cmdState.length-1]:null}function I(o){var l=o.cmdState.pop();l&&l.closeBracket()}function z(o){for(var l=o.cmdState,a=l.length-1;a>=0;a--){var r=l[a];if(r.name=="DEFAULT")continue;return r}return{styleIdentifier:function(){return null}}}function G(o,l,a){return function(){this.name=o,this.bracketNo=0,this.style=l,this.styles=a,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var L={};L.importmodule=G("importmodule","tag",["string","builtin"]),L.documentclass=G("documentclass","tag",["","atom"]),L.usepackage=G("usepackage","tag",["atom"]),L.begin=G("begin","tag",["atom"]),L.end=G("end","tag",["atom"]),L.label=G("label","tag",["atom"]),L.ref=G("ref","tag",["atom"]),L.eqref=G("eqref","tag",["atom"]),L.cite=G("cite","tag",["atom"]),L.bibitem=G("bibitem","tag",["atom"]),L.Bibitem=G("Bibitem","tag",["atom"]),L.RBibitem=G("RBibitem","tag",["atom"]),L.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 a;if(o.match(/^\\[a-zA-Z@]+/)){var r=o.current().slice(1);return a=L.hasOwnProperty(r)?L[r]:L.DEFAULT,a=new a,Q(l,a),D(l,h),a.style}if(o.match(/^\\[$&%#{}_]/))return"tag";if(o.match(/^\\[,;!\/\\]/))return"tag";if(o.match("\\["))return D(l,function(c,f){return g(c,f,"\\]")}),"keyword";if(o.match("\\("))return D(l,function(c,f){return g(c,f,"\\)")}),"keyword";if(o.match("$$"))return D(l,function(c,f){return g(c,f,"$$")}),"keyword";if(o.match("$"))return D(l,function(c,f){return g(c,f,"$")}),"keyword";var t=o.next();if(t=="%")return o.skipToEnd(),"comment";if(t=="}"||t=="]"){if(a=B(l),a)a.closeBracket(t),D(l,h);else return"error";return"bracket"}else return t=="{"||t=="["?(a=L.DEFAULT,a=new a,Q(l,a),"bracket"):/\d/.test(t)?(o.eatWhile(/[\w.%]/),"atom"):(o.eatWhile(/[\w\-_]/),a=z(l),a.name=="begin"&&(a.argument=o.current()),a.styleIdentifier())}function g(o,l,a){if(o.eatSpace())return null;if(a&&o.match(a))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 r=o.next();return r=="{"||r=="}"||r=="["||r=="]"||r=="("||r==")"?"bracket":r=="%"?(o.skipToEnd(),"comment"):"error"}function h(o,l){var a=o.peek(),r;return a=="{"||a=="["?(r=B(l),r.openBracket(a),o.eat(a),D(l,m),"bracket"):/[ \t\r]/.test(a)?(o.eat(a),null):(D(l,m),I(l),m(o,l))}return{startState:function(){var o=k.inMathMode?function(l,a){return g(l,a)}: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:"%"}}),ee.defineMIME("text/x-stex","stex"),ee.defineMIME("text/x-latex","stex")})},"+ua5":function(Rt,Ze,K){},"19Vz":function(Rt,Ze,K){(function(ee){ee(K("VrN/"))})(function(ee){ee.defineOption("placeholder","",function(G,L,D){var m=D&&D!=ee.Init;if(L&&!m)G.on("blur",B),G.on("change",I),G.on("swapDoc",I),ee.on(G.getInputField(),"compositionupdate",G.state.placeholderCompose=function(){Q(G)}),I(G);else if(!L&&m){G.off("blur",B),G.off("change",I),G.off("swapDoc",I),ee.off(G.getInputField(),"compositionupdate",G.state.placeholderCompose),$(G);var g=G.getWrapperElement();g.className=g.className.replace(" CodeMirror-empty","")}L&&!G.hasFocus()&&B(G)});function $(G){G.state.placeholder&&(G.state.placeholder.parentNode.removeChild(G.state.placeholder),G.state.placeholder=null)}function k(G){$(G);var L=G.state.placeholder=document.createElement("pre");L.style.cssText="height: 0; overflow: visible",L.style.direction=G.getOption("direction"),L.className="CodeMirror-placeholder CodeMirror-line-like";var D=G.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),L.appendChild(D),G.display.lineSpace.insertBefore(L,G.display.lineSpace.firstChild)}function Q(G){setTimeout(function(){var L=!1,D=G.getInputField();D.nodeName=="TEXTAREA"?L=!D.value:G.lineCount()==1&&(L=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),L?k(G):$(G)},20)}function B(G){z(G)&&k(G)}function I(G){var L=G.getWrapperElement(),D=z(G);L.className=L.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?k(G):$(G)}function z(G){return G.lineCount()===1&&G.getLine(0)===""}})},"1ZF9":function(Rt,Ze,K){Rt.exports=K.p+"static/Authorize.cc9c212f.png"},"1eCo":function(Rt,Ze,K){(function(ee){ee(K("VrN/"))})(function(ee){"use strict";var $={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},k={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};ee.defineMode("xml",function(Q,B){var I=Q.indentUnit,z={},G=B.htmlMode?$:k;for(var L in G)z[L]=G[L];for(var L in B)z[L]=B[L];var D,m;function g(d,y){function v(N){return y.tokenize=N,N(d,y)}var E=d.next();if(E=="<")return d.eat("!")?d.eat("[")?d.match("CDATA[")?v(l("atom","]]>")):null:d.match("--")?v(l("comment","-->")):d.match("DOCTYPE",!0,!0)?(d.eatWhile(/[\w\._\-]/),v(a(1))):null:d.eat("?")?(d.eatWhile(/[\w\._\-]/),y.tokenize=l("meta","?>"),"meta"):(D=d.eat("/")?"closeTag":"openTag",y.tokenize=h,"tag bracket");if(E=="&"){var M;return d.eat("#")?d.eat("x")?M=d.eatWhile(/[a-fA-F\d]/)&&d.eat(";"):M=d.eatWhile(/[\d]/)&&d.eat(";"):M=d.eatWhile(/[\w\.\-:]/)&&d.eat(";"),M?"atom":"error"}else return d.eatWhile(/[^&<]/),null}g.isInText=!0;function h(d,y){var v=d.next();if(v==">"||v=="/"&&d.eat(">"))return y.tokenize=g,D=v==">"?"endTag":"selfcloseTag","tag bracket";if(v=="=")return D="equals",null;if(v=="<"){y.tokenize=g,y.state=f,y.tagName=y.tagStart=null;var E=y.tokenize(d,y);return E?E+" tag error":"tag error"}else return/[\'\"]/.test(v)?(y.tokenize=o(v),y.stringStartCol=d.column(),y.tokenize(d,y)):(d.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function o(d){var y=function(v,E){for(;!v.eol();)if(v.next()==d){E.tokenize=h;break}return"string"};return y.isInAttribute=!0,y}function l(d,y){return function(v,E){for(;!v.eol();){if(v.match(y)){E.tokenize=g;break}v.next()}return d}}function a(d){return function(y,v){for(var E;(E=y.next())!=null;){if(E=="<")return v.tokenize=a(d+1),v.tokenize(y,v);if(E==">")if(d==1){v.tokenize=g;break}else return v.tokenize=a(d-1),v.tokenize(y,v)}return"meta"}}function r(d,y,v){this.prev=d.context,this.tagName=y,this.indent=d.indented,this.startOfLine=v,(z.doNotIndent.hasOwnProperty(y)||d.context&&d.context.noIndent)&&(this.noIndent=!0)}function t(d){d.context&&(d.context=d.context.prev)}function c(d,y){for(var v;;){if(!d.context)return;if(v=d.context.tagName,!z.contextGrabbers.hasOwnProperty(v)||!z.contextGrabbers[v].hasOwnProperty(y))return;t(d)}}function f(d,y,v){return d=="openTag"?(v.tagStart=y.column(),S):d=="closeTag"?C:f}function S(d,y,v){return d=="word"?(v.tagName=y.current(),m="tag",R):z.allowMissingTagName&&d=="endTag"?(m="tag bracket",R(d,y,v)):(m="error",S)}function C(d,y,v){if(d=="word"){var E=y.current();return v.context&&v.context.tagName!=E&&z.implicitlyClosed.hasOwnProperty(v.context.tagName)&&t(v),v.context&&v.context.tagName==E||z.matchClosing===!1?(m="tag",T):(m="tag error",O)}else return z.allowMissingTagName&&d=="endTag"?(m="tag bracket",T(d,y,v)):(m="error",O)}function T(d,y,v){return d!="endTag"?(m="error",T):(t(v),f)}function O(d,y,v){return m="error",T(d,y,v)}function R(d,y,v){if(d=="word")return m="attribute",b;if(d=="endTag"||d=="selfcloseTag"){var E=v.tagName,M=v.tagStart;return v.tagName=v.tagStart=null,d=="selfcloseTag"||z.autoSelfClosers.hasOwnProperty(E)?c(v,E):(c(v,E),v.context=new r(v,E,M==v.indented)),f}return m="error",R}function b(d,y,v){return d=="equals"?_:(z.allowMissing||(m="error"),R(d,y,v))}function _(d,y,v){return d=="string"?u:d=="word"&&z.allowUnquoted?(m="string",R):(m="error",R(d,y,v))}function u(d,y,v){return d=="string"?u:R(d,y,v)}return{startState:function(d){var y={tokenize:g,state:f,indented:d||0,tagName:null,tagStart:null,context:null};return d!=null&&(y.baseIndent=d),y},token:function(d,y){if(!y.tagName&&d.sol()&&(y.indented=d.indentation()),d.eatSpace())return null;D=null;var v=y.tokenize(d,y);return(v||D)&&v!="comment"&&(m=null,y.state=y.state(D||v,d,y),m&&(v=m=="error"?v+" error":m)),v},indent:function(d,y,v){var E=d.context;if(d.tokenize.isInAttribute)return d.tagStart==d.indented?d.stringStartCol+1:d.indented+I;if(E&&E.noIndent)return ee.Pass;if(d.tokenize!=h&&d.tokenize!=g)return v?v.match(/^(\s*)/)[0].length:0;if(d.tagName)return z.multilineTagIndentPastTag!==!1?d.tagStart+d.tagName.length+2:d.tagStart+I*(z.multilineTagIndentFactor||1);if(z.alignCDATA&&/<!\[CDATA\[/.test(y))return 0;var M=y&&/^<(\/)?([\w_:\.-]*)/.exec(y);if(M&&M[1])for(;E;)if(E.tagName==M[2]){E=E.prev;break}else if(z.implicitlyClosed.hasOwnProperty(E.tagName))E=E.prev;else break;else if(M)for(;E;){var N=z.contextGrabbers[E.tagName];if(N&&N.hasOwnProperty(M[2]))E=E.prev;else break}for(;E&&E.prev&&!E.startOfLine;)E=E.prev;return E?E.indent+I:d.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:z.htmlMode?"html":"xml",helperType:z.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 y=[],v=d.context;v;v=v.prev)v.tagName&&y.push(v.tagName);return y.reverse()}}}),ee.defineMIME("text/xml","xml"),ee.defineMIME("application/xml","xml"),ee.mimeModes.hasOwnProperty("text/html")||ee.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"2aBv":function(Rt,Ze,K){"use strict";var ee=K("2qtc"),$=K("kLXV"),k=K("0Owb"),Q=K("14J3"),B=K("BMrR"),I=K("jCWc"),z=K("kPKH"),G=K("+L6B"),L=K("2/Rp"),D=K("oBTY"),m=K("tJVT"),g=K("cDcd"),h=K.n(g),o=K("ngQI"),l=K("Ty5D"),a=K("YIbm"),r=K.n(a),t=function(f){var S=f.visible,C=f.onOk,T=f.onCancel,O=f.data,R=Object(g.useState)([]),b=Object(m.a)(R,2),_=b[0],u=b[1],d=Object(g.useState)(!1),y=Object(m.a)(d,2),v=y[0],E=y[1],M=Object(l.i)();Object(g.useEffect)(function(){if(!S){u([]),E(!1);return}u(Object(D.a)(O)||[])},[S]);var N=function(){E(!0),C(_,function(){E(!1)})},j=function(){T()},H=function(U,V,q){var ie=Array.from(U),se=ie.splice(V,1),ve=Object(m.a)(se,1),Te=ve[0];return ie.splice(q,0,Te),ie},P=function(U,V){if(!U.destination)return;var q=H(V,U.source.index,U.destination.index);u(q)};return h.a.createElement($.a,{title:"\u9898\u578B\u6392\u5E8F",visible:S,centered:!0,onCancel:j,footer:h.a.createElement("div",null,h.a.createElement("span",{style:{float:"left",color:"#999",paddingTop:5}},"\u63D0\u793A:\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u4E0A\u4E0B\u62D6\u52A8\u6392\u5E8F"),h.a.createElement(L.a,{onClick:j},"\u53D6\u6D88"),h.a.createElement(L.a,{type:"primary",loading:v,onClick:N},"\u786E\u8BA4")),width:"680px"},h.a.createElement("div",{className:r.a.content},h.a.createElement(B.a,null,h.a.createElement(z.a,{span:12},"\u5E8F\u53F7"),h.a.createElement(z.a,{span:12},"\u9898\u578B\u540D\u79F0")),h.a.createElement(o.a,{onDragEnd:function(U){return P(U,_)}},h.a.createElement(o.c,{droppableId:"droppable"},function(x,U){return h.a.createElement("div",Object(k.a)({ref:x.innerRef},x.droppableProps,{style:{width:"100%"}}),_.map(function(V,q){return h.a.createElement(o.b,{key:q,draggableId:q.toString(),index:q},function(ie,se){return h.a.createElement("aside",Object(k.a)({ref:ie.innerRef},ie.draggableProps,ie.dragHandleProps),h.a.createElement("div",null,h.a.createElement(B.a,{style:{backgroundColor:q%2===0?"#f5f5f5":"#fff"}},h.a.createElement(z.a,{span:12},q+1),h.a.createElement(z.a,{span:12},V))))})}))}))))};Ze.a=t},"55Ip":function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return c});var ee=K("Ty5D"),$=K("dI71"),k=K("cDcd"),Q=K.n(k),B=K("YS25"),I=K("17x9"),z=K.n(I),G=K("wx14"),L=K("zLVn"),D=K("9R94"),m=function(_){Object($.a)(u,_);function u(){for(var y,v=arguments.length,E=new Array(v),M=0;M<v;M++)E[M]=arguments[M];return y=_.call.apply(_,[this].concat(E))||this,y.history=Object(B.a)(y.props),y}var d=u.prototype;return d.render=function(){return Q.a.createElement(ee.c,{history:this.history,children:this.props.children})},u}(Q.a.Component),g=function(_){Object($.a)(u,_);function u(){for(var y,v=arguments.length,E=new Array(v),M=0;M<v;M++)E[M]=arguments[M];return y=_.call.apply(_,[this].concat(E))||this,y.history=Object(B.b)(y.props),y}var d=u.prototype;return d.render=function(){return Q.a.createElement(ee.c,{history:this.history,children:this.props.children})},u}(Q.a.Component),h=function(u,d){return typeof u=="function"?u(d):u},o=function(u,d){return typeof u=="string"?Object(B.c)(u,null,null,d):u},l=function(u){return u},a=Q.a.forwardRef;typeof a=="undefined"&&(a=l);function r(_){return!!(_.metaKey||_.altKey||_.ctrlKey||_.shiftKey)}var t=a(function(_,u){var d=_.innerRef,y=_.navigate,v=_.onClick,E=Object(L.a)(_,["innerRef","navigate","onClick"]),M=E.target,N=Object(G.a)({},E,{onClick:function(H){try{v&&v(H)}catch(P){throw H.preventDefault(),P}!H.defaultPrevented&&H.button===0&&(!M||M==="_self")&&!r(H)&&(H.preventDefault(),y())}});return l!==a?N.ref=u||d:N.ref=d,Q.a.createElement("a",N)}),c=a(function(_,u){var d=_.component,y=d===void 0?t:d,v=_.replace,E=_.to,M=_.innerRef,N=Object(L.a)(_,["component","replace","to","innerRef"]);return Q.a.createElement(ee.e.Consumer,null,function(j){j||Object(D.a)(!1);var H=j.history,P=o(h(E,j.location),j.location),x=P?H.createHref(P):"",U=Object(G.a)({},N,{href:x,navigate:function(){var q=h(E,j.location),ie=v?H.replace:H.push;ie(q)}});return l!==a?U.ref=u||M:U.innerRef=M,Q.a.createElement(y,U)})});if(!1)var f,S;var C=function(u){return u},T=Q.a.forwardRef;typeof T=="undefined"&&(T=C);function O(){for(var _=arguments.length,u=new Array(_),d=0;d<_;d++)u[d]=arguments[d];return u.filter(function(y){return y}).join(" ")}var R=T(function(_,u){var d=_["aria-current"],y=d===void 0?"page":d,v=_.activeClassName,E=v===void 0?"active":v,M=_.activeStyle,N=_.className,j=_.exact,H=_.isActive,P=_.location,x=_.sensitive,U=_.strict,V=_.style,q=_.to,ie=_.innerRef,se=Object(L.a)(_,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return Q.a.createElement(ee.e.Consumer,null,function(ve){ve||Object(D.a)(!1);var Te=P||ve.location,fe=o(h(q,Te),Te),_e=fe.pathname,ue=_e&&_e.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),xe=ue?Object(ee.f)(Te.pathname,{path:ue,exact:j,sensitive:x,strict:U}):null,Y=!!(H?H(xe,Te):xe),oe=Y?O(N,E):N,ce=Y?Object(G.a)({},V,{},M):V,Re=Object(G.a)({"aria-current":Y&&y||null,className:oe,style:ce,to:fe},se);return C!==T?Re.ref=u||ie:Re.innerRef=ie,Q.a.createElement(c,Re)})});if(!1)var b},"5VLF":function(Rt,Ze,K){"use strict";var ee,$;function k(Q,B,I){var z=function(G,L){return Q.js_beautify(G,L)};return z.js=Q.js_beautify,z.css=B.css_beautify,z.html=I.html_beautify,z.js_beautify=Q.js_beautify,z.css_beautify=B.css_beautify,z.html_beautify=I.html_beautify,z}!(ee=[K("6UM0"),K("TXwP"),K("psGv")],$=function(Q,B,I){return k(Q,B,I)}.apply(Ze,ee),$!==void 0&&(Rt.exports=$))},"6+eU":function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return T});var ee=K("wx14"),$=K("rePB"),k=K("VTBJ"),Q=K("1OyB"),B=K("vuIU"),I=K("Ji7U"),z=K("LK+K"),G=K("cDcd"),L=K.n(G),D=K("TSYQ"),m=K.n(D),g=function(R){var b,_="".concat(R.rootPrefixCls,"-item"),u=m()(_,"".concat(_,"-").concat(R.page),(b={},Object($.a)(b,"".concat(_,"-active"),R.active),Object($.a)(b,R.className,!!R.className),Object($.a)(b,"".concat(_,"-disabled"),!R.page),b)),d=function(){R.onClick(R.page)},y=function(E){R.onKeyPress(E,R.onClick,R.page)};return L.a.createElement("li",{title:R.showTitle?R.page:null,className:u,onClick:d,onKeyPress:y,tabIndex:"0"},R.itemRender(R.page,"page",L.a.createElement("a",{rel:"nofollow"},R.page)))},h=g,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(I.a)(b,O);var R=Object(z.a)(b);function b(){var _;Object(Q.a)(this,b);for(var u=arguments.length,d=new Array(u),y=0;y<u;y++)d[y]=arguments[y];return _=R.call.apply(R,[this].concat(d)),_.state={goInputText:""},_.buildOptionText=function(v){return"".concat(v," ").concat(_.props.locale.items_per_page)},_.changeSize=function(v){_.props.changeSize(Number(v))},_.handleChange=function(v){_.setState({goInputText:v.target.value})},_.handleBlur=function(v){var E=_.props,M=E.goButton,N=E.quickGo,j=E.rootPrefixCls,H=_.state.goInputText;if(M||H==="")return;if(v.relatedTarget&&(v.relatedTarget.className.indexOf("".concat(j,"-prev"))>=0||v.relatedTarget.className.indexOf("".concat(j,"-next"))>=0))return;_.setState({goInputText:""}),N(_.getValidValue())},_.go=function(v){var E=_.state.goInputText;if(E==="")return;(v.keyCode===o.ENTER||v.type==="click")&&(_.setState({goInputText:""}),_.props.quickGo(_.getValidValue()))},_}return Object(B.a)(b,[{key:"getValidValue",value:function(){var u=this.state,d=u.goInputText,y=u.current;return!d||isNaN(d)?y:Number(d)}},{key:"getPageSizeOptions",value:function(){var u=this.props,d=u.pageSize,y=u.pageSizeOptions;return y.some(function(v){return v.toString()===d.toString()})?y:y.concat([d.toString()]).sort(function(v,E){var M=isNaN(Number(v))?0:Number(v),N=isNaN(Number(E))?0:Number(E);return M-N})}},{key:"render",value:function(){var u=this,d=this.props,y=d.pageSize,v=d.locale,E=d.rootPrefixCls,M=d.changeSize,N=d.quickGo,j=d.goButton,H=d.selectComponentClass,P=d.buildOptionText,x=d.selectPrefixCls,U=d.disabled,V=this.state.goInputText,q="".concat(E,"-options"),ie=H,se=null,ve=null,Te=null;if(!M&&!N)return null;var fe=this.getPageSizeOptions();if(M&&ie){var _e=fe.map(function(ue,xe){return L.a.createElement(ie.Option,{key:xe,value:ue.toString()},(P||u.buildOptionText)(ue))});se=L.a.createElement(ie,{disabled:U,prefixCls:x,showSearch:!1,className:"".concat(q,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(y||fe[0]).toString(),onChange:this.changeSize,getPopupContainer:function(xe){return xe.parentNode}},_e)}return N&&(j&&(Te=typeof j=="boolean"?L.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:U,className:"".concat(q,"-quick-jumper-button")},v.jump_to_confirm):L.a.createElement("span",{onClick:this.go,onKeyUp:this.go},j)),ve=L.a.createElement("div",{className:"".concat(q,"-quick-jumper")},v.jump_to,L.a.createElement("input",{disabled:U,type:"text",value:V,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),v.page,Te)),L.a.createElement("li",{className:"".concat(q)},se,ve)}}]),b}(L.a.Component);l.defaultProps={pageSizeOptions:["10","20","50","100"]};var a=l,r=K("N2Kk");function t(){}function c(O){return typeof O=="number"&&isFinite(O)&&Math.floor(O)===O}function f(O,R,b){return b}function S(O,R,b){var _=typeof O=="undefined"?R.pageSize:O;return Math.floor((b.total-1)/_)+1}var C=function(O){Object(I.a)(b,O);var R=Object(z.a)(b);function b(_){var u;Object(Q.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(S(void 0,u.state,u.props),u.state.current+(u.props.showLessItems?3:5))},u.getItemIcon=function(M,N){var j=u.props.prefixCls,H=M||L.a.createElement("button",{type:"button","aria-label":N,className:"".concat(j,"-item-link")});return typeof M=="function"&&(H=L.a.createElement(M,Object(k.a)({},u.props))),H},u.savePaginationNode=function(M){u.paginationNode=M},u.isValid=function(M){return c(M)&&M!==u.state.current},u.shouldDisplayQuickJumper=function(){var M=u.props,N=M.showQuickJumper,j=M.pageSize,H=M.total;return H<=j?!1:N},u.handleKeyDown=function(M){(M.keyCode===o.ARROW_UP||M.keyCode===o.ARROW_DOWN)&&M.preventDefault()},u.handleKeyUp=function(M){var N=u.getValidValue(M),j=u.state.currentInputValue;N!==j&&u.setState({currentInputValue:N}),M.keyCode===o.ENTER?u.handleChange(N):M.keyCode===o.ARROW_UP?u.handleChange(N-1):M.keyCode===o.ARROW_DOWN&&u.handleChange(N+1)},u.changePageSize=function(M){var N=u.state.current,j=S(M,u.state,u.props);N=N>j?j:N,j===0&&(N=u.state.current),typeof M=="number"&&("pageSize"in u.props||u.setState({pageSize:M}),"current"in u.props||u.setState({current:N,currentInputValue:N})),u.props.onShowSizeChange(N,M),"onChange"in u.props&&u.props.onChange&&u.props.onChange(N,M)},u.handleChange=function(M){var N=u.props.disabled,j=M;if(u.isValid(j)&&!N){var H=S(void 0,u.state,u.props);j>H?j=H:j<1&&(j=1),"current"in u.props||u.setState({current:j,currentInputValue:j});var P=u.state.pageSize;return u.props.onChange(j,P),j}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<S(void 0,u.state,u.props)},u.runIfEnter=function(M,N){if(M.key==="Enter"||M.charCode===13){for(var j=arguments.length,H=new Array(j>2?j-2:0),P=2;P<j;P++)H[P-2]=arguments[P];N.apply(void 0,H)}},u.runIfEnterPrev=function(M){u.runIfEnter(M,u.prev)},u.runIfEnterNext=function(M){u.runIfEnter(M,u.next)},u.runIfEnterJumpPrev=function(M){u.runIfEnter(M,u.jumpPrev)},u.runIfEnterJumpNext=function(M){u.runIfEnter(M,u.jumpNext)},u.handleGoTO=function(M){(M.keyCode===o.ENTER||M.type==="click")&&u.handleChange(u.state.currentInputValue)};var d=_.onChange!==t,y="current"in _;y&&!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 v=_.defaultCurrent;"current"in _&&(v=_.current);var E=_.defaultPageSize;return"pageSize"in _&&(E=_.pageSize),v=Math.min(v,S(E,void 0,_)),u.state={current:v,currentInputValue:v,pageSize:E},u}return Object(B.a)(b,[{key:"componentDidUpdate",value:function(u,d){var y=this.props.prefixCls;if(d.current!==this.state.current&&this.paginationNode){var v=this.paginationNode.querySelector(".".concat(y,"-item-").concat(d.current));v&&document.activeElement===v&&v.blur()}}},{key:"getValidValue",value:function(u){var d=u.target.value,y=S(void 0,this.state,this.props),v=this.state.currentInputValue,E;return d===""?E=d:isNaN(Number(d))?E=v:d>=y?E=y:E=Number(d),E}},{key:"getShowSizeChanger",value:function(){var u=this.props,d=u.showSizeChanger,y=u.total,v=u.totalBoundaryShowSizeChanger;return typeof d!="undefined"?d:y>v}},{key:"renderPrev",value:function(u){var d=this.props,y=d.prevIcon,v=d.itemRender,E=v(u,"prev",this.getItemIcon(y,"prev page")),M=!this.hasPrev();return Object(G.isValidElement)(E)?Object(G.cloneElement)(E,{disabled:M}):E}},{key:"renderNext",value:function(u){var d=this.props,y=d.nextIcon,v=d.itemRender,E=v(u,"next",this.getItemIcon(y,"next page")),M=!this.hasNext();return Object(G.isValidElement)(E)?Object(G.cloneElement)(E,{disabled:M}):E}},{key:"render",value:function(){var u=this,d=this.props,y=d.prefixCls,v=d.className,E=d.style,M=d.disabled,N=d.hideOnSinglePage,j=d.total,H=d.locale,P=d.showQuickJumper,x=d.showLessItems,U=d.showTitle,V=d.showTotal,q=d.simple,ie=d.itemRender,se=d.showPrevNextJumpers,ve=d.jumpPrevIcon,Te=d.jumpNextIcon,fe=d.selectComponentClass,_e=d.selectPrefixCls,ue=d.pageSizeOptions,xe=this.state,Y=xe.current,oe=xe.pageSize,ce=xe.currentInputValue;if(N===!0&&j<=oe)return null;var Re=S(void 0,this.state,this.props),Ge=[],Ne=null,Je=null,rt=null,_t=null,ft=null,ut=P&&P.goButton,qe=x?1:2,Ct=Y-1>0?Y-1:0,kt=Y+1<Re?Y+1:Re,Kt=Object.keys(this.props).reduce(function(le,he){return(he.substr(0,5)==="data-"||he.substr(0,5)==="aria-"||he==="role")&&(le[he]=u.props[he]),le},{});if(q)return ut&&(typeof ut=="boolean"?ft=L.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},H.jump_to_confirm):ft=L.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},ut),ft=L.a.createElement("li",{title:U?"".concat(H.jump_to).concat(Y,"/").concat(Re):null,className:"".concat(y,"-simple-pager")},ft)),L.a.createElement("ul",Object(ee.a)({className:m()(y,"".concat(y,"-simple"),Object($.a)({},"".concat(y,"-disabled"),M),v),style:E,ref:this.savePaginationNode},Kt),L.a.createElement("li",{title:U?H.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:m()("".concat(y,"-prev"),Object($.a)({},"".concat(y,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Ct)),L.a.createElement("li",{title:U?"".concat(Y,"/").concat(Re):null,className:"".concat(y,"-simple-pager")},L.a.createElement("input",{type:"text",value:ce,disabled:M,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),L.a.createElement("span",{className:"".concat(y,"-slash")},"/"),Re),L.a.createElement("li",{title:U?H.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:m()("".concat(y,"-next"),Object($.a)({},"".concat(y,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(kt)),ft);if(Re<=3+qe*2){var zt={locale:H,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:U,itemRender:ie};Re||Ge.push(L.a.createElement(h,Object(ee.a)({},zt,{key:"noPager",page:Re,className:"".concat(y,"-disabled")})));for(var ln=1;ln<=Re;ln+=1){var un=Y===ln;Ge.push(L.a.createElement(h,Object(ee.a)({},zt,{key:ln,page:ln,active:un})))}}else{var We=x?H.prev_3:H.prev_5,je=x?H.next_3:H.next_5;se&&(Ne=L.a.createElement("li",{title:U?We:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:m()("".concat(y,"-jump-prev"),Object($.a)({},"".concat(y,"-jump-prev-custom-icon"),!!ve))},ie(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(ve,"prev page"))),Je=L.a.createElement("li",{title:U?je:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:m()("".concat(y,"-jump-next"),Object($.a)({},"".concat(y,"-jump-next-custom-icon"),!!Te))},ie(this.getJumpNextPage(),"jump-next",this.getItemIcon(Te,"next page")))),_t=L.a.createElement(h,{locale:H,last:!0,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:Re,page:Re,active:!1,showTitle:U,itemRender:ie}),rt=L.a.createElement(h,{locale:H,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:U,itemRender:ie});var ht=Math.max(1,Y-qe),ct=Math.min(Y+qe,Re);Y-1<=qe&&(ct=1+qe*2),Re-Y<=qe&&(ht=Re-qe*2);for(var He=ht;He<=ct;He+=1){var lt=Y===He;Ge.push(L.a.createElement(h,{locale:H,rootPrefixCls:y,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:He,page:He,active:lt,showTitle:U,itemRender:ie}))}Y-1>=qe*2&&Y!==1+2&&(Ge[0]=Object(G.cloneElement)(Ge[0],{className:"".concat(y,"-item-after-jump-prev")}),Ge.unshift(Ne)),Re-Y>=qe*2&&Y!==Re-2&&(Ge[Ge.length-1]=Object(G.cloneElement)(Ge[Ge.length-1],{className:"".concat(y,"-item-before-jump-next")}),Ge.push(Je)),ht!==1&&Ge.unshift(rt),ct!==Re&&Ge.push(_t)}var Pe=null;V&&(Pe=L.a.createElement("li",{className:"".concat(y,"-total-text")},V(j,[j===0?0:(Y-1)*oe+1,Y*oe>j?j:Y*oe])));var Oe=!this.hasPrev()||!Re,Ce=!this.hasNext()||!Re;return L.a.createElement("ul",Object(ee.a)({className:m()(y,v,Object($.a)({},"".concat(y,"-disabled"),M)),style:E,unselectable:"unselectable",ref:this.savePaginationNode},Kt),Pe,L.a.createElement("li",{title:U?H.prev_page:null,onClick:this.prev,tabIndex:Oe?null:0,onKeyPress:this.runIfEnterPrev,className:m()("".concat(y,"-prev"),Object($.a)({},"".concat(y,"-disabled"),Oe)),"aria-disabled":Oe},this.renderPrev(Ct)),Ge,L.a.createElement("li",{title:U?H.next_page:null,onClick:this.next,tabIndex:Ce?null:0,onKeyPress:this.runIfEnterNext,className:m()("".concat(y,"-next"),Object($.a)({},"".concat(y,"-disabled"),Ce)),"aria-disabled":Ce},this.renderNext(kt)),L.a.createElement(a,{disabled:M,locale:H,rootPrefixCls:y,selectComponentClass:fe,selectPrefixCls:_e,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:Y,pageSize:oe,pageSizeOptions:ue,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:ut}))}}],[{key:"getDerivedStateFromProps",value:function(u,d){var y={};if("current"in u&&(y.current=u.current,u.current!==d.current&&(y.currentInputValue=y.current)),"pageSize"in u&&u.pageSize!==d.pageSize){var v=d.current,E=S(u.pageSize,d,u);v=v>E?E:v,"current"in u||(y.current=v,y.currentInputValue=v),y.pageSize=u.pageSize}return y}}]),b}(L.a.Component);C.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:r.a,style:{},itemRender:f,totalBoundaryShowSizeChanger:50};var T=C},"69hG":function(Rt,Ze,K){Rt.exports={customModal:"customModal___1AnAw",content:"content___1zYYV",upload:"upload___1W2G-"}},"6RRn":function(Rt,Ze,K){"use strict";var ee=K("wCXF"),$=K("n6Qo");K.d(Ze,"b",function(){return $.a});var k=K("IBYe"),Q=K("6eGT"),B=K("hW8S");K.d(Ze,"a",function(){return B.a}),Ze.c=ee.b},"6UM0":function(Rt,Ze,K){var ee,$;(function(){var k;(function(){"use strict";var B=[function(L,D,m){var g=m(1).Beautifier,h=m(5).Options;function o(l,a){var r=new g(l,a);return r.beautify()}L.exports=o,L.exports.defaultOptions=function(){return new h}},function(L,D,m){var g=m(2).Output,h=m(3).Token,o=m(4),l=m(5).Options,a=m(7).Tokenizer,r=m(7).line_starters,t=m(7).positionable_operators,c=m(7).TOKEN;function f(x,U){return U.indexOf(x)!==-1}function S(x){return x.replace(/^\s+/g,"")}function C(x){for(var U={},V=0;V<x.length;V++)U[x[V].replace(/-/g,"_")]=x[V];return U}function T(x,U){return x&&x.type===c.RESERVED&&x.text===U}function O(x,U){return x&&x.type===c.RESERVED&&f(x.text,U)}var R=["case","return","do","if","throw","else","await","break","continue","async"],b=["before-newline","after-newline","preserve-newline"],_=C(b),u=[_.before_newline,_.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function y(x,U){if(U.multiline_frame||U.mode===d.ForInitializer||U.mode===d.Conditional)return;x.remove_indent(U.start_line_index)}function v(x){x=x.replace(o.allLineBreaks,`
`);for(var U=[],V=x.indexOf(`
`);V!==-1;)U.push(x.substring(0,V)),x=x.substring(V+1),V=x.indexOf(`
`);return x.length&&U.push(x),U}function E(x){return x===d.ArrayLiteral}function M(x){return f(x,[d.Expression,d.ForInitializer,d.Conditional])}function N(x,U){for(var V=0;V<x.length;V++){var q=x[V].trim();if(q.charAt(0)!==U)return!1}return!0}function j(x,U){for(var V=0,q=x.length,ie;V<q;V++)if(ie=x[V],ie&&ie.indexOf(U)!==0)return!1;return!0}function H(x,U){U=U||{},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(U)}H.prototype.create_flags=function(x,U){var V=0;x&&(V=x.indentation_level,!this._output.just_added_newline()&&x.line_indent_level>V&&(V=x.line_indent_level));var q={mode:U,parent:x,last_token:x?x.last_token:new h(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:V,alignment:0,line_indent_level:x?x.line_indent_level:V,start_line_index:this._output.get_line_number(),ternary_depth:0};return q},H.prototype._reset=function(x){var U=x.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,U),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var V=new a(x,this._options);return this._tokens=V.tokenize(),x},H.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var x,U=this._reset(this._source_text),V=this._options.eol;this._options.eol==="auto"&&(V=`
`,U&&o.lineBreak.test(U||"")&&(V=U.match(o.lineBreak)[0]));for(var q=this._tokens.next();q;)this.handle_token(q),this._last_last_text=this._flags.last_token.text,this._flags.last_token=q,q=this._tokens.next();return x=this._output.get_code(V),x},H.prototype.handle_token=function(x,U){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,U):x.type===c.COMMENT?this.handle_comment(x,U):x.type===c.DOT?this.handle_dot(x):x.type===c.EOF?this.handle_eof(x):x.type===c.UNKNOWN?this.handle_unknown(x,U):this.handle_unknown(x,U)},H.prototype.handle_whitespace_and_comments=function(x,U){var V=x.newlines,q=this._options.keep_array_indentation&&E(this._flags.mode);if(x.comments_before)for(var ie=x.comments_before.next();ie;)this.handle_whitespace_and_comments(ie,U),this.handle_token(ie,U),ie=x.comments_before.next();if(q)for(var se=0;se<V;se+=1)this.print_newline(se>0,U);else if(this._options.max_preserve_newlines&&V>this._options.max_preserve_newlines&&(V=this._options.max_preserve_newlines),this._options.preserve_newlines&&V>1){this.print_newline(!1,U);for(var ve=1;ve<V;ve+=1)this.print_newline(!0,U)}};var P=["async","break","continue","return","throw","yield"];H.prototype.allow_wrap_or_preserved_newline=function(x,U){if(U=U===void 0?!1:U,this._output.just_added_newline())return;var V=this._options.preserve_newlines&&x.newlines||U,q=f(this._flags.last_token.text,t)||f(x.text,t);if(q){var ie=f(this._flags.last_token.text,t)&&f(this._options.operator_position,u)||f(x.text,t);V=V&&ie}if(V)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(O(this._flags.last_token,P))return;this._output.set_wrap_point()}},H.prototype.print_newline=function(x,U){if(!U&&(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 V=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&T(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(x)&&(this._flags.multiline_frame=!0)},H.prototype.print_token_line_indentation=function(x){this._output.just_added_newline()&&(this._options.keep_array_indentation&&x.newlines&&(x.text==="["||E(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))},H.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 U=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(U),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)},H.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},H.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.set_mode=function(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)},H.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===d.Statement&&y(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},H.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"]))},H.prototype.start_of_statement=function(x){var U=!1;return U=U||O(this._flags.last_token,["var","let","const"])&&x.type===c.WORD,U=U||T(this._flags.last_token,"do"),U=U||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&O(this._flags.last_token,P)&&!x.newlines,U=U||T(this._flags.last_token,"else")&&!(T(x,"if")&&!x.comments_before),U=U||this._flags.last_token.type===c.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),U=U||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,U=U||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||O(this._flags.last_token,["get","set"])),U?(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},H.prototype.handle_start_expr=function(x){this.start_of_statement(x)||this.handle_whitespace_and_comments(x);var U=d.Expression;if(x.text==="["){if(this._flags.last_token.type===c.WORD||this._flags.last_token.text===")"){O(this._flags.last_token,r)&&(this._output.space_before_token=!0),this.print_token(x),this.set_mode(U),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}U=d.ArrayLiteral,E(this._flags.mode)&&((this._flags.last_token.text==="["||this._flags.last_token.text===","&&(this._last_last_text==="]"||this._last_last_text==="}"))&&(this._options.keep_array_indentation||this.print_newline())),f(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,U=d.ForInitializer):f(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,U=d.Conditional):f(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:(f(this._flags.last_token.text,r)||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 V=this._tokens.peek(-3);if(this._options.space_after_named_function&&V){var q=this._tokens.peek(-4);O(V,["async","function"])||V.text==="*"&&O(q,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(V.text==="{"||V.text===","||V.text==="*"&&(q.text==="{"||q.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==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&f(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(U),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},H.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==="]"&&E(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(),y(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)},H.prototype.handle_start_block=function(x){this.handle_whitespace_and_comments(x);var U=this._tokens.peek(),V=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):V&&(f(V.text,[":",","])&&f(U.type,[c.STRING,c.WORD,c.RESERVED])||f(U.text,["get","set","..."])&&f(V.type,[c.WORD,c.RESERVED]))?f(this._last_last_text,["class","interface"])&&!f(V.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):f(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 q=!U.comments_before&&U.text==="}",ie=q&&this._flags.last_word==="function"&&this._flags.last_token.type===c.END_EXPR;if(this._options.brace_preserve_inline){var se=0,ve=null;this._flags.inline_frame=!0;do if(se+=1,ve=this._tokens.peek(se-1),ve.newlines){this._flags.inline_frame=!1;break}while(ve.type!==c.EOF&&!(ve.type===c.END_BLOCK&&ve.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&&(ie||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):(E(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(),!q&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},H.prototype.handle_end_block=function(x){for(this.handle_whitespace_and_comments(x);this._flags.mode===d.Statement;)this.restore_mode();var U=this._flags.last_token.type===c.START_BLOCK;this._flags.inline_frame&&!U?this._output.space_before_token=!0:this._options.brace_style==="expand"?U||this.print_newline():U||(E(this._flags.mode)&&this._options.keep_array_indentation?(this._options.keep_array_indentation=!1,this.print_newline(),this._options.keep_array_indentation=!0):this.print_newline()),this.restore_mode(),this.print_token(x)},H.prototype.handle_word=function(x){if(x.type===c.RESERVED){if(f(x.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)x.type=c.WORD;else if(x.text==="import"&&f(this._tokens.peek().text,["(","."]))x.type=c.WORD;else if(f(x.text,["as","from"])&&!this._flags.import_block)x.type=c.WORD;else if(this._flags.mode===d.ObjectLiteral){var U=this._tokens.peek();U.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&&!M(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(T(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&&T(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)),T(x,"function")){(f(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(f(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,P)?this._output.space_before_token=!0:T(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&&(M(this._flags.mode)||E(this._flags.mode))||this.print_newline(),this.print_token(x),this._flags.last_word=x.text;return}var V="NONE";if(this._flags.last_token.type===c.END_BLOCK?this._previous_flags.inline_frame?V="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?V="NEWLINE":(V="SPACE",this._output.space_before_token=!0):V="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&this._flags.mode===d.BlockStatement?V="NEWLINE":this._flags.last_token.type===c.SEMICOLON&&M(this._flags.mode)?V="SPACE":this._flags.last_token.type===c.STRING?V="NEWLINE":this._flags.last_token.type===c.RESERVED||this._flags.last_token.type===c.WORD||this._flags.last_token.text==="*"&&(f(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&f(this._last_last_text,["{",","]))?V="SPACE":this._flags.last_token.type===c.START_BLOCK?this._flags.inline_frame?V="SPACE":V="NEWLINE":this._flags.last_token.type===c.END_EXPR&&(this._output.space_before_token=!0,V="NEWLINE"),O(x,r)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?V="SPACE":V="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 q=this._output.current_line;q.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else V==="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!==":"&&(T(x,"if")&&T(x.previous,"else")?this._output.space_before_token=!0:this.print_newline()):O(x,r)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&E(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():V==="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&&T(x,"from")&&(this._flags.import_block=!1))},H.prototype.handle_semicolon=function(x){this.start_of_statement(x)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(x);for(var U=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&T(U,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(x)},H.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)},H.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},H.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?(M(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)},H.prototype.handle_operator=function(x){var U=x.text==="*"&&(O(this._flags.last_token,["function","yield"])||f(this._flags.last_token.type,[c.START_BLOCK,c.COMMA,c.END_BLOCK,c.SEMICOLON])),V=f(x.text,["-","+"])&&(f(this._flags.last_token.type,[c.START_BLOCK,c.START_EXPR,c.EQUALS,c.OPERATOR])||f(this._flags.last_token.text,r)||this._flags.last_token.text===",");if(!this.start_of_statement(x)){var q=!U;this.handle_whitespace_and_comments(x,q)}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&&f(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 ie=!0,se=!0,ve=!1;if(x.text===":"?this._flags.ternary_depth===0?ie=!1:(this._flags.ternary_depth-=1,ve=!0):x.text==="?"&&(this._flags.ternary_depth+=1),!V&&!U&&this._options.preserve_newlines&&f(x.text,t)){var Te=x.text===":",fe=Te&&ve,_e=Te&&!ve;switch(this._options.operator_position){case _.before_newline:this._output.space_before_token=!_e,this.print_token(x),(!Te||fe)&&this.allow_wrap_or_preserved_newline(x),this._output.space_before_token=!0;return;case _.after_newline:this._output.space_before_token=!0,!Te||fe?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:_e||this.allow_wrap_or_preserved_newline(x),ie=!(this._output.just_added_newline()||_e),this._output.space_before_token=ie,this.print_token(x),this._output.space_before_token=!0;return}}if(U){this.allow_wrap_or_preserved_newline(x),ie=!1;var ue=this._tokens.peek();se=ue&&f(ue.type,[c.WORD,c.RESERVED])}else if(x.text==="...")this.allow_wrap_or_preserved_newline(x),ie=this._flags.last_token.type===c.START_BLOCK,se=!1;else if(f(x.text,["--","++","!","~"])||V){if((this._flags.last_token.type===c.COMMA||this._flags.last_token.type===c.START_EXPR)&&this.allow_wrap_or_preserved_newline(x),ie=!1,se=!1,x.newlines&&(x.text==="--"||x.text==="++"||x.text==="~")){var xe=O(this._flags.last_token,R)&&x.newlines;xe&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(xe,!0)}this._flags.last_token.text===";"&&M(this._flags.mode)&&(ie=!0),this._flags.last_token.type===c.RESERVED?ie=!0:this._flags.last_token.type===c.END_EXPR?ie=!(this._flags.last_token.text==="]"&&(x.text==="--"||x.text==="++")):this._flags.last_token.type===c.OPERATOR&&(ie=f(x.text,["--","-","++","+"])&&f(this._flags.last_token.text,["--","-","++","+"]),f(x.text,["+","-"])&&f(this._flags.last_token.text,["--","++"])&&(se=!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||ie,this.print_token(x),this._output.space_before_token=se},H.prototype.handle_block_comment=function(x,U){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,U),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,U)},H.prototype.print_block_commment=function(x,U){var V=v(x.text),q,ie=!1,se=!1,ve=x.whitespace_before,Te=ve.length;if(this.print_newline(!1,U),this.print_token_line_indentation(x),this._output.add_token(V[0]),this.print_newline(!1,U),V.length>1){for(V=V.slice(1),ie=N(V,"*"),se=j(V,ve),ie&&(this._flags.alignment=1),q=0;q<V.length;q++)ie?(this.print_token_line_indentation(x),this._output.add_token(S(V[q]))):se&&V[q]?(this.print_token_line_indentation(x),this._output.add_token(V[q].substring(Te))):(this._output.current_line.set_indent(-1),this._output.add_token(V[q])),this.print_newline(!1,U);this._flags.alignment=0}},H.prototype.handle_comment=function(x,U){x.newlines?this.print_newline(!1,U):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(x),this.print_newline(!1,U)},H.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)},H.prototype.handle_unknown=function(x,U){this.print_token(x),x.text[x.text.length-1]===`
`&&this.print_newline(!1,U)},H.prototype.handle_eof=function(x){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(x)},L.exports.Beautifier=H},function(L){function D(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var h=new D(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},D.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},D.prototype.has_match=function(h){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(h))return!0;return!1},D.prototype.set_indent=function(h,o){this.is_empty()&&(this.__indent_count=h||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 h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},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(h){this.__items.push(h);var o=h.lastIndexOf(`
`);o!==-1?this.__character_count=h.length-o:this.__character_count+=h.length},D.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},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 h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function m(h,o){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),o=o||"",h.indent_level>0&&(o=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}m.prototype.get_indent_size=function(h,o){var l=this.__base_string_length;return o=o||0,h<0&&(l=0),l+=h*this.__indent_size,l+=o,l},m.prototype.get_indent_string=function(h,o){var l=this.__base_string;return o=o||0,h<0&&(h=0,l=""),o+=h*this.__indent_size,this.__ensure_cache(o),l+=this.__cache[o],l},m.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var h=this.__cache.length,o=0,l="";this.__indent_size&&h>=this.__indent_size&&(o=Math.floor(h/this.__indent_size),h-=o*this.__indent_size,l=new Array(o+1).join(this.__indent_string)),h&&(l+=new Array(h+1).join(" ")),this.__cache.push(l)};function g(h,o){this.__indent_cache=new m(h,o),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(h,o){return this.__indent_cache.get_indent_string(h,o)},g.prototype.get_indent_size=function(h,o){return this.__indent_cache.get_indent_size(h,o)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(h){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 h!==`
`&&(l=l.replace(/[\n]/g,h)),l},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(h,o){return h=h||0,o=o||0,this.next_line.set_indent(h,o),this.__lines.length>1?(this.current_line.set_indent(h,o),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(h){for(var o=0;o<h.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.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(" "))},g.prototype.remove_indent=function(h){for(var o=this.__lines.length;h<o;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(h,o){for(var l=this.__lines.length-2;l>=0;){var a=this.__lines[l];if(a.is_empty())break;if(a.item(0).indexOf(h)!==0&&a.item(-1)!==o){this.__lines.splice(l+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},L.exports.Output=g},function(L){function D(m,g,h,o){this.type=m,this.text=g,this.comments_before=null,this.newlines=h||0,this.whitespace_before=o||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}L.exports.Token=D},function(L,D){var m="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",h="\\xaa\\xb5\\xba\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\u02c1\\u02c6-\\u02d1\\u02e0-\\u02e4\\u02ec\\u02ee\\u0370-\\u0374\\u0376\\u0377\\u037a-\\u037d\\u0386\\u0388-\\u038a\\u038c\\u038e-\\u03a1\\u03a3-\\u03f5\\u03f7-\\u0481\\u048a-\\u0527\\u0531-\\u0556\\u0559\\u0561-\\u0587\\u05d0-\\u05ea\\u05f0-\\u05f2\\u0620-\\u064a\\u066e\\u066f\\u0671-\\u06d3\\u06d5\\u06e5\\u06e6\\u06ee\\u06ef\\u06fa-\\u06fc\\u06ff\\u0710\\u0712-\\u072f\\u074d-\\u07a5\\u07b1\\u07ca-\\u07ea\\u07f4\\u07f5\\u07fa\\u0800-\\u0815\\u081a\\u0824\\u0828\\u0840-\\u0858\\u08a0\\u08a2-\\u08ac\\u0904-\\u0939\\u093d\\u0950\\u0958-\\u0961\\u0971-\\u0977\\u0979-\\u097f\\u0985-\\u098c\\u098f\\u0990\\u0993-\\u09a8\\u09aa-\\u09b0\\u09b2\\u09b6-\\u09b9\\u09bd\\u09ce\\u09dc\\u09dd\\u09df-\\u09e1\\u09f0\\u09f1\\u0a05-\\u0a0a\\u0a0f\\u0a10\\u0a13-\\u0a28\\u0a2a-\\u0a30\\u0a32\\u0a33\\u0a35\\u0a36\\u0a38\\u0a39\\u0a59-\\u0a5c\\u0a5e\\u0a72-\\u0a74\\u0a85-\\u0a8d\\u0a8f-\\u0a91\\u0a93-\\u0aa8\\u0aaa-\\u0ab0\\u0ab2\\u0ab3\\u0ab5-\\u0ab9\\u0abd\\u0ad0\\u0ae0\\u0ae1\\u0b05-\\u0b0c\\u0b0f\\u0b10\\u0b13-\\u0b28\\u0b2a-\\u0b30\\u0b32\\u0b33\\u0b35-\\u0b39\\u0b3d\\u0b5c\\u0b5d\\u0b5f-\\u0b61\\u0b71\\u0b83\\u0b85-\\u0b8a\\u0b8e-\\u0b90\\u0b92-\\u0b95\\u0b99\\u0b9a\\u0b9c\\u0b9e\\u0b9f\\u0ba3\\u0ba4\\u0ba8-\\u0baa\\u0bae-\\u0bb9\\u0bd0\\u0c05-\\u0c0c\\u0c0e-\\u0c10\\u0c12-\\u0c28\\u0c2a-\\u0c33\\u0c35-\\u0c39\\u0c3d\\u0c58\\u0c59\\u0c60\\u0c61\\u0c85-\\u0c8c\\u0c8e-\\u0c90\\u0c92-\\u0ca8\\u0caa-\\u0cb3\\u0cb5-\\u0cb9\\u0cbd\\u0cde\\u0ce0\\u0ce1\\u0cf1\\u0cf2\\u0d05-\\u0d0c\\u0d0e-\\u0d10\\u0d12-\\u0d3a\\u0d3d\\u0d4e\\u0d60\\u0d61\\u0d7a-\\u0d7f\\u0d85-\\u0d96\\u0d9a-\\u0db1\\u0db3-\\u0dbb\\u0dbd\\u0dc0-\\u0dc6\\u0e01-\\u0e30\\u0e32\\u0e33\\u0e40-\\u0e46\\u0e81\\u0e82\\u0e84\\u0e87\\u0e88\\u0e8a\\u0e8d\\u0e94-\\u0e97\\u0e99-\\u0e9f\\u0ea1-\\u0ea3\\u0ea5\\u0ea7\\u0eaa\\u0eab\\u0ead-\\u0eb0\\u0eb2\\u0eb3\\u0ebd\\u0ec0-\\u0ec4\\u0ec6\\u0edc-\\u0edf\\u0f00\\u0f40-\\u0f47\\u0f49-\\u0f6c\\u0f88-\\u0f8c\\u1000-\\u102a\\u103f\\u1050-\\u1055\\u105a-\\u105d\\u1061\\u1065\\u1066\\u106e-\\u1070\\u1075-\\u1081\\u108e\\u10a0-\\u10c5\\u10c7\\u10cd\\u10d0-\\u10fa\\u10fc-\\u1248\\u124a-\\u124d\\u1250-\\u1256\\u1258\\u125a-\\u125d\\u1260-\\u1288\\u128a-\\u128d\\u1290-\\u12b0\\u12b2-\\u12b5\\u12b8-\\u12be\\u12c0\\u12c2-\\u12c5\\u12c8-\\u12d6\\u12d8-\\u1310\\u1312-\\u1315\\u1318-\\u135a\\u1380-\\u138f\\u13a0-\\u13f4\\u1401-\\u166c\\u166f-\\u167f\\u1681-\\u169a\\u16a0-\\u16ea\\u16ee-\\u16f0\\u1700-\\u170c\\u170e-\\u1711\\u1720-\\u1731\\u1740-\\u1751\\u1760-\\u176c\\u176e-\\u1770\\u1780-\\u17b3\\u17d7\\u17dc\\u1820-\\u1877\\u1880-\\u18a8\\u18aa\\u18b0-\\u18f5\\u1900-\\u191c\\u1950-\\u196d\\u1970-\\u1974\\u1980-\\u19ab\\u19c1-\\u19c7\\u1a00-\\u1a16\\u1a20-\\u1a54\\u1aa7\\u1b05-\\u1b33\\u1b45-\\u1b4b\\u1b83-\\u1ba0\\u1bae\\u1baf\\u1bba-\\u1be5\\u1c00-\\u1c23\\u1c4d-\\u1c4f\\u1c5a-\\u1c7d\\u1ce9-\\u1cec\\u1cee-\\u1cf1\\u1cf5\\u1cf6\\u1d00-\\u1dbf\\u1e00-\\u1f15\\u1f18-\\u1f1d\\u1f20-\\u1f45\\u1f48-\\u1f4d\\u1f50-\\u1f57\\u1f59\\u1f5b\\u1f5d\\u1f5f-\\u1f7d\\u1f80-\\u1fb4\\u1fb6-\\u1fbc\\u1fbe\\u1fc2-\\u1fc4\\u1fc6-\\u1fcc\\u1fd0-\\u1fd3\\u1fd6-\\u1fdb\\u1fe0-\\u1fec\\u1ff2-\\u1ff4\\u1ff6-\\u1ffc\\u2071\\u207f\\u2090-\\u209c\\u2102\\u2107\\u210a-\\u2113\\u2115\\u2119-\\u211d\\u2124\\u2126\\u2128\\u212a-\\u212d\\u212f-\\u2139\\u213c-\\u213f\\u2145-\\u2149\\u214e\\u2160-\\u2188\\u2c00-\\u2c2e\\u2c30-\\u2c5e\\u2c60-\\u2ce4\\u2ceb-\\u2cee\\u2cf2\\u2cf3\\u2d00-\\u2d25\\u2d27\\u2d2d\\u2d30-\\u2d67\\u2d6f\\u2d80-\\u2d96\\u2da0-\\u2da6\\u2da8-\\u2dae\\u2db0-\\u2db6\\u2db8-\\u2dbe\\u2dc0-\\u2dc6\\u2dc8-\\u2dce\\u2dd0-\\u2dd6\\u2dd8-\\u2dde\\u2e2f\\u3005-\\u3007\\u3021-\\u3029\\u3031-\\u3035\\u3038-\\u303c\\u3041-\\u3096\\u309d-\\u309f\\u30a1-\\u30fa\\u30fc-\\u30ff\\u3105-\\u312d\\u3131-\\u318e\\u31a0-\\u31ba\\u31f0-\\u31ff\\u3400-\\u4db5\\u4e00-\\u9fcc\\ua000-\\ua48c\\ua4d0-\\ua4fd\\ua500-\\ua60c\\ua610-\\ua61f\\ua62a\\ua62b\\ua640-\\ua66e\\ua67f-\\ua697\\ua6a0-\\ua6ef\\ua717-\\ua71f\\ua722-\\ua788\\ua78b-\\ua78e\\ua790-\\ua793\\ua7a0-\\ua7aa\\ua7f8-\\ua801\\ua803-\\ua805\\ua807-\\ua80a\\ua80c-\\ua822\\ua840-\\ua873\\ua882-\\ua8b3\\ua8f2-\\ua8f7\\ua8fb\\ua90a-\\ua925\\ua930-\\ua946\\ua960-\\ua97c\\ua984-\\ua9b2\\ua9cf\\uaa00-\\uaa28\\uaa40-\\uaa42\\uaa44-\\uaa4b\\uaa60-\\uaa76\\uaa7a\\uaa80-\\uaaaf\\uaab1\\uaab5\\uaab6\\uaab9-\\uaabd\\uaac0\\uaac2\\uaadb-\\uaadd\\uaae0-\\uaaea\\uaaf2-\\uaaf4\\uab01-\\uab06\\uab09-\\uab0e\\uab11-\\uab16\\uab20-\\uab26\\uab28-\\uab2e\\uabc0-\\uabe2\\uac00-\\ud7a3\\ud7b0-\\ud7c6\\ud7cb-\\ud7fb\\uf900-\\ufa6d\\ufa70-\\ufad9\\ufb00-\\ufb06\\ufb13-\\ufb17\\ufb1d\\ufb1f-\\ufb28\\ufb2a-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40\\ufb41\\ufb43\\ufb44\\ufb46-\\ufbb1\\ufbd3-\\ufd3d\\ufd50-\\ufd8f\\ufd92-\\ufdc7\\ufdf0-\\ufdfb\\ufe70-\\ufe74\\ufe76-\\ufefc\\uff21-\\uff3a\\uff41-\\uff5a\\uff66-\\uffbe\\uffc2-\\uffc7\\uffca-\\uffcf\\uffd2-\\uffd7\\uffda-\\uffdc",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+h+"])",a="(?:\\\\u[0-9a-fA-F]{4}|["+g+h+o+"])*";D.identifier=new RegExp(l+a,"g"),D.identifierStart=new RegExp(l),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+h+o+"])+");var r=/[\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(L,D,m){var g=m(6).Options,h=["before-newline","after-newline","preserve-newline"];function o(l){g.call(this,l,"js");var a=this.raw_options.brace_style||null;a==="expand-strict"?this.raw_options.brace_style="expand":a==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var r=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<r.length;t++)r[t]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=r[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",h),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}o.prototype=new g,L.exports.Options=o},function(L){function D(h,o){this.raw_options=m(h,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(h,o){var l=this.raw_options[h],a=o||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(a=l.concat()):typeof l=="string"&&(a=l.split(/[^a-zA-Z0-9_\/\-]+/)),a},D.prototype._get_boolean=function(h,o){var l=this.raw_options[h],a=l===void 0?!!o:!!l;return a},D.prototype._get_characters=function(h,o){var l=this.raw_options[h],a=o||"";return typeof l=="string"&&(a=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},D.prototype._get_number=function(h,o){var l=this.raw_options[h];o=parseInt(o,10),isNaN(o)&&(o=0);var a=parseInt(l,10);return isNaN(a)&&(a=o),a},D.prototype._get_selection=function(h,o,l){var a=this._get_selection_list(h,o,l);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+o+`
You passed in: '`+this.raw_options[h]+"'");return a[0]},D.prototype._get_selection_list=function(h,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 a=this._get_array(h,l);if(!this._is_valid_selection(a,o))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+o+`
You passed in: '`+this.raw_options[h]+"'");return a},D.prototype._is_valid_selection=function(h,o){return h.length&&o.length&&!h.some(function(l){return o.indexOf(l)===-1})};function m(h,o){var l={};h=g(h);var a;for(a in h)a!==o&&(l[a]=h[a]);if(o&&h[o])for(a in h[o])l[a]=h[o][a];return l}function g(h){var o={},l;for(l in h){var a=l.replace(/-/g,"_");o[a]=h[l]}return o}L.exports.Options=D,L.exports.normalizeOpts=g,L.exports.mergeOpts=m},function(L,D,m){var g=m(8).InputScanner,h=m(9).Tokenizer,o=m(9).TOKEN,l=m(13).Directives,a=m(4),r=m(12).Pattern,t=m(14).TemplatablePattern;function c(N,j){return j.indexOf(N)!==-1}var f={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},S=new l(/\/\*/,/\*\//),C=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,T=/[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"]),y=new RegExp("^(?:"+d.join("|")+")$"),v,E=function(N,j){h.call(this,N,j),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var H=new r(this._input),P=new t(this._input).read_options(this._options);this.__patterns={template:P,identifier:P.starting_with(a.identifier).matching(a.identifierMatch),number:H.matching(C),punct:H.matching(_),comment:H.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:H.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:H.matching(/<!--/),html_comment_end:H.matching(/-->/),include:H.starting_with(/#include/).until_after(a.lineBreak),shebang:H.starting_with(/#!/).until_after(a.lineBreak),xml:H.matching(/[\s\S]*?<(\/?)([-a-zA-Z:0-9_.]+|{[^}]+?}|!\[CDATA\[[^\]]*?\]\]|)(\s*{[^}]+?}|\s+[-a-zA-Z:0-9_.]+|\s+[-a-zA-Z:0-9_.]+\s*=\s*('[^']*'|"[^"]*"|{([^{}]|{[^}]+?})+?}))*\s*(\/?)\s*>/),single_quote:P.until(/['\\\n\r\u2028\u2029]/),double_quote:P.until(/["\\\n\r\u2028\u2029]/),template_text:P.until(/[`\\$]/),template_expression:P.until(/[`}\\]/)}};E.prototype=new h,E.prototype._is_comment=function(N){return N.type===f.COMMENT||N.type===f.BLOCK_COMMENT||N.type===f.UNKNOWN},E.prototype._is_opening=function(N){return N.type===f.START_BLOCK||N.type===f.START_EXPR},E.prototype._is_closing=function(N,j){return(N.type===f.END_BLOCK||N.type===f.END_EXPR)&&j&&(N.text==="]"&&j.text==="["||N.text===")"&&j.text==="("||N.text==="}"&&j.text==="{")},E.prototype._reset=function(){v=!1},E.prototype._get_next_token=function(N,j){var H=null;this._readWhitespace();var P=this._input.peek();return P===null?this._create_token(f.EOF,""):(H=H||this._read_non_javascript(P),H=H||this._read_string(P),H=H||this._read_word(N),H=H||this._read_singles(P),H=H||this._read_comment(P),H=H||this._read_regexp(P,N),H=H||this._read_xml(P,N),H=H||this._read_punctuation(),H=H||this._create_token(f.UNKNOWN,this._input.next()),H)},E.prototype._read_word=function(N){var j;if(j=this.__patterns.identifier.read(),j!=="")return j=j.replace(a.allLineBreaks,`
`),!(N.type===f.DOT||N.type===f.RESERVED&&(N.text==="set"||N.text==="get"))&&y.test(j)?(j==="in"||j==="of")&&(N.type===f.WORD||N.type===f.STRING)?this._create_token(f.OPERATOR,j):this._create_token(f.RESERVED,j):this._create_token(f.WORD,j);if(j=this.__patterns.number.read(),j!=="")return this._create_token(f.WORD,j)},E.prototype._read_singles=function(N){var j=null;return N==="("||N==="["?j=this._create_token(f.START_EXPR,N):N===")"||N==="]"?j=this._create_token(f.END_EXPR,N):N==="{"?j=this._create_token(f.START_BLOCK,N):N==="}"?j=this._create_token(f.END_BLOCK,N):N===";"?j=this._create_token(f.SEMICOLON,N):N==="."&&O.test(this._input.peek(1))?j=this._create_token(f.DOT,N):N===","&&(j=this._create_token(f.COMMA,N)),j&&this._input.next(),j},E.prototype._read_punctuation=function(){var N=this.__patterns.punct.read();if(N!=="")return N==="="?this._create_token(f.EQUALS,N):N==="?."?this._create_token(f.DOT,N):this._create_token(f.OPERATOR,N)},E.prototype._read_non_javascript=function(N){var j="";if(N==="#"){if(this._is_first_token()&&(j=this.__patterns.shebang.read(),j))return this._create_token(f.UNKNOWN,j.trim()+`
`);if(j=this.__patterns.include.read(),j)return this._create_token(f.UNKNOWN,j.trim()+`
`);N=this._input.next();var H="#";if(this._input.hasNext()&&this._input.testChar(T)){do N=this._input.next(),H+=N;while(this._input.hasNext()&&N!=="#"&&N!=="=");return N==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(H+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(H+="{}",this._input.next(),this._input.next())),this._create_token(f.WORD,H)}this._input.back()}else if(N==="<"&&this._is_first_token()){if(j=this.__patterns.html_comment_start.read(),j){for(;this._input.hasNext()&&!this._input.testChar(a.newline);)j+=this._input.next();return v=!0,this._create_token(f.COMMENT,j)}}else if(v&&N==="-"&&(j=this.__patterns.html_comment_end.read(),j))return v=!1,this._create_token(f.COMMENT,j);return null},E.prototype._read_comment=function(N){var j=null;if(N==="/"){var H="";if(this._input.peek(1)==="*"){H=this.__patterns.block_comment.read();var P=S.get_directives(H);P&&P.ignore==="start"&&(H+=S.readIgnored(this._input)),H=H.replace(a.allLineBreaks,`
`),j=this._create_token(f.BLOCK_COMMENT,H),j.directives=P}else this._input.peek(1)==="/"&&(H=this.__patterns.comment.read(),j=this._create_token(f.COMMENT,H))}return j},E.prototype._read_string=function(N){if(N==="`"||N==="'"||N==='"'){var j=this._input.next();return this.has_char_escapes=!1,N==="`"?j+=this._read_string_recursive("`",!0,"${"):j+=this._read_string_recursive(N),this.has_char_escapes&&this._options.unescape_strings&&(j=M(j)),this._input.peek()===N&&(j+=this._input.next()),j=j.replace(a.allLineBreaks,`
`),this._create_token(f.STRING,j)}return null},E.prototype._allow_regexp_or_xml=function(N){return N.type===f.RESERVED&&c(N.text,["return","case","throw","else","do","typeof","yield"])||N.type===f.END_EXPR&&N.text===")"&&N.opened.previous.type===f.RESERVED&&c(N.opened.previous.text,["if","while","for"])||c(N.type,[f.COMMENT,f.START_EXPR,f.START_BLOCK,f.START,f.END_BLOCK,f.OPERATOR,f.EQUALS,f.EOF,f.SEMICOLON,f.COMMA])},E.prototype._read_regexp=function(N,j){if(N==="/"&&this._allow_regexp_or_xml(j)){for(var H=this._input.next(),P=!1,x=!1;this._input.hasNext()&&(P||x||this._input.peek()!==N)&&!this._input.testChar(a.newline);)H+=this._input.peek(),P?P=!1:(P=this._input.peek()==="\\",this._input.peek()==="["?x=!0:this._input.peek()==="]"&&(x=!1)),this._input.next();return this._input.peek()===N&&(H+=this._input.next(),H+=this._input.read(a.identifier)),this._create_token(f.STRING,H)}return null},E.prototype._read_xml=function(N,j){if(this._options.e4x&&N==="<"&&this._allow_regexp_or_xml(j)){var H="",P=this.__patterns.xml.read_match();if(P){for(var x=P[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),U=x.indexOf("{")===0,V=0;P;){var q=!!P[1],ie=P[2],se=!!P[P.length-1]||ie.slice(0,8)==="![CDATA[";if(!se&&(ie===x||U&&ie.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(q?--V:++V),H+=P[0],V<=0)break;P=this.__patterns.xml.read_match()}return P||(H+=this._input.match(/[\s\S]*/g)[0]),H=H.replace(a.allLineBreaks,`
`),this._create_token(f.STRING,H)}}return null};function M(N){for(var j="",H=0,P=new g(N),x=null;P.hasNext();)if(x=P.match(/([\s]|[^\\]|\\\\)+/g),x&&(j+=x[0]),P.peek()==="\\"){if(P.next(),P.peek()==="x")x=P.match(/x([0-9A-Fa-f]{2})/g);else if(P.peek()==="u")x=P.match(/u([0-9A-Fa-f]{4})/g);else{j+="\\",P.hasNext()&&(j+=P.next());continue}if(!x)return N;if(H=parseInt(x[1],16),H>126&&H<=255&&x[0].indexOf("x")===0)return N;if(H>=0&&H<32){j+="\\"+x[0];continue}else H===34||H===39||H===92?j+="\\"+String.fromCharCode(H):j+=String.fromCharCode(H)}return j}E.prototype._read_string_recursive=function(N,j,H){var P,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 U=x.read(),V="";this._input.hasNext();){if(V=this._input.next(),V===N||!j&&a.newline.test(V)){this._input.back();break}else V==="\\"&&this._input.hasNext()?(P=this._input.peek(),P==="x"||P==="u"?this.has_char_escapes=!0:P==="\r"&&this._input.peek(1)===`
`&&this._input.next(),V+=this._input.next()):H&&(H==="${"&&V==="$"&&this._input.peek()==="{"&&(V+=this._input.next()),H===V&&(N==="`"?V+=this._read_string_recursive("}",j,"`"):V+=this._read_string_recursive("`",j,"${"),this._input.hasNext()&&(V+=this._input.next())));V+=x.read(),U+=V}return U},L.exports.Tokenizer=E,L.exports.TOKEN=f,L.exports.positionable_operators=R.slice(),L.exports.line_starters=u.slice()},function(L){var D=RegExp.prototype.hasOwnProperty("sticky");function m(g){this.__input=g||"",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 g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},m.prototype.peek=function(g){var h=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(h=this.__input.charAt(g)),h},m.prototype.__match=function(g,h){g.lastIndex=h;var o=g.exec(this.__input);return o&&!(D&&g.sticky)&&(o.index!==h&&(o=null)),o},m.prototype.test=function(g,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(g,h):!1},m.prototype.testChar=function(g,h){var o=this.peek(h);return g.lastIndex=0,o!==null&&g.test(o)},m.prototype.match=function(g){var h=this.__match(g,this.__position);return h?this.__position+=h[0].length:h=null,h},m.prototype.read=function(g,h,o){var l="",a;return g&&(a=this.match(g),a&&(l+=a[0])),h&&(a||!g)&&(l+=this.readUntil(h,o)),l},m.prototype.readUntil=function(g,h){var o="",l=this.__position;g.lastIndex=this.__position;var a=g.exec(this.__input);return a?(l=a.index,h&&(l+=a[0].length)):l=this.__input_length,o=this.__input.substring(this.__position,l),this.__position=l,o},m.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},m.prototype.get_regexp=function(g,h){var o=null,l="g";return h&&D&&(l="y"),typeof g=="string"&&g!==""?o=new RegExp(g,l):g&&(o=new RegExp(g.source,l)),o},m.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(g){var h=this.__position,o=this.readUntilAfter(g);return this.__position=h,o},m.prototype.lookBack=function(g){var h=this.__position-1;return h>=g.length&&this.__input.substring(h-g.length,h).toLowerCase()===g},L.exports.InputScanner=m},function(L,D,m){var g=m(8).InputScanner,h=m(3).Token,o=m(10).TokenStream,l=m(11).WhitespacePattern,a={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(t,c){this._input=new g(t),this._options=c||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new o,this._reset();for(var t,c=new h(a.START,""),f=null,S=[],C=new o;c.type!==a.EOF;){for(t=this._get_next_token(c,f);this._is_comment(t);)C.add(t),t=this._get_next_token(c,f);C.isEmpty()||(t.comments_before=C,C=new o),t.parent=f,this._is_opening(t)?(S.push(f),f=t):f&&this._is_closing(t,f)&&(t.opened=f,f.closed=t,f=S.pop(),t.parent=f),t.previous=c,c.next=t,this.__tokens.add(t),c=t}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(t,c){this._readWhitespace();var f=this._input.read(/.+/g);return f?this._create_token(a.RAW,f):this._create_token(a.EOF,"")},r.prototype._is_comment=function(t){return!1},r.prototype._is_opening=function(t){return!1},r.prototype._is_closing=function(t,c){return!1},r.prototype._create_token=function(t,c){var f=new h(t,c,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return f},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},L.exports.Tokenizer=r,L.exports.TOKEN=a},function(L){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 g=null;return m=m||0,m+=this.__position,m>=0&&m<this.__tokens_length&&(g=this.__tokens[m]),g},D.prototype.add=function(m){this.__parent_token&&(m.parent=this.__parent_token),this.__tokens.push(m),this.__tokens_length+=1},L.exports.TokenStream=D},function(L,D,m){var g=m(12).Pattern;function h(o,l){g.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=""}h.prototype=new g,h.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+"]")},h.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},h.prototype.matching=function(o,l){var a=this._create();return a.__set_whitespace_patterns(o,l),a._update(),a},h.prototype._create=function(){return new h(this._input,this)},h.prototype.__split=function(o,l){o.lastIndex=0;for(var a=0,r=[],t=o.exec(l);t;)r.push(l.substring(a,t.index)),a=t.index+t[0].length,t=o.exec(l);return a<l.length?r.push(l.substring(a,l.length)):r.push(""),r},L.exports.WhitespacePattern=h},function(L){function D(m,g){this._input=m,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,g&&(this._starting_pattern=this._input.get_regexp(g._starting_pattern,!0),this._match_pattern=this._input.get_regexp(g._match_pattern,!0),this._until_pattern=this._input.get_regexp(g._until_pattern),this._until_after=g._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 g=this._create();return g._until_after=!0,g._until_pattern=this._input.get_regexp(m),g._update(),g},D.prototype.until=function(m){var g=this._create();return g._until_after=!1,g._until_pattern=this._input.get_regexp(m),g._update(),g},D.prototype.starting_with=function(m){var g=this._create();return g._starting_pattern=this._input.get_regexp(m,!0),g._update(),g},D.prototype.matching=function(m){var g=this._create();return g._match_pattern=this._input.get_regexp(m,!0),g._update(),g},D.prototype._create=function(){return new D(this._input,this)},D.prototype._update=function(){},L.exports.Pattern=D},function(L){function D(m,g){m=typeof m=="string"?m:m.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+g,"g")}D.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(m);h;)g[h[1]]=h[2],h=this.__directive_pattern.exec(m);return g},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=D},function(L,D,m){var g=m(12).Pattern,h={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function o(l,a){g.call(this,l,a),this.__template_pattern=null,this._disabled=Object.assign({},h),this._excluded=Object.assign({},h),a&&(this.__template_pattern=this._input.get_regexp(a.__template_pattern),this._excluded=Object.assign(this._excluded,a._excluded),this._disabled=Object.assign(this._disabled,a._disabled));var r=new g(l);this.__patterns={handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:r.starting_with(/{{{/).until_after(/}}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),php:r.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:r.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:r.starting_with(/{%/).until_after(/%}/),django_value:r.starting_with(/{{/).until_after(/}}/),django_comment:r.starting_with(/{#/).until_after(/#}/),smarty:r.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:r.starting_with(/{\*/).until_after(/\*}/),smarty_literal:r.starting_with(/{literal}/).until_after(/{\/literal}/)}}o.prototype=new g,o.prototype._create=function(){return new o(this._input,this)},o.prototype._update=function(){this.__set_templated_pattern()},o.prototype.disable=function(l){var a=this._create();return a._disabled[l]=!0,a._update(),a},o.prototype.read_options=function(l){var a=this._create();for(var r in h)a._disabled[r]=l.templating.indexOf(r)===-1;return a._update(),a},o.prototype.exclude=function(l){var a=this._create();return a._excluded[l]=!0,a._update(),a},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 a=this._read_template();a;)this._match_pattern?a+=this._input.read(this._match_pattern):a+=this._input.readUntil(this.__template_pattern),l+=a,a=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="",a=this._input.peek();if(a==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(l=l||this.__patterns.erb.read())}else a==="{"&&(!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},L.exports.TemplatablePattern=o}],I={};function z(L){var D=I[L];if(D!==void 0)return D.exports;var m=I[L]={exports:{}};return B[L](m,m.exports,z),m.exports}var G=z(0);k=G})();var Q=k;!(ee=[],$=function(){return{js_beautify:Q}}.apply(Ze,ee),$!==void 0&&(Rt.exports=$))})()},"6eGT":function(Rt,Ze,K){"use strict";function ee($){return null}Ze.a=ee},"7Cbv":function(Rt,Ze,K){"use strict";var ee=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),$=new Uint8Array(16);function k(){if(!ee)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return ee($)}var Q=/^(?:[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 B(h){return typeof h=="string"&&Q.test(h)}for(var I=B,z=[],G=0;G<256;++G)z.push((G+256).toString(16).substr(1));function L(h){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,l=(z[h[o+0]]+z[h[o+1]]+z[h[o+2]]+z[h[o+3]]+"-"+z[h[o+4]]+z[h[o+5]]+"-"+z[h[o+6]]+z[h[o+7]]+"-"+z[h[o+8]]+z[h[o+9]]+"-"+z[h[o+10]]+z[h[o+11]]+z[h[o+12]]+z[h[o+13]]+z[h[o+14]]+z[h[o+15]]).toLowerCase();if(!I(l))throw TypeError("Stringified UUID is invalid");return l}var D=L;function m(h,o,l){h=h||{};var a=h.random||(h.rng||k)();if(a[6]=a[6]&15|64,a[8]=a[8]&63|128,o){l=l||0;for(var r=0;r<16;++r)o[l+r]=a[r];return o}return D(a)}var g=Ze.a=m},"7ahc":function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return S});var ee=K("k1fw"),$=K("0Owb"),k=K("+L6B"),Q=K("2/Rp"),B=K("y8nQ"),I=K("Vl3Y"),z=K("tJVT"),G=K("OaEy"),L=K("2fM7"),D=K("cDcd"),m=K.n(D),g=K("VrN/"),h=K.n(g),o=K("p77/"),l=K.n(o),a=K("c5Ni"),r=K.n(a),t=L.a.Option,c={labelCol:{span:4},wrapperCol:{span:20}},f={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"]};Ze.b=function(C){var T=C.callback,O=C.onCancel,R=Object(D.useState)("python"),b=Object(z.a)(R,2),_=b[0],u=b[1];function d(v){u(f[v][1])}function y(v){T(v)}return m.a.createElement(I.a,Object($.a)({},c,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:y}),m.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},m.a.createElement(L.a,{onChange:d},Object.keys(f).map(function(v){return m.a.createElement(t,{key:v,value:v},f[v][0])}))),m.a.createElement(I.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},m.a.createElement(S,{mode:_})),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(Q.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(Q.a,{type:"ghost",onClick:O},"\u53D6\u6D88")))};function S(C){var T=C.value,O=C.onChange,R=C.mode,b=C.options,_=b===void 0?{}:b,u=Object(D.useRef)(),d=Object(D.useState)(),y=Object(z.a)(d,2),v=y[0],E=y[1];return Object(D.useEffect)(function(){if(v){function M(N){var j=N.getValue();O&&O(j)}return v.on("change",M),function(){v.off("change",M)}}},[v,O]),Object(D.useEffect)(function(){v&&v.setOption("mode",R)},[v,R]),Object(D.useEffect)(function(){v&&((T!==v.getValue()||T==="")&&setTimeout(function(){v.setValue(T||" ")},300))},[v,T]),Object(D.useEffect)(function(){if(u.current&&!v){var M=h.a.fromTextArea(u.current,Object(ee.a)({mode:R,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},_));E(M)}},[u.current,v]),m.a.createElement("div",{className:"my-codemirror-container"},m.a.createElement("textarea",{ref:u}))}},"7qnI":function(Rt,Ze,K){"use strict";var ee=K("5Dmo"),$=K("3S7+"),k=K("fWQN"),Q=K("mtLc"),B=K("yKVA"),I=K("879j"),z=K("5NDa"),G=K("5rEg"),L=K("cDcd"),D=K.n(L),m=K("O2Wb"),g=K.n(m),h=G.a.TextArea,o=function(l){Object(B.a)(r,l);var a=Object(I.a)(r);function r(){return Object(k.a)(this,r),a.apply(this,arguments)}return Object(Q.a)(r,[{key:"render",value:function(){var c=this,f=this.props,S=f.index,C=f.onAnswerChange,T=f.addChildAnswer,O=f.exerciseIsPublish,R=f.answers,b=f.activeOptionErrorIndex,_=f.flex,u=_===void 0?"0 0 1000px":_;return D.a.createElement("div",{className:g.a.flex},D.a.createElement("div",{className:"".concat(g.a.color666," mb5 mt6"),style:{flex:"0 0 90px"}},"\u7B54\u6848(\u586B\u7A7A",S+1,"):"),D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),style:{flexDirection:"column"}},R.map(function(d,y){var v="".concat(S,"-").concat(y);return D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),key:y},D.a.createElement("div",{className:g.a.flex1,style:{flex:u}},D.a.createElement("div",null,D.a.createElement(h,{className:v===b?g.a.error:"",spellCheck:!1,rows:4,value:d||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(y==0?"":"(\u53EF\u9009)"),onChange:function(M){return C(S,y,M.target.value)},style:{minHeight:95}}))),!O&&D.a.createElement(D.a.Fragment,null,y!=0&&D.a.createElement($.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return c.props.deleteChildAnswer(S,y)},style:{float:"right"}})),y===0&&D.a.createElement($.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return c.props.deleteChildAnswermain(S,y)},style:{float:"right"}})),D.a.createElement($.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},D.a.createElement("i",{className:"".concat(g.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return T(S)},style:{float:"right",visibility:y==R.length-1?"":"hidden"}}))))})))}}]),r}(L.Component);Ze.a=o},"815F":function(Rt,Ze,K){"use strict";K.d(Ze,"e",function(){return z}),K.d(Ze,"c",function(){return L}),K.d(Ze,"d",function(){return D}),K.d(Ze,"a",function(){return g}),K.d(Ze,"f",function(){return h}),K.d(Ze,"b",function(){return o});var ee=K("KQm4"),$=K("VTBJ"),k=K("Ff2n"),Q=K("Zm9Q"),B=K("Kwbf"),I=K("OZM5");function z(l,a){return l!=null?l:a}function G(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=new Map;function r(t){var c=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(f){var S=f.key,C=f.children;Object(B.a)(S!=null,"Tree node must have a certain key: [".concat(c).concat(S,"]"));var T=String(S);Object(B.a)(!a.has(T)||S===null||S===void 0,"Same 'key' exist in the Tree: ".concat(T)),a.set(T,!0),r(C,"".concat(c).concat(T," > "))})}r(l)}function L(l){function a(r){var t=Object(Q.a)(r);return t.map(function(c){if(!Object(I.i)(c))return Object(B.a)(!c,"Tree/TreeNode can only accept TreeNode as children."),null;var f=c.key,S=c.props,C=S.children,T=Object(k.a)(S,["children"]),O=Object($.a)({key:f},T),R=a(C);return R.length&&(O.children=R),O}).filter(function(c){return c})}return a(l)}function D(){var l=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=new Set(a===!0?[]:a),t=[];function c(f){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return f.map(function(C,T){var O=Object(I.h)(S?S.pos:"0",T),R=z(C.key,O),b=Object($.a)(Object($.a)({},C),{},{parent:S,pos:O,children:null,data:C,isStart:[].concat(Object(ee.a)(S?S.isStart:[]),[T===0]),isEnd:[].concat(Object(ee.a)(S?S.isEnd:[]),[T===f.length-1])});return t.push(b),a===!0||r.has(R)?b.children=c(C.children||[],b):b.children=[],b})}return c(l),t}function m(l,a,r){var t;r?typeof r=="string"?t=function(S){return S[r]}:typeof r=="function"&&(t=function(S){return r(S)}):t=function(S,C){return z(S.key,C)};function c(f,S,C){var T=f?f.children:l,O=f?Object(I.h)(C.pos,S):"0";if(f){var R=t(f,O),b={node:f,index:S,pos:O,key:R,parentPos:C.node?C.pos:null,level:C.level+1};a(b)}T&&T.forEach(function(_,u){c(_,u,{node:f,pos:O,level:C?C.level+1:-1})})}c(null)}function g(l){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=a.initWrapper,t=a.processEntity,c=a.onProcessFinished,f=arguments.length>2?arguments[2]:void 0,S={},C={},T={posEntities:S,keyEntities:C};return r&&(T=r(T)||T),m(l,function(O){var R=O.node,b=O.index,_=O.pos,u=O.key,d=O.parentPos,y=O.level,v={node:R,index:b,key:u,pos:_,level:y},E=z(u,_);S[_]=v,C[E]=v,v.parent=S[d],v.parent&&(v.parent.children=v.parent.children||[],v.parent.children.push(v)),t&&t(v,T)},f),c&&c(T),T}function h(l,a){var r=a.expandedKeys,t=a.selectedKeys,c=a.loadedKeys,f=a.loadingKeys,S=a.checkedKeys,C=a.halfCheckedKeys,T=a.dragOverNodeKey,O=a.dropPosition,R=a.keyEntities,b=R[l],_={eventKey:l,expanded:r.indexOf(l)!==-1,selected:t.indexOf(l)!==-1,loaded:c.indexOf(l)!==-1,loading:f.indexOf(l)!==-1,checked:S.indexOf(l)!==-1,halfChecked:C.indexOf(l)!==-1,pos:String(b?b.pos:""),dragOver:T===l&&O===0,dragOverGapTop:T===l&&O===-1,dragOverGapBottom:T===l&&O===1};return _}function o(l){var a=l.data,r=l.expanded,t=l.selected,c=l.checked,f=l.loaded,S=l.loading,C=l.halfChecked,T=l.dragOver,O=l.dragOverGapTop,R=l.dragOverGapBottom,b=l.pos,_=l.active,u=Object($.a)(Object($.a)({},a),{},{expanded:r,selected:t,checked:c,loaded:f,loading:S,halfChecked:C,dragOver:T,dragOverGapTop:O,dragOverGapBottom:R,pos:b,active:_});return"props"in u||Object.defineProperty(u,"props",{get:function(){return Object(B.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(Rt,Ze,K){(function(ee){ee(K("VrN/"))})(function(ee){"use strict";ee.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 $=0;$<ee.modeInfo.length;$++){var k=ee.modeInfo[$];k.mimes&&(k.mime=k.mimes[0])}ee.findModeByMIME=function(Q){Q=Q.toLowerCase();for(var B=0;B<ee.modeInfo.length;B++){var I=ee.modeInfo[B];if(I.mime==Q)return I;if(I.mimes){for(var z=0;z<I.mimes.length;z++)if(I.mimes[z]==Q)return I}}if(/\+xml$/.test(Q))return ee.findModeByMIME("application/xml");if(/\+json$/.test(Q))return ee.findModeByMIME("application/json")},ee.findModeByExtension=function(Q){Q=Q.toLowerCase();for(var B=0;B<ee.modeInfo.length;B++){var I=ee.modeInfo[B];if(I.ext){for(var z=0;z<I.ext.length;z++)if(I.ext[z]==Q)return I}}},ee.findModeByFileName=function(Q){for(var B=0;B<ee.modeInfo.length;B++){var I=ee.modeInfo[B];if(I.file&&I.file.test(Q))return I}var z=Q.lastIndexOf("."),G=z>-1&&Q.substring(z+1,Q.length);if(G)return ee.findModeByExtension(G)},ee.findModeByName=function(Q){Q=Q.toLowerCase();for(var B=0;B<ee.modeInfo.length;B++){var I=ee.modeInfo[B];if(I.name.toLowerCase()==Q)return I;if(I.alias){for(var z=0;z<I.alias.length;z++)if(I.alias[z].toLowerCase()==Q)return I}}}})},"8hTe":function(Rt,Ze,K){Rt.exports={button:"button___1wy9m"}},"9Bee":function(Rt,Ze,K){"use strict";var ee=K("DYRE"),$=K("zeV3"),k=K("+L6B"),Q=K("2/Rp"),B=K("k1fw"),I=K("tJVT"),z=K("cDcd"),G=K.n(z),L=K("vg9a"),D=K("DlQD"),m=K.n(D),g=K("rUJ1");function h(Te,fe){var _e=Te.match(/^(\s+)(?:```)/);if(_e===null)return fe;var ue=_e[1];return fe.split(`
`).map(function(xe){var Y=xe.match(/^\s+/);if(Y===null)return xe;var oe=Object(I.a)(Y,1),ce=oe[0];return ce.length>=ue.length?xe.slice(ue.length):xe}).join(`
`)}var o=[],l=["<ul>"],a=new m.a.Renderer,r=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function t(){o.length=0,l=["<ul>"]}var c={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function f(Te,fe,_e,ue){if(fe>=Te.length||Te[fe].level<=_e)return fe;var xe=Te[fe];ue.push("<li><a href='#"+xe.anchor+"'>"+xe.text+"</a>"),fe++;var Y=[];return fe=f(Te,fe,xe.level,Y),Y.length>0&&(ue.push("<ul>"),Y.forEach(function(oe){ue.push(oe)}),ue.push("</ul>")),ue.push("</li>"),fe=f(Te,fe,_e,ue),fe}function S(){return f(o,0,0,l),l.push("</ul>"),l.join("")}var C={heading:function(fe){var _e=r.exec(fe);if(_e)return{type:"heading",raw:_e[0],depth:_e[1].length,text:_e[2]}},fences:function(fe){var _e=this.rules.block.fences.exec(fe);if(_e){var ue=_e[0],xe=h(ue,_e[3]||""),Y=_e[2]?_e[2].trim():_e[2];if(["latex","katex","math"].indexOf(Y)>=0){var oe=R(),ce=xe;xe=oe,b[oe]={type:"block",expression:ce}}return{type:"code",raw:ue,lang:Y,text:xe}}}},T=/(?:\${2})([^\n`]+?)(?:\${2})/gi,O=0,R=function(){return"__special_katext_id_".concat(O++,"__")},b={};function _(){return b}function u(){O=0,b={}}function d(Te){return Te=Te.replace(T,function(fe,_e){var ue=R();return b[ue]={type:"inline",expression:_e},ue}),Te}var y=a.listitem;a.listitem=function(Te){return y(d(Te))};var v=a.paragraph;a.paragraph=function(Te){return v(d(Te))};var E=a.tablecell;a.tablecell=function(Te,fe){return E(d(Te),fe)},a.code=function(Te,fe,_e){var ue=(fe||"").match(/\S*/)[0];return ue?["latex","katex","math"].indexOf(ue)>=0?"<p class='editormd-tex'>".concat(Te,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(fe,'">').concat(_e?Te:Object(g.escape)(Te,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(_e?Te:Object(g.escape)(Te,!0))+"</code></pre>"},a.heading=function(Te,fe,_e){var ue=this.options.headerPrefix+_e.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return o.push({anchor:ue,level:fe,text:Te}),"<h"+fe+' id="'+ue+'">'+Te+"</h"+fe+">"},m.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),m.a.use({tokenizer:C,renderer:a});var M=m.a,N=K("SJMd"),j=K("ulZh"),H=K.n(j),P=K("m3rI"),x=K("Oy/b"),U=K("p5ED"),V=K("8hTe"),q=K.n(V),ie=/<pre[^>]*>/g;function se(Te){var fe=document.createElement("div");return fe.innerHTML=Te,fe.childNodes.length===0?"":fe.childNodes[0].nodeValue}var ve=Ze.a=function(Te){var fe=Te.value,_e=fe===void 0?"":fe,ue=Te.edit,xe=ue===void 0?!1:ue,Y=Te.className,oe=Te.showTextOnly,ce=Te.showLines,Re=Te.replaces,Ge=Te.zoomImg,Ne=Te.hasMask,Je=Te.style,rt=Je===void 0?{}:Je,_t=Te.stylesPrev,ft=_t===void 0?{}:_t,ut=String(_e),qe=Object(z.useRef)(),Ct=Object(z.useRef)(),kt=Object(z.useState)(""),Kt=Object(I.a)(kt,2),zt=Kt[0],ln=Kt[1],un=Object(z.useState)("office"),We=Object(I.a)(un,2),je=We[0],ht=We[1],ct=Object(z.useMemo)(function(){try{var Ce=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,le=/\"\/api\/attachments\/|\"\/attachments\/download\//g,he=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;ut=ut.replace(Ce,"("+P.a.API_SERVER+"/api/attachments/").replace(le,'"'+P.a.API_SERVER+"/api/attachments/").replace(he,'"'+P.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($e){}var ye=M(ut),ae=_();if(ut.match(/\[TOC\]/)&&(ye=ye.replace("<p>[TOC]</p>",S()),t()),ye=ye.replace(/(__special_katext_id_\d+__)/g,function($e,dt){var St=ae[dt],Dt=St.type,Mt=St.expression;return Object(x.renderToString)(se(Mt)||"",{displayMode:Dt==="block",throwOnError:!1,output:"html"})}),ye=ye.replace(/▁/g,"\u2581\u2581\u2581"),u(),oe){var Se=document.createElement("div");return Se.innerHTML=ye,Se.innerText}return setTimeout(function(){return Pe()},500),ye},[ut]),He=Object(z.useRef)();c.WebkitLineClamp=ce,ce&&(rt=Object(B.a)(Object(B.a)({},rt),c));function lt(Ce){var le=Ce.target;if(le.tagName.toUpperCase()==="IMG"){if(Ge){var he=le.getAttribute("src");ln(he),ht("image")}}else if(le.tagName.toUpperCase()==="A"){var ye=le.getAttribute("href");if(ye.indexOf("office")>-1)Ce.preventDefault(),ln(ye),ht("office");else if(ye.indexOf("application/pdf")>-1)Ce.preventDefault(),ln(ye),ht("pdf");else if(ye.indexOf("text/html")>-1)Ce.preventDefault(),ln(ye),ht("html");else if(ye.startsWith("#")){Ce.preventDefault();var ae=document.getElementById(ye.replace("#",""));ae&&ae.scrollIntoView(!0)}}}var Pe=function(){var le,he=(le=He.current)===null||le===void 0?void 0:le.querySelectorAll("video");he==null||he.forEach(function(ye){if(ye.oncontextmenu=function(){return!1},ye.src.indexOf(".m3u8")>-1&&!ye.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var ae=new H.a;ae.loadSource(ye.src),ae.attachMedia(ye)}}})};Object(z.useEffect)(function(){if(He.current&&ct&&(ct.match(ie)&&window.PR.prettyPrint()),He.current)return He.current.addEventListener("click",lt),function(){He.current.removeEventListener("click",lt),u(),t()}},[ct,He.current,lt]);var Oe=function(le){if(!xe)return;le.target.nodeName==="IMG"?(qe.current.style.display="flex",qe.current.style.width=le.target.clientWidth+"px",qe.current.style.height=le.target.clientHeight+"px",qe.current.style.top=le.target.offsetTop+"px",qe.current.style.left=le.target.offsetLeft+"px",Ct.current.src=le.target.getAttribute("src")):qe.current.style.display="none"};return G.a.createElement("div",{style:{position:"relative"}},G.a.createElement("div",{ref:He,style:Object(B.a)({},rt),className:"".concat(Y||""," markdown-body ").concat(q.a.mdBody),onMouseOver:Oe,dangerouslySetInnerHTML:{__html:ct}}),G.a.createElement("div",{ref:qe,className:q.a.button},G.a.createElement($.a,null,G.a.createElement(Q.a,{onClick:function(){return openCrop()}},"\u88C1\u526A"),G.a.createElement(Q.a,{onClick:function(){return openEditor()}},"\u7F16\u8F91"))),G.a.createElement("img",{ref:Ct,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1,top:"-10000px"}}),G.a.createElement(U.a,{close:!0,data:zt,type:zt!=null&&zt.length?je:"",style:Object(B.a)({},ft),onClose:function(){return ln("")}}))}},"9VGf":function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return k});var ee=K("cDcd"),$=K.n(ee);function k(Q,B){var I=Object(ee.useRef)();Object(ee.useEffect)(function(){I.current=Q}),Object(ee.useEffect)(function(){function z(){I.current()}if(B!==null){var G=setInterval(z,B);return function(){return clearInterval(G)}}},[B])}},"9z17":function(Rt,Ze,K){"use strict";K.d(Ze,"b",function(){return T});var ee=K("g9YV"),$=K("wCAj"),k=K("5NDa"),Q=K("5rEg"),B=K("y8nQ"),I=K("Vl3Y"),z=K("2qtc"),G=K("kLXV"),L=K("7Kak"),D=K("9yH6"),m=K("9og8"),g=K("tJVT"),h=K("WmNS"),o=K.n(h),l=K("cDcd"),a=K.n(l),r=K("ie49"),t=K.n(r),c=K("HBuW"),f=function(_){var u=_.total,d=_.used,y=_.copy,v=_.canNotCopy,E=_.inPaper,M="";return y>0&&v>0?M="\u5176\u4E2D\u6709".concat(y,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236\uFF0C\u6709").concat(v,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236"):y>0&&v===0?M="\u5176\u4E2D\u6709".concat(y,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236"):y===0&&v>0&&(M="\u5176\u4E2D\u6709".concat(v,"\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(M).concat(E?"\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4F7F\u7528\u8BD5\u5377\uFF1F":"")},S=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"}},C=function(_){var u=_.onCancel,d=_.onOk,y=_.visible,v=_.inPaper,E=_.renderData,M=_.type,N=Object(l.useState)(1),j=Object(g.a)(N,2),H=j[0],P=j[1],x=Object(l.useState)(!1),U=Object(g.a)(x,2),V=U[0],q=U[1],ie=Object(l.useMemo)(function(){return(E==null?void 0:E.total_num)===1&&(E==null?void 0:E.can_copy_num)===1},[E]);return a.a.createElement(a.a.Fragment,null,ie?a.a.createElement(G.a,{centered:!0,closable:!0,visible:y,title:"\u63D0\u793A",width:600,confirmLoading:V,onCancel:u,onOk:Object(m.a)(o.a.mark(function se(){return o.a.wrap(function(Te){for(;;)switch(Te.prev=Te.next){case 0:return q(!0),Te.next=3,d(H);case 3:q(!1);case 4:case"end":return Te.stop()}},se)}))},a.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"),a.a.createElement(D.a.Group,{value:H,onChange:function(ve){return P(ve.target.value)},className:t.a.content,style:{marginBottom:30}},a.a.createElement(D.a,{value:1,style:{color:"#464f66"}},"\u590D\u5236\u5B9E\u8BAD"),a.a.createElement(D.a,{value:0,style:{color:"#464f66"}},"\u4E0D\u590D\u5236\u5B9E\u8BAD")),a.a.createElement("div",{className:t.a.content,style:{marginBottom:10}},"\u8BF4\u660E\uFF1A"),a.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"),a.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")):a.a.createElement(G.a,{centered:!0,closable:!0,visible:y,title:"\u63D0\u793A",width:600,onCancel:u,onOk:Object(m.a)(o.a.mark(function se(){return o.a.wrap(function(Te){for(;;)switch(Te.prev=Te.next){case 0:return q(!0),Te.next=3,d(0);case 3:q(!1);case 4:case"end":return Te.stop()}},se)}))},a.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")))},T=function(){var _=Object(l.useState)(!1),u=Object(g.a)(_,2),d=u[0],y=u[1],v=Object(l.useState)(),E=Object(g.a)(v,2),M=E[0],N=E[1],j=function(){return y(!1)},H=function(){var P=Object(m.a)(o.a.mark(function x(U){var V;return o.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,Object(c.p)(U);case 2:if(V=ie.sent,!("status"in V)){ie.next=5;break}return ie.abrupt("return",!1);case 5:if(!(V.repeat_shixun_num===0)){ie.next=7;break}return ie.abrupt("return",!1);case 7:return N(V),y(!0),ie.abrupt("return",!0);case 10:case"end":return ie.stop()}},x)}));return function(U){return P.apply(this,arguments)}}();return[d,j,M,H]},O=function(_){var u=I.a.useForm(),d=Object(g.a)(u,1),y=d[0],v=Object(l.useState)(!1),E=Object(g.a)(v,2),M=E[0],N=E[1],j=_.onCancel,H=_.onOk,P=_.visible,x=_.inPaper,U=x===void 0?!1:x,V=_.renderData,q=_.type,ie=Object(l.useMemo)(function(){return U?[{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(_e,ue){return a.a.createElement(a.a.Fragment,null,a.a.createElement(I.a.Item,{name:["".concat(q==="subject"?ue.stage_shixun_id:ue.id),"is_copy"],initialValue:1},a.a.createElement(D.a.Group,null,a.a.createElement(D.a,{value:1},"\u662F"),a.a.createElement(D.a,{value:0},"\u5426"))),a.a.createElement(I.a.Item,{name:["".concat(q==="subject"?ue==null?void 0:ue.stage_shixun_id:ue.id),"is_use"],hidden:!0,initialValue:1},a.a.createElement(Q.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(_e,ue){return a.a.createElement(I.a.Item,{name:["".concat(q==="subject"?ue.stage_shixun_id:ue.id),"is_use"],initialValue:1},a.a.createElement(D.a.Group,null,a.a.createElement(D.a,{value:1},"\u662F"),a.a.createElement(D.a,{value:0},"\u5426")))}},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(_e,ue){return a.a.createElement(I.a.Item,{name:["".concat(q==="subject"?ue.stage_shixun_id:ue.id),"is_copy"],initialValue:1},a.a.createElement(D.a.Group,null,a.a.createElement(D.a,{value:1},"\u662F"),a.a.createElement(D.a,{value:0},"\u5426")))}}]},[U]),se=Object(l.useMemo)(function(){return U?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center",render:function(_e,ue){return a.a.createElement(a.a.Fragment,null,a.a.createElement("span",null,_e),a.a.createElement(I.a.Item,{name:["".concat(q==="subject"?ue==null?void 0:ue.stage_shixun_id:ue.id),"is_copy"],hidden:!0,initialValue:0},a.a.createElement(Q.a,{type:"hidden"})),a.a.createElement(I.a.Item,{name:["".concat(q==="subject"?ue==null?void 0:ue.stage_shixun_id:ue.id),"is_use"],hidden:!0,initialValue:1},a.a.createElement(Q.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(_e,ue){return a.a.createElement(a.a.Fragment,null,a.a.createElement(I.a.Item,{name:["".concat(q==="subject"?ue==null?void 0:ue.stage_shixun_id:ue.id),"is_use"],initialValue:0},a.a.createElement(D.a.Group,null,a.a.createElement(D.a,{value:1},"\u662F"),a.a.createElement(D.a,{value:0},"\u5426"))),a.a.createElement(I.a.Item,{name:["".concat(q==="subject"?ue==null?void 0:ue.stage_shixun_id:ue.id),"is_copy"],hidden:!0,initialValue:0},a.a.createElement(Q.a,{type:"hidden"})))}}]},[U]),ve=Object(l.useMemo)(function(){return f({total:V==null?void 0:V.total_num,used:V==null?void 0:V.repeat_shixun_num,copy:V==null?void 0:V.can_copy_num,canNotCopy:V==null?void 0:V.no_copy_num,inPaper:U})},[V,U]),Te=Object(l.useMemo)(function(){return S(U)},[U]);return a.a.createElement(G.a,{title:"\u5B9E\u8BAD\u91CD\u590D\u4F7F\u7528\u63D0\u793A",centered:!0,visible:P,confirmLoading:M,onOk:Object(m.a)(o.a.mark(function fe(){var _e,ue;return o.a.wrap(function(Y){for(;;)switch(Y.prev=Y.next){case 0:return N(!0),_e=y.getFieldsValue(),ue=Object.keys(_e).map(function(oe){return{id:parseInt(oe),is_use:_e[oe].is_use,is_copy:_e[oe].is_copy}}),Y.next=5,H(ue);case 5:N(!1);case 6:case"end":return Y.stop()}},fe)})),onCancel:j,width:800,okText:"\u786E\u8BA4",className:t.a.antdModal,destroyOnClose:!0},a.a.createElement(I.a,{form:y,preserve:!1},a.a.createElement("div",{className:t.a.brief},ve),(V==null?void 0:V.can_copy_num)>0&&a.a.createElement("div",null,a.a.createElement("div",{className:t.a.contentTitle},"\u53EF\u590D\u5236\u5B9E\u8BAD"),a.a.createElement("div",{className:t.a.content},Te.reproducible),a.a.createElement("div",{className:t.a.tips},a.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"),a.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")),a.a.createElement($.a,{columns:ie,className:t.a.antdTable,dataSource:V==null?void 0:V.can_copy_list,rowKey:q==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:240},bordered:!0})),(V==null?void 0:V.no_copy_num)>0&&a.a.createElement("div",null,a.a.createElement("div",{className:t.a.contentTitle},"\u4E0D\u53EF\u590D\u5236\u5B9E\u8BAD"),a.a.createElement("div",{className:t.a.content},Te.irreproducible),a.a.createElement($.a,{columns:se,className:t.a.antdTable,dataSource:V==null?void 0:V.no_copy_list,rowKey:q==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:200},bordered:!0})),(V==null?void 0:V.no_use_list.length)>0&&(V==null?void 0:V.no_use_list.map(function(fe){return a.a.createElement("div",{key:q==="subject"?fe.stage_shixun_id:fe.id},a.a.createElement(I.a.Item,{name:["".concat(q==="subject"?fe==null?void 0:fe.stage_shixun_id:fe.id),"is_copy"],hidden:!0,initialValue:0},a.a.createElement(Q.a,{type:"hidden"})),a.a.createElement(I.a.Item,{name:["".concat(q==="subject"?fe==null?void 0:fe.stage_shixun_id:fe.id),"is_use"],hidden:!0,initialValue:1},a.a.createElement(Q.a,{type:"hidden"})))}))))},R=function(_){var u=_.modalType;return u==="multiple"?a.a.createElement(O,_):a.a.createElement(C,_)};Ze.a=R},BU3w:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return I});var ee=K("MNnm"),$="rc-util-key";function k(z){if(z.attachTo)return z.attachTo;var G=document.querySelector("head");return G||document.body}function Q(z){var G,L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(ee.a)())return null;var D=document.createElement("style");if((G=L.csp)===null||G===void 0?void 0:G.nonce){var m;D.nonce=(m=L.csp)===null||m===void 0?void 0:m.nonce}D.innerHTML=z;var g=k(L),h=g.firstChild;return L.prepend&&g.prepend?g.prepend(D):L.prepend&&h?g.insertBefore(D,h):g.appendChild(D),D}var B=new Map;function I(z,G){var L=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=k(L);if(!B.has(D)){var m=Q("",L),g=m.parentNode;B.set(D,g),g.removeChild(m)}var h=Array.from(B.get(D).children).find(function(t){return t.tagName==="STYLE"&&t[$]===G});if(h){var o,l;if(((o=L.csp)===null||o===void 0?void 0:o.nonce)&&h.nonce!==((l=L.csp)===null||l===void 0?void 0:l.nonce)){var a;h.nonce=(a=L.csp)===null||a===void 0?void 0:a.nonce}return h.innerHTML!==z&&(h.innerHTML=z),h}var r=Q(z,L);return r[$]=G,r}},Bd2K:function(Rt,Ze,K){(function(ee){ee(K("VrN/"),K("osHv"))})(function(ee){ee.defineOption("autoCloseTags",!1,function(L,D,m){if(m!=ee.Init&&m&&L.removeKeyMap("autoCloseTags"),!D)return;var g={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(g["'/'"]=function(h){return I(h)}),(typeof D!="object"||D.whenOpening!==!1)&&(g["'>'"]=function(h){return Q(h)}),L.addKeyMap(g)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],k=["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 Q(L){if(L.getOption("disableInput"))return ee.Pass;for(var D=L.listSelections(),m=[],g=L.getOption("autoCloseTags"),h=0;h<D.length;h++){if(!D[h].empty())return ee.Pass;var o=D[h].head,l=L.getTokenAt(o),a=ee.innerMode(L.getMode(),l.state),r=a.state,t=a.mode.xmlCurrentTag&&a.mode.xmlCurrentTag(r),c=t&&t.name;if(!c)return ee.Pass;var f=a.mode.configuration=="html",S=typeof g=="object"&&g.dontCloseTags||f&&$,C=typeof g=="object"&&g.indentTags||f&&k;l.end>o.ch&&(c=c.slice(0,c.length-l.end+o.ch));var T=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||S&&z(S,T)>-1||G(L,a.mode.xmlCurrentContext&&a.mode.xmlCurrentContext(r)||[],c,o,!0))return ee.Pass;var O=typeof g=="object"&&g.emptyTags;if(O&&z(O,c)>-1){m[h]={text:"/>",newPos:ee.Pos(o.line,o.ch+2)};continue}var R=C&&z(C,T)>-1;m[h]={indent:R,text:">"+(R?`
`:"")+"</"+c+">",newPos:R?ee.Pos(o.line+1,0):ee.Pos(o.line,o.ch+1)}}for(var b=typeof g=="object"&&g.dontIndentOnAutoClose,h=D.length-1;h>=0;h--){var _=m[h];L.replaceRange(_.text,D[h].head,D[h].anchor,"+insert");var u=L.listSelections().slice(0);u[h]={head:_.newPos,anchor:_.newPos},L.setSelections(u),!b&&_.indent&&(L.indentLine(_.newPos.line,null,!0),L.indentLine(_.newPos.line+1,null,!0))}}function B(L,D){for(var m=L.listSelections(),g=[],h=D?"/":"</",o=L.getOption("autoCloseTags"),l=typeof o=="object"&&o.dontIndentOnSlash,a=0;a<m.length;a++){if(!m[a].empty())return ee.Pass;var r=m[a].head,t=L.getTokenAt(r),c=ee.innerMode(L.getMode(),t.state),f=c.state;if(D&&(t.type=="string"||t.string.charAt(0)!="<"||t.start!=r.ch-1))return ee.Pass;var S,C=c.mode.name!="xml"&&L.getMode().name=="htmlmixed";if(C&&c.mode.name=="javascript")S=h+"script";else if(C&&c.mode.name=="css")S=h+"style";else{var T=c.mode.xmlCurrentContext&&c.mode.xmlCurrentContext(f);if(!T||T.length&&G(L,T,T[T.length-1],r))return ee.Pass;S=h+T[T.length-1]}L.getLine(r.line).charAt(t.end)!=">"&&(S+=">"),g[a]=S}if(L.replaceSelections(g),m=L.listSelections(),!l)for(var a=0;a<m.length;a++)(a==m.length-1||m[a].head.line<m[a+1].head.line)&&L.indentLine(m[a].head.line)}function I(L){return L.getOption("disableInput")?ee.Pass:B(L,!0)}ee.commands.closeTag=function(L){return B(L)};function z(L,D){if(L.indexOf)return L.indexOf(D);for(var m=0,g=L.length;m<g;++m)if(L[m]==D)return m;return-1}function G(L,D,m,g,h){if(!ee.scanForClosingTag)return!1;var o=Math.min(L.lastLine()+1,g.line+500),l=ee.scanForClosingTag(L,g,null,o);if(!l||l.tag!=m)return!1;for(var a=h?1:0,r=D.length-1;r>=0&&D[r]==m;r--)++a;g=l.to;for(var r=1;r<a;r++){var t=ee.scanForClosingTag(L,g,null,o);if(!t||t.tag!=m)return!1;g=t.to}return!0}})},BjJ7:function(Rt,Ze,K){"use strict";K.d(Ze,"d",function(){return $}),K.d(Ze,"c",function(){return k}),K.d(Ze,"e",function(){return Q}),K.d(Ze,"b",function(){return B}),K.d(Ze,"a",function(){return z});var ee=K("m3rI");function $(G){var L=!0;if(G.length>0){for(var D=0;D<G.length;D++)if(G[D].compile_success==0||!G[D].compile_success){L=!1;break}}else L=!1;return L}function k(G){for(var L=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],m=0;m<G.length;m++){var g=G[m],h=L?"".concat(L,"/").concat(g.name):"".concat(g.name);D.push({title:g.name,isLeaf:!(g.type==="tree"),key:h})}return D}function Q(G,L,D){for(var m=0;m<G.length;m++){var g=G[m];if(g.key===L){g.children=D;break}g.children&&Q(g.children,L,D)}return G}function B(G,L,D){var m;return function(){var g=this,h=arguments,o=function(){m=null,D||G.apply(g,h)},l=D&&!m;clearTimeout(m),m=setTimeout(o,L),l&&G.apply(g,h)}}var I=!0,z=ee.a.API_SERVER},"C+DQ":function(Rt,Ze,K){},DlQD:function(Rt,Ze,K){(function(ee,$){Rt.exports=$()})(this,function(){"use strict";function ee(Pe,Oe){for(var Ce=0;Ce<Oe.length;Ce++){var le=Oe[Ce];le.enumerable=le.enumerable||!1,le.configurable=!0,"value"in le&&(le.writable=!0),Object.defineProperty(Pe,le.key,le)}}function $(Pe,Oe,Ce){return Oe&&ee(Pe.prototype,Oe),Ce&&ee(Pe,Ce),Pe}function k(Pe,Oe){if(!Pe)return;if(typeof Pe=="string")return Q(Pe,Oe);var Ce=Object.prototype.toString.call(Pe).slice(8,-1);if(Ce==="Object"&&Pe.constructor&&(Ce=Pe.constructor.name),Ce==="Map"||Ce==="Set")return Array.from(Pe);if(Ce==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ce))return Q(Pe,Oe)}function Q(Pe,Oe){(Oe==null||Oe>Pe.length)&&(Oe=Pe.length);for(var Ce=0,le=new Array(Oe);Ce<Oe;Ce++)le[Ce]=Pe[Ce];return le}function B(Pe,Oe){var Ce;if(typeof Symbol=="undefined"||Pe[Symbol.iterator]==null){if(Array.isArray(Pe)||(Ce=k(Pe))||Oe&&Pe&&typeof Pe.length=="number"){Ce&&(Pe=Ce);var le=0;return function(){return le>=Pe.length?{done:!0}:{done:!1,value:Pe[le++]}}}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 Ce=Pe[Symbol.iterator](),Ce.next.bind(Ce)}function I(Pe,Oe){return Oe={exports:{}},Pe(Oe,Oe.exports),Oe.exports}var z=I(function(Pe){function Oe(){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 Ce(le){Pe.exports.defaults=le}Pe.exports={defaults:Oe(),getDefaults:Oe,changeDefaults:Ce}}),G=z.defaults,L=z.getDefaults,D=z.changeDefaults,m=/[&<>"']/,g=/[&<>"']/g,h=/[<>"']|&(?!#?\w+;)/,o=/[<>"']|&(?!#?\w+;)/g,l={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},a=function(Oe){return l[Oe]};function r(Pe,Oe){if(Oe){if(m.test(Pe))return Pe.replace(g,a)}else if(h.test(Pe))return Pe.replace(o,a);return Pe}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function c(Pe){return Pe.replace(t,function(Oe,Ce){return Ce=Ce.toLowerCase(),Ce==="colon"?":":Ce.charAt(0)==="#"?Ce.charAt(1)==="x"?String.fromCharCode(parseInt(Ce.substring(2),16)):String.fromCharCode(+Ce.substring(1)):""})}var f=/(^|[^\[])\^/g;function S(Pe,Oe){Pe=Pe.source||Pe,Oe=Oe||"";var Ce={replace:function(he,ye){return ye=ye.source||ye,ye=ye.replace(f,"$1"),Pe=Pe.replace(he,ye),Ce},getRegex:function(){return new RegExp(Pe,Oe)}};return Ce}var C=/[^\w:]/g,T=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function O(Pe,Oe,Ce){if(Pe){var le;try{le=decodeURIComponent(c(Ce)).replace(C,"").toLowerCase()}catch(he){return null}if(le.indexOf("javascript:")===0||le.indexOf("vbscript:")===0||le.indexOf("data:")===0)return null}Oe&&!T.test(Ce)&&(Ce=d(Oe,Ce));try{Ce=encodeURI(Ce).replace(/%25/g,"%")}catch(he){return null}return Ce}var R={},b=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,u=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(Pe,Oe){R[" "+Pe]||(b.test(Pe)?R[" "+Pe]=Pe+"/":R[" "+Pe]=M(Pe,"/",!0)),Pe=R[" "+Pe];var Ce=Pe.indexOf(":")===-1;return Oe.substring(0,2)==="//"?Ce?Oe:Pe.replace(_,"$1")+Oe:Oe.charAt(0)==="/"?Ce?Oe:Pe.replace(u,"$1")+Oe:Pe+Oe}var y={exec:function(){}};function v(Pe){for(var Oe=1,Ce,le;Oe<arguments.length;Oe++){Ce=arguments[Oe];for(le in Ce)Object.prototype.hasOwnProperty.call(Ce,le)&&(Pe[le]=Ce[le])}return Pe}function E(Pe,Oe){var Ce=Pe.replace(/\|/g,function(ye,ae,Se){for(var $e=!1,dt=ae;--dt>=0&&Se[dt]==="\\";)$e=!$e;return $e?"|":" |"}),le=Ce.split(/ \|/),he=0;if(le.length>Oe)le.splice(Oe);else for(;le.length<Oe;)le.push("");for(;he<le.length;he++)le[he]=le[he].trim().replace(/\\\|/g,"|");return le}function M(Pe,Oe,Ce){var le=Pe.length;if(le===0)return"";for(var he=0;he<le;){var ye=Pe.charAt(le-he-1);if(ye===Oe&&!Ce)he++;else if(ye!==Oe&&Ce)he++;else break}return Pe.substr(0,le-he)}function N(Pe,Oe){if(Pe.indexOf(Oe[1])===-1)return-1;for(var Ce=Pe.length,le=0,he=0;he<Ce;he++)if(Pe[he]==="\\")he++;else if(Pe[he]===Oe[0])le++;else if(Pe[he]===Oe[1]&&(le--,le<0))return he;return-1}function j(Pe){Pe&&Pe.sanitize&&!Pe.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var H={escape:r,unescape:c,edit:S,cleanUrl:O,resolveUrl:d,noopTest:y,merge:v,splitCells:E,rtrim:M,findClosingBracket:N,checkSanitizeDeprecation:j},P=z.defaults,x=H.rtrim,U=H.splitCells,V=H.escape,q=H.findClosingBracket;function ie(Pe,Oe,Ce){var le=Oe.href,he=Oe.title?V(Oe.title):null,ye=Pe[1].replace(/\\([\[\]])/g,"$1");return Pe[0].charAt(0)!=="!"?{type:"link",raw:Ce,href:le,title:he,text:ye}:{type:"image",raw:Ce,href:le,title:he,text:V(ye)}}function se(Pe,Oe){var Ce=Pe.match(/^(\s+)(?:```)/);if(Ce===null)return Oe;var le=Ce[1];return Oe.split(`
`).map(function(he){var ye=he.match(/^\s+/);if(ye===null)return he;var ae=ye[0];return ae.length>=le.length?he.slice(le.length):he}).join(`
`)}var ve=function(){function Pe(Ce){this.options=Ce||P}var Oe=Pe.prototype;return Oe.space=function(le){var he=this.rules.block.newline.exec(le);if(he)return he[0].length>1?{type:"space",raw:he[0]}:{raw:`
`}},Oe.code=function(le,he){var ye=this.rules.block.code.exec(le);if(ye){var ae=he[he.length-1];if(ae&&ae.type==="paragraph")return{raw:ye[0],text:ye[0].trimRight()};var Se=ye[0].replace(/^ {4}/gm,"");return{type:"code",raw:ye[0],codeBlockStyle:"indented",text:this.options.pedantic?Se:x(Se,`
`)}}},Oe.fences=function(le){var he=this.rules.block.fences.exec(le);if(he){var ye=he[0],ae=se(ye,he[3]||"");return{type:"code",raw:ye,lang:he[2]?he[2].trim():he[2],text:ae}}},Oe.heading=function(le){var he=this.rules.block.heading.exec(le);if(he)return{type:"heading",raw:he[0],depth:he[1].length,text:he[2]}},Oe.nptable=function(le){var he=this.rules.block.nptable.exec(le);if(he){var ye={type:"table",header:U(he[1].replace(/^ *| *\| *$/g,"")),align:he[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:he[3]?he[3].replace(/\n$/,"").split(`
`):[],raw:he[0]};if(ye.header.length===ye.align.length){var ae=ye.align.length,Se;for(Se=0;Se<ae;Se++)/^ *-+: *$/.test(ye.align[Se])?ye.align[Se]="right":/^ *:-+: *$/.test(ye.align[Se])?ye.align[Se]="center":/^ *:-+ *$/.test(ye.align[Se])?ye.align[Se]="left":ye.align[Se]=null;for(ae=ye.cells.length,Se=0;Se<ae;Se++)ye.cells[Se]=U(ye.cells[Se],ye.header.length);return ye}}},Oe.hr=function(le){var he=this.rules.block.hr.exec(le);if(he)return{type:"hr",raw:he[0]}},Oe.blockquote=function(le){var he=this.rules.block.blockquote.exec(le);if(he){var ye=he[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:he[0],text:ye}}},Oe.list=function(le){var he=this.rules.block.list.exec(le);if(he){for(var ye=he[0],ae=he[2],Se=ae.length>1,$e=ae[ae.length-1]===")",dt={type:"list",raw:ye,ordered:Se,start:Se?+ae.slice(0,-1):"",loose:!1,items:[]},St=he[0].match(this.rules.block.item),Dt=!1,Mt,hr,on,fn,nn,kn,dr,pr=St.length,Yn=0;Yn<pr;Yn++)Mt=St[Yn],ye=Mt,hr=Mt.length,Mt=Mt.replace(/^ *([*+-]|\d+[.)]) */,""),~Mt.indexOf(`
`)&&(hr-=Mt.length,Mt=this.options.pedantic?Mt.replace(/^ {1,4}/gm,""):Mt.replace(new RegExp("^ {1,"+hr+"}","gm"),"")),Yn!==pr-1&&(on=this.rules.block.bullet.exec(St[Yn+1])[0],(Se?on.length===1||!$e&&on[on.length-1]===")":on.length>1||this.options.smartLists&&on!==ae)&&(fn=St.slice(Yn+1).join(`
`),dt.raw=dt.raw.substring(0,dt.raw.length-fn.length),Yn=pr-1)),nn=Dt||/\n\n(?!\s*$)/.test(Mt),Yn!==pr-1&&(Dt=Mt.charAt(Mt.length-1)===`
`,nn||(nn=Dt)),nn&&(dt.loose=!0),kn=/^\[[ xX]\] /.test(Mt),dr=void 0,kn&&(dr=Mt[1]!==" ",Mt=Mt.replace(/^\[[ xX]\] +/,"")),dt.items.push({type:"list_item",raw:ye,task:kn,checked:dr,loose:nn,text:Mt});return dt}},Oe.html=function(le){var he=this.rules.block.html.exec(le);if(he)return{type:this.options.sanitize?"paragraph":"html",raw:he[0],pre:!this.options.sanitizer&&(he[1]==="pre"||he[1]==="script"||he[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(he[0]):V(he[0]):he[0]}},Oe.def=function(le){var he=this.rules.block.def.exec(le);if(he){he[3]&&(he[3]=he[3].substring(1,he[3].length-1));var ye=he[1].toLowerCase().replace(/\s+/g," ");return{tag:ye,raw:he[0],href:he[2],title:he[3]}}},Oe.table=function(le){var he=this.rules.block.table.exec(le);if(he){var ye={type:"table",header:U(he[1].replace(/^ *| *\| *$/g,"")),align:he[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:he[3]?he[3].replace(/\n$/,"").split(`
`):[]};if(ye.header.length===ye.align.length){ye.raw=he[0];var ae=ye.align.length,Se;for(Se=0;Se<ae;Se++)/^ *-+: *$/.test(ye.align[Se])?ye.align[Se]="right":/^ *:-+: *$/.test(ye.align[Se])?ye.align[Se]="center":/^ *:-+ *$/.test(ye.align[Se])?ye.align[Se]="left":ye.align[Se]=null;for(ae=ye.cells.length,Se=0;Se<ae;Se++)ye.cells[Se]=U(ye.cells[Se].replace(/^ *\| *| *\| *$/g,""),ye.header.length);return ye}}},Oe.lheading=function(le){var he=this.rules.block.lheading.exec(le);if(he)return{type:"heading",raw:he[0],depth:he[2].charAt(0)==="="?1:2,text:he[1]}},Oe.paragraph=function(le){var he=this.rules.block.paragraph.exec(le);if(he)return{type:"paragraph",raw:he[0],text:he[1].charAt(he[1].length-1)===`
`?he[1].slice(0,-1):he[1]}},Oe.text=function(le,he){var ye=this.rules.block.text.exec(le);if(ye){var ae=he[he.length-1];return ae&&ae.type==="text"?{raw:ye[0],text:ye[0]}:{type:"text",raw:ye[0],text:ye[0]}}},Oe.escape=function(le){var he=this.rules.inline.escape.exec(le);if(he)return{type:"escape",raw:he[0],text:V(he[1])}},Oe.tag=function(le,he,ye){var ae=this.rules.inline.tag.exec(le);if(ae)return!he&&/^<a /i.test(ae[0])?he=!0:he&&/^<\/a>/i.test(ae[0])&&(he=!1),!ye&&/^<(pre|code|kbd|script)(\s|>)/i.test(ae[0])?ye=!0:ye&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ae[0])&&(ye=!1),{type:this.options.sanitize?"text":"html",raw:ae[0],inLink:he,inRawBlock:ye,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):V(ae[0]):ae[0]}},Oe.link=function(le){var he=this.rules.inline.link.exec(le);if(he){var ye=q(he[2],"()");if(ye>-1){var ae=he[0].indexOf("!")===0?5:4,Se=ae+he[1].length+ye;he[2]=he[2].substring(0,ye),he[0]=he[0].substring(0,Se).trim(),he[3]=""}var $e=he[2],dt="";if(this.options.pedantic){var St=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec($e);St?($e=St[1],dt=St[3]):dt=""}else dt=he[3]?he[3].slice(1,-1):"";$e=$e.trim().replace(/^<([\s\S]*)>$/,"$1");var Dt=ie(he,{href:$e&&$e.replace(this.rules.inline._escapes,"$1"),title:dt&&dt.replace(this.rules.inline._escapes,"$1")},he[0]);return Dt}},Oe.reflink=function(le,he){var ye;if((ye=this.rules.inline.reflink.exec(le))||(ye=this.rules.inline.nolink.exec(le))){var ae=(ye[2]||ye[1]).replace(/\s+/g," ");if(ae=he[ae.toLowerCase()],!ae||!ae.href){var Se=ye[0].charAt(0);return{type:"text",raw:Se,text:Se}}var $e=ie(ye,ae,ye[0]);return $e}},Oe.strong=function(le,he,ye){ye===void 0&&(ye="");var ae=this.rules.inline.strong.start.exec(le);if(ae&&(!ae[1]||ae[1]&&(ye===""||this.rules.inline.punctuation.exec(ye)))){he=he.slice(-1*le.length);var Se=ae[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Se.lastIndex=0;for(var $e;(ae=Se.exec(he))!=null;)if($e=this.rules.inline.strong.middle.exec(he.slice(0,ae.index+3)),$e)return{type:"strong",raw:le.slice(0,$e[0].length),text:le.slice(2,$e[0].length-2)}}},Oe.em=function(le,he,ye){ye===void 0&&(ye="");var ae=this.rules.inline.em.start.exec(le);if(ae&&(!ae[1]||ae[1]&&(ye===""||this.rules.inline.punctuation.exec(ye)))){he=he.slice(-1*le.length);var Se=ae[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Se.lastIndex=0;for(var $e;(ae=Se.exec(he))!=null;)if($e=this.rules.inline.em.middle.exec(he.slice(0,ae.index+2)),$e)return{type:"em",raw:le.slice(0,$e[0].length),text:le.slice(1,$e[0].length-1)}}},Oe.codespan=function(le){var he=this.rules.inline.code.exec(le);if(he){var ye=he[2].replace(/\n/g," "),ae=/[^ ]/.test(ye),Se=ye.startsWith(" ")&&ye.endsWith(" ");return ae&&Se&&(ye=ye.substring(1,ye.length-1)),ye=V(ye,!0),{type:"codespan",raw:he[0],text:ye}}},Oe.br=function(le){var he=this.rules.inline.br.exec(le);if(he)return{type:"br",raw:he[0]}},Oe.del=function(le){var he=this.rules.inline.del.exec(le);if(he)return{type:"del",raw:he[0],text:he[1]}},Oe.autolink=function(le,he){var ye=this.rules.inline.autolink.exec(le);if(ye){var ae,Se;return ye[2]==="@"?(ae=V(this.options.mangle?he(ye[1]):ye[1]),Se="mailto:"+ae):(ae=V(ye[1]),Se=ae),{type:"link",raw:ye[0],text:ae,href:Se,tokens:[{type:"text",raw:ae,text:ae}]}}},Oe.url=function(le,he){var ye;if(ye=this.rules.inline.url.exec(le)){var ae,Se;if(ye[2]==="@")ae=V(this.options.mangle?he(ye[0]):ye[0]),Se="mailto:"+ae;else{var $e;do $e=ye[0],ye[0]=this.rules.inline._backpedal.exec(ye[0])[0];while($e!==ye[0]);ae=V(ye[0]),ye[1]==="www."?Se="http://"+ae:Se=ae}return{type:"link",raw:ye[0],text:ae,href:Se,tokens:[{type:"text",raw:ae,text:ae}]}}},Oe.inlineText=function(le,he,ye){var ae=this.rules.inline.text.exec(le);if(ae){var Se;return he?Se=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ae[0]):V(ae[0]):ae[0]:Se=V(this.options.smartypants?ye(ae[0]):ae[0]),{type:"text",raw:ae[0],text:Se}}},Pe}(),Te=H.noopTest,fe=H.edit,_e=H.merge,ue={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:Te,table:Te,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};ue._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,ue._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,ue.def=fe(ue.def).replace("label",ue._label).replace("title",ue._title).getRegex(),ue.bullet=/(?:[*+-]|\d{1,9}[.)])/,ue.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,ue.item=fe(ue.item,"gm").replace(/bull/g,ue.bullet).getRegex(),ue.list=fe(ue.list).replace(/bull/g,ue.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+ue.def.source+")").getRegex(),ue._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",ue._comment=/<!--(?!-?>)[\s\S]*?-->/,ue.html=fe(ue.html,"i").replace("comment",ue._comment).replace("tag",ue._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ue.paragraph=fe(ue._paragraph).replace("hr",ue.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",ue._tag).getRegex(),ue.blockquote=fe(ue.blockquote).replace("paragraph",ue.paragraph).getRegex(),ue.normal=_e({},ue),ue.gfm=_e({},ue.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*|$)"}),ue.gfm.nptable=fe(ue.gfm.nptable).replace("hr",ue.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",ue._tag).getRegex(),ue.gfm.table=fe(ue.gfm.table).replace("hr",ue.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",ue._tag).getRegex(),ue.pedantic=_e({},ue.normal,{html:fe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",ue._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:Te,paragraph:fe(ue.normal._paragraph).replace("hr",ue.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",ue.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var xe={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Te,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:Te,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};xe._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",xe.punctuation=fe(xe.punctuation).replace(/punctuation/g,xe._punctuation).getRegex(),xe._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",xe._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",xe.em.start=fe(xe.em.start).replace(/punctuation/g,xe._punctuation).getRegex(),xe.em.middle=fe(xe.em.middle).replace(/punctuation/g,xe._punctuation).replace(/overlapSkip/g,xe._overlapSkip).getRegex(),xe.em.endAst=fe(xe.em.endAst,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.em.endUnd=fe(xe.em.endUnd,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.strong.start=fe(xe.strong.start).replace(/punctuation/g,xe._punctuation).getRegex(),xe.strong.middle=fe(xe.strong.middle).replace(/punctuation/g,xe._punctuation).replace(/blockSkip/g,xe._blockSkip).getRegex(),xe.strong.endAst=fe(xe.strong.endAst,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.strong.endUnd=fe(xe.strong.endUnd,"g").replace(/punctuation/g,xe._punctuation).getRegex(),xe.blockSkip=fe(xe._blockSkip,"g").getRegex(),xe.overlapSkip=fe(xe._overlapSkip,"g").getRegex(),xe._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,xe._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,xe._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])?)+(?![-_])/,xe.autolink=fe(xe.autolink).replace("scheme",xe._scheme).replace("email",xe._email).getRegex(),xe._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,xe.tag=fe(xe.tag).replace("comment",ue._comment).replace("attribute",xe._attribute).getRegex(),xe._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,xe._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,xe._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,xe.link=fe(xe.link).replace("label",xe._label).replace("href",xe._href).replace("title",xe._title).getRegex(),xe.reflink=fe(xe.reflink).replace("label",xe._label).getRegex(),xe.reflinkSearch=fe(xe.reflinkSearch,"g").replace("reflink",xe.reflink).replace("nolink",xe.nolink).getRegex(),xe.normal=_e({},xe),xe.pedantic=_e({},xe.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:fe(/^!?\[(label)\]\((.*?)\)/).replace("label",xe._label).getRegex(),reflink:fe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",xe._label).getRegex()}),xe.gfm=_e({},xe.normal,{escape:fe(xe.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),xe.gfm.url=fe(xe.gfm.url,"i").replace("email",xe.gfm._extended_email).getRegex(),xe.breaks=_e({},xe.gfm,{br:fe(xe.br).replace("{2,}","*").getRegex(),text:fe(xe.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var Y={block:ue,inline:xe},oe=z.defaults,ce=Y.block,Re=Y.inline;function Ge(Pe){return Pe.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 Ne(Pe){var Oe="",Ce,le,he=Pe.length;for(Ce=0;Ce<he;Ce++)le=Pe.charCodeAt(Ce),Math.random()>.5&&(le="x"+le.toString(16)),Oe+="&#"+le+";";return Oe}var Je=function(){function Pe(Ce){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ce||oe,this.options.tokenizer=this.options.tokenizer||new ve,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var le={block:ce.normal,inline:Re.normal};this.options.pedantic?(le.block=ce.pedantic,le.inline=Re.pedantic):this.options.gfm&&(le.block=ce.gfm,this.options.breaks?le.inline=Re.breaks:le.inline=Re.gfm),this.tokenizer.rules=le}Pe.lex=function(le,he){var ye=new Pe(he);return ye.lex(le)};var Oe=Pe.prototype;return Oe.lex=function(le){return le=le.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(le,this.tokens,!0),this.inline(this.tokens),this.tokens},Oe.blockTokens=function(le,he,ye){he===void 0&&(he=[]),ye===void 0&&(ye=!0),le=le.replace(/^ +$/gm,"");for(var ae,Se,$e,dt;le;){if(ae=this.tokenizer.space(le)){le=le.substring(ae.raw.length),ae.type&&he.push(ae);continue}if(ae=this.tokenizer.code(le,he)){le=le.substring(ae.raw.length),ae.type?he.push(ae):(dt=he[he.length-1],dt.raw+=`
`+ae.raw,dt.text+=`
`+ae.text);continue}if(ae=this.tokenizer.fences(le)){le=le.substring(ae.raw.length),he.push(ae);continue}if(ae=this.tokenizer.heading(le)){le=le.substring(ae.raw.length),he.push(ae);continue}if(ae=this.tokenizer.nptable(le)){le=le.substring(ae.raw.length),he.push(ae);continue}if(ae=this.tokenizer.hr(le)){le=le.substring(ae.raw.length),he.push(ae);continue}if(ae=this.tokenizer.blockquote(le)){le=le.substring(ae.raw.length),ae.tokens=this.blockTokens(ae.text,[],ye),he.push(ae);continue}if(ae=this.tokenizer.list(le)){for(le=le.substring(ae.raw.length),$e=ae.items.length,Se=0;Se<$e;Se++)ae.items[Se].tokens=this.blockTokens(ae.items[Se].text,[],!1);he.push(ae);continue}if(ae=this.tokenizer.html(le)){le=le.substring(ae.raw.length),he.push(ae);continue}if(ye&&(ae=this.tokenizer.def(le))){le=le.substring(ae.raw.length),this.tokens.links[ae.tag]||(this.tokens.links[ae.tag]={href:ae.href,title:ae.title});continue}if(ae=this.tokenizer.table(le)){le=le.substring(ae.raw.length),he.push(ae);continue}if(ae=this.tokenizer.lheading(le)){le=le.substring(ae.raw.length),he.push(ae);continue}if(ye&&(ae=this.tokenizer.paragraph(le))){le=le.substring(ae.raw.length),he.push(ae);continue}if(ae=this.tokenizer.text(le,he)){le=le.substring(ae.raw.length),ae.type?he.push(ae):(dt=he[he.length-1],dt.raw+=`
`+ae.raw,dt.text+=`
`+ae.text);continue}if(le){var St="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error(St);break}else throw new Error(St)}}return he},Oe.inline=function(le){var he,ye,ae,Se,$e,dt,St=le.length;for(he=0;he<St;he++){dt=le[he];switch(dt.type){case"paragraph":case"text":case"heading":{dt.tokens=[],this.inlineTokens(dt.text,dt.tokens);break}case"table":{for(dt.tokens={header:[],cells:[]},Se=dt.header.length,ye=0;ye<Se;ye++)dt.tokens.header[ye]=[],this.inlineTokens(dt.header[ye],dt.tokens.header[ye]);for(Se=dt.cells.length,ye=0;ye<Se;ye++)for($e=dt.cells[ye],dt.tokens.cells[ye]=[],ae=0;ae<$e.length;ae++)dt.tokens.cells[ye][ae]=[],this.inlineTokens($e[ae],dt.tokens.cells[ye][ae]);break}case"blockquote":{this.inline(dt.tokens);break}case"list":{for(Se=dt.items.length,ye=0;ye<Se;ye++)this.inline(dt.items[ye].tokens);break}}}return le},Oe.inlineTokens=function(le,he,ye,ae,Se){he===void 0&&(he=[]),ye===void 0&&(ye=!1),ae===void 0&&(ae=!1),Se===void 0&&(Se="");var $e,dt=le,St;if(this.tokens.links){var Dt=Object.keys(this.tokens.links);if(Dt.length>0)for(;(St=this.tokenizer.rules.inline.reflinkSearch.exec(dt))!=null;)Dt.includes(St[0].slice(St[0].lastIndexOf("[")+1,-1))&&(dt=dt.slice(0,St.index)+"["+"a".repeat(St[0].length-2)+"]"+dt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(St=this.tokenizer.rules.inline.blockSkip.exec(dt))!=null;)dt=dt.slice(0,St.index)+"["+"a".repeat(St[0].length-2)+"]"+dt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;le;){if($e=this.tokenizer.escape(le)){le=le.substring($e.raw.length),he.push($e);continue}if($e=this.tokenizer.tag(le,ye,ae)){le=le.substring($e.raw.length),ye=$e.inLink,ae=$e.inRawBlock,he.push($e);continue}if($e=this.tokenizer.link(le)){le=le.substring($e.raw.length),$e.type==="link"&&($e.tokens=this.inlineTokens($e.text,[],!0,ae)),he.push($e);continue}if($e=this.tokenizer.reflink(le,this.tokens.links)){le=le.substring($e.raw.length),$e.type==="link"&&($e.tokens=this.inlineTokens($e.text,[],!0,ae)),he.push($e);continue}if($e=this.tokenizer.strong(le,dt,Se)){le=le.substring($e.raw.length),$e.tokens=this.inlineTokens($e.text,[],ye,ae),he.push($e);continue}if($e=this.tokenizer.em(le,dt,Se)){le=le.substring($e.raw.length),$e.tokens=this.inlineTokens($e.text,[],ye,ae),he.push($e);continue}if($e=this.tokenizer.codespan(le)){le=le.substring($e.raw.length),he.push($e);continue}if($e=this.tokenizer.br(le)){le=le.substring($e.raw.length),he.push($e);continue}if($e=this.tokenizer.del(le)){le=le.substring($e.raw.length),$e.tokens=this.inlineTokens($e.text,[],ye,ae),he.push($e);continue}if($e=this.tokenizer.autolink(le,Ne)){le=le.substring($e.raw.length),he.push($e);continue}if(!ye&&($e=this.tokenizer.url(le,Ne))){le=le.substring($e.raw.length),he.push($e);continue}if($e=this.tokenizer.inlineText(le,ae,Ge)){le=le.substring($e.raw.length),Se=$e.raw.slice(-1),he.push($e);continue}if(le){var Mt="Infinite loop on byte: "+le.charCodeAt(0);if(this.options.silent){console.error(Mt);break}else throw new Error(Mt)}}return he},$(Pe,null,[{key:"rules",get:function(){return{block:ce,inline:Re}}}]),Pe}(),rt=z.defaults,_t=H.cleanUrl,ft=H.escape,ut=function(){function Pe(Ce){this.options=Ce||rt}var Oe=Pe.prototype;return Oe.code=function(le,he,ye){var ae=(he||"").match(/\S*/)[0];if(this.options.highlight){var Se=this.options.highlight(le,ae);Se!=null&&Se!==le&&(ye=!0,le=Se)}return ae?'<pre><code class="'+this.options.langPrefix+ft(ae,!0)+'">'+(ye?le:ft(le,!0))+`</code></pre>
`:"<pre><code>"+(ye?le:ft(le,!0))+`</code></pre>
`},Oe.blockquote=function(le){return`<blockquote>
`+le+`</blockquote>
`},Oe.html=function(le){return le},Oe.heading=function(le,he,ye,ae){return this.options.headerIds?"<h"+he+' id="'+this.options.headerPrefix+ae.slug(ye)+'">'+le+"</h"+he+`>
`:"<h"+he+">"+le+"</h"+he+`>
`},Oe.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Oe.list=function(le,he,ye){var ae=he?"ol":"ul",Se=he&&ye!==1?' start="'+ye+'"':"";return"<"+ae+Se+`>
`+le+"</"+ae+`>
`},Oe.listitem=function(le){return"<li>"+le+`</li>
`},Oe.checkbox=function(le){return"<input "+(le?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Oe.paragraph=function(le){return"<p>"+le+`</p>
`},Oe.table=function(le,he){return he&&(he="<tbody>"+he+"</tbody>"),`<table>
<thead>
`+le+`</thead>
`+he+`</table>
`},Oe.tablerow=function(le){return`<tr>
`+le+`</tr>
`},Oe.tablecell=function(le,he){var ye=he.header?"th":"td",ae=he.align?"<"+ye+' align="'+he.align+'">':"<"+ye+">";return ae+le+"</"+ye+`>
`},Oe.strong=function(le){return"<strong>"+le+"</strong>"},Oe.em=function(le){return"<em>"+le+"</em>"},Oe.codespan=function(le){return"<code>"+le+"</code>"},Oe.br=function(){return this.options.xhtml?"<br/>":"<br>"},Oe.del=function(le){return"<del>"+le+"</del>"},Oe.link=function(le,he,ye){if(le=_t(this.options.sanitize,this.options.baseUrl,le),le===null)return ye;var ae='<a href="'+ft(le)+'"';return he&&(ae+=' title="'+he+'"'),ae+=">"+ye+"</a>",ae},Oe.image=function(le,he,ye){if(le=_t(this.options.sanitize,this.options.baseUrl,le),le===null)return ye;var ae='<img src="'+le+'" alt="'+ye+'"';return he&&(ae+=' title="'+he+'"'),ae+=this.options.xhtml?"/>":">",ae},Oe.text=function(le){return le},Pe}(),qe=function(){function Pe(){}var Oe=Pe.prototype;return Oe.strong=function(le){return le},Oe.em=function(le){return le},Oe.codespan=function(le){return le},Oe.del=function(le){return le},Oe.html=function(le){return le},Oe.text=function(le){return le},Oe.link=function(le,he,ye){return""+ye},Oe.image=function(le,he,ye){return""+ye},Oe.br=function(){return""},Pe}(),Ct=function(){function Pe(){this.seen={}}var Oe=Pe.prototype;return Oe.slug=function(le){var he=le.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(he)){var ye=he;do this.seen[ye]++,he=ye+"-"+this.seen[ye];while(this.seen.hasOwnProperty(he))}return this.seen[he]=0,he},Pe}(),kt=z.defaults,Kt=H.unescape,zt=function(){function Pe(Ce){this.options=Ce||kt,this.options.renderer=this.options.renderer||new ut,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new qe,this.slugger=new Ct}Pe.parse=function(le,he){var ye=new Pe(he);return ye.parse(le)};var Oe=Pe.prototype;return Oe.parse=function(le,he){he===void 0&&(he=!0);var ye="",ae,Se,$e,dt,St,Dt,Mt,hr,on,fn,nn,kn,dr,pr,Yn,Tr,Or,Wt,Ln=le.length;for(ae=0;ae<Ln;ae++){fn=le[ae];switch(fn.type){case"space":continue;case"hr":{ye+=this.renderer.hr();continue}case"heading":{ye+=this.renderer.heading(this.parseInline(fn.tokens),fn.depth,Kt(this.parseInline(fn.tokens,this.textRenderer)),this.slugger);continue}case"code":{ye+=this.renderer.code(fn.text,fn.lang,fn.escaped);continue}case"table":{for(hr="",Mt="",dt=fn.header.length,Se=0;Se<dt;Se++)Mt+=this.renderer.tablecell(this.parseInline(fn.tokens.header[Se]),{header:!0,align:fn.align[Se]});for(hr+=this.renderer.tablerow(Mt),on="",dt=fn.cells.length,Se=0;Se<dt;Se++){for(Dt=fn.tokens.cells[Se],Mt="",St=Dt.length,$e=0;$e<St;$e++)Mt+=this.renderer.tablecell(this.parseInline(Dt[$e]),{header:!1,align:fn.align[$e]});on+=this.renderer.tablerow(Mt)}ye+=this.renderer.table(hr,on);continue}case"blockquote":{on=this.parse(fn.tokens),ye+=this.renderer.blockquote(on);continue}case"list":{for(nn=fn.ordered,kn=fn.start,dr=fn.loose,dt=fn.items.length,on="",Se=0;Se<dt;Se++)Yn=fn.items[Se],Tr=Yn.checked,Or=Yn.task,pr="",Yn.task&&(Wt=this.renderer.checkbox(Tr),dr?Yn.tokens.length>0&&Yn.tokens[0].type==="text"?(Yn.tokens[0].text=Wt+" "+Yn.tokens[0].text,Yn.tokens[0].tokens&&Yn.tokens[0].tokens.length>0&&Yn.tokens[0].tokens[0].type==="text"&&(Yn.tokens[0].tokens[0].text=Wt+" "+Yn.tokens[0].tokens[0].text)):Yn.tokens.unshift({type:"text",text:Wt}):pr+=Wt),pr+=this.parse(Yn.tokens,dr),on+=this.renderer.listitem(pr,Or,Tr);ye+=this.renderer.list(on,nn,kn);continue}case"html":{ye+=this.renderer.html(fn.text);continue}case"paragraph":{ye+=this.renderer.paragraph(this.parseInline(fn.tokens));continue}case"text":{for(on=fn.tokens?this.parseInline(fn.tokens):fn.text;ae+1<Ln&&le[ae+1].type==="text";)fn=le[++ae],on+=`
`+(fn.tokens?this.parseInline(fn.tokens):fn.text);ye+=he?this.renderer.paragraph(on):on;continue}default:{var mr='Token with "'+fn.type+'" type was not found.';if(this.options.silent){console.error(mr);return}else throw new Error(mr)}}}return ye},Oe.parseInline=function(le,he){he=he||this.renderer;var ye="",ae,Se,$e=le.length;for(ae=0;ae<$e;ae++){Se=le[ae];switch(Se.type){case"escape":{ye+=he.text(Se.text);break}case"html":{ye+=he.html(Se.text);break}case"link":{ye+=he.link(Se.href,Se.title,this.parseInline(Se.tokens,he));break}case"image":{ye+=he.image(Se.href,Se.title,Se.text);break}case"strong":{ye+=he.strong(this.parseInline(Se.tokens,he));break}case"em":{ye+=he.em(this.parseInline(Se.tokens,he));break}case"codespan":{ye+=he.codespan(Se.text);break}case"br":{ye+=he.br();break}case"del":{ye+=he.del(this.parseInline(Se.tokens,he));break}case"text":{ye+=he.text(Se.text);break}default:{var dt='Token with "'+Se.type+'" type was not found.';if(this.options.silent){console.error(dt);return}else throw new Error(dt)}}}return ye},Pe}(),ln=H.merge,un=H.checkSanitizeDeprecation,We=H.escape,je=z.getDefaults,ht=z.changeDefaults,ct=z.defaults;function He(Pe,Oe,Ce){if(typeof Pe=="undefined"||Pe===null)throw new Error("marked(): input parameter is undefined or null");if(typeof Pe!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(Pe)+", string expected");if(typeof Oe=="function"&&(Ce=Oe,Oe=null),Oe=ln({},He.defaults,Oe||{}),un(Oe),Ce){var le=Oe.highlight,he;try{he=Je.lex(Pe,Oe)}catch($e){return Ce($e)}var ye=function(dt){var St;if(!dt)try{St=zt.parse(he,Oe)}catch(Dt){dt=Dt}return Oe.highlight=le,dt?Ce(dt):Ce(null,St)};if(!le||le.length<3)return ye();if(delete Oe.highlight,!he.length)return ye();var ae=0;He.walkTokens(he,function($e){$e.type==="code"&&(ae++,setTimeout(function(){le($e.text,$e.lang,function(dt,St){if(dt)return ye(dt);St!=null&&St!==$e.text&&($e.text=St,$e.escaped=!0),ae--,ae===0&&ye()})},0))}),ae===0&&ye();return}try{var Se=Je.lex(Pe,Oe);return Oe.walkTokens&&He.walkTokens(Se,Oe.walkTokens),zt.parse(Se,Oe)}catch($e){if($e.message+=`
Please report this to https://github.com/markedjs/marked.`,Oe.silent)return"<p>An error occurred:</p><pre>"+We($e.message+"",!0)+"</pre>";throw $e}}He.options=He.setOptions=function(Pe){return ln(He.defaults,Pe),ht(He.defaults),He},He.getDefaults=je,He.defaults=ct,He.use=function(Pe){var Oe=ln({},Pe);if(Pe.renderer&&function(){var le=He.defaults.renderer||new ut,he=function(Se){var $e=le[Se];le[Se]=function(){for(var dt=arguments.length,St=new Array(dt),Dt=0;Dt<dt;Dt++)St[Dt]=arguments[Dt];var Mt=Pe.renderer[Se].apply(le,St);return Mt===!1&&(Mt=$e.apply(le,St)),Mt}};for(var ye in Pe.renderer)he(ye);Oe.renderer=le}(),Pe.tokenizer&&function(){var le=He.defaults.tokenizer||new ve,he=function(Se){var $e=le[Se];le[Se]=function(){for(var dt=arguments.length,St=new Array(dt),Dt=0;Dt<dt;Dt++)St[Dt]=arguments[Dt];var Mt=Pe.tokenizer[Se].apply(le,St);return Mt===!1&&(Mt=$e.apply(le,St)),Mt}};for(var ye in Pe.tokenizer)he(ye);Oe.tokenizer=le}(),Pe.walkTokens){var Ce=He.defaults.walkTokens;Oe.walkTokens=function(le){Pe.walkTokens(le),Ce&&Ce(le)}}He.setOptions(Oe)},He.walkTokens=function(Pe,Oe){for(var Ce=B(Pe),le;!(le=Ce()).done;){var he=le.value;Oe(he);switch(he.type){case"table":{for(var ye=B(he.tokens.header),ae;!(ae=ye()).done;){var Se=ae.value;He.walkTokens(Se,Oe)}for(var $e=B(he.tokens.cells),dt;!(dt=$e()).done;)for(var St=dt.value,Dt=B(St),Mt;!(Mt=Dt()).done;){var hr=Mt.value;He.walkTokens(hr,Oe)}break}case"list":{He.walkTokens(he.items,Oe);break}default:he.tokens&&He.walkTokens(he.tokens,Oe)}}},He.Parser=zt,He.parser=zt.parse,He.Renderer=ut,He.TextRenderer=qe,He.Lexer=Je,He.lexer=Je.lex,He.Tokenizer=ve,He.Slugger=Ct,He.parse=He;var lt=He;return lt})},ELLl:function(Rt,Ze,K){(function(ee){ee(K("VrN/"))})(function(ee){var $={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},k=ee.Pos;ee.defineOption("autoCloseBrackets",!1,function(l,a,r){r&&r!=ee.Init&&(l.removeKeyMap(B),l.state.closeBrackets=null),a&&(I(Q(a,"pairs")),l.state.closeBrackets=a,l.addKeyMap(B))});function Q(l,a){return a=="pairs"&&typeof l=="string"?l:typeof l=="object"&&l[a]!=null?l[a]:$[a]}var B={Backspace:L,Enter:D};function I(l){for(var a=0;a<l.length;a++){var r=l.charAt(a),t="'"+r+"'";B[t]||(B[t]=z(r))}}I($.pairs+"`");function z(l){return function(a){return g(a,l)}}function G(l){var a=l.state.closeBrackets;if(!a||a.override)return a;var r=l.getModeAt(l.getCursor());return r.closeBrackets||a}function L(l){var a=G(l);if(!a||l.getOption("disableInput"))return ee.Pass;for(var r=Q(a,"pairs"),t=l.listSelections(),c=0;c<t.length;c++){if(!t[c].empty())return ee.Pass;var f=h(l,t[c].head);if(!f||r.indexOf(f)%2!=0)return ee.Pass}for(var c=t.length-1;c>=0;c--){var S=t[c].head;l.replaceRange("",k(S.line,S.ch-1),k(S.line,S.ch+1),"+delete")}}function D(l){var a=G(l),r=a&&Q(a,"explode");if(!r||l.getOption("disableInput"))return ee.Pass;for(var t=l.listSelections(),c=0;c<t.length;c++){if(!t[c].empty())return ee.Pass;var f=h(l,t[c].head);if(!f||r.indexOf(f)%2!=0)return ee.Pass}l.operation(function(){var S=l.lineSeparator()||`
`;l.replaceSelection(S+S,null),l.execCommand("goCharLeft"),t=l.listSelections();for(var C=0;C<t.length;C++){var T=t[C].head.line;l.indentLine(T,null,!0),l.indentLine(T+1,null,!0)}})}function m(l){var a=ee.cmpPos(l.anchor,l.head)>0;return{anchor:new k(l.anchor.line,l.anchor.ch+(a?-1:1)),head:new k(l.head.line,l.head.ch+(a?1:-1))}}function g(l,a){var r=G(l);if(!r||l.getOption("disableInput"))return ee.Pass;var t=Q(r,"pairs"),c=t.indexOf(a);if(c==-1)return ee.Pass;for(var f=Q(r,"closeBefore"),S=Q(r,"triples"),C=t.charAt(c+1)==a,T=l.listSelections(),O=c%2==0,R,b=0;b<T.length;b++){var _=T[b],u=_.head,d,y=l.getRange(u,k(u.line,u.ch+1));if(O&&!_.empty())d="surround";else if((C||!O)&&y==a)C&&o(l,u)?d="both":S.indexOf(a)>=0&&l.getRange(u,k(u.line,u.ch+3))==a+a+a?d="skipThree":d="skip";else if(C&&u.ch>1&&S.indexOf(a)>=0&&l.getRange(k(u.line,u.ch-2),u)==a+a){if(u.ch>2&&/\bstring/.test(l.getTokenTypeAt(k(u.line,u.ch-2))))return ee.Pass;d="addFour"}else if(C){var v=u.ch==0?" ":l.getRange(k(u.line,u.ch-1),u);if(!ee.isWordChar(y)&&v!=a&&!ee.isWordChar(v))d="both";else return ee.Pass}else if(O&&(y.length===0||/\s/.test(y)||f.indexOf(y)>-1))d="both";else return ee.Pass;if(!R)R=d;else if(R!=d)return ee.Pass}var E=c%2?t.charAt(c-1):a,M=c%2?a: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 j=l.getSelections(),N=0;N<j.length;N++)j[N]=E+j[N]+M;l.replaceSelections(j,"around"),j=l.listSelections().slice();for(var N=0;N<j.length;N++)j[N]=m(j[N]);l.setSelections(j)}else R=="both"?(l.replaceSelection(E+M,null),l.triggerElectric(E+M),l.execCommand("goCharLeft")):R=="addFour"&&(l.replaceSelection(E+E+E+E,"before"),l.execCommand("goCharRight"))})}function h(l,a){var r=l.getRange(k(a.line,a.ch-1),k(a.line,a.ch+1));return r.length==2?r:null}function o(l,a){var r=l.getTokenAt(k(a.line,a.ch+1));return/\bstring/.test(r.type)&&r.start==a.ch&&(a.ch==0||!/\bstring/.test(l.getTokenTypeAt(a)))}})},GfqC:function(Rt,Ze,K){"use strict";var ee=K("cDcd"),$=K.n(ee),k=K("TSYQ"),Q=K.n(k);function B(H,P){var x="cannot "+H.method+" "+H.action+" "+P.status+"'",U=new Error(x);return U.status=P.status,U.method=H.method,U.url=H.action,U}function I(H){var P=H.responseText||H.response;if(!P)return P;try{return JSON.parse(P)}catch(x){return P}}function z(H){var P=new XMLHttpRequest;H.onProgress&&P.upload&&(P.upload.onprogress=function(q){q.total>0&&(q.percent=q.loaded/q.total*100),H.onProgress(q)});var x=new FormData;H.data&&Object.keys(H.data).forEach(function(V){var q=H.data[V];if(Array.isArray(q)){q.forEach(function(ie){x.append(V+"[]",ie)});return}x.append(V,H.data[V])}),H.file instanceof Blob?x.append(H.filename,H.file,H.file.name):x.append(H.filename,H.file),P.onerror=function(q){H.onError(q)},P.onload=function(){return P.status<200||P.status>=300?H.onError(B(H,P),I(P)):H.onSuccess(I(P),P)},P.open(H.method,H.action,!0),H.withCredentials&&"withCredentials"in P&&(P.withCredentials=!0);var U=H.headers||{};return U["X-Requested-With"]!==null&&P.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(U).forEach(function(V){U[V]!==null&&P.setRequestHeader(V,U[V])}),P.send(x),{abort:function(){P.abort()}}}var G=+new Date,L=0;function D(){return"rc-upload-"+G+"-"+ ++L}function m(H,P){return H.indexOf(P,H.length-P.length)!==-1}var g=function(H,P){if(H&&P){var x=Array.isArray(P)?P:P.split(","),U=H.name||"",V=H.type||"",q=V.replace(/\/.*$/,"");return x.some(function(ie){var se=ie.trim();return se.charAt(0)==="."?m(U.toLowerCase(),se.toLowerCase()):/\/\*$/.test(se)?q===se.replace(/\/.*$/,""):V===se})}return!0};function h(H,P){var x=H.createReader(),U=[];function V(){x.readEntries(function(q){var ie=Array.prototype.slice.apply(q);U=U.concat(ie);var se=!ie.length;se?P(U):V()})}V()}var o=function(P,x,U){var V=function q(ie,se){se=se||"",ie.isFile?ie.file(function(ve){U(ve)&&(ie.fullPath&&!ve.webkitRelativePath&&(Object.defineProperties(ve,{webkitRelativePath:{writable:!0}}),ve.webkitRelativePath=ie.fullPath.replace(/^\//,""),Object.defineProperties(ve,{webkitRelativePath:{writable:!1}})),x([ve]))}):ie.isDirectory&&h(ie,function(ve){ve.forEach(function(Te){q(Te,""+se+ie.name+"/")})})};P.forEach(function(q){V(q.webkitGetAsEntry())})},l=o,a=Object.assign||function(H){for(var P=1;P<arguments.length;P++){var x=arguments[P];for(var U in x)Object.prototype.hasOwnProperty.call(x,U)&&(H[U]=x[U])}return H},r=function(){function H(P,x){var U=[],V=!0,q=!1,ie=void 0;try{for(var se=P[Symbol.iterator](),ve;!(V=(ve=se.next()).done)&&!(U.push(ve.value),x&&U.length===x);V=!0);}catch(Te){q=!0,ie=Te}finally{try{!V&&se.return&&se.return()}finally{if(q)throw ie}}return U}return function(P,x){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return H(P,x);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),t=function(){function H(P,x){for(var U=0;U<x.length;U++){var V=x[U];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(P,V.key,V)}}return function(P,x,U){return x&&H(P.prototype,x),U&&H(P,U),P}}();function c(H,P,x){return P in H?Object.defineProperty(H,P,{value:x,enumerable:!0,configurable:!0,writable:!0}):H[P]=x,H}function f(H,P){var x={};for(var U in H){if(P.indexOf(U)>=0)continue;if(!Object.prototype.hasOwnProperty.call(H,U))continue;x[U]=H[U]}return x}function S(H,P){if(!(H instanceof P))throw new TypeError("Cannot call a class as a function")}function C(H,P){if(!H)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:H}function T(H,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);H.prototype=Object.create(P&&P.prototype,{constructor:{value:H,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(H,P):H.__proto__=P)}var O=function(P){return Object.keys(P).reduce(function(x,U){return(U.substr(0,5)==="data-"||U.substr(0,5)==="aria-"||U==="role")&&(x[U]=P[U]),x},{})},R=function(H){T(P,H);function P(){var x,U,V,q;S(this,P);for(var ie=arguments.length,se=Array(ie),ve=0;ve<ie;ve++)se[ve]=arguments[ve];return q=(U=(V=C(this,(x=P.__proto__||Object.getPrototypeOf(P)).call.apply(x,[this].concat(se))),V),V.state={uid:D()},V.reqs={},V.onChange=function(Te){var fe=Te.target.files;V.uploadFiles(fe),V.reset()},V.onClick=function(Te){var fe=V.fileInput;if(!fe)return;var _e=V.props,ue=_e.children,xe=_e.onClick;ue&&ue.type==="button"&&(fe.parentNode.focus(),fe.parentNode.querySelector("button").blur()),fe.click(),xe&&xe(Te)},V.onKeyDown=function(Te){Te.key==="Enter"&&V.onClick()},V.onFileDrop=function(Te){var fe=V.props.multiple;if(Te.preventDefault(),Te.type==="dragover")return;if(V.props.directory)l(Array.prototype.slice.call(Te.dataTransfer.items),V.uploadFiles,function(ue){return g(ue,V.props.accept)});else{var _e=Array.prototype.slice.call(Te.dataTransfer.files).filter(function(ue){return g(ue,V.props.accept)});fe===!1&&(_e=_e.slice(0,1)),V.uploadFiles(_e)}},V.uploadFiles=function(Te){var fe=Array.prototype.slice.call(Te);fe.map(function(_e){return _e.uid=D(),_e}).forEach(function(_e){V.upload(_e,fe)})},V.saveFileInput=function(Te){V.fileInput=Te},U),C(V,q)}return t(P,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(U,V){var q=this,ie=this.props;if(!ie.beforeUpload)return setTimeout(function(){return q.post(U)},0);var se=ie.beforeUpload(U,V);se&&se.then?se.then(function(ve){var Te=Object.prototype.toString.call(ve);return Te==="[object File]"||Te==="[object Blob]"?q.post(ve):q.post(U)}).catch(function(ve){console.log(ve)}):se!==!1&&setTimeout(function(){return q.post(U)},0);return}},{key:"post",value:function(U){var V=this;if(!this._isMounted)return;var q=this.props,ie=q.onStart,se=q.onProgress,ve=q.transformFile,Te=ve===void 0?function(fe){return fe}:ve;new Promise(function(fe){var _e=q.action;return typeof _e=="function"&&(_e=_e(U)),fe(_e)}).then(function(fe){var _e=U.uid,ue=q.customRequest||z,xe=Promise.resolve(Te(U)).then(function(Y){var oe=q.data;return typeof oe=="function"&&(oe=oe(Y)),Promise.all([Y,oe])}).catch(function(Y){console.error(Y)});xe.then(function(Y){var oe=r(Y,2),ce=oe[0],Re=oe[1],Ge={action:fe,filename:q.name,data:Re,file:ce,headers:q.headers,withCredentials:q.withCredentials,method:q.method||"post",onProgress:se?function(Ne){se(Ne,U)}:null,onSuccess:function(Je,rt){delete V.reqs[_e],q.onSuccess(Je,U,rt)},onError:function(Je,rt){delete V.reqs[_e],q.onError(Je,rt,U)}};ie(U),V.reqs[_e]=ue(Ge)})})}},{key:"reset",value:function(){this.setState({uid:D()})}},{key:"abort",value:function(U){var V=this.reqs;if(U){var q=U;U&&U.uid&&(q=U.uid),V[q]&&V[q].abort&&V[q].abort(),delete V[q]}else Object.keys(V).forEach(function(ie){V[ie]&&V[ie].abort&&V[ie].abort(),delete V[ie]})}},{key:"render",value:function(){var U,V=this.props,q=V.component,ie=V.prefixCls,se=V.className,ve=V.disabled,Te=V.id,fe=V.style,_e=V.multiple,ue=V.accept,xe=V.children,Y=V.directory,oe=V.openFileDialogOnClick,ce=V.onMouseEnter,Re=V.onMouseLeave,Ge=f(V,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),Ne=Q()((U={},c(U,ie,!0),c(U,ie+"-disabled",ve),c(U,se,se),U)),Je=ve?{}:{onClick:oe?this.onClick:function(){},onKeyDown:oe?this.onKeyDown:function(){},onMouseEnter:ce,onMouseLeave:Re,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return $.a.createElement(q,a({},Je,{className:Ne,role:"button",style:fe}),$.a.createElement("input",a({},O(Ge),{id:Te,type:"file",ref:this.saveFileInput,onClick:function(_t){return _t.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:ue,directory:Y?"directory":null,webkitdirectory:Y?"webkitdirectory":null,multiple:_e,onChange:this.onChange})),xe)}}]),P}(ee.Component),b=R,_=Object.assign||function(H){for(var P=1;P<arguments.length;P++){var x=arguments[P];for(var U in x)Object.prototype.hasOwnProperty.call(x,U)&&(H[U]=x[U])}return H},u=function(){function H(P,x){for(var U=0;U<x.length;U++){var V=x[U];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(P,V.key,V)}}return function(P,x,U){return x&&H(P.prototype,x),U&&H(P,U),P}}();function d(H,P){if(!(H instanceof P))throw new TypeError("Cannot call a class as a function")}function y(H,P){if(!H)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:H}function v(H,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);H.prototype=Object.create(P&&P.prototype,{constructor:{value:H,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(H,P):H.__proto__=P)}function E(){}var M=function(H){v(P,H);function P(){var x,U,V,q;d(this,P);for(var ie=arguments.length,se=Array(ie),ve=0;ve<ie;ve++)se[ve]=arguments[ve];return q=(U=(V=y(this,(x=P.__proto__||Object.getPrototypeOf(P)).call.apply(x,[this].concat(se))),V),V.saveUploader=function(Te){V.uploader=Te},U),y(V,q)}return u(P,[{key:"abort",value:function(U){this.uploader.abort(U)}},{key:"render",value:function(){return $.a.createElement(b,_({},this.props,{ref:this.saveUploader}))}}]),P}(ee.Component);M.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:E,onError:E,onSuccess:E,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var N=M,j=Ze.a=N},HmJG:function(Rt,Ze,K){},IBYe:function(Rt,Ze,K){"use strict";function ee($){return null}Ze.a=ee},LYsE:function(Rt,Ze,K){"use strict";var ee=K("9og8"),$=K("giR+"),k=K("fyUT"),Q=K("2qtc"),B=K("kLXV"),I=K("/zsF"),z=K("PArb"),G=K("14J3"),L=K("BMrR"),D=K("+L6B"),m=K("2/Rp"),g=K("k1fw"),h=K("0Owb"),o=K("tJVT"),l=K("WmNS"),a=K.n(l),r=K("cDcd"),t=K.n(r),c=K("5Dmo"),f=K("3S7+"),S=K("5NDa"),C=K("5rEg"),T=K("jCWc"),O=K("kPKH"),R=K("BoS7"),b=K("Sdc0"),_=K("7Kak"),u=K("9yH6"),d=K("sRBo"),y=K("kaz8"),v=K("miYZ"),E=K("tsqr"),M=K("oBTY"),N=K("PpiC"),j=K("Ty5D"),H=K("9kvl"),P=K("V0Rq"),x=K("Ot1p"),U=K("kqOp"),V=K("7qnI"),q=K("1vsH"),ie=K("YJx+"),se=K.n(ie),ve=K("9Bee"),Te=K("u2Z1"),fe=["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="\u2581",ue=function(ke,xt){var Ae=ke.problemset,me=ke.globalSetting,pe=ke.exercise,ir=ke.loading,Vt=ke.dispatch,we=ke.editData,at=ke.editKey,ge=ke.setEditKey,en=ge===void 0?function(){}:ge,sr=ke.cancelAdd,ur=sr===void 0?function(){}:sr,Wn=ke.addCallback,Ft=Wn===void 0?function(){}:Wn,or=ke.reload,ot=or===void 0?function(){}:or,Mn=ke.setIsClaer,bn=Mn===void 0?function(){}:Mn,sn=Object(N.a)(ke,["problemset","globalSetting","exercise","loading","dispatch","editData","editKey","setEditKey","cancelAdd","addCallback","reload","setIsClaer"]),$t=Object(r.useState)(""),Dn=Object(o.a)($t,2),hn=Dn[0],Jt=Dn[1],It=Object(r.useState)(""),jt=Object(o.a)(It,2),tr=jt[0],nr=jt[1],Un=Object(r.useState)([]),yn=Object(o.a)(Un,2),Nt=yn[0],Xt=yn[1],Ht=Object(r.useState)(""),Ot=Object(o.a)(Ht,2),Qn=Ot[0],An=Ot[1],pn=Object(r.useState)(),Gn=Object(o.a)(pn,2),dn=Gn[0],En=Gn[1],qt=Object(r.useState)(!1),In=Object(o.a)(qt,2),Jn=In[0],qn=In[1],wn=Object(r.useState)(),Nn=Object(o.a)(wn,2),cn=Nn[0],rr=Nn[1],zn=Object(r.useState)(0),fr=Object(o.a)(zn,2),cr=fr[0],Hn=fr[1],Fn=Object(r.useState)(!1),gr=Object(o.a)(Fn,2),Sn=gr[0],xn=gr[1],Cn=Object(r.useState)(!1),_n=Object(o.a)(Cn,2),Qt=_n[0],yt=_n[1],Pt=Object(r.useState)([]),Lt=Object(o.a)(Pt,2),wt=Lt[0],Gt=Lt[1],rn=Object(r.useState)(1),tn=Object(o.a)(rn,2),st=tn[0],Ye=tn[1],Be=Object(r.useState)(!1),ze=Object(o.a)(Be,2),Le=ze[0],tt=ze[1],Ve=Object(r.useRef)(!1),pt=Object(j.i)(),bt=Object(r.useState)([]),mt=Object(o.a)(bt,2),At=mt[0],vt=mt[1],Et=function($n){vt([].concat(Object(M.a)(At),[Object(g.a)({},$n)]))};Object(r.useEffect)(function(){if(Ve.current)return;if(!(we!=null&&we.question_title)){xn(!0),Jt(""),En(!1),rr(2),Xt([]),An(""),qn(!1);return}Jt(we==null?void 0:we.question_title),En(we==null?void 0:we.is_ordered),Ye(we==null?void 0:we.difficulty),tt(!(we!=null&&we.repeat_answer)),rr(we==null?void 0:we.question_score);var Er=we==null?void 0:we.standard_answer.map(function($n){return $n.answer_text});Xt(Object(M.a)(Er)),Gt(we.tag_discipline_ids),nr(we==null?void 0:we.analysis)},[we,Sn]),Object(r.useEffect)(function(){qn(!1),Sn&&Er();function Er(){return $n.apply(this,arguments)}function $n(){return $n=Object(ee.a)(a.a.mark(function br(){var _r,yr,Mr;return a.a.wrap(function(Ur){for(;;)switch(Ur.prev=Ur.next){case 0:return Ur.next=2,Object(P.I)({sub_discipline_id:(_r=pe.editData)===null||_r===void 0||((yr=_r.exercise)===null||yr===void 0)?void 0:yr.sub_discipline_id});case 2:Mr=Ur.sent,vt(Mr.tag_disciplines);case 4:case"end":return Ur.stop()}},br)})),$n.apply(this,arguments)}},[Sn]),Object(r.useImperativeHandle)(xt,function(){return{onSave:Yt,isEdit:Sn}}),Object(r.useEffect)(function(){var Er,$n=pe!=null&&(Er=pe.tagDisciplineData)!==null&&Er!==void 0&&Er.tag_disciplines&&Array.isArray(pe.tagDisciplineData.tag_disciplines)?pe.tagDisciplineData.tag_disciplines:[];vt($n)},[pe.tagDisciplineData]);var an=function($n){($n==null?void 0:$n.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),xn(!1),en(-1),Ve.current=!1,ot())},Yt=function(){var Er=Object(ee.a)(a.a.mark(function $n(){var br,_r,yr,Mr,Vr,Ur,Ir;return a.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:if(br=[],_r=!1,yt(!0),Nt.forEach(function(Oa,qr){br.push({choice_id:qr+1,answer_text:[]}),Oa.forEach(function(ea,Ea){br[qr].answer_text.push(ea),(!ea||!Object(q.fb)(ea,1e4))&&(An("".concat(qr,"-").concat(Ea)),E.b.info(ea?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),_r=!0)})}),!_r){Kr.next=7;break}return yt(!1),Kr.abrupt("return",!1);case 7:if(Ve.current=!0,!we.question_id){Kr.next=19;break}if(!((we==null?void 0:we.is_my)===1)){Kr.next=13;break}B.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 Oa=Object(ee.a)(a.a.mark(function ea(){var Ea,Ra;return a.a.wrap(function(ha){for(;;)switch(ha.prev=ha.next){case 0:return ha.next=2,Vt({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:hn,question_type:3,question_score:cn,is_ordered:dn,standard_answers:br,tag_discipline_ids:wt,sub_discipline_id:(Ea=pe.editData)===null||Ea===void 0||((Ra=Ea.exercise)===null||Ra===void 0)?void 0:Ra.sub_discipline_id,difficulty:st,is_cover:1,repeat_answer:!Le,analysis:tr}});case 2:yr=ha.sent,an(yr);case 4:case"end":return ha.stop()}},ea)}));function qr(){return Oa.apply(this,arguments)}return qr}(),onCancel:function(){var Oa=Object(ee.a)(a.a.mark(function ea(){var Ea,Ra;return a.a.wrap(function(ha){for(;;)switch(ha.prev=ha.next){case 0:return ha.next=2,Vt({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:hn,question_type:3,question_score:cn,is_ordered:dn,standard_answers:br,tag_discipline_ids:wt,sub_discipline_id:(Ea=pe.editData)===null||Ea===void 0||((Ra=Ea.exercise)===null||Ra===void 0)?void 0:Ra.sub_discipline_id,difficulty:st,repeat_answer:!Le,analysis:tr}});case 2:yr=ha.sent,an(yr);case 4:case"end":return ha.stop()}},ea)}));function qr(){return Oa.apply(this,arguments)}return qr}()}),Kr.next=17;break;case 13:return Kr.next=15,Vt({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:hn,question_type:3,question_score:cn,is_ordered:dn,standard_answers:br,tag_discipline_ids:wt,sub_discipline_id:(Mr=pe.editData)===null||Mr===void 0||((Vr=Mr.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,difficulty:st,repeat_answer:!Le,analysis:tr}});case 15:yr=Kr.sent,an(yr);case 17:Kr.next=23;break;case 19:return Kr.next=21,Vt({type:"exercise/addExerciseQuestion",payload:{insert_id:we==null?void 0:we.insert_id,categoryId:pt.categoryId,question_title:hn,question_type:3,question_score:cn,is_ordered:dn,standard_answers:br,tag_discipline_ids:wt,sub_discipline_id:(Ur=pe.editData)===null||Ur===void 0||((Ir=Ur.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:st,repeat_answer:!Le,analysis:tr}});case 21:yr=Kr.sent,an(yr);case 23:return yt(!1),Kr.abrupt("return",{name:hn,analysis:tr,standard_answers:br,is_ordered:dn});case 25:case"end":return Kr.stop()}},$n)}));return function(){return Er.apply(this,arguments)}}(),lr=function($n,br,_r){var yr=Nt.slice();if(br&&yr.splice($n,br),_r&&Jn||!we.question_id)for(var Mr=0;Mr<_r;Mr++)yr.splice($n+Mr,0,[""]);Hn(yr==null?void 0:yr.length),qn(!0),console.log(yr,"newStandardAnswers"),Xt(yr)},Bn=function($n,br,_r){An("");var yr=Nt.slice();yr[$n][br]=_r,Xt(yr)},jn=function($n){var br=Nt.slice();br[$n]=[].concat(Object(M.a)(br[$n]),[""]),Xt(br)},Ut=function($n,br){var _r=Nt.slice();if(!_r[$n][br]){_r[$n]=_r[$n].filter(function(yr,Mr){return Mr!==br}),Xt(_r);return}B.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:se.a.modal,onOk:function(){_r[$n]=_r[$n].filter(function(Mr,Vr){return Vr!==br}),Xt(_r)}})},mn=function($n){B.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:se.a.modal,onOk:function(){var _r=0;Jt(hn.replace(/\▁/g,function(yr){return _r++,_r-1===$n?"":yr})),setTimeout(function(){var yr=Nt.slice();yr=Nt.filter(function(Mr,Vr){return $n!==Vr}),Xt(yr)},500)}})},Pn=function(){},Kn=function(){var $n,br,_r,yr,Mr,Vr;return console.log(Nt,"answers"),t.a.createElement("aside",null,t.a.createElement("div",{className:se.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(U.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:hn,onChange:function(Ir){return Jt(Ir)},showNullButton:(($n=pe.editData)===null||$n===void 0||((br=$n.exercise)===null||br===void 0)?void 0:br.exercise_status)===1,deleteEmptyDisabled:!(((_r=pe.editData)===null||_r===void 0||((yr=_r.exercise)===null||yr===void 0)?void 0:yr.exercise_status)===1)||Qt,onPlaceholderChange:lr})),t.a.createElement("div",{className:"mt20"},Nt.map(function(Ur,Ir){var Ca,Kr;return t.a.createElement(V.a,{key:Ir,answers:Ur,index:Ir,is_md:!0,exerciseIsPublish:((Ca=pe.editData)===null||Ca===void 0||((Kr=Ca.exercise)===null||Kr===void 0)?void 0:Kr.exercise_status)!==1,activeOptionErrorIndex:Qn,onAnswerChange:Bn,addChildAnswer:jn,deleteChildAnswer:Ut,deleteChildAnswermain:mn})})),t.a.createElement("div",{className:"mt20"},Nt.length>1&&t.a.createElement("span",null,t.a.createElement(y.a,{checked:dn,onChange:function(Ir){return En(Ir.target.checked)},className:"".concat(se.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(se.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:se.a.titleWrap},t.a.createElement("span",{className:se.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:tr,onChange:function(Ir){return nr(Ir)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:cn,max:1e4,min:0,onChange:function(Ir){rr(Ir)}})," \u5206 \xA0 ",!!cn&&!!cr&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(cn/cr).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:se.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:st,onChange:function(Ir){Ye(Ir.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:se.a.titleWrap},t.a.createElement("span",{className:"".concat(se.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:se.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(Te.a,{value:wt,selectvalues:we==null?void 0:we.tag_discipline_ids,onChange:Gt,subId:(Mr=pe.editData)===null||Mr===void 0||((Vr=Mr.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,knowledgeOptions:At,onAddKnowledgeFinish:Et})),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:Le,onChange:function(Ir){tt(Ir)}}))),t.a.createElement("aside",{className:"tr"},(at!==-1||we.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){ur(),xn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Yt()}},"\u4FDD\u5B58")))},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(Er){var $n,br;return(pe==null||(($n=pe.editData)===null||$n===void 0||((br=$n.exercise)===null||br===void 0))?void 0:br.exercise_status)===1?Er:Er.id!=="del"&&Er.id!=="add"}),Lr=function(){var Er=Object(ee.a)(a.a.mark(function $n(br){return a.a.wrap(function(yr){for(;;)switch(yr.prev=yr.next){case 0:if(!(at!==-1)){yr.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),yr.abrupt("return");case 3:yr.t0=br.id,yr.next=yr.t0==="del"?6:yr.t0==="up"||yr.t0==="down"?8:yr.t0==="edit"?12:yr.t0==="add"?15:17;break;case 6:return B.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(ee.a)(a.a.mark(function Vr(){return a.a.wrap(function(Ir){for(;;)switch(Ir.prev=Ir.next){case 0:return Ir.next=2,Object(P.n)({id:we.question_id});case 2:Vt({type:"exercise/editExercise",payload:Object(g.a)({},pt)});case 3:case"end":return Ir.stop()}},Vr)}))()}}),yr.abrupt("break",17);case 8:return yr.next=10,Vt({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:br.id}});case 10:return Vt({type:"exercise/editExercise",payload:Object(g.a)({},pt)}),yr.abrupt("break",17);case 12:return en(we.dragKey),xn(!0),yr.abrupt("break",17);case 15:return Ft({key:we.key,insert_id:we==null?void 0:we.question_id,question_type:3}),yr.abrupt("break",17);case 17:case"end":return yr.stop()}},$n)}));return function(br){return Er.apply(this,arguments)}}(),Br=function(){var $n;return t.a.createElement("aside",null,t.a.createElement("div",{className:se.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u586B\u7A7A\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(ve.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(ve.a,{value:we.question_title})),t.a.createElement("div",{className:se.a.questionChoices},we==null||(($n=we.standard_answer)===null||$n===void 0)?void 0:$n.map(function(br,_r){return t.a.createElement(L.a,{key:_r,align:"middle"},t.a.createElement(O.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",br.choice_id,"\uFF09\uFF1A"),t.a.createElement(O.a,{flex:"1"},t.a.createElement(L.a,{align:"middle",gutter:[1,1]},br.answer_text.map(function(yr,Mr){return t.a.createElement(O.a,{span:24,key:Mr},t.a.createElement(C.a,{key:_r,checked:we.standard_answer.includes(_r),disabled:!0,value:yr}))}))))})),t.a.createElement("div",{className:se.a.action},!we.hideAction&&vn.map(function(br,_r){return br.id==="up"&&we.key===1||br.id==="down"&&we.key===we.len?null:t.a.createElement(f.a,{key:_r,placement:"bottom",title:br.name},t.a.createElement("span",{onClick:function(){return Lr(br)},className:br.icon}))})))};return t.a.createElement("section",{className:se.a.wrap},!Sn&&Br(),Sn&&Kn())},xe=Object(H.a)(function(nt){var ke=nt.problemset,xt=nt.loading,Ae=nt.exercise,me=nt.globalSetting;return{problemset:ke,globalSetting:me,exercise:Ae,loading:xt.effects}},null,null,{forwardRef:!0})(Object(r.forwardRef)(ue)),Y=["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=function(ke,xt){var Ae=ke.problemset,me=ke.globalSetting,pe=ke.exercise,ir=ke.loading,Vt=ke.dispatch,we=ke.onRef,at=we===void 0?function(){}:we,ge=ke.editData,en=ke.editKey,sr=ke.setEditKey,ur=sr===void 0?function(){}:sr,Wn=ke.cancelAdd,Ft=Wn===void 0?function(){}:Wn,or=ke.reload,ot=or===void 0?function(){}:or,Mn=ke.addCallback,bn=Mn===void 0?function(){}:Mn,sn=ke.setIsClaer,$t=sn===void 0?function(){}:sn,Dn=Object(N.a)(ke,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","editKey","setEditKey","cancelAdd","reload","addCallback","setIsClaer"]),hn=Object(r.useState)(),Jt=Object(o.a)(hn,2),It=Jt[0],jt=Jt[1],tr=Object(r.useState)(""),nr=Object(o.a)(tr,2),Un=nr[0],yn=nr[1],Nt=Object(r.useState)(!1),Xt=Object(o.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=Object(r.useState)(),An=Object(o.a)(Qn,2),pn=An[0],Gn=An[1],dn=Object(r.useState)([]),En=Object(o.a)(dn,2),qt=En[0],In=En[1],Jn=Object(r.useState)([]),qn=Object(o.a)(Jn,2),wn=qn[0],Nn=qn[1],cn=Object(r.useState)(1),rr=Object(o.a)(cn,2),zn=rr[0],fr=rr[1],cr=Object(r.useState)(!1),Hn=Object(o.a)(cr,2),Fn=Hn[0],gr=Hn[1],Sn=Object(r.useState)(""),xn=Object(o.a)(Sn,2),Cn=xn[0],_n=xn[1],Qt=Object(r.useRef)(!1),yt=function(Be){Nn([].concat(Object(M.a)(wn),[Object(g.a)({},Be)]))},Pt=Object(j.i)();Object(r.useEffect)(function(){if(Qt.current)return;if(!(ge!=null&&ge.question_choices)){Ot(!0),yn(""),Gn(2),jt("");return}gr(!(ge!=null&&ge.repeat_answer)),yn(ge==null?void 0:ge.question_title),Gn(ge==null?void 0:ge.question_score),fr(ge==null?void 0:ge.difficulty),jt(ge.standard_answer[0]+""),In(ge.tag_discipline_ids),_n(ge==null?void 0:ge.analysis)},[ge,Ht]),Object(r.useEffect)(function(){Ht&&Ye();function Ye(){return Be.apply(this,arguments)}function Be(){return Be=Object(ee.a)(a.a.mark(function ze(){var Le,tt,Ve;return a.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(P.I)({sub_discipline_id:(Le=pe.editData)===null||Le===void 0||((tt=Le.exercise)===null||tt===void 0)?void 0:tt.sub_discipline_id});case 2:Ve=bt.sent,Nn(Ve.tag_disciplines);case 4:case"end":return bt.stop()}},ze)})),Be.apply(this,arguments)}},[Ht]),Object(r.useImperativeHandle)(xt,function(){return{onSave:wt,isEdit:Ht}}),Object(r.useEffect)(function(){var Ye,Be=pe!=null&&(Ye=pe.tagDisciplineData)!==null&&Ye!==void 0&&Ye.tag_disciplines&&Array.isArray(pe.tagDisciplineData.tag_disciplines)?pe.tagDisciplineData.tag_disciplines:[];Nn(Be)},[pe.tagDisciplineData]);var Lt=function(Be){(Be==null?void 0:Be.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),Ot(!1),ur(-1),Qt.current=!1,ot())},wt=function(){var Ye=Object(ee.a)(a.a.mark(function Be(){var ze,Le,tt,Ve,pt,bt;return a.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(Un){At.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),At.abrupt("return",!1);case 3:if(It){At.next=6;break}return E.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),At.abrupt("return",!1);case 6:if(ze=[{choice_text:"\u6B63\u786E",is_answer:It==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:It==="2"?2:0}],Qt.current=!0,!ge.question_id){At.next=19;break}if(!((ge==null?void 0:ge.is_my)===1)){At.next=13;break}B.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 vt=Object(ee.a)(a.a.mark(function an(){var Yt,lr;return a.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:return jn.next=2,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:Un,question_type:2,question_score:pn,question_choices:ze.map(function(Ut){return Ut.choice_text}),standard_answers:ze.filter(function(Ut){return Ut.is_answer}).map(function(Ut){return Ut.is_answer}),tag_discipline_ids:qt,sub_discipline_id:(Yt=pe.editData)===null||Yt===void 0||((lr=Yt.exercise)===null||lr===void 0)?void 0:lr.sub_discipline_id,difficulty:zn,is_cover:1,repeat_answer:!Fn,analysis:Cn}});case 2:Le=jn.sent,Lt(Le);case 4:case"end":return jn.stop()}},an)}));function Et(){return vt.apply(this,arguments)}return Et}(),onCancel:function(){var vt=Object(ee.a)(a.a.mark(function an(){var Yt,lr;return a.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:return jn.next=2,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:Un,question_type:2,question_score:pn,question_choices:ze.map(function(Ut){return Ut.choice_text}),standard_answers:ze.filter(function(Ut){return Ut.is_answer}).map(function(Ut){return Ut.is_answer}),tag_discipline_ids:qt,sub_discipline_id:(Yt=pe.editData)===null||Yt===void 0||((lr=Yt.exercise)===null||lr===void 0)?void 0:lr.sub_discipline_id,difficulty:zn,repeat_answer:!Fn,analysis:Cn}});case 2:Le=jn.sent,Lt(Le);case 4:case"end":return jn.stop()}},an)}));function Et(){return vt.apply(this,arguments)}return Et}()}),At.next=17;break;case 13:return At.next=15,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:Un,question_type:2,question_score:pn,question_choices:ze.map(function(vt){return vt.choice_text}),standard_answers:ze.filter(function(vt){return vt.is_answer}).map(function(vt){return vt.is_answer}),tag_discipline_ids:qt,sub_discipline_id:(tt=pe.editData)===null||tt===void 0||((Ve=tt.exercise)===null||Ve===void 0)?void 0:Ve.sub_discipline_id,difficulty:zn,repeat_answer:!Fn,analysis:Cn}});case 15:Le=At.sent,Lt(Le);case 17:At.next=23;break;case 19:return At.next=21,Vt({type:"exercise/addExerciseQuestion",payload:{insert_id:ge==null?void 0:ge.insert_id,categoryId:Pt.categoryId,question_title:Un,question_type:2,question_score:pn,question_choices:ze.map(function(vt){return vt.choice_text}),standard_answers:ze.filter(function(vt){return vt.is_answer}).map(function(vt){return vt.is_answer}),tag_discipline_ids:qt,sub_discipline_id:(pt=pe.editData)===null||pt===void 0||((bt=pt.exercise)===null||bt===void 0)?void 0:bt.sub_discipline_id,difficulty:zn,repeat_answer:!Fn,analysis:Cn}});case 21:Le=At.sent,Lt(Le);case 23:return At.abrupt("return",{name:Un,choices:ze});case 24:case"end":return At.stop()}},Be)}));return function(){return Ye.apply(this,arguments)}}(),Gt=[{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(Ye){var Be,ze;return(pe==null||((Be=pe.editData)===null||Be===void 0||((ze=Be.exercise)===null||ze===void 0))?void 0:ze.exercise_status)===1?Ye:Ye.id!=="del"&&Ye.id!=="add"}),rn=function(){var Ye=Object(ee.a)(a.a.mark(function Be(ze){return a.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:if(!(en!==-1)){tt.next=3;break}return E.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=ze.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 B.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(ee.a)(a.a.mark(function pt(){return a.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(P.n)({id:ge.question_id});case 2:Vt({type:"exercise/editExercise",payload:Object(g.a)({},Pt)});case 3:case"end":return mt.stop()}},pt)}))()}}),tt.abrupt("break",17);case 8:return tt.next=10,Vt({type:"exercise/exeriseMoveUpDown",payload:{id:ge.question_id,opr:ze.id}});case 10:return Vt({type:"exercise/editExercise",payload:Object(g.a)({},Pt)}),tt.abrupt("break",17);case 12:return ur(ge.dragKey),Ot(!0),tt.abrupt("break",17);case 15:return bn({key:ge.key,insert_id:ge==null?void 0:ge.question_id,question_type:2}),tt.abrupt("break",17);case 17:case"end":return tt.stop()}},Be)}));return function(ze){return Ye.apply(this,arguments)}}(),tn=function(){var Be;return t.a.createElement("aside",null,t.a.createElement("div",{className:se.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(ve.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:ge.question_title})),t.a.createElement("div",{className:se.a.questionChoices},ge==null||((Be=ge.question_choices)===null||Be===void 0)?void 0:Be.map(function(ze,Le){return t.a.createElement(u.a,{key:Le,checked:ge.standard_answer.includes(Le+1),disabled:!0},Y[Le],". ",t.a.createElement("span",{className:"c-black font14"},ze.choice_text))})),t.a.createElement("div",{className:se.a.action},!ge.hideAction&&Gt.map(function(ze,Le){return ze.id==="up"&&ge.key===1||ze.id==="down"&&ge.key===ge.len?null:t.a.createElement(f.a,{key:Le,placement:"bottom",title:ze.name},t.a.createElement("span",{onClick:function(){return rn(ze)},className:ze.icon}))})))},st=function(){var Be,ze;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:se.a.titleWrap},t.a.createElement("span",{className:se.a.required},"*"),t.a.createElement("span",{className:se.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(tt){return yn(tt)}}),t.a.createElement("p",{className:se.a.titleWrap},t.a.createElement("span",{className:se.a.required},"*"),t.a.createElement("span",{className:se.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:se.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(u.a.Group,{buttonStyle:"solid",value:It,onChange:function(tt){return jt(tt.target.value)}},t.a.createElement(u.a.Button,{value:"1",className:"".concat(se.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(u.a.Button,{value:"2",className:se.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:se.a.titleWrap},t.a.createElement("span",{className:se.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:Cn,onChange:function(tt){return _n(tt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:pn,max:1e4,min:0,onChange:function(tt){Gn(tt)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:se.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:zn,onChange:function(tt){fr(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:se.a.titleWrap},t.a.createElement("span",{className:"".concat(se.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:se.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(Te.a,{value:qt,selectvalues:ge==null?void 0:ge.tag_discipline_ids,onChange:In,subId:(Be=pe.editData)===null||Be===void 0||((ze=Be.exercise)===null||ze===void 0)?void 0:ze.sub_discipline_id,knowledgeOptions:wn,onAddKnowledgeFinish:yt})),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:Fn,onChange:function(tt){gr(tt)}}))),t.a.createElement("aside",{className:"tr"},(en!==-1||ge.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Ft(),Ot(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){wt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:se.a.wrap},!Ht&&tn(),Ht&&st())},ce=Object(H.a)(function(nt){var ke=nt.problemset,xt=nt.loading,Ae=nt.exercise,me=nt.globalSetting;return{problemset:ke,globalSetting:me,exercise:Ae,loading:xt.effects}},null,null,{forwardRef:!0})(Object(r.forwardRef)(oe)),Re=["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"],Ge=Object(r.forwardRef)(function(nt,ke){var xt=nt.problemset,Ae=nt.globalSetting,me=nt.exercise,pe=nt.loading,ir=nt.dispatch,Vt=nt.onRef,we=Vt===void 0?function(){}:Vt,at=nt.editData,ge=nt.cancelAdd,en=ge===void 0?function(){}:ge,sr=nt.editKey,ur=nt.setEditKey,Wn=ur===void 0?function(){}:ur,Ft=nt.setIsClaer,or=Ft===void 0?function(){}:Ft,ot=nt.addCallback,Mn=ot===void 0?function(bt){}:ot,bn=nt.reload,sn=bn===void 0?function(){}:bn,$t=Object(N.a)(nt,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),Dn=Object(r.useState)([]),hn=Object(o.a)(Dn,2),Jt=hn[0],It=hn[1],jt=Object(r.useState)(),tr=Object(o.a)(jt,2),nr=tr[0],Un=tr[1],yn=Object(r.useState)([]),Nt=Object(o.a)(yn,2),Xt=Nt[0],Ht=Nt[1],Ot=Object(r.useState)(""),Qn=Object(o.a)(Ot,2),An=Qn[0],pn=Qn[1],Gn=Object(r.useState)(),dn=Object(o.a)(Gn,2),En=dn[0],qt=dn[1],In=Object(r.useState)(!1),Jn=Object(o.a)(In,2),qn=Jn[0],wn=Jn[1],Nn=Object(r.useState)([]),cn=Object(o.a)(Nn,2),rr=cn[0],zn=cn[1],fr=Object(r.useState)(1),cr=Object(o.a)(fr,2),Hn=cr[0],Fn=cr[1],gr=Object(r.useState)(!1),Sn=Object(o.a)(gr,2),xn=Sn[0],Cn=Sn[1],_n=Object(r.useState)(""),Qt=Object(o.a)(_n,2),yt=Qt[0],Pt=Qt[1],Lt=Object(r.useState)([]),wt=Object(o.a)(Lt,2),Gt=wt[0],rn=wt[1],tn=Object(r.useRef)(!1),st=function(mt){rn([].concat(Object(M.a)(Gt),[Object(g.a)({},mt)]))},Ye=Object(j.i)();Object(r.useEffect)(function(){It(["","","",""])},[]),Object(r.useEffect)(function(){if(tn.current)return;if(!(at!=null&&at.question_choices)){wn(!0),pn(""),qt(5),It(["","","",""]),Ht([]);return}pn(at==null?void 0:at.question_title),qt(at==null?void 0:at.question_score),Cn(!(at!=null&&at.repeat_answer)),Fn(at==null?void 0:at.difficulty),It(at==null?void 0:at.question_choices.map(function(mt){return mt.choice_text}));var bt=[];at==null||at.standard_answer.map(function(mt,At){bt.push(mt-1)}),Ht(bt),zn(at.tag_discipline_ids),Pt(at==null?void 0:at.analysis)},[at,qn]),Object(r.useEffect)(function(){qn&&bt();function bt(){return mt.apply(this,arguments)}function mt(){return mt=Object(ee.a)(a.a.mark(function At(){var vt,Et,an;return a.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return lr.next=2,Object(P.I)({sub_discipline_id:(vt=me.editData)===null||vt===void 0||((Et=vt.exercise)===null||Et===void 0)?void 0:Et.sub_discipline_id});case 2:an=lr.sent,rn(an.tag_disciplines);case 4:case"end":return lr.stop()}},At)})),mt.apply(this,arguments)}},[qn]),Object(r.useImperativeHandle)(ke,function(){return{onSave:ze,isEdit:qn}}),Object(r.useEffect)(function(){var bt,mt=me!=null&&(bt=me.tagDisciplineData)!==null&&bt!==void 0&&bt.tag_disciplines&&Array.isArray(me.tagDisciplineData.tag_disciplines)?me.tagDisciplineData.tag_disciplines:[];rn(mt)},[me.tagDisciplineData]);var Be=function(mt){(mt==null?void 0:mt.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),wn(!1),Wn(-1),tn.current=!1,sn())},ze=function(){var bt=Object(ee.a)(a.a.mark(function mt(){var At,vt,Et,an,Yt,lr,Bn;return a.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(An){Ut.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ut.abrupt("return",!1);case 3:if(At=Jt.findIndex(function(mn){return!mn}),!(At>-1)){Ut.next=7;break}return E.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Re[At]," \u9009\u9879\u7684\u5185\u5BB9")),Ut.abrupt("return",!1);case 7:if(Xt.length){Ut.next=10;break}return E.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ut.abrupt("return",!1);case 10:if(!(Xt.length<1)){Ut.next=13;break}return E.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ut.abrupt("return",!1);case 13:if(vt=Jt.map(function(mn,Pn){return{choice_text:mn,is_answer:Xt.includes(Pn)?Pn+1:0}}),tn.current=!0,!at.question_id){Ut.next=26;break}if(!((at==null?void 0:at.is_my)===1)){Ut.next=20;break}B.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 mn=Object(ee.a)(a.a.mark(function Kn(){var vn,Lr;return a.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,ir({type:"exercise/editExerciseQuestion",payload:{id:at.question_id,question_title:An,question_type:1,question_score:En,question_choices:vt.map(function($n){return $n.choice_text}),standard_answers:vt.filter(function($n){return $n.is_answer}).map(function($n){return $n.is_answer}),tag_discipline_ids:rr,sub_discipline_id:(vn=me.editData)===null||vn===void 0||((Lr=vn.exercise)===null||Lr===void 0)?void 0:Lr.sub_discipline_id,difficulty:Hn,is_cover:1,repeat_answer:!xn,analysis:yt}});case 2:Et=Er.sent,Be(Et);case 4:case"end":return Er.stop()}},Kn)}));function Pn(){return mn.apply(this,arguments)}return Pn}(),onCancel:function(){var mn=Object(ee.a)(a.a.mark(function Kn(){var vn,Lr;return a.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,ir({type:"exercise/editExerciseQuestion",payload:{id:at.question_id,question_title:An,question_type:1,question_score:En,question_choices:vt.map(function($n){return $n.choice_text}),standard_answers:vt.filter(function($n){return $n.is_answer}).map(function($n){return $n.is_answer}),tag_discipline_ids:rr,sub_discipline_id:(vn=me.editData)===null||vn===void 0||((Lr=vn.exercise)===null||Lr===void 0)?void 0:Lr.sub_discipline_id,difficulty:Hn,repeat_answer:!xn,analysis:yt}});case 2:Et=Er.sent,Be(Et);case 4:case"end":return Er.stop()}},Kn)}));function Pn(){return mn.apply(this,arguments)}return Pn}()}),Ut.next=24;break;case 20:return Ut.next=22,ir({type:"exercise/editExerciseQuestion",payload:{id:at.question_id,question_title:An,question_type:1,question_score:En,question_choices:vt.map(function(mn){return mn.choice_text}),standard_answers:vt.filter(function(mn){return mn.is_answer}).map(function(mn){return mn.is_answer}),tag_discipline_ids:rr,sub_discipline_id:(an=me.editData)===null||an===void 0||((Yt=an.exercise)===null||Yt===void 0)?void 0:Yt.sub_discipline_id,difficulty:Hn,repeat_answer:!xn,analysis:yt}});case 22:Et=Ut.sent,Be(Et);case 24:Ut.next=30;break;case 26:return Ut.next=28,ir({type:"exercise/addExerciseQuestion",payload:{insert_id:at==null?void 0:at.insert_id,categoryId:Ye.categoryId,question_title:An,question_type:1,question_score:En,question_choices:vt.map(function(mn){return mn.choice_text}),standard_answers:vt.filter(function(mn){return mn.is_answer}).map(function(mn){return mn.is_answer}),tag_discipline_ids:rr,sub_discipline_id:(lr=me.editData)===null||lr===void 0||((Bn=lr.exercise)===null||Bn===void 0)?void 0:Bn.sub_discipline_id,difficulty:Hn,repeat_answer:!xn,analysis:yt}});case 28:Et=Ut.sent,Be(Et);case 30:case"end":return Ut.stop()}},mt)}));return function(){return bt.apply(this,arguments)}}(),Le=[{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(bt){var mt,At;return(me==null||((mt=me.editData)===null||mt===void 0||((At=mt.exercise)===null||At===void 0))?void 0:At.exercise_status)===1?bt:bt.id!=="del"&&bt.id!=="add"}),tt=function(){var bt=Object(ee.a)(a.a.mark(function mt(At){return a.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:if(!(sr!==-1)){Et.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Et.abrupt("return");case 3:Et.t0=At.id,Et.next=Et.t0==="del"?6:Et.t0==="up"||Et.t0==="down"?8:Et.t0==="edit"?12:Et.t0==="add"?15:17;break;case 6:return B.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(ee.a)(a.a.mark(function Yt(){return a.a.wrap(function(Bn){for(;;)switch(Bn.prev=Bn.next){case 0:return Bn.next=2,Object(P.n)({id:at.question_id});case 2:ir({type:"exercise/editExercise",payload:Object(g.a)({},Ye)});case 3:case"end":return Bn.stop()}},Yt)}))()}}),Et.abrupt("break",17);case 8:return Et.next=10,ir({type:"exercise/exeriseMoveUpDown",payload:{id:at.question_id,opr:At.id}});case 10:return ir({type:"exercise/editExercise",payload:Object(g.a)({},Ye)}),Et.abrupt("break",17);case 12:return Wn(at.dragKey),wn(!0),Et.abrupt("break",17);case 15:return Mn({key:at.key,insert_id:at==null?void 0:at.question_id,question_type:1}),Et.abrupt("break",17);case 17:case"end":return Et.stop()}},mt)}));return function(At){return bt.apply(this,arguments)}}(),Ve=function(){var mt;return t.a.createElement("aside",null,t.a.createElement("div",{className:se.a.questionType},!(at!=null&&at.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},at.key,"\u3001\u591A\u9009\u9898"),"\uFF08",at.question_score,"\u5206\uFF09")),at!=null&&at.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},at.key,"."),t.a.createElement(ve.a,{value:at.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",at.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:at.question_title})),t.a.createElement("div",{className:se.a.questionChoices},at==null||((mt=at.question_choices)===null||mt===void 0)?void 0:mt.map(function(At,vt){return t.a.createElement(L.a,{key:vt},t.a.createElement(O.a,null,t.a.createElement(y.a,{key:vt,checked:at.standard_answer.includes(vt+1),disabled:!0},Re[vt],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(ve.a,{value:At.choice_text}))))})),t.a.createElement("div",{className:se.a.action},!at.hideAction&&Le.map(function(At,vt){return At.id==="up"&&at.key===1||At.id==="down"&&at.key===at.len?null:t.a.createElement(f.a,{key:vt,placement:"bottom",title:At.name},t.a.createElement("span",{onClick:function(){return tt(At)},className:At.icon}))})))},pt=function(){var mt,At;return t.a.createElement("aside",null,t.a.createElement("div",{className:se.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:se.a.titleWrap},t.a.createElement("span",{className:se.a.required},"*"),t.a.createElement("span",{className:se.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:An,onChange:function(Et){return pn(Et)}}),t.a.createElement("p",{className:se.a.titleWrap},t.a.createElement("span",{className:se.a.required},"*"),t.a.createElement("span",{className:se.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:se.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Jt.map(function(vt,Et){var an,Yt;return t.a.createElement("div",{className:se.a.choiceWrap,key:Et},t.a.createElement(f.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(se.a.answer," ").concat(Xt.includes(Et)?se.a.activeAnswer:""),onClick:function(){Xt.includes(Et)?Ht(Xt.filter(function(Bn){return Bn!==Et})):Ht([].concat(Object(M.a)(Xt),[Et]))}},Re[Et])),t.a.createElement("div",{className:se.a.editorWrap},nr===Et?t.a.createElement(x.a,{id:"single-question-option-".concat(Et),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:vt,onChange:function(Bn){Jt[Et]=Bn,It(Jt)}}):t.a.createElement("div",{className:se.a.htmlWrap,onClick:function(){return Un(Et)}},t.a.createElement(ve.a,{value:vt}))),((an=me.editData)===null||an===void 0||((Yt=an.exercise)===null||Yt===void 0)?void 0:Yt.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,Et>1&&t.a.createElement(f.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(se.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return It(Jt.filter(function(Bn,jn){return jn!==Et}))}})),Et<7&&Et===Jt.length-1&&t.a.createElement(f.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(se.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return It([].concat(Object(M.a)(Jt),[""]))}}))))}),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:se.a.titleWrap},t.a.createElement("span",{className:se.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:yt,onChange:function(Et){return Pt(Et)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:En,max:1e4,min:0,onChange:function(Et){qt(Et)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:se.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Hn,onChange:function(Et){Fn(Et.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:se.a.titleWrap},t.a.createElement("span",{className:"".concat(se.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:se.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(Te.a,{value:rr,selectvalues:at==null?void 0:at.tag_discipline_ids,onChange:zn,subId:(mt=me.editData)===null||mt===void 0||((At=mt.exercise)===null||At===void 0)?void 0:At.sub_discipline_id,knowledgeOptions:Gt,onAddKnowledgeFinish:st})),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:xn,onChange:function(Et){Cn(Et)}}))),t.a.createElement("aside",{className:"tr"},(sr!==-1||at.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){en(),wn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){ze()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:se.a.wrap},!qn&&Ve(),qn&&pt())}),Ne=Object(H.a)(function(nt){var ke=nt.problemset,xt=nt.loading,Ae=nt.exercise,me=nt.globalSetting;return{problemset:ke,globalSetting:me,exercise:Ae,loading:xt.effects}},null,null,{forwardRef:!0})(Ge),Je=K("55Ip"),rt=["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=function(ke,xt){var Ae=ke.problemset,me=ke.globalSetting,pe=ke.exercise,ir=ke.loading,Vt=ke.dispatch,we=ke.editData,at=ke.cancelAdd,ge=at===void 0?function(){}:at,en=ke.editKey,sr=ke.setEditKey,ur=sr===void 0?function(){}:sr,Wn=ke.addCallback,Ft=Wn===void 0?function(){}:Wn,or=ke.reload,ot=or===void 0?function(){}:or,Mn=ke.setIsClaer,bn=Mn===void 0?function(){}:Mn,sn=Object(N.a)(ke,["problemset","globalSetting","exercise","loading","dispatch","editData","cancelAdd","editKey","setEditKey","addCallback","reload","setIsClaer"]),$t=Object(r.useState)(""),Dn=Object(o.a)($t,2),hn=Dn[0],Jt=Dn[1],It=Object(r.useState)(""),jt=Object(o.a)(It,2),tr=jt[0],nr=jt[1],Un=Object(r.useState)(""),yn=Object(o.a)(Un,2),Nt=yn[0],Xt=yn[1],Ht=Object(r.useState)([]),Ot=Object(o.a)(Ht,2),Qn=Ot[0],An=Ot[1],pn=Object(r.useState)(""),Gn=Object(o.a)(pn,2),dn=Gn[0],En=Gn[1],qt=Object(r.useState)(),In=Object(o.a)(qt,2),Jn=In[0],qn=In[1],wn=Object(r.useState)(!1),Nn=Object(o.a)(wn,2),cn=Nn[0],rr=Nn[1],zn=Object(r.useState)([]),fr=Object(o.a)(zn,2),cr=fr[0],Hn=fr[1],Fn=Object(r.useState)(!1),gr=Object(o.a)(Fn,2),Sn=gr[0],xn=gr[1],Cn=Object(r.useState)(!1),_n=Object(o.a)(Cn,2),Qt=_n[0],yt=_n[1],Pt=Object(j.i)(),Lt=Object(r.useRef)(!1);Object(r.useEffect)(function(){var Be;if(Lt.current)return;we.edit&&(xn(!0),nr(""),Jt(""),Hn([])),Jt(we.shixun_name),nr(we.question_title);var ze=[];(Be=we.shixun)===null||Be===void 0||Be.map(function(Le){ze.push(Le.challenge_score)}),Hn(ze)},[we]),Object(r.useEffect)(function(){rr(!1)},[Sn]),Object(r.useImperativeHandle)(xt,function(){return{onSave:Gt,isEdit:Sn}});var wt=function(ze){(ze==null?void 0:ze.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),xn(!1),ur(-1),Lt.current=!1,ot())},Gt=function(){var Be=Object(ee.a)(a.a.mark(function ze(){var Le,tt,Ve;return a.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:if(Le=[],tt=!1,!tt){bt.next=4;break}return bt.abrupt("return",!1);case 4:if(Lt.current=!0,yt(!0),!we.question_id){bt.next=12;break}return bt.next=9,Vt({type:"exercise/editExerciseQuestion",payload:{id:we.question_id,question_title:tr,shixun_name:hn,shixun_id:we.shixun_id,question_type:5,question_scores:cr}});case 9:Ve=bt.sent,bt.next=15;break;case 12:return bt.next=14,Vt({type:"exercise/addExerciseQuestion",payload:{insert_id:we==null?void 0:we.insert_id,categoryId:Pt.categoryId,question_title:tr,shixun_name:hn,shixun_id:we.shixun_id,question_type:5,question_scores:cr,is_copy:we.is_copy}});case 14:Ve=bt.sent;case 15:return wt(Ve),yt(!1),bt.abrupt("return",{name:tr,analysis:Nt,standard_answers:Le,is_ordered:Jn});case 18:case"end":return bt.stop()}},ze)}));return function(){return Be.apply(this,arguments)}}(),rn=function(){var ze;return t.a.createElement("aside",null,t.a.createElement("div",{className:se.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(C.a,{defaultValue:hn,onChange:function(tt){Jt(tt.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:tr,onChange:function(tt){nr(tt)}})),t.a.createElement("div",{className:"mt20"},(ze=we.shixun)===null||ze===void 0?void 0:ze.map(function(Le,tt){return t.a.createElement(L.a,{gutter:[20,20]},t.a.createElement(O.a,{flex:"1"},tt+1,".",Le.challenge_name),t.a.createElement(O.a,null,t.a.createElement(k.a,{defaultValue:cr[tt],onChange:function(pt){cr[tt]=pt,Hn(cr),console.log("srore:L",cr[tt])}})," \u5206"))})),t.a.createElement("div",{className:"mt20"},Qn.length>1&&t.a.createElement("span",null,t.a.createElement(y.a,{checked:Jn,onChange:function(tt){return qn(tt.target.checked)},className:"".concat(se.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(se.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||!(we!=null&&we.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){ge(),xn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:Qt,className:"ml20",type:"primary",onClick:function(){Gt()}},"\u4FDD\u5B58")))},tn=[{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(Be){var ze,Le;return(pe==null||((ze=pe.editData)===null||ze===void 0||((Le=ze.exercise)===null||Le===void 0))?void 0:Le.exercise_status)===1?Be:Be.id!=="del"&&Be.id!=="add"}),st=function(){var Be=Object(ee.a)(a.a.mark(function ze(Le){return a.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:if(!(en!==-1)){Ve.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ve.abrupt("return");case 3:Ve.t0=Le.id,Ve.next=Ve.t0==="del"?6:Ve.t0==="up"||Ve.t0==="down"?8:Ve.t0==="edit"?12:Ve.t0==="add"?15:17;break;case 6:return B.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(ee.a)(a.a.mark(function bt(){return a.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return At.next=2,Object(P.n)({id:we.question_id});case 2:Vt({type:"exercise/editExercise",payload:Object(g.a)({},Pt)});case 3:case"end":return At.stop()}},bt)}))()}}),Ve.abrupt("break",17);case 8:return Ve.next=10,Vt({type:"exercise/exeriseMoveUpDown",payload:{id:we.question_id,opr:Le.id}});case 10:return Vt({type:"exercise/editExercise",payload:Object(g.a)({},Pt)}),Ve.abrupt("break",17);case 12:return ur(we.dragKey),xn(!0),Ve.abrupt("break",17);case 15:return Vt({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:we.key,insert_id:we==null?void 0:we.question_id,question_type:5}}}),Ve.abrupt("break",17);case 17:case"end":return Ve.stop()}},ze)}));return function(Le){return Be.apply(this,arguments)}}(),Ye=function(){var ze,Le;return t.a.createElement("aside",null,t.a.createElement("div",{className:se.a.questionType},!(we!=null&&we.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},we.key,"\u3001\u5B9E\u8BAD\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(ve.a,{value:we.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",we.question_score,"\u5206\uFF09"),!!((ze=we.schools)!==null&&ze!==void 0&&ze.length)&&t.a.createElement(f.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(ve.a,{value:we.shixun_name})),t.a.createElement("div",{className:"mt30"}),(Le=we.shixun)===null||Le===void 0?void 0:Le.map(function(tt,Ve){return t.a.createElement("div",{key:Ve},"\u7B2C",Ve+1,"\u5173 ",t.a.createElement("span",{className:"ml10"},tt.challenge_name)," ",t.a.createElement("span",{className:"ml10"},tt.challenge_score," \u5206"))}),t.a.createElement("div",{className:se.a.action},t.a.createElement(Je.a,{target:"_blank",to:"/shixuns/".concat(we.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!we.hideAction&&tn.map(function(tt,Ve){return tt.id==="up"&&we.key===1||tt.id==="down"&&we.key===we.len?null:t.a.createElement(f.a,{key:Ve,placement:"bottom",title:tt.name},t.a.createElement("span",{onClick:function(){return st(tt)},className:tt.icon}))})))};return t.a.createElement("section",{className:se.a.wrap},!Sn&&Ye(),Sn&&rn())},ft=Object(H.a)(function(nt){var ke=nt.problemset,xt=nt.loading,Ae=nt.globalSetting,me=nt.exercise;return{problemset:ke,globalSetting:Ae,exercise:me,loading:xt.effects}},null,null,{forwardRef:!0})(Object(r.forwardRef)(_t)),ut=["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"],qe=function(ke,xt){var Ae=ke.problemset,me=ke.exercise,pe=ke.globalSetting,ir=ke.loading,Vt=ke.dispatch,we=ke.onRef,at=we===void 0?function(){}:we,ge=ke.editData,en=ke.cancelAdd,sr=en===void 0?function(){}:en,ur=ke.editKey,Wn=ke.setEditKey,Ft=Wn===void 0?function(){}:Wn,or=ke.setIsClaer,ot=or===void 0?function(){}:or,Mn=ke.reload,bn=Mn===void 0?function(){}:Mn,sn=ke.addCallback,$t=sn===void 0?function(At){}:sn,Dn=Object(N.a)(ke,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","reload","addCallback"]),hn=Object(r.useState)([]),Jt=Object(o.a)(hn,2),It=Jt[0],jt=Jt[1],tr=Object(r.useState)(),nr=Object(o.a)(tr,2),Un=nr[0],yn=nr[1],Nt=Object(r.useState)([]),Xt=Object(o.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=Object(r.useState)(""),An=Object(o.a)(Qn,2),pn=An[0],Gn=An[1],dn=Object(r.useState)(),En=Object(o.a)(dn,2),qt=En[0],In=En[1],Jn=Object(r.useState)([]),qn=Object(o.a)(Jn,2),wn=qn[0],Nn=qn[1],cn=Object(r.useState)(!1),rr=Object(o.a)(cn,2),zn=rr[0],fr=rr[1],cr=Object(r.useState)(1),Hn=Object(o.a)(cr,2),Fn=Hn[0],gr=Hn[1],Sn=Object(r.useState)(!1),xn=Object(o.a)(Sn,2),Cn=xn[0],_n=xn[1],Qt=Object(r.useState)(""),yt=Object(o.a)(Qt,2),Pt=yt[0],Lt=yt[1],wt=Object(j.i)(),Gt=Object(r.useRef)(null),rn=Object(r.useRef)(!1),tn=Object(r.useState)([]),st=Object(o.a)(tn,2),Ye=st[0],Be=st[1],ze=function(vt){Be([].concat(Object(M.a)(Ye),[Object(g.a)({},vt)]))};Object(r.useEffect)(function(){jt(["","","",""])},[]),Object(r.useEffect)(function(){if(rn.current)return;if(!(ge!=null&&ge.question_choices)){fr(!0),Gn(""),In(5),jt(["","","",""]),Ot([]);return}Gn(ge==null?void 0:ge.question_title),In(ge==null?void 0:ge.question_score),_n(!(ge!=null&&ge.repeat_answer)),Lt(ge==null?void 0:ge.analysis),gr(ge==null?void 0:ge.difficulty),jt(ge==null?void 0:ge.question_choices.map(function(vt){return vt.choice_text}));var At=[];ge==null||ge.standard_answer.map(function(vt,Et){At.push(vt-1)}),Nn(ge.tag_discipline_ids),Ot(At)},[ge,zn]),Object(r.useEffect)(function(){zn&&At();function At(){return vt.apply(this,arguments)}function vt(){return vt=Object(ee.a)(a.a.mark(function Et(){var an,Yt,lr;return a.a.wrap(function(jn){for(;;)switch(jn.prev=jn.next){case 0:return jn.next=2,Object(P.I)({sub_discipline_id:(an=me.editData)===null||an===void 0||((Yt=an.exercise)===null||Yt===void 0)?void 0:Yt.sub_discipline_id});case 2:lr=jn.sent,Be(lr.tag_disciplines);case 4:case"end":return jn.stop()}},Et)})),vt.apply(this,arguments)}},[zn]),Object(r.useEffect)(function(){var At,vt=me!=null&&(At=me.tagDisciplineData)!==null&&At!==void 0&&At.tag_disciplines&&Array.isArray(me.tagDisciplineData.tag_disciplines)?me.tagDisciplineData.tag_disciplines:[];Be(vt)},[me.tagDisciplineData]),Object(r.useImperativeHandle)(xt,function(){return{onSave:tt,isEdit:zn}});var Le=function(vt){(vt==null?void 0:vt.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),fr(!1),Ft(-1),rn.current=!1,bn())},tt=function(){var At=Object(ee.a)(a.a.mark(function vt(){var Et,an,Yt,lr,Bn,jn,Ut;return a.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(pn){Pn.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Pn.abrupt("return",!1);case 3:if(Et=It.findIndex(function(Kn){return!Kn}),!(Et>-1)){Pn.next=7;break}return E.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ut[Et]," \u9009\u9879\u7684\u5185\u5BB9")),Pn.abrupt("return",!1);case 7:if(Ht.length){Pn.next=10;break}return E.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(!(Ht.length<1)){Pn.next=13;break}return E.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Pn.abrupt("return",!1);case 13:if(an=It.map(function(Kn,vn){return{choice_text:Kn,is_answer:Ht.includes(vn)?vn+1:0}}),rn.current=!0,!ge.question_id){Pn.next=26;break}if(!((ge==null?void 0:ge.is_my)===1)){Pn.next=20;break}B.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 Kn=Object(ee.a)(a.a.mark(function Lr(){var Br,Er;return a.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:return br.next=2,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:pn,question_type:1,question_score:qt,question_choices:an.map(function(_r){return _r.choice_text}),standard_answers:an.filter(function(_r){return _r.is_answer}).map(function(_r){return _r.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(Br=me.editData)===null||Br===void 0||((Er=Br.exercise)===null||Er===void 0)?void 0:Er.sub_discipline_id,difficulty:Fn,is_cover:1,repeat_answer:!Cn,analysis:Pt}});case 2:Yt=br.sent,Le(Yt);case 4:case"end":return br.stop()}},Lr)}));function vn(){return Kn.apply(this,arguments)}return vn}(),onCancel:function(){var Kn=Object(ee.a)(a.a.mark(function Lr(){var Br,Er;return a.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:return br.next=2,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:pn,question_type:1,question_score:qt,question_choices:an.map(function(_r){return _r.choice_text}),standard_answers:an.filter(function(_r){return _r.is_answer}).map(function(_r){return _r.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(Br=me.editData)===null||Br===void 0||((Er=Br.exercise)===null||Er===void 0)?void 0:Er.sub_discipline_id,difficulty:Fn,repeat_answer:!Cn,analysis:Pt}});case 2:Yt=br.sent,Le(Yt);case 4:case"end":return br.stop()}},Lr)}));function vn(){return Kn.apply(this,arguments)}return vn}()}),Pn.next=24;break;case 20:return Pn.next=22,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:pn,question_type:1,question_score:qt,question_choices:an.map(function(Kn){return Kn.choice_text}),standard_answers:an.filter(function(Kn){return Kn.is_answer}).map(function(Kn){return Kn.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(lr=me.editData)===null||lr===void 0||((Bn=lr.exercise)===null||Bn===void 0)?void 0:Bn.sub_discipline_id,difficulty:Fn,repeat_answer:!Cn,analysis:Pt}});case 22:Yt=Pn.sent,Le(Yt);case 24:Pn.next=30;break;case 26:return Pn.next=28,Vt({type:"exercise/addExerciseQuestion",payload:{insert_id:ge==null?void 0:ge.insert_id,categoryId:wt.categoryId,question_title:pn,question_type:1,question_score:qt,question_choices:an.map(function(Kn){return Kn.choice_text}),standard_answers:an.filter(function(Kn){return Kn.is_answer}).map(function(Kn){return Kn.is_answer}),tag_discipline_ids:wn,sub_discipline_id:(jn=me.editData)===null||jn===void 0||((Ut=jn.exercise)===null||Ut===void 0)?void 0:Ut.sub_discipline_id,difficulty:Fn,repeat_answer:!Cn,analysis:Pt}});case 28:Yt=Pn.sent,Le(Yt);case 30:case"end":return Pn.stop()}},vt)}));return function(){return At.apply(this,arguments)}}(),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(At){var vt,Et;return(me==null||((vt=me.editData)===null||vt===void 0||((Et=vt.exercise)===null||Et===void 0))?void 0:Et.exercise_status)===1?At:At.id!=="del"&&At.id!=="add"}),pt=function(){var At=Object(ee.a)(a.a.mark(function vt(Et){return a.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(!(ur!==-1)){Yt.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Yt.abrupt("return");case 3:Yt.t0=Et.id,Yt.next=Yt.t0==="del"?6:Yt.t0==="up"||Yt.t0==="down"?8:Yt.t0==="edit"?12:Yt.t0==="add"?15:17;break;case 6:return B.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(ee.a)(a.a.mark(function Bn(){return a.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(P.n)({id:ge.question_id});case 2:Vt({type:"exercise/editExercise",payload:Object(g.a)({},wt)});case 3:case"end":return Ut.stop()}},Bn)}))()}}),Yt.abrupt("break",17);case 8:return Yt.next=10,Vt({type:"exercise/exeriseMoveUpDown",payload:{id:ge.question_id,opr:Et.id}});case 10:return Vt({type:"exercise/editExercise",payload:Object(g.a)({},wt)}),Yt.abrupt("break",17);case 12:return Ft(ge.dragKey),fr(!0),Yt.abrupt("break",17);case 15:return $t({key:ge.key,insert_id:ge==null?void 0:ge.question_id,question_type:0}),Yt.abrupt("break",17);case 17:case"end":return Yt.stop()}},vt)}));return function(Et){return At.apply(this,arguments)}}(),bt=function(){var vt;return t.a.createElement("aside",{ref:Gt},t.a.createElement("div",{className:se.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u5355\u9009\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(ve.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:ge.question_title})),t.a.createElement("div",{className:se.a.questionChoices},ge==null||((vt=ge.question_choices)===null||vt===void 0)?void 0:vt.map(function(Et,an){return t.a.createElement(L.a,{key:an},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:an,checked:ge.standard_answer.includes(an+1),disabled:!0},ut[an],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(ve.a,{value:Et.choice_text}))))})),t.a.createElement("div",{className:se.a.action},!ge.hideAction&&Ve.map(function(Et,an){return Et.id==="up"&&ge.key===1||Et.id==="down"&&ge.key===ge.len?null:t.a.createElement(f.a,{key:an,placement:"bottom",title:Et.name},t.a.createElement("span",{onClick:function(){return pt(Et)},className:Et.icon}))})))},mt=function(){var vt,Et;return t.a.createElement("aside",null,t.a.createElement("div",{className:se.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:se.a.titleWrap},t.a.createElement("span",{className:se.a.required},"*"),t.a.createElement("span",{className:se.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:pn,onChange:function(Yt){return Gn(Yt)}}),t.a.createElement("p",{className:se.a.titleWrap},t.a.createElement("span",{className:se.a.required},"*"),t.a.createElement("span",{className:se.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:se.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),It.map(function(an,Yt){var lr,Bn;return t.a.createElement("div",{className:se.a.choiceWrap,key:Yt},t.a.createElement(f.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(se.a.answer," ").concat(Ht.includes(Yt)?se.a.activeAnswer:""),onClick:function(){Ht.includes(Yt)?Ot(Ht.filter(function(Ut){return Ut!==Yt})):Ot([].concat(Object(M.a)(Ht),[Yt]))}},ut[Yt])),t.a.createElement("div",{className:se.a.editorWrap},Un===Yt?t.a.createElement(x.a,{id:"single-question-option-".concat(Yt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:an,onChange:function(Ut){It[Yt]=Ut,jt(It)}}):t.a.createElement("div",{className:se.a.htmlWrap,onClick:function(){return yn(Yt)}},t.a.createElement(ve.a,{value:an}))),((lr=me.editData)===null||lr===void 0||((Bn=lr.exercise)===null||Bn===void 0)?void 0:Bn.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,Yt>1&&t.a.createElement(f.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(se.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return jt(It.filter(function(Ut,mn){return mn!==Yt}))}})),Yt<7&&Yt===It.length-1&&t.a.createElement(f.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(se.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return jt([].concat(Object(M.a)(It),[""]))}}))))}),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:se.a.titleWrap},t.a.createElement("span",{className:se.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:Pt,onChange:function(Yt){return Lt(Yt)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:qt,max:1e4,min:0,onChange:function(Yt){In(Yt)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:se.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Fn,onChange:function(Yt){gr(Yt.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:se.a.titleWrap},t.a.createElement("span",{className:"".concat(se.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:se.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(Te.a,{selectvalues:ge==null?void 0:ge.tag_discipline_ids,value:wn,onChange:Nn,subId:(vt=me.editData)===null||vt===void 0||((Et=vt.exercise)===null||Et===void 0)?void 0:Et.sub_discipline_id,knowledgeOptions:Ye,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:Cn,onChange:function(Yt){_n(Yt)}}))),t.a.createElement("aside",{className:"tr"},(ur!==-1||ge.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){sr(),fr(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){tt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:se.a.wrap},!zn&&bt(),zn&&mt())},Ct=Object(H.a)(function(nt){var ke=nt.problemset,xt=nt.loading,Ae=nt.globalSetting,me=nt.exercise;return{problemset:ke,globalSetting:Ae,exercise:me,loading:xt.effects}},null,null,{forwardRef:!0})(Object(r.forwardRef)(qe)),kt=K("Z9P2"),Kt=["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"],zt=function(ke,xt){var Ae=ke.problemset,me=ke.exercise,pe=ke.globalSetting,ir=ke.loading,Vt=ke.dispatch,we=ke.onRef,at=we===void 0?function(){}:we,ge=ke.editData,en=ke.cancelAdd,sr=en===void 0?function(){}:en,ur=ke.editKey,Wn=ke.setEditKey,Ft=Wn===void 0?function(){}:Wn,or=ke.reload,ot=or===void 0?function(){}:or,Mn=ke.addCallback,bn=Mn===void 0?function(){}:Mn,sn=ke.setIsClaer,$t=sn===void 0?function(){}:sn,Dn=Object(N.a)(ke,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","reload","addCallback","setIsClaer"]),hn=Object(r.useState)(""),Jt=Object(o.a)(hn,2),It=Jt[0],jt=Jt[1],tr=Object(r.useState)(""),nr=Object(o.a)(tr,2),Un=nr[0],yn=nr[1],Nt=Object(r.useState)(""),Xt=Object(o.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=Object(r.useState)(),An=Object(o.a)(Qn,2),pn=An[0],Gn=An[1],dn=Object(r.useState)(!1),En=Object(o.a)(dn,2),qt=En[0],In=En[1],Jn=Object(r.useState)([]),qn=Object(o.a)(Jn,2),wn=qn[0],Nn=qn[1],cn=Object(r.useState)(1),rr=Object(o.a)(cn,2),zn=rr[0],fr=rr[1],cr=Object(r.useState)(!1),Hn=Object(o.a)(cr,2),Fn=Hn[0],gr=Hn[1],Sn=Object(r.useState)([[],[]]),xn=Object(o.a)(Sn,2),Cn=xn[0],_n=xn[1],Qt=Object(r.useRef)(!1),yt=Object(j.i)(),Pt=Object(r.useState)([]),Lt=Object(o.a)(Pt,2),wt=Lt[0],Gt=Lt[1],rn=function(Ve){Gt([].concat(Object(M.a)(wt),[Object(g.a)({},Ve)]))};Object(r.useEffect)(function(){var tt;if(Qt.current)return;if(!(ge!=null&&ge.question_title)){In(!0),jt(""),Ot(""),Gn(10);return}gr(!(ge!=null&&ge.repeat_answer)),jt(ge==null?void 0:ge.question_title),Ot(ge==null||((tt=ge.standard_answer)===null||tt===void 0)?void 0:tt[0]),Gn(ge==null?void 0:ge.question_score),Nn(ge.tag_discipline_ids),fr(ge==null?void 0:ge.difficulty),yn(ge==null?void 0:ge.analysis),_n([ge==null?void 0:ge.normal_keywords,ge==null?void 0:ge.main_keywords])},[Ae.editData,qt]),Object(r.useEffect)(function(){var tt,Ve=me!=null&&(tt=me.tagDisciplineData)!==null&&tt!==void 0&&tt.tag_disciplines&&Array.isArray(me.tagDisciplineData.tag_disciplines)?me.tagDisciplineData.tag_disciplines:[];Gt(Ve)},[me.tagDisciplineData]),Object(r.useEffect)(function(){qt&&tt();function tt(){return Ve.apply(this,arguments)}function Ve(){return Ve=Object(ee.a)(a.a.mark(function pt(){var bt,mt,At;return a.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:return Et.next=2,Object(P.I)({sub_discipline_id:(bt=me.editData)===null||bt===void 0||((mt=bt.exercise)===null||mt===void 0)?void 0:mt.sub_discipline_id});case 2:At=Et.sent,Gt(At.tag_disciplines);case 4:case"end":return Et.stop()}},pt)})),Ve.apply(this,arguments)}},[qt]),Object(r.useImperativeHandle)(xt,function(){return{onSave:st,isEdit:qt}});var tn=function(Ve){(Ve==null?void 0:Ve.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),In(!1),Ft(-1),Qt.current=!1,ot())},st=function(){var tt=Object(ee.a)(a.a.mark(function Ve(){var pt,bt,mt,At,vt,Et,an;return a.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:if(It){lr.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),lr.abrupt("return",!1);case 3:if(pt=Cn[0],bt=Cn[1],Qt.current=!0,!ge.question_id){lr.next=17;break}if(!((ge==null?void 0:ge.is_my)===1)){lr.next=11;break}B.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 Bn=Object(ee.a)(a.a.mark(function Ut(){var mn,Pn;return a.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:It,question_type:4,question_score:pn,standard_answers:[Ht],tag_discipline_ids:wn,sub_discipline_id:(mn=me.editData)===null||mn===void 0||((Pn=mn.exercise)===null||Pn===void 0)?void 0:Pn.sub_discipline_id,difficulty:zn,is_cover:1,repeat_answer:!Fn,analysis:Un,normal_keywords:pt,main_keywords:bt}});case 2:mt=vn.sent,tn(mt);case 4:case"end":return vn.stop()}},Ut)}));function jn(){return Bn.apply(this,arguments)}return jn}(),onCancel:function(){var Bn=Object(ee.a)(a.a.mark(function Ut(){var mn,Pn;return a.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:return vn.next=2,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:It,question_type:4,question_score:pn,standard_answers:[Ht],tag_discipline_ids:wn,sub_discipline_id:(mn=me.editData)===null||mn===void 0||((Pn=mn.exercise)===null||Pn===void 0)?void 0:Pn.sub_discipline_id,difficulty:zn,repeat_answer:!Fn,analysis:Un,normal_keywords:pt,main_keywords:bt}});case 2:mt=vn.sent,tn(mt);case 4:case"end":return vn.stop()}},Ut)}));function jn(){return Bn.apply(this,arguments)}return jn}()}),lr.next=15;break;case 11:return lr.next=13,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:It,question_type:4,question_score:pn,standard_answers:[Ht],tag_discipline_ids:wn,sub_discipline_id:(At=me.editData)===null||At===void 0||((vt=At.exercise)===null||vt===void 0)?void 0:vt.sub_discipline_id,difficulty:zn,repeat_answer:!Fn,analysis:Un,normal_keywords:pt,main_keywords:bt}});case 13:mt=lr.sent,tn(mt);case 15:lr.next=21;break;case 17:return lr.next=19,Vt({type:"exercise/addExerciseQuestion",payload:{insert_id:ge==null?void 0:ge.insert_id,categoryId:yt.categoryId,exercise_bank_id:yt.categoryId,question_title:It,question_type:4,question_score:pn,standard_answers:[Ht],tag_discipline_ids:wn,sub_discipline_id:(Et=me.editData)===null||Et===void 0||((an=Et.exercise)===null||an===void 0)?void 0:an.sub_discipline_id,difficulty:zn,repeat_answer:!Fn,analysis:Un,normal_keywords:pt,main_keywords:bt}});case 19:mt=lr.sent,tn(mt);case 21:return lr.abrupt("return",{name:It,answer_texts:[Ht],analysis:Un,normal_keywords:pt,main_keywords:bt});case 22:case"end":return lr.stop()}},Ve)}));return function(){return tt.apply(this,arguments)}}(),Ye=function(){var Ve,pt;return t.a.createElement("aside",null,t.a.createElement("div",{className:se.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:It,onChange:function(mt){return jt(mt)}}),t.a.createElement("p",{className:se.a.titleWrap},t.a.createElement("span",{className:se.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:Ht,onChange:function(mt){return Ot(mt)}}),t.a.createElement(kt.a,{value:Cn,onChange:_n}),t.a.createElement("p",{className:se.a.titleWrap},t.a.createElement("span",{className:se.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:Un,onChange:function(mt){return yn(mt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:pn,max:1e4,min:0,onChange:function(mt){Gn(mt)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:se.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:zn,onChange:function(mt){fr(mt.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:se.a.titleWrap},t.a.createElement("span",{className:"".concat(se.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:se.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(Te.a,{value:wn,selectvalues:ge==null?void 0:ge.tag_discipline_ids,onChange:Nn,subId:(Ve=me.editData)===null||Ve===void 0||((pt=Ve.exercise)===null||pt===void 0)?void 0:pt.sub_discipline_id,knowledgeOptions:wt,onAddKnowledgeFinish:rn})),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:Fn,onChange:function(mt){gr(mt)}}))),t.a.createElement("aside",{className:"tr"},(ur!==-1||ge.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){sr(),In(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){st()}},"\u4FDD\u5B58")))},Be=[{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(tt){var Ve,pt;return(me==null||((Ve=me.editData)===null||Ve===void 0||((pt=Ve.exercise)===null||pt===void 0))?void 0:pt.exercise_status)===1?tt:tt.id!=="del"&&tt.id!=="add"}),ze=function(){var tt=Object(ee.a)(a.a.mark(function Ve(pt){return a.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:if(!(ur!==-1)){mt.next=3;break}return E.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=pt.id,mt.next=mt.t0==="del"?6:mt.t0==="up"||mt.t0==="down"?8:mt.t0==="edit"?12:mt.t0==="add"?15:17;break;case 6:return B.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(ee.a)(a.a.mark(function vt(){return a.a.wrap(function(an){for(;;)switch(an.prev=an.next){case 0:return an.next=2,Object(P.n)({id:ge.question_id});case 2:Vt({type:"exercise/editExercise",payload:Object(g.a)({},yt)});case 3:case"end":return an.stop()}},vt)}))()}}),mt.abrupt("break",17);case 8:return mt.next=10,Vt({type:"exercise/exeriseMoveUpDown",payload:{id:ge.question_id,opr:pt.id}});case 10:return Vt({type:"exercise/editExercise",payload:Object(g.a)({},yt)}),mt.abrupt("break",17);case 12:return Ft(ge.dragKey),In(!0),mt.abrupt("break",17);case 15:return bn({key:ge.key,insert_id:ge==null?void 0:ge.question_id,question_type:4}),mt.abrupt("break",17);case 17:case"end":return mt.stop()}},Ve)}));return function(pt){return tt.apply(this,arguments)}}(),Le=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:se.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(ve.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:ge.question_title})),t.a.createElement("div",{className:se.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(ve.a,{value:Ht||""})),t.a.createElement("div",{className:se.a.action},!ge.hideAction&&Be.map(function(Ve,pt){return Ve.id==="up"&&ge.key===1||Ve.id==="down"&&ge.key===ge.len?null:t.a.createElement(f.a,{key:pt,placement:"bottom",title:Ve.name},t.a.createElement("span",{onClick:function(){return ze(Ve)},className:Ve.icon}))})))};return t.a.createElement("section",{className:se.a.wrap},!qt&&Le(),qt&&Ye())},ln=Object(H.a)(function(nt){var ke=nt.problemset,xt=nt.loading,Ae=nt.exercise,me=nt.globalSetting;return{problemset:ke,globalSetting:me,exercise:Ae,loading:xt.effects}},null,null,{forwardRef:!0})(Object(r.forwardRef)(zt)),un=["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"],We=function(ke,xt){var Ae=ke.problemset,me=ke.exercise,pe=ke.globalSetting,ir=ke.loading,Vt=ke.dispatch,we=ke.onRef,at=we===void 0?function(){}:we,ge=ke.editData,en=ke.cancelAdd,sr=en===void 0?function(){}:en,ur=ke.editKey,Wn=ke.setEditKey,Ft=Wn===void 0?function(){}:Wn,or=ke.addCallback,ot=or===void 0?function(){}:or,Mn=ke.setIsClaer,bn=Mn===void 0?function(){}:Mn,sn=Object(N.a)(ke,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","addCallback","setIsClaer"]),$t=Object(r.useState)([]),Dn=Object(o.a)($t,2),hn=Dn[0],Jt=Dn[1],It=Object(r.useState)(),jt=Object(o.a)(It,2),tr=jt[0],nr=jt[1],Un=Object(r.useState)([]),yn=Object(o.a)(Un,2),Nt=yn[0],Xt=yn[1],Ht=Object(r.useState)(""),Ot=Object(o.a)(Ht,2),Qn=Ot[0],An=Ot[1],pn=Object(r.useState)(5),Gn=Object(o.a)(pn,2),dn=Gn[0],En=Gn[1],qt=Object(r.useState)(!1),In=Object(o.a)(qt,2),Jn=In[0],qn=In[1],wn=Object(j.g)(),Nn=Object(j.i)();Object(r.useEffect)(function(){Jt(["","","",""])},[]),Object(r.useEffect)(function(){if(!(ge!=null&&ge.question_choices)){qn(!0),An(""),En(5),Jt(["","","",""]),Xt([]);return}An(ge==null?void 0:ge.question_title),En(ge==null?void 0:ge.question_score),Jt(ge==null?void 0:ge.question_choices.map(function(Fn){return Fn.choice_text}));var Hn=[];ge==null||ge.standard_answer.map(function(Fn,gr){Hn.push(Fn-1)}),Xt(Hn)},[ge]),Object(r.useImperativeHandle)(xt,function(){return{onSave:cn,isEdit:Jn}});var cn=function(){var Hn=Object(ee.a)(a.a.mark(function Fn(){var gr,Sn,xn;return a.a.wrap(function(_n){for(;;)switch(_n.prev=_n.next){case 0:if(Qn){_n.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),_n.abrupt("return",!1);case 3:if(gr=hn.findIndex(function(Qt){return!Qt}),!(gr>-1)){_n.next=7;break}return E.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(un[gr]," \u9009\u9879\u7684\u5185\u5BB9")),_n.abrupt("return",!1);case 7:if(Nt.length){_n.next=10;break}return E.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),_n.abrupt("return",!1);case 10:if(!(Nt.length<1)){_n.next=13;break}return E.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),_n.abrupt("return",!1);case 13:if(Sn=hn.map(function(Qt,yt){return{choice_text:Qt,is_answer:Nt.includes(yt)?yt+1:0}}),!ge.question_id){_n.next=20;break}return _n.next=17,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:Qn,question_type:1,question_score:dn,question_choices:Sn.map(function(Qt){return Qt.choice_text}),standard_answers:Sn.filter(function(Qt){return Qt.is_answer}).map(function(Qt){return Qt.is_answer})}});case 17:xn=_n.sent,_n.next=23;break;case 20:return _n.next=22,Vt({type:"exercise/addExerciseQuestion",payload:{insert_id:ge==null?void 0:ge.insert_id,categoryId:Nn.categoryId,question_title:Qn,question_type:1,question_score:"5.0",question_choices:Sn.map(function(Qt){return Qt.choice_text}),standard_answers:Sn.filter(function(Qt){return Qt.is_answer}).map(function(Qt){return Qt.is_answer})}});case 22:xn=_n.sent;case 23:xn.status===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),qn(!1),Vt({type:"exercise/editExercise",payload:Object(g.a)({},Nn)}));case 24:case"end":return _n.stop()}},Fn)}));return function(){return Hn.apply(this,arguments)}}(),rr=[{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(Hn){var Fn,gr;return(me==null||((Fn=me.editData)===null||Fn===void 0||((gr=Fn.exercise)===null||gr===void 0))?void 0:gr.exercise_status)===1?Hn:Hn.id!=="del"&&Hn.id!=="add"}),zn=function(){var Hn=Object(ee.a)(a.a.mark(function Fn(gr){return a.a.wrap(function(xn){for(;;)switch(xn.prev=xn.next){case 0:if(!(ur!==-1)){xn.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),xn.abrupt("return");case 3:xn.t0=gr.id,xn.next=xn.t0==="del"?6:xn.t0==="up"||xn.t0==="down"?8:xn.t0==="edit"?12:xn.t0==="add"?14:16;break;case 6:return B.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(ee.a)(a.a.mark(function _n(){return a.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(P.n)({id:ge.question_id});case 2:Vt({type:"exercise/editExercise",payload:Object(g.a)({},Nn)});case 3:case"end":return yt.stop()}},_n)}))()}}),xn.abrupt("break",16);case 8:return xn.next=10,Vt({type:"exercise/exeriseMoveUpDown",payload:{id:ge.question_id,opr:gr.id}});case 10:return Vt({type:"exercise/editExercise",payload:Object(g.a)({},Nn)}),xn.abrupt("break",16);case 12:return wn.push("/problems/".concat(ge==null?void 0:ge.hack_identifier,"/edit?type=exercises&express_id=").concat(Nn.categoryId,"&question_id=").concat(ge==null?void 0:ge.question_id,"&score=").concat(ge==null?void 0:ge.question_score,"&exercise=true&callback_url=").concat(location.pathname)),xn.abrupt("break",16);case 14:return ot({key:ge.key,insert_id:ge==null?void 0:ge.question_id,question_type:6}),xn.abrupt("break",16);case 16:case"end":return xn.stop()}},Fn)}));return function(gr){return Hn.apply(this,arguments)}}(),fr=function(){var Hn=Object(ee.a)(a.a.mark(function Fn(gr){var Sn;return a.a.wrap(function(Cn){for(;;)switch(Cn.prev=Cn.next){case 0:return gr.preventDefault(),Cn.next=3,Object(P.X)({id:ge==null?void 0:ge.hack_identifier});case 3:Sn=Cn.sent,Sn.status===0&&Object(q.U)("/myproblems/".concat(Sn==null?void 0:Sn.identifier));case 5:case"end":return Cn.stop()}},Fn)}));return function(gr){return Hn.apply(this,arguments)}}(),cr=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:se.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(ve.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:ge.question_title})),t.a.createElement("div",{className:se.a.questionChoices},t.a.createElement(ve.a,{value:ge.description||""})),t.a.createElement("div",{className:se.a.action},!ge.hideAction&&rr.map(function(Fn,gr){return Fn.id==="up"&&ge.key===1||Fn.id==="down"&&ge.key===ge.len?null:t.a.createElement(f.a,{key:gr,placement:"bottom",title:Fn.name},t.a.createElement("span",{onClick:function(){return zn(Fn)},className:Fn.icon}))})))};return t.a.createElement("section",{className:se.a.wrap},cr())},je=Object(H.a)(function(nt){var ke=nt.problemset,xt=nt.loading,Ae=nt.globalSetting,me=nt.exercise;return{problemset:ke,globalSetting:Ae,exercise:me,loading:xt.effects}},null,null,{forwardRef:!0})(Object(r.forwardRef)(We)),ht=K("LvDl"),ct=["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"],He=function(ke,xt){var Ae=ke.problemset,me=ke.exercise,pe=ke.globalSetting,ir=ke.loading,Vt=ke.dispatch,we=ke.onRef,at=we===void 0?function(){}:we,ge=ke.editData,en=ke.cancelAdd,sr=en===void 0?function(){}:en,ur=ke.editKey,Wn=ke.setEditKey,Ft=Wn===void 0?function(){}:Wn,or=ke.setIsClaer,ot=or===void 0?function(){}:or,Mn=ke.addCallback,bn=Mn===void 0?function(st){}:Mn,sn=ke.reload,$t=sn===void 0?function(){}:sn,Dn=Object(N.a)(ke,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),hn=Object(r.useState)([]),Jt=Object(o.a)(hn,2),It=Jt[0],jt=Jt[1],tr=Object(r.useState)(!1),nr=Object(o.a)(tr,2),Un=nr[0],yn=nr[1],Nt=Object(r.useState)(!0),Xt=Object(o.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=Object(r.useState)(1),An=Object(o.a)(Qn,2),pn=An[0],Gn=An[1],dn=Object(r.useState)(!1),En=Object(o.a)(dn,2),qt=En[0],In=En[1],Jn=Object(r.useState)([]),qn=Object(o.a)(Jn,2),wn=qn[0],Nn=qn[1],cn=Object(j.i)(),rr=Object(r.useRef)(null),zn=Object(r.useState)(""),fr=Object(o.a)(zn,2),cr=fr[0],Hn=fr[1],Fn=Object(r.useState)([]),gr=Object(o.a)(Fn,2),Sn=gr[0],xn=gr[1],Cn=Object(r.useRef)(!1),_n=function(Ye){Nn([].concat(Object(M.a)(wn),[Object(g.a)({},Ye)]))};Object(r.useEffect)(function(){var st;if(Cn.current)return;if(!(ge!=null&&ge.question_title)){yn(!0),Hn("");return}Hn(ge==null?void 0:ge.question_title),In(!(ge!=null&&ge.repeat_answer)),Gn(ge==null?void 0:ge.difficulty),jt(ge.tag_discipline_ids);var Ye=ge==null||((st=ge.sub_exercise_questions)===null||st===void 0)?void 0:st.map(function(Be){var ze,Le,tt;return Object(g.a)(Object(g.a)({},Be),{},{id:Be.question_id,name:Be.question_title,open:!1,score:Be.question_score,qusList:Be==null||((ze=Be.question_choices)===null||ze===void 0)?void 0:ze.map(function(Ve){return Ve.choice_text}),activeQusEditor:null,qusAnswer:(Le=[Be==null||((tt=Be.question_choices)===null||tt===void 0)?void 0:tt.findIndex(function(Ve){return Ve.standard_boolean})])===null||Le===void 0?void 0:Le.filter(function(Ve){return Ve!==-1})})});xn(Ye)},[ge,Un]),Object(r.useEffect)(function(){Un&&st();function st(){return Ye.apply(this,arguments)}function Ye(){return Ye=Object(ee.a)(a.a.mark(function Be(){var ze,Le,tt;return a.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(P.I)({sub_discipline_id:(ze=me.editData)===null||ze===void 0||((Le=ze.exercise)===null||Le===void 0)?void 0:Le.sub_discipline_id});case 2:tt=pt.sent,Nn(tt.tag_disciplines);case 4:case"end":return pt.stop()}},Be)})),Ye.apply(this,arguments)}},[Un]),Object(r.useEffect)(function(){var st,Ye=me!=null&&(st=me.tagDisciplineData)!==null&&st!==void 0&&st.tag_disciplines&&Array.isArray(me.tagDisciplineData.tag_disciplines)?me.tagDisciplineData.tag_disciplines:[];Nn(Ye)},[me.tagDisciplineData]),Object(r.useImperativeHandle)(xt,function(){return{onSave:yt,isEdit:Un}});var Qt=function(Ye){(Ye==null?void 0:Ye.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),yn(!1),Ft(-1),Cn.current=!1,$t())},yt=function(){var st=Object(ee.a)(a.a.mark(function Ye(){var Be,ze,Le,tt,Ve,pt,bt,mt;return a.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:if(cr){vt.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),vt.abrupt("return",!1);case 3:if(!(Sn.length===0)){vt.next=6;break}return E.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),vt.abrupt("return",!1);case 6:Be=0;case 7:if(!(Be<Sn.length)){vt.next=25;break}if(Le=Sn[Be],Le!=null&&Le.name){vt.next=12;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Be+1,"\u5C0F\u9898\u9898\u5E72")),vt.abrupt("return",!1);case 12:if(Le!=null&&Le.score){vt.next=15;break}return E.b.info("\u7B2C".concat(Be+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),vt.abrupt("return",!1);case 15:if(tt=Le==null||((ze=Le.qusList)===null||ze===void 0)?void 0:ze.findIndex(function(Et){return!Et}),!(tt>-1)){vt.next=19;break}return E.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Be+1,"\u5C0F\u9898").concat(ct[tt],"\u9009\u9879\u7684\u5185\u5BB9")),vt.abrupt("return",!1);case 19:if(Le!=null&&Le.qusAnswer.length){vt.next=22;break}return E.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Be+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),vt.abrupt("return",!1);case 22:Be++,vt.next=7;break;case 25:if(Ve=Sn.map(function(Et){var an;return{id:Et.id>1?Et.id:null,question_title:Et.name,question_type:1,question_choices:Et.qusList,question_score:Et.score,standard_answers:[((an=Et.qusAnswer)===null||an===void 0?void 0:an[0])+1]}}),Cn.current=!0,!ge.question_id){vt.next=36;break}if(!((ge==null?void 0:ge.is_my)===1)){vt.next=32;break}B.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 Et=Object(ee.a)(a.a.mark(function Yt(){var lr,Bn;return a.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:cr,question_type:7,sub_questions:Ve,tag_discipline_ids:It,sub_discipline_id:(lr=me.editData)===null||lr===void 0||((Bn=lr.exercise)===null||Bn===void 0)?void 0:Bn.sub_discipline_id,difficulty:pn,is_cover:1,repeat_answer:!qt}});case 2:pt=Ut.sent,Qt(pt);case 4:case"end":return Ut.stop()}},Yt)}));function an(){return Et.apply(this,arguments)}return an}(),onCancel:function(){var Et=Object(ee.a)(a.a.mark(function Yt(){var lr,Bn;return a.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:cr,question_type:7,sub_questions:Ve,tag_discipline_ids:It,sub_discipline_id:(lr=me.editData)===null||lr===void 0||((Bn=lr.exercise)===null||Bn===void 0)?void 0:Bn.sub_discipline_id,difficulty:pn,repeat_answer:!qt}});case 2:pt=Ut.sent,Qt(pt);case 4:case"end":return Ut.stop()}},Yt)}));function an(){return Et.apply(this,arguments)}return an}()}),vt.next=36;break;case 32:return vt.next=34,Vt({type:"exercise/editExerciseQuestion",payload:{id:ge.question_id,question_title:cr,question_type:7,sub_questions:Ve,tag_discipline_ids:It,sub_discipline_id:(bt=me.editData)===null||bt===void 0||((mt=bt.exercise)===null||mt===void 0)?void 0:mt.sub_discipline_id,difficulty:pn,repeat_answer:!qt}});case 34:pt=vt.sent,Qt(pt);case 36:case"end":return vt.stop()}},Ye)}));return function(){return st.apply(this,arguments)}}(),Pt=[{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(st){var Ye,Be;return(me==null||((Ye=me.editData)===null||Ye===void 0||((Be=Ye.exercise)===null||Be===void 0))?void 0:Be.exercise_status)===1?st:st.id!=="del"&&st.id!=="add"}),Lt=function(){var st=Object(ee.a)(a.a.mark(function Ye(Be){return a.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:if(!(ur!==-1)){Le.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Le.abrupt("return");case 3:Le.t0=Be.id,Le.next=Le.t0==="del"?6:Le.t0==="up"||Le.t0==="down"?8:Le.t0==="edit"?12:Le.t0==="add"?15:17;break;case 6:return B.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(ee.a)(a.a.mark(function Ve(){return a.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(P.n)({id:ge.question_id});case 2:Vt({type:"exercise/editExercise",payload:Object(g.a)({},cn)});case 3:case"end":return bt.stop()}},Ve)}))()}}),Le.abrupt("break",17);case 8:return Le.next=10,Vt({type:"exercise/exeriseMoveUpDown",payload:{id:ge.question_id,opr:Be.id}});case 10:return Vt({type:"exercise/editExercise",payload:Object(g.a)({},cn)}),Le.abrupt("break",17);case 12:return Ft(ge.dragKey),yn(!0),Le.abrupt("break",17);case 15:return bn({key:ge.key,insert_id:ge==null?void 0:ge.question_id,question_type:0}),Le.abrupt("break",17);case 17:case"end":return Le.stop()}},Ye)}));return function(Be){return st.apply(this,arguments)}}(),wt=function(){var Ye;return t.a.createElement("aside",{ref:rr},t.a.createElement("div",{className:se.a.questionType},!(ge!=null&&ge.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ge.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",ge.question_score,"\u5206\uFF09")),ge!=null&&ge.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,"."),t.a.createElement(ve.a,{value:ge.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",ge==null?void 0:ge.sub_q_count,"\u5C0F\u9898\uFF0C",ge.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:ge.question_title})),t.a.createElement("div",{style:{display:Ht?"block":"none"},className:se.a.questionChoices},ge==null||((Ye=ge.sub_exercise_questions)===null||Ye===void 0)?void 0:Ye.map(function(Be,ze){var Le;return t.a.createElement("div",{key:ze},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ge.key,".",ze+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(ve.a,{value:Be.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Be.question_score,"\u5206\uFF09")),Be==null||((Le=Be.question_choices)===null||Le===void 0)?void 0:Le.map(function(tt,Ve){return t.a.createElement(L.a,{key:Ve},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:Ve,checked:Be.standard_answer.includes(Ve+1),disabled:!0},ct[Ve],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(ve.a,{value:tt.choice_text}))))}))})),t.a.createElement("div",{className:se.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Ot(!Ht)},style:{}},Ht?"\u6536\u8D77":"\u5C55\u5F00"),!ge.hideAction&&Pt.map(function(Be,ze){return Be.id==="up"&&ge.key===1||Be.id==="down"&&ge.key===ge.len?null:t.a.createElement(f.a,{key:ze,placement:"bottom",title:Be.name},t.a.createElement("span",{onClick:function(){return Lt(Be)},className:Be.icon}))})))},Gt=function(){var Ye,Be;return t.a.createElement("aside",null,t.a.createElement("div",{className:se.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:se.a.wrap,style:{padding:0}},t.a.createElement("p",{className:se.a.titleWrap},t.a.createElement("span",{className:se.a.required},"*"),t.a.createElement("span",{className:se.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:cr,onChange:function(Le){return Hn(Le)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",Sn==null?void 0:Sn.length),Sn==null?void 0:Sn.map(function(ze,Le){var tt;return t.a.createElement("div",{className:se.a.fold,key:ze.id},t.a.createElement("div",{onClick:function(){return tn("open",Le)},className:se.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:ze.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",Le+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(pt){pt.stopPropagation(),tn("delete",Le)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:ze.open?"block":"none"}},t.a.createElement(x.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:ze==null?void 0:ze.name,onChange:function(pt){return tn("value",Le,pt)}}),t.a.createElement("p",{className:se.a.titleWrap},t.a.createElement("span",{className:se.a.required},"*"),t.a.createElement("span",{className:se.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:se.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ze==null||((tt=ze.qusList)===null||tt===void 0)?void 0:tt.map(function(Ve,pt){var bt,mt;return t.a.createElement("div",{className:se.a.choiceWrap,key:pt},t.a.createElement(f.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(se.a.answer," ").concat(ze!=null&&(bt=ze.qusAnswer)!==null&&bt!==void 0&&bt.includes(pt)?se.a.activeAnswer:""),onClick:function(){return tn("answer",Le,pt)}},ct[pt])),t.a.createElement("div",{className:se.a.editorWrap},(ze==null?void 0:ze.activeQusEditor)===pt?t.a.createElement(x.a,{id:"single-question-option-".concat(pt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Ve,onChange:function(vt){return tn("details",Le,vt)}}):t.a.createElement("div",{className:se.a.htmlWrap,onClick:function(){return tn("edit",Le,pt)}},t.a.createElement(ve.a,{value:Ve}))),pt>1&&t.a.createElement(f.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(se.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return tn("deleteQus",Le,pt)}})),pt<7&&pt===(ze==null||((mt=ze.qusList)===null||mt===void 0)?void 0:mt.length)-1&&t.a.createElement(f.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(se.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return tn("addQus",Le)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:ze.score,max:1e4,min:0,onChange:function(pt){return tn("score",Le,pt)}})," ","\u5206")))}),Sn.length<20&&t.a.createElement(m.a,{type:"primary",onClick:rn},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:se.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:pn,onChange:function(Le){Gn(Le.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:se.a.titleWrap},t.a.createElement("span",{className:"".concat(se.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:se.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(Te.a,{selectvalues:ge==null?void 0:ge.tag_discipline_ids,value:It,onChange:jt,subId:(Ye=me.editData)===null||Ye===void 0||((Be=Ye.exercise)===null||Be===void 0)?void 0:Be.sub_discipline_id,knowledgeOptions:wn,onAddKnowledgeFinish:_n}))),t.a.createElement("aside",{className:"tr"},(ur!==-1||ge.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){sr(),yn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){yt()}},"\u4FDD\u5B58")))},rn=function(){var Ye={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};xn(Sn.concat(Ye))},tn=function(Ye,Be,ze){var Le=Object(ht.cloneDeep)(Sn);if(Ye==="open"&&(Le[Be].open=!Le[Be].open),Ye==="delete"&&Le.splice(Be,1),Ye==="value"&&(Le[Be].name=ze),Ye==="answer"&&(Le[Be].qusAnswer=[ze]),Ye==="edit"&&(Le[Be].activeQusEditor=ze),Ye==="details"&&(Le[Be].qusList[Le[Be].activeQusEditor]=ze),Ye==="addQus"&&(Le[Be].qusList=Le[Be].qusList.concat("")),Ye==="deleteQus"){var tt;Le[Be].qusList=Le[Be].qusList.filter(function(Ve,pt){return pt!==ze}),Le[Be].qusAnswer=(tt=Le[Be].qusAnswer)===null||tt===void 0?void 0:tt.filter(function(Ve){return Ve!==ze})}Ye==="analysis"&&(Le[Be].analysis=ze),Ye==="score"&&(Le[Be].score=ze),xn(Le)};return t.a.createElement("section",{className:se.a.wrap},!Un&&wt(),Un&&Gt())},lt=Object(H.a)(function(nt){var ke=nt.problemset,xt=nt.loading,Ae=nt.globalSetting,me=nt.exercise;return{problemset:ke,globalSetting:Ae,exercise:me,loading:xt.effects}},null,null,{forwardRef:!0})(Object(r.forwardRef)(He)),Pe=K("ngQI"),Oe=K("loLm"),Ce=K.n(Oe),le=K("ErOA"),he=K("vCeJ"),ye=K("Nog9"),ae=K.n(ye),Se=K("hQp1"),$e=["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"],dt=function(ke,xt){var Ae=ke.newExercisePaper,me=ke.dispatch,pe=ke.editData,ir=ke.cancelAdd,Vt=ir===void 0?function(){}:ir,we=ke.editKey,at=ke.setEditKey,ge=at===void 0?function(){}:at,en=ke.reload,sr=en===void 0?function(){}:en,ur=ke.addCallback,Wn=ur===void 0?function(Be){}:ur,Ft=Object(r.useState)([]),or=Object(o.a)(Ft,2),ot=or[0],Mn=or[1],bn=Object(r.useState)(),sn=Object(o.a)(bn,2),$t=sn[0],Dn=sn[1],hn=Object(r.useState)([]),Jt=Object(o.a)(hn,2),It=Jt[0],jt=Jt[1],tr=Object(r.useState)(""),nr=Object(o.a)(tr,2),Un=nr[0],yn=nr[1],Nt=Object(r.useState)(),Xt=Object(o.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=Object(r.useState)([]),An=Object(o.a)(Qn,2),pn=An[0],Gn=An[1],dn=Object(r.useState)(!1),En=Object(o.a)(dn,2),qt=En[0],In=En[1],Jn=Object(r.useState)(1),qn=Object(o.a)(Jn,2),wn=qn[0],Nn=qn[1],cn=Object(r.useState)(!1),rr=Object(o.a)(cn,2),zn=rr[0],fr=rr[1],cr=Object(r.useState)(""),Hn=Object(o.a)(cr,2),Fn=Hn[0],gr=Hn[1],Sn=Object(j.i)(),xn=Object(r.useRef)(null),Cn=Object(r.useRef)(!1),_n=Object(r.useState)([]),Qt=Object(o.a)(_n,2),yt=Qt[0],Pt=Qt[1],Lt=function(ze){Pt([].concat(Object(M.a)(yt),[Object(g.a)({},ze)]))};Object(r.useEffect)(function(){Mn(["","","",""])},[]),Object(r.useEffect)(function(){if(Cn.current)return;if(!(pe!=null&&pe.question_choices)){In(!0),yn(""),Ot(5),Mn(["","","",""]),jt([]);return}yn(pe==null?void 0:pe.question_title),Ot(pe==null?void 0:pe.question_score),fr(!(pe!=null&&pe.repeat_answer)),gr(pe==null?void 0:pe.analysis),Nn(pe==null?void 0:pe.difficulty),Mn(pe==null?void 0:pe.question_choices.map(function(ze){return ze.choice_text}));var Be=[];pe==null||pe.standard_answer.map(function(ze,Le){Be.push(ze-1)}),Gn(pe.tag_discipline_ids),jt(Be)},[pe,qt]),Object(r.useEffect)(function(){qt&&Be();function Be(){return ze.apply(this,arguments)}function ze(){return ze=Object(ee.a)(a.a.mark(function Le(){var tt,Ve,pt;return a.a.wrap(function(mt){for(;;)switch(mt.prev=mt.next){case 0:return mt.next=2,Object(P.I)({sub_discipline_id:(tt=Ae.editData)===null||tt===void 0||((Ve=tt.exercise)===null||Ve===void 0)?void 0:Ve.sub_discipline_id});case 2:pt=mt.sent,Pt(pt.tag_disciplines);case 4:case"end":return mt.stop()}},Le)})),ze.apply(this,arguments)}},[qt]),Object(r.useEffect)(function(){var Be,ze=Ae!=null&&(Be=Ae.tagDisciplineData)!==null&&Be!==void 0&&Be.tag_disciplines&&Array.isArray(Ae.tagDisciplineData.tag_disciplines)?Ae.tagDisciplineData.tag_disciplines:[];Pt(ze)},[Ae.tagDisciplineData]),Object(r.useImperativeHandle)(xt,function(){return{onSave:Gt,isEdit:qt}});var wt=function(ze){(ze==null?void 0:ze.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),In(!1),ge(-1),Cn.current=!1,sr())},Gt=function(){var Be=Object(ee.a)(a.a.mark(function ze(){var Le,tt,Ve,pt,bt,mt,At;return a.a.wrap(function(Et){for(;;)switch(Et.prev=Et.next){case 0:if(Un){Et.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Et.abrupt("return",!1);case 3:if(Le=ot.findIndex(function(an){return!an}),!(Le>-1)){Et.next=7;break}return E.b.info("\u8BF7\u5148\u8F93\u5165 ".concat($e[Le]," \u9009\u9879\u7684\u5185\u5BB9")),Et.abrupt("return",!1);case 7:if(It.length){Et.next=10;break}return E.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Et.abrupt("return",!1);case 10:if(!(It.length<1)){Et.next=13;break}return E.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Et.abrupt("return",!1);case 13:if(tt=ot.map(function(an,Yt){return{choice_text:an,is_answer:It.includes(Yt)?1:0}}),Cn.current=!0,!pe.question_id){Et.next=22;break}return Et.next=18,me({type:"newExercisePaper/editExerciseQuestion",payload:{id:Sn.id,question_id:pe.question_id,name:Un,item_type:It.length>1?Se.a.Multiple:Se.a.Single,question_score:Ht,choices:tt,tag_discipline_ids:pn,sub_discipline_id:(pt=Ae.editData)===null||pt===void 0||((bt=pt.exercise)===null||bt===void 0)?void 0:bt.sub_discipline_id,difficulty:wn,repeat_answer:!zn,analysis:Fn}});case 18:Ve=Et.sent,wt(Ve),Et.next=26;break;case 22:return Et.next=24,me({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:pe==null?void 0:pe.insert_id,id:Sn.id,name:Un,item_type:It.length>1?Se.a.Multiple:Se.a.Single,question_score:Ht,choices:tt,tag_discipline_ids:pn,sub_discipline_id:(mt=Ae.editData)===null||mt===void 0||((At=mt.exercise)===null||At===void 0)?void 0:At.sub_discipline_id,difficulty:wn,repeat_answer:!zn,analysis:Fn}});case 24:Ve=Et.sent,wt(Ve);case 26:case"end":return Et.stop()}},ze)}));return function(){return Be.apply(this,arguments)}}(),rn=[{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"}],tn=function(){var Be=Object(ee.a)(a.a.mark(function ze(Le){return a.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:if(!(we!==-1)){Ve.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ve.abrupt("return");case 3:Ve.t0=Le.id,Ve.next=Ve.t0==="del"?6:Ve.t0==="edit"?8:Ve.t0==="add"?11:13;break;case 6:return B.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(ee.a)(a.a.mark(function bt(){return a.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:return At.next=2,Object(he.g)({exam_id:Sn.id,question_id:pe.question_id});case 2:me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Sn)});case 3:case"end":return At.stop()}},bt)}))()}}),Ve.abrupt("break",13);case 8:return ge(pe.dragKey),In(!0),Ve.abrupt("break",13);case 11:return Wn({key:pe.key,insert_id:pe==null?void 0:pe.question_id,question_type:0}),Ve.abrupt("break",13);case 13:case"end":return Ve.stop()}},ze)}));return function(Le){return Be.apply(this,arguments)}}(),st=function(){var ze;return t.a.createElement("aside",{ref:xn},t.a.createElement("div",{className:ae.a.questionType},!(pe!=null&&pe.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},pe.key,"\u3001\u5355\u9009\u9898"),"\uFF08",pe.question_score,"\u5206\uFF09")),pe!=null&&pe.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},pe.key,"."),t.a.createElement(ve.a,{value:pe.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",pe.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:pe.question_title})),t.a.createElement("div",{className:ae.a.questionChoices},pe==null||((ze=pe.question_choices)===null||ze===void 0)?void 0:ze.map(function(Le,tt){return t.a.createElement(L.a,{key:tt},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:tt,checked:pe.standard_answer.includes(tt+1),disabled:!0},$e[tt],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(ve.a,{value:Le.choice_text}))))})),t.a.createElement("div",{className:ae.a.action},!pe.hideAction&&rn.map(function(Le,tt){return t.a.createElement(f.a,{key:tt,placement:"bottom",title:Le.name},t.a.createElement("span",{onClick:function(){return tn(Le)},className:Le.icon}))})))},Ye=function(){var ze,Le;return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.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:ae.a.titleWrap},t.a.createElement("span",{className:ae.a.required},"*"),t.a.createElement("span",{className:ae.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(Ve){return yn(Ve)}}),t.a.createElement("p",{className:ae.a.titleWrap},t.a.createElement("span",{className:ae.a.required},"*"),t.a.createElement("span",{className:ae.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ae.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),ot.map(function(tt,Ve){return t.a.createElement("div",{className:ae.a.choiceWrap,key:Ve},t.a.createElement(f.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ae.a.answer," ").concat(It.includes(Ve)?ae.a.activeAnswer:""),onClick:function(){It.includes(Ve)?jt(function(bt){return bt.filter(function(mt){return mt!==Ve})}):jt(function(bt){return[].concat(Object(M.a)(bt),[Ve])})}},$e[Ve])),t.a.createElement("div",{className:ae.a.editorWrap},$t===Ve?t.a.createElement(x.a,{id:"single-question-option-".concat(Ve),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:tt,onChange:function(bt){ot[Ve]=bt,Mn(ot)}}):t.a.createElement("div",{className:ae.a.htmlWrap,onClick:function(){return Dn(Ve)}},t.a.createElement(ve.a,{value:tt}))),t.a.createElement(t.a.Fragment,null,Ve>1&&t.a.createElement(f.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ae.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Mn(ot.filter(function(bt,mt){return mt!==Ve}))}})),Ve<7&&Ve===ot.length-1&&t.a.createElement(f.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ae.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Mn([].concat(Object(M.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:ae.a.titleWrap},t.a.createElement("span",{className:ae.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:Fn,onChange:function(Ve){return gr(Ve)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:Ht,max:1e4,min:0,onChange:function(Ve){Ot(Ve)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ae.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:wn,onChange:function(Ve){Nn(Ve.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:ae.a.titleWrap},t.a.createElement("span",{className:"".concat(ae.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ae.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(Te.a,{selectvalues:pe==null?void 0:pe.tag_discipline_ids,value:pn,onChange:Gn,subId:(ze=Ae.editData)===null||ze===void 0||((Le=ze.exercise)===null||Le===void 0)?void 0:Le.sub_discipline_id,knowledgeOptions:yt,onAddKnowledgeFinish:Lt})),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:zn,onChange:function(Ve){fr(Ve)}}))),t.a.createElement("aside",{className:"tr"},(we!==-1||pe.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Vt(),In(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Gt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ae.a.wrap},!qt&&st(),qt&&Ye())},St=Object(H.a)(function(nt){var ke=nt.newExercisePaper;return{newExercisePaper:ke}},null,null,{forwardRef:!0})(Object(r.forwardRef)(dt)),Dt=["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"],Mt=Object(r.forwardRef)(function(nt,ke){var xt=nt.newExercisePaper,Ae=nt.dispatch,me=nt.editData,pe=nt.cancelAdd,ir=pe===void 0?function(){}:pe,Vt=nt.editKey,we=nt.setEditKey,at=we===void 0?function(){}:we,ge=nt.addCallback,en=ge===void 0?function(st){}:ge,sr=nt.reload,ur=sr===void 0?function(){}:sr,Wn=Object(r.useState)([]),Ft=Object(o.a)(Wn,2),or=Ft[0],ot=Ft[1],Mn=Object(r.useState)(),bn=Object(o.a)(Mn,2),sn=bn[0],$t=bn[1],Dn=Object(r.useState)([]),hn=Object(o.a)(Dn,2),Jt=hn[0],It=hn[1],jt=Object(r.useState)(""),tr=Object(o.a)(jt,2),nr=tr[0],Un=tr[1],yn=Object(r.useState)(),Nt=Object(o.a)(yn,2),Xt=Nt[0],Ht=Nt[1],Ot=Object(r.useState)(!1),Qn=Object(o.a)(Ot,2),An=Qn[0],pn=Qn[1],Gn=Object(r.useState)([]),dn=Object(o.a)(Gn,2),En=dn[0],qt=dn[1],In=Object(r.useState)(1),Jn=Object(o.a)(In,2),qn=Jn[0],wn=Jn[1],Nn=Object(r.useState)(!1),cn=Object(o.a)(Nn,2),rr=cn[0],zn=cn[1],fr=Object(r.useState)(""),cr=Object(o.a)(fr,2),Hn=cr[0],Fn=cr[1],gr=Object(r.useState)([]),Sn=Object(o.a)(gr,2),xn=Sn[0],Cn=Sn[1],_n=Object(r.useRef)(!1),Qt=function(Ye){Cn([].concat(Object(M.a)(xn),[Object(g.a)({},Ye)]))},yt=Object(j.i)();Object(r.useEffect)(function(){ot(["","","",""])},[]),Object(r.useEffect)(function(){if(_n.current)return;if(!(me!=null&&me.question_choices)){pn(!0),Un(""),Ht(5),ot(["","","",""]),It([]);return}Un(me==null?void 0:me.question_title),Ht(me==null?void 0:me.question_score),zn(!(me!=null&&me.repeat_answer)),wn(me==null?void 0:me.difficulty),ot(me==null?void 0:me.question_choices.map(function(Ye){return Ye.choice_text}));var st=[];me==null||me.standard_answer.map(function(Ye,Be){st.push(Ye-1)}),It(st),qt(me.tag_discipline_ids),Fn(me==null?void 0:me.analysis)},[me,An]),Object(r.useEffect)(function(){An&&st();function st(){return Ye.apply(this,arguments)}function Ye(){return Ye=Object(ee.a)(a.a.mark(function Be(){var ze,Le,tt;return a.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(P.I)({sub_discipline_id:(ze=xt.editData)===null||ze===void 0||((Le=ze.exercise)===null||Le===void 0)?void 0:Le.sub_discipline_id});case 2:tt=pt.sent,Cn(tt.tag_disciplines);case 4:case"end":return pt.stop()}},Be)})),Ye.apply(this,arguments)}},[An]),Object(r.useImperativeHandle)(ke,function(){return{onSave:Lt,isEdit:An}}),Object(r.useEffect)(function(){var st,Ye=xt!=null&&(st=xt.tagDisciplineData)!==null&&st!==void 0&&st.tag_disciplines&&Array.isArray(xt.tagDisciplineData.tag_disciplines)?xt.tagDisciplineData.tag_disciplines:[];Cn(Ye)},[xt.tagDisciplineData]);var Pt=function(Ye){(Ye==null?void 0:Ye.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),pn(!1),at(-1),_n.current=!1,ur())},Lt=function(){var st=Object(ee.a)(a.a.mark(function Ye(){var Be,ze,Le,tt,Ve,pt,bt;return a.a.wrap(function(At){for(;;)switch(At.prev=At.next){case 0:if(nr){At.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),At.abrupt("return",!1);case 3:if(Be=or.findIndex(function(vt){return!vt}),!(Be>-1)){At.next=7;break}return E.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Dt[Be]," \u9009\u9879\u7684\u5185\u5BB9")),At.abrupt("return",!1);case 7:if(Jt.length){At.next=10;break}return E.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),At.abrupt("return",!1);case 10:if(!(Jt.length<1)){At.next=13;break}return E.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),At.abrupt("return",!1);case 13:if(ze=or.map(function(vt,Et){return{choice_text:vt,is_answer:Jt.includes(Et)?1:0}}),_n.current=!0,!me.question_id){At.next=22;break}return At.next=18,Ae({type:"newExercisePaper/editExerciseQuestion",payload:{id:yt.id,question_id:me.question_id,name:nr,item_type:Jt.length>1?Se.a.Multiple:Se.a.Single,question_score:Xt,choices:ze,tag_discipline_ids:En,sub_discipline_id:(tt=xt.editData)===null||tt===void 0||((Ve=tt.exercise)===null||Ve===void 0)?void 0:Ve.sub_discipline_id,difficulty:qn,repeat_answer:!rr,analysis:Hn}});case 18:Le=At.sent,Pt(Le),At.next=26;break;case 22:return At.next=24,Ae({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:me==null?void 0:me.insert_id,id:yt.id,name:nr,item_type:Jt.length>1?Se.a.Multiple:Se.a.Single,question_score:Xt,choices:ze,tag_discipline_ids:En,sub_discipline_id:(pt=xt.editData)===null||pt===void 0||((bt=pt.exercise)===null||bt===void 0)?void 0:bt.sub_discipline_id,difficulty:qn,repeat_answer:!rr,analysis:Hn}});case 24:Le=At.sent,Pt(Le);case 26:case"end":return At.stop()}},Ye)}));return function(){return st.apply(this,arguments)}}(),wt=[{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"}],Gt=function(){var st=Object(ee.a)(a.a.mark(function Ye(Be){return a.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:if(!(Vt!==-1)){Le.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Le.abrupt("return");case 3:Le.t0=Be.id,Le.next=Le.t0==="del"?6:Le.t0==="edit"?8:Le.t0==="add"?11:13;break;case 6:return B.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(ee.a)(a.a.mark(function Ve(){return a.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(he.g)({question_id:me.question_id,exam_id:yt.id});case 2:Ae({type:"newExercisePaper/editExercise",payload:Object(g.a)({},yt)});case 3:case"end":return bt.stop()}},Ve)}))()}}),Le.abrupt("break",13);case 8:return at(me.dragKey),pn(!0),Le.abrupt("break",13);case 11:return en({key:me.key,insert_id:me==null?void 0:me.question_id,question_type:1}),Le.abrupt("break",13);case 13:case"end":return Le.stop()}},Ye)}));return function(Be){return st.apply(this,arguments)}}(),rn=function(){var Ye;return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.a.questionType},!(me!=null&&me.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},me.key,"\u3001\u591A\u9009\u9898"),"\uFF08",me.question_score,"\u5206\uFF09")),me!=null&&me.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},me.key,"."),t.a.createElement(ve.a,{value:me.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",me.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:me.question_title})),t.a.createElement("div",{className:ae.a.questionChoices},me==null||((Ye=me.question_choices)===null||Ye===void 0)?void 0:Ye.map(function(Be,ze){return t.a.createElement(L.a,{key:ze},t.a.createElement(O.a,null,t.a.createElement(y.a,{key:ze,checked:me.standard_answer.includes(ze+1),disabled:!0},Dt[ze],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(ve.a,{value:Be.choice_text}))))})),t.a.createElement("div",{className:ae.a.action},!me.hideAction&&wt.map(function(Be,ze){return t.a.createElement(f.a,{key:ze,placement:"bottom",title:Be.name},t.a.createElement("span",{onClick:function(){return Gt(Be)},className:Be.icon}))})))},tn=function(){var Ye,Be;return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.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:ae.a.titleWrap},t.a.createElement("span",{className:ae.a.required},"*"),t.a.createElement("span",{className:ae.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:nr,onChange:function(Le){return Un(Le)}}),t.a.createElement("p",{className:ae.a.titleWrap},t.a.createElement("span",{className:ae.a.required},"*"),t.a.createElement("span",{className:ae.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ae.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),or.map(function(ze,Le){var tt,Ve;return t.a.createElement("div",{className:ae.a.choiceWrap,key:Le},t.a.createElement(f.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ae.a.answer," ").concat(Jt.includes(Le)?ae.a.activeAnswer:""),onClick:function(){Jt.includes(Le)?It(Jt.filter(function(bt){return bt!==Le})):It([].concat(Object(M.a)(Jt),[Le]))}},Dt[Le])),t.a.createElement("div",{className:ae.a.editorWrap},sn===Le?t.a.createElement(x.a,{id:"single-question-option-".concat(Le),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:ze,onChange:function(bt){or[Le]=bt,ot(or)}}):t.a.createElement("div",{className:ae.a.htmlWrap,onClick:function(){return $t(Le)}},t.a.createElement(ve.a,{value:ze}))),((tt=xt.editData)===null||tt===void 0||((Ve=tt.exercise)===null||Ve===void 0)?void 0:Ve.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,Le>1&&t.a.createElement(f.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ae.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return ot(or.filter(function(bt,mt){return mt!==Le}))}})),Le<7&&Le===or.length-1&&t.a.createElement(f.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ae.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return ot([].concat(Object(M.a)(or),[""]))}}))))}),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:ae.a.titleWrap},t.a.createElement("span",{className:ae.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:Hn,onChange:function(Le){return Fn(Le)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:Xt,max:1e4,min:0,onChange:function(Le){Ht(Le)}}),"\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ae.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:qn,onChange:function(Le){wn(Le.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:ae.a.titleWrap},t.a.createElement("span",{className:"".concat(ae.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ae.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(Te.a,{value:En,selectvalues:me==null?void 0:me.tag_discipline_ids,onChange:qt,subId:(Ye=xt.editData)===null||Ye===void 0||((Be=Ye.exercise)===null||Be===void 0)?void 0:Be.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:Qt})),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:rr,onChange:function(Le){zn(Le)}}))),t.a.createElement("aside",{className:"tr"},(Vt!==-1||me.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){ir(),pn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Lt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ae.a.wrap},!An&&rn(),An&&tn())}),hr=Object(H.a)(function(nt){var ke=nt.newExercisePaper;return{newExercisePaper:ke}},null,null,{forwardRef:!0})(Mt),on=["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"],fn=function(ke,xt){var Ae=ke.newExercisePaper,me=ke.dispatch,pe=ke.editData,ir=ke.editKey,Vt=ke.setEditKey,we=Vt===void 0?function(){}:Vt,at=ke.cancelAdd,ge=at===void 0?function(){}:at,en=ke.reload,sr=en===void 0?function(){}:en,ur=ke.addCallback,Wn=ur===void 0?function(){}:ur,Ft=Object(r.useState)(),or=Object(o.a)(Ft,2),ot=or[0],Mn=or[1],bn=Object(r.useState)(""),sn=Object(o.a)(bn,2),$t=sn[0],Dn=sn[1],hn=Object(r.useState)(!1),Jt=Object(o.a)(hn,2),It=Jt[0],jt=Jt[1],tr=Object(r.useState)(),nr=Object(o.a)(tr,2),Un=nr[0],yn=nr[1],Nt=Object(r.useState)([]),Xt=Object(o.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=Object(r.useState)([]),An=Object(o.a)(Qn,2),pn=An[0],Gn=An[1],dn=Object(r.useState)(1),En=Object(o.a)(dn,2),qt=En[0],In=En[1],Jn=Object(r.useState)(!1),qn=Object(o.a)(Jn,2),wn=qn[0],Nn=qn[1],cn=Object(r.useState)(""),rr=Object(o.a)(cn,2),zn=rr[0],fr=rr[1],cr=Object(r.useRef)(!1),Hn=function(Pt){Gn([].concat(Object(M.a)(pn),[Object(g.a)({},Pt)]))},Fn=Object(j.i)();Object(r.useEffect)(function(){if(cr.current)return;if(!(pe!=null&&pe.question_choices)){jt(!0),Dn(""),yn(2),Mn("");return}Nn(!(pe!=null&&pe.repeat_answer)),Dn(pe==null?void 0:pe.question_title),yn(pe==null?void 0:pe.question_score),In(pe==null?void 0:pe.difficulty),Mn(pe.standard_answer[0]+""),Ot(pe.tag_discipline_ids),fr(pe==null?void 0:pe.analysis)},[pe,It]),Object(r.useEffect)(function(){It&&yt();function yt(){return Pt.apply(this,arguments)}function Pt(){return Pt=Object(ee.a)(a.a.mark(function Lt(){var wt,Gt,rn;return a.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return st.next=2,Object(P.I)({sub_discipline_id:(wt=Ae.editData)===null||wt===void 0||((Gt=wt.exercise)===null||Gt===void 0)?void 0:Gt.sub_discipline_id});case 2:rn=st.sent,Gn(rn.tag_disciplines);case 4:case"end":return st.stop()}},Lt)})),Pt.apply(this,arguments)}},[It]),Object(r.useImperativeHandle)(xt,function(){return{onSave:Sn,isEdit:It}}),Object(r.useEffect)(function(){var yt,Pt=Ae!=null&&(yt=Ae.tagDisciplineData)!==null&&yt!==void 0&&yt.tag_disciplines&&Array.isArray(Ae.tagDisciplineData.tag_disciplines)?Ae.tagDisciplineData.tag_disciplines:[];Gn(Pt)},[Ae.tagDisciplineData]);var gr=function(Pt){(Pt==null?void 0:Pt.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),jt(!1),we(-1),cr.current=!1,sr())},Sn=function(){var yt=Object(ee.a)(a.a.mark(function Pt(){var Lt,wt,Gt,rn,tn,st;return a.a.wrap(function(Be){for(;;)switch(Be.prev=Be.next){case 0:if($t){Be.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Be.abrupt("return",!1);case 3:if(ot){Be.next=6;break}return E.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Be.abrupt("return",!1);case 6:if(Lt=[{choice_text:"\u6B63\u786E",is_answer:ot==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:ot==="2"?1:0}],cr.current=!0,!pe.question_id){Be.next=15;break}return Be.next=11,me({type:"newExercisePaper/editExerciseQuestion",payload:{id:Fn.id,question_id:pe.question_id,name:$t,item_type:Se.a.Judge,question_score:Un,choices:Lt,tag_discipline_ids:Ht,sub_discipline_id:(Gt=Ae.editData)===null||Gt===void 0||((rn=Gt.exercise)===null||rn===void 0)?void 0:rn.sub_discipline_id,difficulty:qt,repeat_answer:!wn,analysis:zn}});case 11:wt=Be.sent,gr(wt),Be.next=19;break;case 15:return Be.next=17,me({type:"newExercisePaper/addExerciseQuestion",payload:{id:Fn.id,insert_id:pe==null?void 0:pe.insert_id,name:$t,item_type:Se.a.Judge,question_score:Un,choices:Lt,tag_discipline_ids:Ht,sub_discipline_id:(tn=Ae.editData)===null||tn===void 0||((st=tn.exercise)===null||st===void 0)?void 0:st.sub_discipline_id,difficulty:qt,repeat_answer:!wn,analysis:zn}});case 17:wt=Be.sent,gr(wt);case 19:return Be.abrupt("return",{name:$t,choices:Lt});case 20:case"end":return Be.stop()}},Pt)}));return function(){return yt.apply(this,arguments)}}(),xn=[{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"}],Cn=function(){var yt=Object(ee.a)(a.a.mark(function Pt(Lt){return a.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:if(!(ir!==-1)){Gt.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Gt.abrupt("return");case 3:Gt.t0=Lt.id,Gt.next=Gt.t0==="del"?6:Gt.t0==="edit"?8:Gt.t0==="add"?11:13;break;case 6:return B.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(ee.a)(a.a.mark(function tn(){return a.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:return Ye.next=2,Object(he.g)({question_id:pe.question_id,exam_id:Fn.id});case 2:me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Fn)});case 3:case"end":return Ye.stop()}},tn)}))()}}),Gt.abrupt("break",13);case 8:return we(pe.dragKey),jt(!0),Gt.abrupt("break",13);case 11:return Wn({key:pe.key,insert_id:pe==null?void 0:pe.question_id,question_type:2}),Gt.abrupt("break",13);case 13:case"end":return Gt.stop()}},Pt)}));return function(Lt){return yt.apply(this,arguments)}}(),_n=function(){var Pt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.a.questionType},!(pe!=null&&pe.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},pe.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",pe.question_score,"\u5206\uFF09")),pe!=null&&pe.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},pe.key,"."),t.a.createElement(ve.a,{value:pe.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",pe.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:pe.question_title})),t.a.createElement("div",{className:ae.a.questionChoices},pe==null||((Pt=pe.question_choices)===null||Pt===void 0)?void 0:Pt.map(function(Lt,wt){return t.a.createElement(u.a,{key:wt,checked:pe.standard_answer.includes(wt+1),disabled:!0},on[wt],". ",t.a.createElement("span",{className:"c-black font14"},Lt.choice_text))})),t.a.createElement("div",{className:ae.a.action},!pe.hideAction&&xn.map(function(Lt,wt){return t.a.createElement(f.a,{key:wt,placement:"bottom",title:Lt.name},t.a.createElement("span",{onClick:function(){return Cn(Lt)},className:Lt.icon}))})))},Qt=function(){var Pt,Lt;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:ae.a.titleWrap},t.a.createElement("span",{className:ae.a.required},"*"),t.a.createElement("span",{className:ae.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:$t,onChange:function(Gt){return Dn(Gt)}}),t.a.createElement("p",{className:ae.a.titleWrap},t.a.createElement("span",{className:ae.a.required},"*"),t.a.createElement("span",{className:ae.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ae.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(u.a.Group,{buttonStyle:"solid",value:ot,onChange:function(Gt){return Mn(Gt.target.value)}},t.a.createElement(u.a.Button,{value:"1",className:"".concat(ae.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(u.a.Button,{value:"2",className:ae.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:ae.a.titleWrap},t.a.createElement("span",{className:ae.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:zn,onChange:function(Gt){return fr(Gt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:Un,max:1e4,min:0,onChange:function(Gt){yn(Gt)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ae.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:qt,onChange:function(Gt){In(Gt.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:ae.a.titleWrap},t.a.createElement("span",{className:"".concat(ae.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ae.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(Te.a,{value:Ht,selectvalues:pe==null?void 0:pe.tag_discipline_ids,onChange:Ot,subId:(Pt=Ae.editData)===null||Pt===void 0||((Lt=Pt.exercise)===null||Lt===void 0)?void 0:Lt.sub_discipline_id,knowledgeOptions:pn,onAddKnowledgeFinish:Hn})),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:wn,onChange:function(Gt){Nn(Gt)}}))),t.a.createElement("aside",{className:"tr"},(ir!==-1||pe.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){ge(),jt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Sn()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ae.a.wrap},!It&&_n(),It&&Qt())},nn=Object(H.a)(function(nt){var ke=nt.newExercisePaper;return{newExercisePaper:ke}},null,null,{forwardRef:!0})(Object(r.forwardRef)(fn)),kn=function(ke,xt){var Ae=ke.newExercisePaper,me=ke.dispatch,pe=ke.editData,ir=ke.editKey,Vt=ke.setEditKey,we=Vt===void 0?function(){}:Vt,at=ke.cancelAdd,ge=at===void 0?function(){}:at,en=ke.addCallback,sr=en===void 0?function(){}:en,ur=ke.reload,Wn=ur===void 0?function(){}:ur,Ft=Object(r.useState)(""),or=Object(o.a)(Ft,2),ot=or[0],Mn=or[1],bn=Object(r.useState)(""),sn=Object(o.a)(bn,2),$t=sn[0],Dn=sn[1],hn=Object(r.useState)([]),Jt=Object(o.a)(hn,2),It=Jt[0],jt=Jt[1],tr=Object(r.useState)(""),nr=Object(o.a)(tr,2),Un=nr[0],yn=nr[1],Nt=Object(r.useState)(),Xt=Object(o.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=Object(r.useState)(!1),An=Object(o.a)(Qn,2),pn=An[0],Gn=An[1],dn=Object(r.useState)(),En=Object(o.a)(dn,2),qt=En[0],In=En[1],Jn=Object(r.useState)(0),qn=Object(o.a)(Jn,2),wn=qn[0],Nn=qn[1],cn=Object(r.useState)(!1),rr=Object(o.a)(cn,2),zn=rr[0],fr=rr[1],cr=Object(r.useState)(!1),Hn=Object(o.a)(cr,2),Fn=Hn[0],gr=Hn[1],Sn=Object(r.useState)([]),xn=Object(o.a)(Sn,2),Cn=xn[0],_n=xn[1],Qt=Object(r.useState)(1),yt=Object(o.a)(Qt,2),Pt=yt[0],Lt=yt[1],wt=Object(r.useState)(!1),Gt=Object(o.a)(wt,2),rn=Gt[0],tn=Gt[1],st=Object(r.useRef)(!1),Ye=Object(j.i)(),Be=Object(r.useState)([]),ze=Object(o.a)(Be,2),Le=ze[0],tt=ze[1],Ve=function(mn){tt([].concat(Object(M.a)(Le),[Object(g.a)({},mn)]))};Object(r.useEffect)(function(){if(st.current)return;if(!(pe!=null&&pe.question_title)){fr(!0),Mn(""),Ot(!1),In(2),jt([]),yn(""),Gn(!1);return}Mn(pe==null?void 0:pe.question_title),Ot(pe==null?void 0:pe.is_ordered),Lt(pe==null?void 0:pe.difficulty),tn(!(pe!=null&&pe.repeat_answer)),In(pe==null?void 0:pe.question_score);var Ut=pe==null?void 0:pe.standard_answer.map(function(mn){return mn.answer_text});jt(Object(M.a)(Ut)),_n(pe.tag_discipline_ids),Dn(pe==null?void 0:pe.analysis)},[pe,zn]),Object(r.useEffect)(function(){Gn(!1),zn&&Ut();function Ut(){return mn.apply(this,arguments)}function mn(){return mn=Object(ee.a)(a.a.mark(function Pn(){var Kn,vn,Lr;return a.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:return Er.next=2,Object(P.I)({sub_discipline_id:(Kn=Ae.editData)===null||Kn===void 0||((vn=Kn.exercise)===null||vn===void 0)?void 0:vn.sub_discipline_id});case 2:Lr=Er.sent,tt(Lr.tag_disciplines);case 4:case"end":return Er.stop()}},Pn)})),mn.apply(this,arguments)}},[zn]),Object(r.useImperativeHandle)(xt,function(){return{onSave:bt,isEdit:zn}}),Object(r.useEffect)(function(){var Ut,mn=Ae!=null&&(Ut=Ae.tagDisciplineData)!==null&&Ut!==void 0&&Ut.tag_disciplines&&Array.isArray(Ae.tagDisciplineData.tag_disciplines)?Ae.tagDisciplineData.tag_disciplines:[];tt(mn)},[Ae.tagDisciplineData]);var pt=function(mn){(mn==null?void 0:mn.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),fr(!1),we(-1),st.current=!1,Wn())},bt=function(){var Ut=Object(ee.a)(a.a.mark(function mn(){var Pn,Kn,vn,Lr,Br,Er,$n;return a.a.wrap(function(_r){for(;;)switch(_r.prev=_r.next){case 0:if(Pn=[],Kn=!1,gr(!0),It.forEach(function(yr,Mr){Pn.push({position:Mr+1,answer_text:[]}),yr.forEach(function(Vr,Ur){Pn[Mr].answer_text.push(Vr),(!Vr||!Object(q.fb)(Vr,1e4))&&(yn("".concat(Mr,"-").concat(Ur)),E.b.info(Vr?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Kn=!0)})}),!Kn){_r.next=7;break}return gr(!1),_r.abrupt("return",!1);case 7:if(st.current=!0,!pe.question_id){_r.next=15;break}return _r.next=11,me({type:"newExercisePaper/editExerciseQuestion",payload:{id:Ye.id,question_id:pe.question_id,name:ot,item_type:3,question_score:qt,is_ordered:Ht,standard_answers:Pn,tag_discipline_ids:Cn,sub_discipline_id:(Lr=Ae.editData)===null||Lr===void 0||((Br=Lr.exercise)===null||Br===void 0)?void 0:Br.sub_discipline_id,difficulty:Pt,repeat_answer:!rn,analysis:$t}});case 11:vn=_r.sent,pt(vn),_r.next=19;break;case 15:return _r.next=17,me({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:pe==null?void 0:pe.insert_id,id:Ye.id,name:ot,item_type:3,question_score:qt,is_ordered:Ht,standard_answers:Pn,tag_discipline_ids:Cn,sub_discipline_id:(Er=Ae.editData)===null||Er===void 0||(($n=Er.exercise)===null||$n===void 0)?void 0:$n.sub_discipline_id,difficulty:Pt,repeat_answer:!rn,analysis:$t}});case 17:vn=_r.sent,pt(vn);case 19:return gr(!1),_r.abrupt("return",{name:ot,analysis:$t,standard_answers:Pn,is_ordered:Ht});case 21:case"end":return _r.stop()}},mn)}));return function(){return Ut.apply(this,arguments)}}(),mt=function(mn,Pn,Kn){var vn=It.slice();if(Pn&&vn.splice(mn,Pn),Kn&&pn||!pe.question_id)for(var Lr=0;Lr<Kn;Lr++)vn.splice(mn+Lr,0,[""]);Nn(vn==null?void 0:vn.length),Gn(!0),jt(vn)},At=function(mn,Pn,Kn){yn("");var vn=It.slice();vn[mn][Pn]=Kn,jt(vn)},vt=function(mn){var Pn=It.slice();Pn[mn]=[].concat(Object(M.a)(Pn[mn]),[""]),jt(Pn)},Et=function(mn,Pn){var Kn=It.slice();if(!Kn[mn][Pn]){Kn[mn]=Kn[mn].filter(function(vn,Lr){return Lr!==Pn}),jt(Kn);return}B.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:ae.a.modal,onOk:function(){Kn[mn]=Kn[mn].filter(function(Lr,Br){return Br!==Pn}),jt(Kn)}})},an=function(mn){B.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:ae.a.modal,onOk:function(){var Kn=0;Mn(ot.replace(/\▁/g,function(vn){return Kn++,Kn-1===mn?"":vn})),setTimeout(function(){var vn=It.slice();vn=It.filter(function(Lr,Br){return mn!==Br}),jt(vn)},500)}})},Yt=function(){var mn,Pn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.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(U.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:ot,onChange:function(vn){return Mn(vn)},showNullButton:!0,deleteEmptyDisabled:Fn,onPlaceholderChange:mt})),t.a.createElement("div",{className:"mt20"},It.map(function(Kn,vn){return t.a.createElement(V.a,{key:vn,answers:Kn,index:vn,is_md:!0,exerciseIsPublish:!1,activeOptionErrorIndex:Un,onAnswerChange:At,addChildAnswer:vt,deleteChildAnswer:Et,deleteChildAnswermain:an})})),t.a.createElement("div",{className:"mt20"},It.length>1&&t.a.createElement("span",null,t.a.createElement(y.a,{checked:Ht,onChange:function(vn){return Ot(vn.target.checked)},className:"".concat(ae.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ae.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:ae.a.titleWrap},t.a.createElement("span",{className:ae.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:$t,onChange:function(vn){return Dn(vn)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:qt,max:1e4,min:0,onChange:function(vn){In(vn)}})," \u5206 \xA0 ",!!qt&&!!wn&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(qt/wn).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:ae.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Pt,onChange:function(vn){Lt(vn.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:ae.a.titleWrap},t.a.createElement("span",{className:"".concat(ae.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ae.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(Te.a,{value:Cn,selectvalues:pe==null?void 0:pe.tag_discipline_ids,onChange:_n,subId:(mn=Ae.editData)===null||mn===void 0||((Pn=mn.exercise)===null||Pn===void 0)?void 0:Pn.sub_discipline_id,knowledgeOptions:Le,onAddKnowledgeFinish:Ve})),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:rn,onChange:function(vn){tn(vn)}}))),t.a.createElement("aside",{className:"tr"},(ir!==-1||pe.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){ge(),fr(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){bt()}},"\u4FDD\u5B58")))},lr=[{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"}],Bn=function(){var Ut=Object(ee.a)(a.a.mark(function mn(Pn){return a.a.wrap(function(vn){for(;;)switch(vn.prev=vn.next){case 0:if(!(ir!==-1)){vn.next=3;break}return E.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=Pn.id,vn.next=vn.t0==="del"?6:vn.t0==="edit"?8:vn.t0==="add"?11:13;break;case 6:return B.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(ee.a)(a.a.mark(function Br(){return a.a.wrap(function($n){for(;;)switch($n.prev=$n.next){case 0:return $n.next=2,Object(he.g)({question_id:pe.question_id,exam_id:Ye.id});case 2:me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Ye)});case 3:case"end":return $n.stop()}},Br)}))()}}),vn.abrupt("break",13);case 8:return we(pe.dragKey),fr(!0),vn.abrupt("break",13);case 11:return sr({key:pe.key,insert_id:pe==null?void 0:pe.question_id,question_type:3}),vn.abrupt("break",13);case 13:case"end":return vn.stop()}},mn)}));return function(Pn){return Ut.apply(this,arguments)}}(),jn=function(){var mn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.a.questionType},!(pe!=null&&pe.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},pe.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",pe.question_score,"\u5206\uFF09")),pe!=null&&pe.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},pe.key,"."),t.a.createElement(ve.a,{value:pe.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",pe.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:pe.question_title})),t.a.createElement("div",{className:ae.a.questionChoices},pe==null||((mn=pe.standard_answer)===null||mn===void 0)?void 0:mn.map(function(Pn,Kn){return t.a.createElement(L.a,{key:Kn,align:"middle"},t.a.createElement(O.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",Pn.choice_id,"\uFF09\uFF1A"),t.a.createElement(O.a,{flex:"1"},t.a.createElement(L.a,{align:"middle",gutter:[1,1]},Pn.answer_text.map(function(vn,Lr){return t.a.createElement(O.a,{span:24,key:Lr},t.a.createElement(C.a,{key:Kn,checked:pe.standard_answer.includes(Kn),disabled:!0,value:vn}))}))))})),t.a.createElement("div",{className:ae.a.action},!pe.hideAction&&lr.map(function(Pn,Kn){return Pn.id==="up"&&pe.key===1||Pn.id==="down"&&pe.key===pe.len?null:t.a.createElement(f.a,{key:Kn,placement:"bottom",title:Pn.name},t.a.createElement("span",{onClick:function(){return Bn(Pn)},className:Pn.icon}))})))};return t.a.createElement("section",{className:ae.a.wrap},!zn&&jn(),zn&&Yt())},dr=Object(H.a)(function(nt){var ke=nt.newExercisePaper;return{newExercisePaper:ke}},null,null,{forwardRef:!0})(Object(r.forwardRef)(kn)),pr=function(ke,xt){var Ae=ke.newExercisePaper,me=ke.dispatch,pe=ke.editData,ir=ke.cancelAdd,Vt=ir===void 0?function(){}:ir,we=ke.editKey,at=ke.setEditKey,ge=at===void 0?function(){}:at,en=ke.reload,sr=en===void 0?function(){}:en,ur=ke.addCallback,Wn=ur===void 0?function(){}:ur,Ft=Object(r.useState)(""),or=Object(o.a)(Ft,2),ot=or[0],Mn=or[1],bn=Object(r.useState)(""),sn=Object(o.a)(bn,2),$t=sn[0],Dn=sn[1],hn=Object(r.useState)(""),Jt=Object(o.a)(hn,2),It=Jt[0],jt=Jt[1],tr=Object(r.useState)(),nr=Object(o.a)(tr,2),Un=nr[0],yn=nr[1],Nt=Object(r.useState)(!1),Xt=Object(o.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=Object(r.useState)([]),An=Object(o.a)(Qn,2),pn=An[0],Gn=An[1],dn=Object(r.useState)(1),En=Object(o.a)(dn,2),qt=En[0],In=En[1],Jn=Object(r.useState)(!1),qn=Object(o.a)(Jn,2),wn=qn[0],Nn=qn[1],cn=Object(r.useState)([[],[]]),rr=Object(o.a)(cn,2),zn=rr[0],fr=rr[1],cr=Object(r.useRef)(!1),Hn=Object(j.i)(),Fn=Object(r.useState)([]),gr=Object(o.a)(Fn,2),Sn=gr[0],xn=gr[1],Cn=function(rn){xn([].concat(Object(M.a)(Sn),[Object(g.a)({},rn)]))};Object(r.useEffect)(function(){var Gt;if(cr.current)return;if(!(pe!=null&&pe.question_title)){Ot(!0),Mn(""),jt(""),yn(10);return}Nn(!(pe!=null&&pe.repeat_answer)),Mn(pe==null?void 0:pe.question_title),jt(pe==null||((Gt=pe.standard_answer)===null||Gt===void 0)?void 0:Gt[0]),yn(pe==null?void 0:pe.question_score),Gn(pe.tag_discipline_ids),In(pe==null?void 0:pe.difficulty),Dn(pe==null?void 0:pe.analysis),fr([pe==null?void 0:pe.normal_keywords,pe==null?void 0:pe.main_keywords])},[Ae.editData,Ht]),Object(r.useEffect)(function(){var Gt,rn=Ae!=null&&(Gt=Ae.tagDisciplineData)!==null&&Gt!==void 0&&Gt.tag_disciplines&&Array.isArray(Ae.tagDisciplineData.tag_disciplines)?Ae.tagDisciplineData.tag_disciplines:[];xn(rn)},[Ae.tagDisciplineData]),Object(r.useEffect)(function(){Ht&&Gt();function Gt(){return rn.apply(this,arguments)}function rn(){return rn=Object(ee.a)(a.a.mark(function tn(){var st,Ye,Be;return a.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:return Le.next=2,Object(P.I)({sub_discipline_id:(st=Ae.editData)===null||st===void 0||((Ye=st.exercise)===null||Ye===void 0)?void 0:Ye.sub_discipline_id});case 2:Be=Le.sent,xn(Be.tag_disciplines);case 4:case"end":return Le.stop()}},tn)})),rn.apply(this,arguments)}},[Ht]),Object(r.useImperativeHandle)(xt,function(){return{onSave:Qt,isEdit:Ht}});var _n=function(rn){(rn==null?void 0:rn.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),Ot(!1),ge(-1),cr.current=!1,sr())},Qt=function(){var Gt=Object(ee.a)(a.a.mark(function rn(){var tn,st,Ye,Be,ze,Le,tt;return a.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:if(ot){pt.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),pt.abrupt("return",!1);case 3:if(tn=zn[0],st=zn[1],cr.current=!0,!pe.question_id){pt.next=13;break}return pt.next=9,me({type:"newExercisePaper/editExerciseQuestion",payload:{id:Hn.id,question_id:pe.question_id,name:ot,item_type:4,question_score:Un,answer_texts:[It],tag_discipline_ids:pn,sub_discipline_id:(Be=Ae.editData)===null||Be===void 0||((ze=Be.exercise)===null||ze===void 0)?void 0:ze.sub_discipline_id,difficulty:qt,repeat_answer:!wn,analysis:$t,normal_keywords:tn,main_keywords:st}});case 9:Ye=pt.sent,_n(Ye),pt.next=17;break;case 13:return pt.next=15,me({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:pe==null?void 0:pe.insert_id,id:Hn.id,name:ot,item_type:4,question_score:Un,answer_texts:[It],tag_discipline_ids:pn,sub_discipline_id:(Le=Ae.editData)===null||Le===void 0||((tt=Le.exercise)===null||tt===void 0)?void 0:tt.sub_discipline_id,difficulty:qt,repeat_answer:!wn,analysis:$t,normal_keywords:tn,main_keywords:st}});case 15:Ye=pt.sent,_n(Ye);case 17:return pt.abrupt("return",{name:ot,answer_texts:[It],analysis:$t,normal_keywords:tn,main_keywords:st});case 18:case"end":return pt.stop()}},rn)}));return function(){return Gt.apply(this,arguments)}}(),yt=function(){var rn,tn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.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:ot,onChange:function(Ye){return Mn(Ye)}}),t.a.createElement("p",{className:ae.a.titleWrap},t.a.createElement("span",{className:ae.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:It,onChange:function(Ye){return jt(Ye)}}),t.a.createElement(kt.a,{value:zn,onChange:fr}),t.a.createElement("p",{className:ae.a.titleWrap},t.a.createElement("span",{className:ae.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:$t,onChange:function(Ye){return Dn(Ye)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:Un,max:1e4,min:0,onChange:function(Ye){yn(Ye)}})," \u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ae.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:qt,onChange:function(Ye){In(Ye.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:ae.a.titleWrap},t.a.createElement("span",{className:"".concat(ae.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ae.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(Te.a,{value:pn,selectvalues:pe==null?void 0:pe.tag_discipline_ids,onChange:Gn,subId:(rn=Ae.editData)===null||rn===void 0||((tn=rn.exercise)===null||tn===void 0)?void 0:tn.sub_discipline_id,knowledgeOptions:Sn,onAddKnowledgeFinish:Cn})),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:wn,onChange:function(Ye){Nn(Ye)}}))),t.a.createElement("aside",{className:"tr"},(we!==-1||pe.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Vt(),Ot(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Qt()}},"\u4FDD\u5B58")))},Pt=[{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"}],Lt=function(){var Gt=Object(ee.a)(a.a.mark(function rn(tn){return a.a.wrap(function(Ye){for(;;)switch(Ye.prev=Ye.next){case 0:if(!(we!==-1)){Ye.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ye.abrupt("return");case 3:Ye.t0=tn.id,Ye.next=Ye.t0==="del"?6:Ye.t0==="up"||Ye.t0==="down"?8:Ye.t0==="edit"?12:Ye.t0==="add"?15:17;break;case 6:return B.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(ee.a)(a.a.mark(function ze(){return a.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.next=2,Object(he.g)({question_id:pe.question_id,exam_id:Hn.id});case 2:me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Hn)});case 3:case"end":return tt.stop()}},ze)}))()}}),Ye.abrupt("break",17);case 8:return Ye.next=10,me({type:"newExercisePaper/exeriseMoveUpDown",payload:{id:pe.question_id,opr:tn.id}});case 10:return me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Hn)}),Ye.abrupt("break",17);case 12:return ge(pe.dragKey),Ot(!0),Ye.abrupt("break",17);case 15:return Wn({key:pe.key,insert_id:pe==null?void 0:pe.question_id,question_type:4}),Ye.abrupt("break",17);case 17:case"end":return Ye.stop()}},rn)}));return function(tn){return Gt.apply(this,arguments)}}(),wt=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.a.questionType},!(pe!=null&&pe.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},pe.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",pe.question_score,"\u5206\uFF09")),pe!=null&&pe.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},pe.key,"."),t.a.createElement(ve.a,{value:pe.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",pe.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:pe.question_title})),t.a.createElement("div",{className:ae.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(ve.a,{value:It||""})),t.a.createElement("div",{className:ae.a.action},!pe.hideAction&&Pt.map(function(rn,tn){return t.a.createElement(f.a,{key:tn,placement:"bottom",title:rn.name},t.a.createElement("span",{onClick:function(){return Lt(rn)},className:rn.icon}))})))};return t.a.createElement("section",{className:ae.a.wrap},!Ht&&wt(),Ht&&yt())},Yn=Object(H.a)(function(nt){var ke=nt.newExercisePaper;return{newExercisePaper:ke}},null,null,{forwardRef:!0})(Object(r.forwardRef)(pr)),Tr=function(ke,xt){var Ae=ke.dispatch,me=ke.editData,pe=ke.cancelAdd,ir=pe===void 0?function(){}:pe,Vt=ke.editKey,we=ke.setEditKey,at=we===void 0?function(){}:we,ge=ke.reload,en=ge===void 0?function(){}:ge,sr=Object(r.useState)(""),ur=Object(o.a)(sr,2),Wn=ur[0],Ft=ur[1],or=Object(r.useState)(""),ot=Object(o.a)(or,2),Mn=ot[0],bn=ot[1],sn=Object(r.useState)(""),$t=Object(o.a)(sn,2),Dn=$t[0],hn=$t[1],Jt=Object(r.useState)([]),It=Object(o.a)(Jt,2),jt=It[0],tr=It[1],nr=Object(r.useState)(),Un=Object(o.a)(nr,2),yn=Un[0],Nt=Un[1],Xt=Object(r.useState)(!1),Ht=Object(o.a)(Xt,2),Ot=Ht[0],Qn=Ht[1],An=Object(r.useState)([]),pn=Object(o.a)(An,2),Gn=pn[0],dn=pn[1],En=Object(r.useState)(!1),qt=Object(o.a)(En,2),In=qt[0],Jn=qt[1],qn=Object(r.useState)(!1),wn=Object(o.a)(qn,2),Nn=wn[0],cn=wn[1],rr=Object(j.i)(),zn=Object(r.useRef)(!1);Object(r.useEffect)(function(){var xn;if(zn.current)return;me.edit&&(Jn(!0),bn(""),Ft(""),dn([])),Ft(me.shixun_name),bn(me.question_title);var Cn=[];(xn=me.shixun)===null||xn===void 0||xn.map(function(_n){Cn.push(_n.challenge_score)}),dn(Cn)},[me]),Object(r.useEffect)(function(){Qn(!1)},[In]),Object(r.useImperativeHandle)(xt,function(){return{onSave:cr,isEdit:In}});var fr=function(Cn){(Cn==null?void 0:Cn.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),Jn(!1),at(-1),zn.current=!1,en())},cr=function(){var xn=Object(ee.a)(a.a.mark(function Cn(){var _n,Qt,yt;return a.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:if(_n=[],Qt=!1,!Qt){Lt.next=4;break}return Lt.abrupt("return",!1);case 4:if(zn.current=!0,cn(!0),!me.question_id){Lt.next=12;break}return Lt.next=9,Ae({type:"newExercisePaper/editExerciseQuestion",payload:{id:rr.id,question_id:me.question_id,name:Mn,shixun_name:Wn,shixun_id:me.shixun_id,item_type:5,question_scores:Gn}});case 9:yt=Lt.sent,Lt.next=15;break;case 12:return Lt.next=14,Ae({type:"newExercisePaper/addExerciseQuestion",payload:{id:rr.id,insert_id:me==null?void 0:me.insert_id,name:Mn,shixun_name:Wn,shixun_id:me.shixun_id,item_type:5,question_scores:Gn,is_copy:me.is_copy}});case 14:yt=Lt.sent;case 15:return fr(yt),cn(!1),Lt.abrupt("return",{name:Mn,analysis:Dn,standard_answers:_n,is_ordered:yn});case 18:case"end":return Lt.stop()}},Cn)}));return function(){return xn.apply(this,arguments)}}(),Hn=function(){var Cn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.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(C.a,{defaultValue:Wn,onChange:function(Qt){Ft(Qt.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:Mn,onChange:function(Qt){bn(Qt)}})),t.a.createElement("div",{className:"mt20"},(Cn=me.shixun)===null||Cn===void 0?void 0:Cn.map(function(_n,Qt){return t.a.createElement(L.a,{gutter:[20,20]},t.a.createElement(O.a,{flex:"1"},Qt+1,".",_n.challenge_name),t.a.createElement(O.a,null,t.a.createElement(k.a,{defaultValue:Gn[Qt],onChange:function(Pt){Gn[Qt]=Pt,dn(Gn)}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},jt.length>1&&t.a.createElement("span",null,t.a.createElement(y.a,{checked:yn,onChange:function(Qt){return Nt(Qt.target.checked)},className:"".concat(ae.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ae.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"},(Vt!==-1||!(me!=null&&me.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){ir(),Jn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:Nn,className:"ml20",type:"primary",onClick:function(){cr()}},"\u4FDD\u5B58")))},Fn=[{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"}],gr=function(){var xn=Object(ee.a)(a.a.mark(function Cn(_n){return a.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:if(!(Vt!==-1)){yt.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),yt.abrupt("return");case 3:yt.t0=_n.id,yt.next=yt.t0==="del"?6:yt.t0==="edit"?8:yt.t0==="add"?11:13;break;case 6:return B.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(ee.a)(a.a.mark(function Lt(){return a.a.wrap(function(Gt){for(;;)switch(Gt.prev=Gt.next){case 0:return Gt.next=2,Object(he.g)({question_id:me.question_id,exam_id:rr.id});case 2:Ae({type:"newExercisePaper/editExercise",payload:Object(g.a)({},rr)});case 3:case"end":return Gt.stop()}},Lt)}))()}}),yt.abrupt("break",13);case 8:return at(me.dragKey),Jn(!0),yt.abrupt("break",13);case 11:return Ae({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:me.key,insert_id:me==null?void 0:me.question_id,question_type:5}}}),yt.abrupt("break",13);case 13:case"end":return yt.stop()}},Cn)}));return function(_n){return xn.apply(this,arguments)}}(),Sn=function(){var Cn,_n;return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.a.questionType},!(me!=null&&me.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},me.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",me.question_score,"\u5206\uFF09")),me!=null&&me.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},me.key,"."),t.a.createElement(ve.a,{value:me.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",me.question_score,"\u5206\uFF09"),!!((Cn=me.schools)!==null&&Cn!==void 0&&Cn.length)&&t.a.createElement(f.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(ve.a,{value:me.shixun_name})),t.a.createElement("div",{className:"mt30"}),(_n=me.shixun)===null||_n===void 0?void 0:_n.map(function(Qt,yt){return t.a.createElement("div",{key:yt},"\u7B2C",yt+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},Qt.challenge_name)," ",t.a.createElement("span",{className:"ml10"},Qt.challenge_score," \u5206"))}),t.a.createElement("div",{className:ae.a.action},t.a.createElement(Je.a,{target:"_blank",to:"/shixuns/".concat(me.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!me.hideAction&&Fn.map(function(Qt,yt){return t.a.createElement(f.a,{key:yt,placement:"bottom",title:Qt.name},t.a.createElement("span",{onClick:function(){return gr(Qt)},className:Qt.icon}))})))};return t.a.createElement("section",{className:ae.a.wrap},!In&&Sn(),In&&Hn())},Or=Object(H.a)(function(nt){var ke=nt.newExercisePaper;return{newExercisePaper:ke}},null,null,{forwardRef:!0})(Object(r.forwardRef)(Tr)),Wt=["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"],Ln=function(ke,xt){var Ae=ke.newExercisePaper,me=ke.dispatch,pe=ke.editData,ir=ke.editKey,Vt=ke.addCallback,we=Vt===void 0?function(){}:Vt,at=Object(r.useState)([]),ge=Object(o.a)(at,2),en=ge[0],sr=ge[1],ur=Object(r.useState)(),Wn=Object(o.a)(ur,2),Ft=Wn[0],or=Wn[1],ot=Object(r.useState)([]),Mn=Object(o.a)(ot,2),bn=Mn[0],sn=Mn[1],$t=Object(r.useState)(""),Dn=Object(o.a)($t,2),hn=Dn[0],Jt=Dn[1],It=Object(r.useState)(5),jt=Object(o.a)(It,2),tr=jt[0],nr=jt[1],Un=Object(r.useState)(!1),yn=Object(o.a)(Un,2),Nt=yn[0],Xt=yn[1],Ht=Object(j.i)();Object(r.useEffect)(function(){sr(["","","",""])},[]),Object(r.useEffect)(function(){if(!(pe!=null&&pe.question_choices)){Xt(!0),Jt(""),nr(5),sr(["","","",""]),sn([]);return}Jt(pe==null?void 0:pe.question_title),nr(pe==null?void 0:pe.question_score),sr(pe==null?void 0:pe.question_choices.map(function(En){return En.choice_text}));var dn=[];pe==null||pe.standard_answer.map(function(En,qt){dn.push(En-1)}),sn(dn)},[pe]),Object(r.useImperativeHandle)(xt,function(){return{onSave:Ot,isEdit:Nt}});var Ot=function(){var dn=Object(ee.a)(a.a.mark(function En(){var qt,In,Jn;return a.a.wrap(function(wn){for(;;)switch(wn.prev=wn.next){case 0:if(hn){wn.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),wn.abrupt("return",!1);case 3:if(qt=en.findIndex(function(Nn){return!Nn}),!(qt>-1)){wn.next=7;break}return E.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Wt[qt]," \u9009\u9879\u7684\u5185\u5BB9")),wn.abrupt("return",!1);case 7:if(bn.length){wn.next=10;break}return E.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),wn.abrupt("return",!1);case 10:if(!(bn.length<1)){wn.next=13;break}return E.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),wn.abrupt("return",!1);case 13:if(In=en.map(function(Nn,cn){return{choice_text:Nn,is_answer:bn.includes(cn)?cn+1:0}}),!pe.question_id){wn.next=20;break}return wn.next=17,me({type:"newExercisePaper/editExerciseQuestion",payload:{id:pe.question_id,question_title:hn,question_type:1,question_score:tr,question_choices:In.map(function(Nn){return Nn.choice_text}),standard_answers:In.filter(function(Nn){return Nn.is_answer}).map(function(Nn){return Nn.is_answer})}});case 17:Jn=wn.sent,wn.next=23;break;case 20:return wn.next=22,me({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:pe==null?void 0:pe.insert_id,categoryId:Ht.categoryId,question_title:hn,question_type:1,question_score:"5.0",question_choices:In.map(function(Nn){return Nn.choice_text}),standard_answers:In.filter(function(Nn){return Nn.is_answer}).map(function(Nn){return Nn.is_answer})}});case 22:Jn=wn.sent;case 23:Jn.status===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),Xt(!1),me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Ht)}));case 24:case"end":return wn.stop()}},En)}));return function(){return dn.apply(this,arguments)}}(),Qn=[{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"}],An=function(){var dn=Object(ee.a)(a.a.mark(function En(qt){return a.a.wrap(function(Jn){for(;;)switch(Jn.prev=Jn.next){case 0:if(!(ir!==-1)){Jn.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Jn.abrupt("return");case 3:Jn.t0=qt.id,Jn.next=Jn.t0==="del"?6:Jn.t0==="edit"?8:Jn.t0==="add"?10:12;break;case 6:return B.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(ee.a)(a.a.mark(function wn(){return a.a.wrap(function(cn){for(;;)switch(cn.prev=cn.next){case 0:return cn.next=2,Object(he.g)({exam_id:Ht.id,question_id:pe.question_id});case 2:me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Ht)});case 3:case"end":return cn.stop()}},wn)}))()}}),Jn.abrupt("break",12);case 8:return H.d.push("/problems/".concat(pe==null?void 0:pe.hack_identifier,"/edit?type=exercises&express_id=").concat(Ht.id,"&question_id=").concat(pe==null?void 0:pe.question_id,"&score=").concat(pe==null?void 0:pe.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Jn.abrupt("break",12);case 10:return we({key:pe.key,insert_id:pe==null?void 0:pe.question_id,question_type:6}),Jn.abrupt("break",12);case 12:case"end":return Jn.stop()}},En)}));return function(qt){return dn.apply(this,arguments)}}(),pn=function(){var dn=Object(ee.a)(a.a.mark(function En(qt){var In;return a.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return qt.preventDefault(),qn.next=3,Object(P.X)({id:pe==null?void 0:pe.hack_identifier});case 3:In=qn.sent,In.status===0&&Object(q.U)("/myproblems/".concat(In==null?void 0:In.identifier));case 5:case"end":return qn.stop()}},En)}));return function(qt){return dn.apply(this,arguments)}}(),Gn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.a.questionType},!(pe!=null&&pe.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},pe.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",pe.question_score,"\u5206\uFF09")),pe!=null&&pe.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},pe.key,"."),t.a.createElement(ve.a,{value:pe.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",pe.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:pe.question_title})),t.a.createElement("div",{className:ae.a.questionChoices},t.a.createElement(ve.a,{value:pe.description||""})),t.a.createElement("div",{className:ae.a.action},!pe.hideAction&&Qn.map(function(En,qt){return t.a.createElement(f.a,{key:qt,placement:"bottom",title:En.name},t.a.createElement("span",{onClick:function(){return An(En)},className:En.icon}))})))};return t.a.createElement("section",{className:ae.a.wrap},Gn())},mr=Object(H.a)(function(nt){var ke=nt.newExercisePaper;return{newExercisePaper:ke}},null,null,{forwardRef:!0})(Object(r.forwardRef)(Ln)),vr=["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"],Rr=function(ke,xt){var Ae=ke.newExercisePaper,me=ke.dispatch,pe=ke.editData,ir=ke.cancelAdd,Vt=ir===void 0?function(){}:ir,we=ke.editKey,at=ke.setEditKey,ge=at===void 0?function(){}:at,en=ke.addCallback,sr=en===void 0?function(Qt){}:en,ur=ke.reload,Wn=ur===void 0?function(){}:ur,Ft=Object(r.useState)([]),or=Object(o.a)(Ft,2),ot=or[0],Mn=or[1],bn=Object(r.useState)(!1),sn=Object(o.a)(bn,2),$t=sn[0],Dn=sn[1],hn=Object(r.useState)(!0),Jt=Object(o.a)(hn,2),It=Jt[0],jt=Jt[1],tr=Object(r.useState)(1),nr=Object(o.a)(tr,2),Un=nr[0],yn=nr[1],Nt=Object(r.useState)(!1),Xt=Object(o.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=Object(r.useState)([]),An=Object(o.a)(Qn,2),pn=An[0],Gn=An[1],dn=Object(j.i)(),En=Object(r.useRef)(null),qt=Object(r.useState)(""),In=Object(o.a)(qt,2),Jn=In[0],qn=In[1],wn=Object(r.useState)([]),Nn=Object(o.a)(wn,2),cn=Nn[0],rr=Nn[1],zn=Object(r.useRef)(!1),fr=function(yt){Gn([].concat(Object(M.a)(pn),[Object(g.a)({},yt)]))};Object(r.useEffect)(function(){var Qt;if(zn.current)return;if(!(pe!=null&&pe.question_title)){Dn(!0),qn("");return}qn(pe==null?void 0:pe.question_title),Ot(!(pe!=null&&pe.repeat_answer)),yn(pe==null?void 0:pe.difficulty),Mn(pe.tag_discipline_ids);var yt=pe==null||((Qt=pe.sub_exercise_questions)===null||Qt===void 0)?void 0:Qt.map(function(Pt){return Object(g.a)(Object(g.a)({},Pt),{},{id:Pt.question_id,name:Pt.question_title,open:!1,question_score:Pt.question_score,choices:Pt==null?void 0:Pt.question_choices.map(function(Lt){return{choice_text:Lt.choice_text,is_answer:Lt.standard_boolean?1:0}}),activeQusEditor:null})});rr(yt)},[pe,$t]),Object(r.useEffect)(function(){$t&&Qt();function Qt(){return yt.apply(this,arguments)}function yt(){return yt=Object(ee.a)(a.a.mark(function Pt(){var Lt,wt,Gt;return a.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(P.I)({sub_discipline_id:(Lt=Ae.editData)===null||Lt===void 0||((wt=Lt.exercise)===null||wt===void 0)?void 0:wt.sub_discipline_id});case 2:Gt=tn.sent,Gn(Gt.tag_disciplines);case 4:case"end":return tn.stop()}},Pt)})),yt.apply(this,arguments)}},[$t]),Object(r.useEffect)(function(){var Qt,yt=Ae!=null&&(Qt=Ae.tagDisciplineData)!==null&&Qt!==void 0&&Qt.tag_disciplines&&Array.isArray(Ae.tagDisciplineData.tag_disciplines)?Ae.tagDisciplineData.tag_disciplines:[];Gn(yt)},[Ae.tagDisciplineData]),Object(r.useImperativeHandle)(xt,function(){return{onSave:Hn,isEdit:$t}});var cr=function(yt){(yt==null?void 0:yt.status)===0&&(E.b.success("\u4FDD\u5B58\u6210\u529F"),Dn(!1),ge(-1),zn.current=!1,Wn())},Hn=function(){var Qt=Object(ee.a)(a.a.mark(function yt(){var Pt,Lt,wt,Gt,rn,tn,st,Ye,Be,ze,Le;return a.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:if(Jn){Ve.next=3;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Ve.abrupt("return",!1);case 3:if(!(cn.length===0)){Ve.next=6;break}return E.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),Ve.abrupt("return",!1);case 6:Pt=0;case 7:if(!(Pt<cn.length)){Ve.next=25;break}if(wt=cn[Pt],wt!=null&&wt.name){Ve.next=12;break}return E.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Pt+1,"\u5C0F\u9898\u9898\u5E72")),Ve.abrupt("return",!1);case 12:if(wt!=null&&wt.question_score){Ve.next=15;break}return E.b.info("\u7B2C".concat(Pt+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),Ve.abrupt("return",!1);case 15:if(Gt=wt==null||((Lt=wt.choices)===null||Lt===void 0)?void 0:Lt.findIndex(function(pt){return!pt}),!(Gt>-1)){Ve.next=19;break}return E.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Pt+1,"\u5C0F\u9898").concat(vr[Gt],"\u9009\u9879\u7684\u5185\u5BB9")),Ve.abrupt("return",!1);case 19:if(!(wt.choices.findIndex(function(pt){return pt.is_answer===1})===-1)){Ve.next=22;break}return E.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Pt+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),Ve.abrupt("return",!1);case 22:Pt++,Ve.next=7;break;case 25:if(rn=cn.map(function(pt){return{id:pt.id>1?pt.id:null,name:pt.name,item_type:Se.a.Single,choices:pt.choices,question_score:pt.question_score}}),zn.current=!0,!pe.question_id){Ve.next=34;break}return Ve.next=30,me({type:"newExercisePaper/editExerciseQuestion",payload:{id:dn.id,question_id:pe.question_id,name:Jn,item_type:Se.a.Combine,sub_item_banks:rn,tag_discipline_ids:ot,sub_discipline_id:(st=Ae.editData)===null||st===void 0||((Ye=st.exercise)===null||Ye===void 0)?void 0:Ye.sub_discipline_id,difficulty:Un,repeat_answer:!Ht}});case 30:tn=Ve.sent,cr(tn),Ve.next=38;break;case 34:return Ve.next=36,me({type:"newExercisePaper/addExerciseQuestion",payload:{id:dn.id,insert_id:pe==null?void 0:pe.insert_id,name:Jn,item_type:Se.a.Combine,tag_discipline_ids:ot,sub_discipline_id:(Be=Ae.editData)===null||Be===void 0||((ze=Be.exercise)===null||ze===void 0)?void 0:ze.sub_discipline_id,difficulty:Un,repeat_answer:!Ht,sub_item_banks:rn}});case 36:tn=Ve.sent,((Le=tn)===null||Le===void 0?void 0:Le.status)===0&&(ge(-1),E.b.success("\u4FDD\u5B58\u6210\u529F"),Dn(!1),me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},dn)}));case 38:case"end":return Ve.stop()}},yt)}));return function(){return Qt.apply(this,arguments)}}(),Fn=[{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"}],gr=function(){var Qt=Object(ee.a)(a.a.mark(function yt(Pt){return a.a.wrap(function(wt){for(;;)switch(wt.prev=wt.next){case 0:if(!(we!==-1)){wt.next=3;break}return E.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),wt.abrupt("return");case 3:wt.t0=Pt.id,wt.next=wt.t0==="del"?6:wt.t0==="edit"?8:wt.t0==="add"?11:13;break;case 6:return B.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(ee.a)(a.a.mark(function rn(){return a.a.wrap(function(st){for(;;)switch(st.prev=st.next){case 0:return st.next=2,Object(he.g)({question_id:pe.question_id,exam_id:dn.id});case 2:me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},dn)});case 3:case"end":return st.stop()}},rn)}))()}}),wt.abrupt("break",13);case 8:return ge(pe.dragKey),Dn(!0),wt.abrupt("break",13);case 11:return sr({key:pe.key,insert_id:pe==null?void 0:pe.question_id,item_type:Se.a.Single}),wt.abrupt("break",13);case 13:case"end":return wt.stop()}},yt)}));return function(Pt){return Qt.apply(this,arguments)}}(),Sn=function(){var yt;return t.a.createElement("aside",{ref:En},t.a.createElement("div",{className:ae.a.questionType},!(pe!=null&&pe.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},pe.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",pe.question_score,"\u5206\uFF09")),pe!=null&&pe.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},pe.key,"."),t.a.createElement(ve.a,{value:pe.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",pe==null?void 0:pe.sub_q_count,"\u5C0F\u9898\uFF0C",pe.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(ve.a,{value:pe.question_title})),t.a.createElement("div",{style:{display:It?"block":"none"},className:ae.a.questionChoices},pe==null||((yt=pe.sub_exercise_questions)===null||yt===void 0)?void 0:yt.map(function(Pt,Lt){var wt;return t.a.createElement("div",{key:Lt},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},pe.key,".",Lt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(ve.a,{value:Pt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Pt.question_score,"\u5206\uFF09")),Pt==null||((wt=Pt.question_choices)===null||wt===void 0)?void 0:wt.map(function(Gt,rn){return t.a.createElement(L.a,{key:rn},t.a.createElement(O.a,null,t.a.createElement(u.a,{key:rn,checked:Gt.standard_boolean,disabled:!0},vr[rn],".")),t.a.createElement(O.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(ve.a,{value:Gt.choice_text}))))}))})),t.a.createElement("div",{className:ae.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return jt(!It)},style:{}},It?"\u6536\u8D77":"\u5C55\u5F00"),!pe.hideAction&&Fn.map(function(Pt,Lt){return t.a.createElement(f.a,{key:Lt,placement:"bottom",title:Pt.name},t.a.createElement("span",{onClick:function(){return gr(Pt)},className:Pt.icon}))})))},xn=function(){var yt,Pt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ae.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:ae.a.wrap,style:{padding:0}},t.a.createElement("p",{className:ae.a.titleWrap},t.a.createElement("span",{className:ae.a.required},"*"),t.a.createElement("span",{className:ae.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:Jn,onChange:function(wt){return qn(wt)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",cn==null?void 0:cn.length),cn==null?void 0:cn.map(function(Lt,wt){var Gt;return t.a.createElement("div",{className:ae.a.fold,key:Lt.id},t.a.createElement("div",{onClick:function(){return _n("open",wt)},className:ae.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:Lt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",wt+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(tn){tn.stopPropagation(),_n("delete",wt)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:Lt.open?"block":"none"}},t.a.createElement(x.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Lt==null?void 0:Lt.name,onChange:function(tn){return _n("value",wt,tn)}}),t.a.createElement("p",{className:ae.a.titleWrap},t.a.createElement("span",{className:ae.a.required},"*"),t.a.createElement("span",{className:ae.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ae.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),Lt==null||((Gt=Lt.choices)===null||Gt===void 0)?void 0:Gt.map(function(rn,tn){var st;return t.a.createElement("div",{className:ae.a.choiceWrap,key:tn},t.a.createElement(f.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ae.a.answer," ").concat(rn.is_answer===1?ae.a.activeAnswer:""),onClick:function(){return _n("answer",wt,tn)}},vr[tn])),t.a.createElement("div",{className:ae.a.editorWrap},(Lt==null?void 0:Lt.activeQusEditor)===tn?t.a.createElement(x.a,{id:"single-question-option-".concat(tn),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:rn.choice_text,onChange:function(Be){return _n("details",wt,Be)}}):t.a.createElement("div",{className:ae.a.htmlWrap,onClick:function(){return _n("edit",wt,tn)}},t.a.createElement(ve.a,{value:rn.choice_text}))),tn>1&&t.a.createElement(f.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ae.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return _n("deleteQus",wt,tn)}})),tn<7&&tn===(Lt==null||((st=Lt.choices)===null||st===void 0)?void 0:st.length)-1&&t.a.createElement(f.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ae.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return _n("addQus",wt)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(k.a,{value:Lt.question_score,max:1e4,min:0,onChange:function(tn){return _n("score",wt,tn)}}),"\u5206")))}),cn.length<20&&t.a.createElement(m.a,{type:"primary",onClick:Cn},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:ae.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(u.a.Group,{value:Un,onChange:function(wt){yn(wt.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:ae.a.titleWrap},t.a.createElement("span",{className:"".concat(ae.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ae.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(Te.a,{selectvalues:pe==null?void 0:pe.tag_discipline_ids,value:ot,onChange:Mn,subId:(yt=Ae.editData)===null||yt===void 0||((Pt=yt.exercise)===null||Pt===void 0)?void 0:Pt.sub_discipline_id,knowledgeOptions:pn,onAddKnowledgeFinish:fr}))),t.a.createElement("aside",{className:"tr"},(we!==-1||pe.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Vt(),Dn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Hn()}},"\u4FDD\u5B58")))},Cn=function(){var yt={id:Math.random(),item_type:"SINGLE",open:!1,name:"",choices:Array.from({length:4},function(){return{choice_text:"",is_answer:0}}),activeQusEditor:null,analysis:""};rr(cn.concat(yt))},_n=function(yt,Pt,Lt){var wt=Object(ht.cloneDeep)(cn);yt==="open"&&(wt[Pt].open=!wt[Pt].open),yt==="delete"&&wt.splice(Pt,1),yt==="value"&&(wt[Pt].name=Lt),yt==="answer"&&wt[Pt].choices.forEach(function(Gt,rn){Gt.is_answer=Lt===rn?1:0}),yt==="edit"&&(wt[Pt].activeQusEditor=Lt),yt==="details"&&(wt[Pt].choices[wt[Pt].activeQusEditor].choice_text=Lt),yt==="addQus"&&(wt[Pt].choices=wt[Pt].choices.concat({choice_text:"",is_answer:0})),yt==="deleteQus"&&(wt[Pt].choices=wt[Pt].choices.filter(function(Gt,rn){return rn!==Lt})),yt==="analysis"&&(wt[Pt].analysis=Lt),yt==="score"&&(wt[Pt].question_score=Lt),rr(wt)};return t.a.createElement("section",{className:ae.a.wrap},!$t&&Sn(),$t&&xn())},Sr=Object(H.a)(function(nt){var ke=nt.newExercisePaper;return{newExercisePaper:ke}},null,null,{forwardRef:!0})(Object(r.forwardRef)(Rr)),Wr=function(ke){var xt=ke.data,Ae=ke.isDragDisabled,me=Ae===void 0?!1:Ae,pe=ke.editorProps,ir=pe===void 0?{}:pe,Vt=ke.onDragEnd,we=Vt===void 0?function(){}:Vt,at=ke.dispatch,ge=ke.markBtnVisible,en=ge===void 0?!1:ge,sr=ke.batchScore,ur=sr===void 0?[]:sr,Wn=ke.reload,Ft=Wn===void 0?function(){}:Wn,or=ke.inNewPaperLibrary,ot=or===void 0?!1:or,Mn=Object(r.useRef)(),bn=Object(j.i)(),sn=function(){var Nt,Xt,Ht,Ot,Qn,An,pn,Gn,dn,En,qt,In,Jn,qn,wn,Nn,cn=[{name:"\u5355\u9009\u9898",type:0,count:xt==null||((Nt=xt.exercise_types)===null||Nt===void 0)?void 0:Nt.q_singles,score:xt==null||((Xt=xt.exercise_types)===null||Xt===void 0)?void 0:Xt.q_singles_scores,items:[]},{name:"\u591A\u9009\u9898",type:1,count:xt==null||((Ht=xt.exercise_types)===null||Ht===void 0)?void 0:Ht.q_doubles,score:xt==null||((Ot=xt.exercise_types)===null||Ot===void 0)?void 0:Ot.q_doubles_scores,items:[]},{name:"\u5224\u65AD\u9898",type:2,count:xt==null||((Qn=xt.exercise_types)===null||Qn===void 0)?void 0:Qn.q_judges,score:xt==null||((An=xt.exercise_types)===null||An===void 0)?void 0:An.q_judges_scores,items:[]},{name:"\u586B\u7A7A\u9898",type:3,count:xt==null||((pn=xt.exercise_types)===null||pn===void 0)?void 0:pn.q_nulls,score:xt==null||((Gn=xt.exercise_types)===null||Gn===void 0)?void 0:Gn.q_nulls_scores,items:[]},{name:"\u7B80\u7B54\u9898",type:4,count:xt==null||((dn=xt.exercise_types)===null||dn===void 0)?void 0:dn.q_mains,score:xt==null||((En=xt.exercise_types)===null||En===void 0)?void 0:En.q_mains_scores,items:[]},{name:"\u5B9E\u8BAD\u9898",type:5,count:xt==null||((qt=xt.exercise_types)===null||qt===void 0)?void 0:qt.q_shixuns,score:xt==null||((In=xt.exercise_types)===null||In===void 0)?void 0:In.q_shixuns_scores,items:[]},{name:"\u7F16\u7A0B\u9898",type:6,count:xt==null||((Jn=xt.exercise_types)===null||Jn===void 0)?void 0:Jn.q_pros,score:xt==null||((qn=xt.exercise_types)===null||qn===void 0)?void 0:qn.q_pros_scores,items:[]},{name:"\u7EC4\u5408\u9898",type:7,count:xt==null||((wn=xt.exercise_types)===null||wn===void 0)?void 0:wn.q_combinations,score:xt==null||((Nn=xt.exercise_types)===null||Nn===void 0)?void 0:Nn.q_combination_scores,items:[]}];return cn},$t=function(Nt,Xt,Ht){var Ot=Array.from(Nt),Qn=Ot.splice(Xt,1),An=Object(o.a)(Qn,1),pn=An[0];return Ot.splice(Ht,0,pn),Ot},Dn=function(Nt,Xt,Ht){if(!Nt.destination)return;var Ot=$t(Xt,Nt.source.index,Nt.destination.index);ot?we(Nt,Ot,Ht):we(Ot,Ht)},hn=function(Nt){at({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:Nt}})},Jt=function(Nt,Xt){if(Xt===0)return ot?t.a.createElement(St,Object(h.a)({reload:Ft,editData:Nt},Nt)):t.a.createElement(Ct,Object(h.a)({reload:Ft,editData:Nt},Nt));if(Xt===1)return ot?t.a.createElement(hr,Object(h.a)({reload:Ft,editData:Nt},Nt)):t.a.createElement(Ne,Object(h.a)({reload:Ft,editData:Nt},Nt));if(Xt===2)return ot?t.a.createElement(nn,Object(h.a)({reload:Ft,editData:Nt},Nt)):t.a.createElement(ce,Object(h.a)({reload:Ft,editData:Nt},Nt));if(Xt===3)return ot?t.a.createElement(dr,Object(h.a)({reload:Ft,editData:Nt},Nt)):t.a.createElement(xe,Object(h.a)({reload:Ft,editData:Nt},Nt));if(Xt===4)return ot?t.a.createElement(Yn,Object(h.a)({reload:Ft,editData:Nt},Nt)):t.a.createElement(ln,Object(h.a)({reload:Ft,editData:Nt},Nt));if(Xt===5)return ot?t.a.createElement(Or,Object(h.a)({reload:Ft,editData:Nt},Nt)):t.a.createElement(ft,Object(h.a)({reload:Ft,editData:Nt},Nt));if(Xt===6)return ot?t.a.createElement(mr,Object(h.a)({reload:Ft,editData:Nt},Nt)):t.a.createElement(je,Object(h.a)({editData:Nt},Nt));if(Xt===7)return ot?t.a.createElement(Sr,Object(h.a)({reload:Ft,editData:Nt},Nt)):t.a.createElement(lt,Object(h.a)({reload:Ft,editData:Nt},Nt))},It=function(Nt,Xt,Ht){return t.a.createElement(Pe.a,{onDragEnd:function(Qn){return Dn(Qn,Nt,Xt)}},t.a.createElement(Pe.c,{droppableId:"droppable"},function(Ot,Qn){return t.a.createElement("div",Object(h.a)({ref:Ot.innerRef},Ot.droppableProps,{style:{width:"100%"}}),Nt==null?void 0:Nt.map(function(An,pn){var Gn,dn=Object(g.a)(Object(g.a)({},An),{},{key:pn+1,hideAction:!0,isPreview:!0,dragKey:Xt+"-"+pn},ir);return t.a.createElement(Pe.b,{key:dn==null?void 0:dn.question_id,draggableId:dn==null||((Gn=dn.question_id)===null||Gn===void 0)?void 0:Gn.toString(),index:pn,isDragDisabled:me},function(En,qt){return t.a.createElement("aside",Object(h.a)({ref:En.innerRef},En.draggableProps,En.dragHandleProps),t.a.createElement("div",{className:Ce.a.posWarp,id:dn.dragKey},Jt(dn,Xt),en&&t.a.createElement(L.a,{className:Ce.a.markWrongBtnWrapper},t.a.createElement(m.a,{onClick:function(){return hn({value:dn,type:Xt})}},dn!=null&&dn.is_wrong?"\u53D6\u6D88\u6807\u8BB0\u9519\u9898":"\u6807\u8BB0\u9519\u9898")),t.a.createElement(z.a,null),!me&&t.a.createElement("div",{className:Ce.a.pos},t.a.createElement("div",{className:Ce.a.tips},"\u62D6\u52A8\u53EF\u4EE5\u6539\u53D8\u8BD5\u9898\u663E\u793A\u987A\u5E8F"))))})}))}))},jt=function(Nt){var Xt=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],Ht=["","\u5341","\u767E","\u5343","\u4E07"];Nt=parseInt(Nt);var Ot=function(Gn){for(var dn=Gn.toString().split("").reverse(),En="",qt=0;qt<dn.length;qt++)En=(qt==0&&dn[qt]==0||qt>0&&dn[qt]==0&&dn[qt-1]==0?"":Xt[dn[qt]]+(dn[qt]==0?Ht[0]:Ht[qt]))+En;return En},Qn=Math.floor(Nt/1e4),An=Nt%1e4;return An.toString().length<4&&(An="0"+An),Qn?Ot(Qn)+"\u4E07"+Ot(An):Ot(Nt)},tr=function(Nt){var Xt={\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 Xt[Nt]||0},nr=function(Nt,Xt){Mn.current=tr(Xt),B.a.confirm({centered:!0,title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u6570",content:t.a.createElement("div",{className:""},t.a.createElement("span",null,Xt==="\u7EC4\u5408\u9898"?"\u7EC4\u5408\u9898\u4E2D\u7684\u6BCF\u5C0F\u9898":Xt,"\uFF1A"),t.a.createElement(k.a,{min:1,defaultValue:Mn.current,onChange:function(Ot){Mn.current=Ot}}),t.a.createElement("span",{className:"ml5"},"\u5206/\u9898"),t.a.createElement("br",null),Xt==="\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 Ht=Object(ee.a)(a.a.mark(function Qn(){var An,pn;return a.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:if(!ot){dn.next=6;break}return dn.next=3,Object(he.t)(bn.id,{question_type:Nt,score:Mn.current});case 3:return An=dn.sent,An.status===0&&Ft(),dn.abrupt("return");case 6:return dn.next=8,Object(le.a)("/api/exercises/".concat(bn.categoryId,"/batch_set_score.json"),{method:"post",body:{question_type:Nt,score:Mn.current}});case 8:pn=dn.sent,pn.status!==-1&&Ft();case 10:case"end":return dn.stop()}},Qn)}));function Ot(){return Ht.apply(this,arguments)}return Ot}()})},Un=function(){var Nt,Xt=sn();xt==null||((Nt=xt.exercise_questions)===null||Nt===void 0)||Nt.forEach(function(Ot,Qn){if(Ot.question_type===0){var An,pn;(An=Xt[Ot.question_type])===null||An===void 0||((pn=An.items)===null||pn===void 0)||pn.push(Ot)}if(Ot.question_type===1){var Gn,dn;(Gn=Xt[Ot.question_type])===null||Gn===void 0||((dn=Gn.items)===null||dn===void 0)||dn.push(Ot)}if(Ot.question_type===2){var En,qt;(En=Xt[Ot.question_type])===null||En===void 0||((qt=En.items)===null||qt===void 0)||qt.push(Ot)}if(Ot.question_type===3){var In,Jn;(In=Xt[Ot.question_type])===null||In===void 0||((Jn=In.items)===null||Jn===void 0)||Jn.push(Ot)}if(Ot.question_type===4){var qn,wn;(qn=Xt[Ot.question_type])===null||qn===void 0||((wn=qn.items)===null||wn===void 0)||wn.push(Ot)}if(Ot.question_type===5){var Nn,cn;(Nn=Xt[Ot.question_type])===null||Nn===void 0||((cn=Nn.items)===null||cn===void 0)||cn.push(Ot)}if(Ot.question_type===6){var rr,zn;(rr=Xt[Ot.question_type])===null||rr===void 0||((zn=rr.items)===null||zn===void 0)||zn.push(Ot)}if(Ot.question_type===7){var fr,cr;(fr=Xt[Ot.question_type])===null||fr===void 0||((cr=fr.items)===null||cr===void 0)||cr.push(Ot)}});var Ht=xt==null?void 0:xt.map(function(Ot,Qn){return t.a.createElement(t.a.Fragment,{key:Qn},t.a.createElement("div",{className:"pl20"},t.a.createElement("span",{className:"font16 c-light-primary"},jt(Qn+1),"\u3001",Ot.name),t.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",Ot.count,"\u9898",(Ot==null?void 0:Ot.question_type)===7?"\uFF0C\u5305\u542B".concat(Ot.sub_count,"\u5C0F\u9898"):"","\uFF1B\u5171",Ot.score,"\u5206\uFF09"),(ur==null?void 0:ur.includes(Ot==null?void 0:Ot.name))&&t.a.createElement(m.a,{onClick:function(){return nr(Ot==null?void 0:Ot.question_type,Ot==null?void 0:Ot.name)},style:{float:"right"},type:"primary",ghost:!0},"\u6279\u91CF\u8BBE\u7F6E\u5F97\u5206")),It(Ot.items,Ot==null?void 0:Ot.question_type,Ot==null?void 0:Ot.name))});return Ht};return t.a.createElement("div",null," ",Un()," ")},Ar=Ze.a=Object(H.a)()(Wr)},LdHM:function(Rt,Ze,K){"use strict";K.d(Ze,"b",function(){return f}),K.d(Ze,"a",function(){return C});var ee=K("1OyB"),$=K("vuIU"),k=K("Ji7U"),Q=K("LK+K"),B=K("cDcd"),I=K("rePB"),z=K("Ff2n"),G=K("ODXe"),L=K("4IlW"),D=K("bX4T"),m=K("YrtM"),g=K("TSYQ"),h=K.n(g),o=K("+nKL"),l=K("8OUc"),a=function(U,V){var q=U.prefixCls,ie=U.id,se=U.flattenOptions,ve=U.childrenAsData,Te=U.values,fe=U.searchValue,_e=U.multiple,ue=U.defaultActiveFirstOption,xe=U.height,Y=U.itemHeight,oe=U.notFoundContent,ce=U.open,Re=U.menuItemSelectedIcon,Ge=U.virtual,Ne=U.onSelect,Je=U.onToggleOpen,rt=U.onActiveValue,_t=U.onScroll,ft=U.onMouseEnter,ut="".concat(q,"-item"),qe=Object(m.a)(function(){return se},[ce,se],function(lt,Pe){return Pe[0]&&lt[1]!==Pe[1]}),Ct=B.useRef(null),kt=function(Pe){Pe.preventDefault()},Kt=function(Pe){Ct.current&&Ct.current.scrollTo({index:Pe})},zt=function(Pe){for(var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ce=qe.length,le=0;le<Ce;le+=1){var he=(Pe+le*Oe+Ce)%Ce,ye=qe[he],ae=ye.group,Se=ye.data;if(!ae&&!Se.disabled)return he}return-1},ln=B.useState(function(){return zt(0)}),un=Object(G.a)(ln,2),We=un[0],je=un[1],ht=function(Pe){je(Pe);var Oe=qe[Pe];if(!Oe){rt(null,-1);return}rt(Oe.data.value,Pe)};B.useEffect(function(){ht(ue!==!1?zt(0):-1)},[qe.length,fe]),B.useEffect(function(){var lt=setTimeout(function(){if(!_e&&ce&&Te.size===1){var Pe=Array.from(Te)[0],Oe=qe.findIndex(function(Ce){var le=Ce.data;return le.value===Pe});ht(Oe),Kt(Oe)}});return function(){return clearTimeout(lt)}},[ce]);var ct=function(Pe){Pe!==void 0&&Ne(Pe,{selected:!Te.has(Pe)}),_e||Je(!1)};if(B.useImperativeHandle(V,function(){return{onKeyDown:function(Pe){var Oe=Pe.which;switch(Oe){case L.a.UP:case L.a.DOWN:{var Ce=0;if(Oe===L.a.UP?Ce=-1:Oe===L.a.DOWN&&(Ce=1),Ce!==0){var le=zt(We+Ce,Ce);Kt(le),ht(le)}break}case L.a.ENTER:{var he=qe[We];he&&!he.data.disabled?ct(he.data.value):ct(void 0),ce&&Pe.preventDefault();break}case L.a.ESC:Je(!1)}},onKeyUp:function(){},scrollTo:function(Pe){Kt(Pe)}}}),qe.length===0)return B.createElement("div",{role:"listbox",id:"".concat(ie,"_list"),className:"".concat(ut,"-empty"),onMouseDown:kt},oe);function He(lt){var Pe=qe[lt];if(!Pe)return null;var Oe=Pe.data||{},Ce=Oe.value,le=Oe.label,he=Oe.children,ye=Object(D.a)(Oe,!0),ae=ve?he:le;return Pe?B.createElement("div",Object.assign({"aria-label":typeof ae=="string"?ae:null},ye,{key:lt,role:"option",id:"".concat(ie,"_list_").concat(lt),"aria-selected":Te.has(Ce)}),Ce):null}return B.createElement(B.Fragment,null,B.createElement("div",{role:"listbox",id:"".concat(ie,"_list"),style:{height:0,width:0,overflow:"hidden"}},He(We-1),He(We),He(We+1)),B.createElement(o.a,{itemKey:"key",ref:Ct,data:qe,height:xe,itemHeight:Y,fullHeight:!1,onMouseDown:kt,onScroll:_t,virtual:Ge,onMouseEnter:ft},function(lt,Pe){var Oe,Ce=lt.group,le=lt.groupOption,he=lt.data,ye=he.label,ae=he.key;if(Ce)return B.createElement("div",{className:h()(ut,"".concat(ut,"-group"))},ye!==void 0?ye:ae);var Se=he.disabled,$e=he.value,dt=he.title,St=he.children,Dt=he.style,Mt=he.className,hr=Object(z.a)(he,["disabled","value","title","children","style","className"]),on=Te.has($e),fn="".concat(ut,"-option"),nn=h()(ut,fn,Mt,(Oe={},Object(I.a)(Oe,"".concat(fn,"-grouped"),le),Object(I.a)(Oe,"".concat(fn,"-active"),We===Pe&&!Se),Object(I.a)(Oe,"".concat(fn,"-disabled"),Se),Object(I.a)(Oe,"".concat(fn,"-selected"),on),Oe)),kn=ve?St:ye,dr=!Re||typeof Re=="function"||on;return B.createElement("div",Object.assign({},hr,{"aria-selected":on,className:nn,title:dt,onMouseMove:function(){if(We===Pe||Se)return;ht(Pe)},onClick:function(){Se||ct($e)},style:Dt}),B.createElement("div",{className:"".concat(fn,"-content")},kn||$e),B.isValidElement(Re)||on,dr&&B.createElement(l.a,{className:"".concat(ut,"-option-state"),customizeIcon:Re,customizeIconProps:{isSelected:on}},on?"\u2713":null))}))},r=B.forwardRef(a);r.displayName="OptionList";var t=r,c=function(){return null};c.isSelectOption=!0;var f=c,S=function(){return null};S.isSelectOptGroup=!0;var C=S,T=K("VTBJ"),O=K("Zm9Q");function R(x){var U=x.key,V=x.props,q=V.children,ie=V.value,se=Object(z.a)(V,["children","value"]);return Object(T.a)({key:U,value:ie!==void 0?ie:U,children:q},se)}function b(x){var U=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(O.a)(x).map(function(V,q){if(!B.isValidElement(V)||!V.type)return null;var ie=V.type.isSelectOptGroup,se=V.key,ve=V.props,Te=ve.children,fe=Object(z.a)(ve,["children"]);return U||!ie?R(V):Object(T.a)(Object(T.a)({key:"__RC_SELECT_GRP__".concat(se===null?q:se,"__"),label:se},fe),{},{options:b(Te)})}).filter(function(V){return V})}var _=K("2Qr1"),u=K("qNPg"),d=K("U8pU"),y=K("Kwbf"),v=K("WKfj");function E(x){var U=x.mode,V=x.options,q=x.children,ie=x.backfill,se=x.allowClear,ve=x.placeholder,Te=x.getInputElement,fe=x.showSearch,_e=x.onSearch,ue=x.defaultOpen,xe=x.autoFocus,Y=x.labelInValue,oe=x.value,ce=x.inputValue,Re=x.optionLabelProp,Ge=U==="multiple"||U==="tags",Ne=fe!==void 0?fe:Ge||U==="combobox",Je=V||b(q);if(Object(y.a)(U!=="tags"||Je.every(function(ut){return!ut.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),U==="tags"||U==="combobox"){var rt=Je.some(function(ut){return ut.options?ut.options.some(function(qe){return typeof("value"in qe?qe.value:qe.key)=="number"}):typeof("value"in ut?ut.value:ut.key)=="number"});Object(y.a)(!rt,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(y.a)(U!=="combobox"||!Re,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(y.a)(U==="combobox"||!ie,"`backfill` only works with `combobox` mode."),Object(y.a)(U==="combobox"||!Te,"`getInputElement` only work with `combobox` mode."),Object(y.b)(U!=="combobox"||!Te||!se||!ve,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),_e&&!Ne&&U!=="combobox"&&U!=="tags"&&Object(y.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(y.b)(!ue||xe,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),oe!=null){var _t=Object(v.d)(oe);Object(y.a)(!Y||_t.every(function(ut){return Object(d.a)(ut)==="object"&&("key"in ut||"value"in ut)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(y.a)(!Ge||Array.isArray(oe),"`value` should be array when `mode` is `multiple` or `tags`")}if(q){var ft=null;Object(O.a)(q).some(function(ut){if(!B.isValidElement(ut)||!ut.type)return!1;var qe=ut.type;if(qe.isSelectOption)return!1;if(qe.isSelectOptGroup){var Ct=Object(O.a)(ut.props.children).every(function(kt){return!B.isValidElement(kt)||!ut.type||kt.type.isSelectOption?!0:(ft=kt.type,!1)});return!Ct}return ft=qe,!0}),ft&&Object(y.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(ft.displayName||ft.name||ft,"`.")),Object(y.a)(ce===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var M=E,N=Object(u.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:b,flattenOptions:_.d,getLabeledValue:_.e,filterOptions:_.b,isValueDisabled:_.g,findValueOption:_.c,warningProps:M,fillOptionsWithMissingValue:_.a}),j=function(x){Object(k.a)(V,x);var U=Object(Q.a)(V);function V(){var q;return Object(ee.a)(this,V),q=U.apply(this,arguments),q.selectRef=B.createRef(),q.focus=function(){q.selectRef.current.focus()},q.blur=function(){q.selectRef.current.blur()},q}return Object($.a)(V,[{key:"render",value:function(){return B.createElement(N,Object.assign({ref:this.selectRef},this.props))}}]),V}(B.Component);j.Option=f,j.OptGroup=C;var H=j,P=Ze.c=H},M8RZ:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return L});var ee=K("fWQN"),$=K("mtLc"),k=K("yKVA"),Q=K("879j"),B=K("cDcd"),I=K.n(B),z=K("faye"),G=K.n(z),L=function(D){Object(k.a)(g,D);var m=Object(Q.a)(g);function g(h){var o;Object(ee.a)(this,g),o=m.call(this,h);var l=window.document;return o.node=l.createElement("div"),l.body.appendChild(o.node),o}return Object($.a)(g,[{key:"render",value:function(){var o=this.props.children;return Object(z.createPortal)(o,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),g}(I.a.Component)},NLgs:function(Rt,Ze,K){"use strict";K.d(Ze,"e",function(){return f}),K.d(Ze,"f",function(){return S}),K.d(Ze,"d",function(){return T}),K.d(Ze,"c",function(){return O}),K.d(Ze,"a",function(){return R}),K.d(Ze,"b",function(){return b});var ee=K("miYZ"),$=K("tsqr"),k=K("9og8"),Q=K("2qtc"),B=K("kLXV"),I=K("WmNS"),z=K.n(I),G=K("cDcd"),L=K.n(G),D=K("9kvl"),m=K("xKgJ"),g=K("1vsH"),h=K("RCxd"),o=K("mOS8"),l=K.n(o),a=K("1ZF9"),r=K.n(a),t=K("NoGO"),c=K.n(t),f=function(u){var d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(S(u)&&C(d))},S=function(u){return Object(m.p)()?!0:(u({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},C=function(){var u,d=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,y=Object(D.c)()._store.getState(),v=y.user;return(u=v.userInfo)!==null&&u!==void 0&&u.profile_completed?!0:(B.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)},T=function(){var u,d=Object(D.c)()._store.getState(),y=d.user;return(u=y.userInfo)!==null&&u!==void 0&&u.professional_certification?!0:(B.a.confirm({title:"\u63D0\u793A",centered:!0,content:L.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(g.U)("/account/certification")}}),!1)},O=function(){return Object(m.a)()?!0:(B.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:L.a.createElement("div",{className:"tc",style:{marginLeft:-38}},L.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),L.a.createElement("img",{src:c.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},R=function(u,d){return u?!0:(B.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:L.a.createElement("div",null,L.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"),L.a.createElement("div",{style:{marginLeft:"110px"}},L.a.createElement("img",{src:r.a,width:200}),L.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(g.U)("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]:"",y=Object(D.c)()._store.getState(),v=y.shixunsDetail.detail;return(v==null?void 0:v.public)===2||(v==null?void 0:v.public)===1||(v==null?void 0:v.shixun_status)===3?(B.a.info({centered:!0,icon:L.a.createElement(h.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:L.a.createElement("div",{className:"tc",style:{marginLeft:-38}},L.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},L.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(v==null?void 0:v.public)===2?"\u5DF2\u516C\u5F00":(v==null?void 0:v.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",d,"\u3002"),L.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),L.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:l.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(v==null?void 0:v.shixun_status)===2?(B.a.confirm({centered:!0,icon:L.a.createElement(h.a,null),title:"\u63D0\u793A",content:L.a.createElement("div",null,L.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",d,"\u3002"),L.a.createElement("br",null),L.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){B.a.confirm({width:440,centered:!0,icon:L.a.createElement(h.a,{style:{color:"#faad14"}}),title:"\u63D0\u793A",content:"\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u5B66\u5458\u5C06\u65E0\u6CD5\u8FDB\u884C\u7EC3\u4E60\u3002\u662F\u5426\u786E\u8BA4\u64A4\u9500\u53D1\u5E03\uFF1F",okText:"\u786E\u5B9A\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){var M=Object(k.a)(z.a.mark(function j(){var H;return z.a.wrap(function(x){for(;;)switch(x.prev=x.next){case 0:return x.next=2,u({type:"shixunsDetail/cancelRelease",payload:{id:v==null?void 0:v.identifier}});case 2:H=x.sent,H.status!==401&&($.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:v==null?void 0:v.identifier}}),u({type:"practiceSetting/getCommonData",payload:{id:v==null?void 0:v.identifier}}));case 4:case"end":return x.stop()}},j)}));function N(){return M.apply(this,arguments)}return N}()})}}),!0):!1}},NoGO:function(Rt,Ze,K){Rt.exports=K.p+"static/newqrcode.9bae6615.png"},Nog9:function(Rt,Ze,K){Rt.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(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return I});var ee=K("Kwbf");function $(z,G){var L=new Set;return z.forEach(function(D){G.has(D)||L.add(D)}),L}function k(z){var G=z||{},L=G.disabled,D=G.disableCheckbox,m=G.checkable;return!!(L||D)||m===!1}function Q(z,G,L,D){for(var m=new Set(z),g=new Set,h=0;h<=L;h+=1){var o=G.get(h)||new Set;o.forEach(function(t){var c=t.key,f=t.node,S=t.children,C=S===void 0?[]:S;m.has(c)&&!D(f)&&C.filter(function(T){return!D(T.node)}).forEach(function(T){m.add(T.key)})})}for(var l=new Set,a=L;a>=0;a-=1){var r=G.get(a)||new Set;r.forEach(function(t){var c=t.parent,f=t.node;if(D(f)||!t.parent||l.has(t.parent.key))return;if(D(t.parent.node)){l.add(c.key);return}var S=!0,C=!1;(c.children||[]).filter(function(T){return!D(T.node)}).forEach(function(T){var O=T.key,R=m.has(O);S&&!R&&(S=!1),!C&&(R||g.has(O))&&(C=!0)}),S&&m.add(c.key),C&&g.add(c.key),l.add(c.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from($(g,m))}}function B(z,G,L,D,m){for(var g=new Set(z),h=new Set(G),o=0;o<=D;o+=1){var l=L.get(o)||new Set;l.forEach(function(c){var f=c.key,S=c.node,C=c.children,T=C===void 0?[]:C;!g.has(f)&&!h.has(f)&&!m(S)&&T.filter(function(O){return!m(O.node)}).forEach(function(O){g.delete(O.key)})})}h=new Set;for(var a=new Set,r=D;r>=0;r-=1){var t=L.get(r)||new Set;t.forEach(function(c){var f=c.parent,S=c.node;if(m(S)||!c.parent||a.has(c.parent.key))return;if(m(c.parent.node)){a.add(f.key);return}var C=!0,T=!1;(f.children||[]).filter(function(O){return!m(O.node)}).forEach(function(O){var R=O.key,b=g.has(R);C&&!b&&(C=!1),!T&&(b||h.has(R))&&(T=!0)}),C||g.delete(f.key),T&&h.add(f.key),a.add(f.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from($(h,g))}}function I(z,G,L,D){var m=[],g;D?g=D:g=k;var h=new Set(z.filter(function(r){var t=!!L[r];return t||m.push(r),t})),o=new Map,l=0;Object.keys(L).forEach(function(r){var t=L[r],c=t.level,f=o.get(c);f||(f=new Set,o.set(c,f)),f.add(t),l=Math.max(l,c)}),Object(ee.a)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(r){return"'".concat(r,"'")}).join(", ")));var a;return G===!0?a=Q(h,o,l,g):a=B(h,G.halfCheckedKeys,o,l,g),a}},O2Wb:function(Rt,Ze,K){Rt.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OZM5:function(Rt,Ze,K){"use strict";K.d(Ze,"b",function(){return D}),K.d(Ze,"a",function(){return m}),K.d(Ze,"k",function(){return g}),K.d(Ze,"h",function(){return h}),K.d(Ze,"i",function(){return o}),K.d(Ze,"g",function(){return l}),K.d(Ze,"c",function(){return a}),K.d(Ze,"d",function(){return r}),K.d(Ze,"j",function(){return f}),K.d(Ze,"e",function(){return S}),K.d(Ze,"f",function(){return C});var ee=K("KQm4"),$=K("U8pU"),k=K("Ff2n"),Q=K("cDcd"),B=K.n(Q),I=K("Kwbf"),z=K("WaYH"),G=.25,L=2;function D(T,O){var R=T.slice(),b=R.indexOf(O);return b>=0&&R.splice(b,1),R}function m(T,O){var R=T.slice();return R.indexOf(O)===-1&&R.push(O),R}function g(T){return T.split("-")}function h(T,O){return"".concat(T,"-").concat(O)}function o(T){return T&&T.type&&T.type.isTreeNode}function l(T,O){var R=[T],b=O[T];function _(){var u=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];u.forEach(function(d){var y=d.key,v=d.children;R.push(y),_(v)})}return _(b.children),R}function a(T,O){var R=T.clientY,b=O.selectHandle.getBoundingClientRect(),_=b.top,u=b.bottom,d=b.height,y=Math.max(d*G,L);return R<=_+y?-1:R>=u-y?1:0}function r(T,O){if(!T)return;var R=O.multiple;return R?T.slice():T.length?[T[0]]:T}var t=function(O){return O};function c(T,O){if(!T)return[];var R=O||{},b=R.processProps,_=b===void 0?t:b,u=Array.isArray(T)?T:[T];return u.map(function(d){var y=d.children,v=Object(k.a)(d,["children"]),E=c(y,O);return B.a.createElement(z.a,Object.assign({},_(v)),E)})}function f(T){if(!T)return null;var O;if(Array.isArray(T))O={checkedKeys:T,halfCheckedKeys:void 0};else if(Object($.a)(T)==="object")O={checkedKeys:T.checked||void 0,halfCheckedKeys:T.halfChecked||void 0};else return Object(I.a)(!1,"`checkedKeys` is not an array or an object"),null;return O}function S(T,O){var R=new Set;function b(_){if(R.has(_))return;var u=O[_];if(!u)return;R.add(_);var d=u.parent,y=u.node;if(y.disabled)return;d&&b(d.key)}return(T||[]).forEach(function(_){b(_)}),Object(ee.a)(R)}function C(T){var O={};return Object.keys(T).forEach(function(R){(R.startsWith("data-")||R.startsWith("aria-"))&&(O[R]=T[R])}),O}},Ot1p:function(Rt,Ze,K){"use strict";var ee=K("2qtc"),$=K("kLXV"),k=K("rAM+"),Q=K("miYZ"),B=K("tsqr"),I=K("9og8"),z=K("tJVT"),G=K("jrin"),L=K("WmNS"),D=K.n(L),m=K("cDcd"),g=K.n(m),h=K("VrN/"),o=K.n(h),l=K("bdgK"),a=K("p77/"),r=K("Bd2K"),t=K("ELLl"),c=K("19Vz"),f=K("lZu9"),S=K("+NIl"),C=K("kSUc"),T=K("9Bee"),O=function(Se){var $e=Se.value,dt=$e===void 0?"":$e,St=Se.className,Dt=Se.showTextOnly,Mt=Se.showLines,hr=Se.style,on=hr===void 0?{}:hr,fn=Object(m.useMemo)(function(){return""},[dt]);return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{dangerouslySetInnerHTML:{__html:fn}}))},R=K("0Owb"),b=K("dejd"),_=K("C+DQ"),u=K("1vsH"),d=K("m3rI"),y=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function v(Se){var $e=Se.onActionCallback,dt=Se.title,St=Se.icon,Dt=Se.actionName,Mt=Se.className,hr=Mt===void 0?"":Mt,on=Se.children;function fn(){$e(Dt)}return g.a.createElement("a",{title:dt,className:hr,onClick:fn},g.a.createElement("i",{className:"md-iconfont ".concat(St)}),on)}var E=function(Se){var $e=Se.watch,dt=Se.showNullButton,St=Se.onActionCallback,Dt=Se.fullScreen,Mt=Se.insertTemp,hr=Se.hidetoolBar,on=Se.uuid,fn=Se.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(u.G)("_educoder_session_login"),"&_educoder_session=").concat(Object(u.G)("_educoder_session"),"&key=").concat(on,"&api=").concat(encodeURIComponent(d.a.PROXY_SERVER)));var nn=[].concat(y,[{title:"".concat($e?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat($e?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return g.a.createElement("ul",{className:"markdown-toolbar-container"},!hr&&nn.map(function(kn,dr){return g.a.createElement("li",{key:dr},kn.actionName?g.a.createElement(v,Object(R.a)({},kn,{onActionCallback:St})):g.a.createElement("span",{className:"v-line"}))}),dt?g.a.createElement("li",null,g.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:St},g.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,Mt&&g.a.createElement("li",null,g.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(Mt),onActionCallback:St},g.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),g.a.createElement("li",{className:"btn-full-screen"},g.a.createElement(v,{icon:"".concat(Dt?"icon-shrink":"icon-enlarge"),title:Dt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:St})))},M=K("M8RZ"),N=K("+L6B"),j=K("2/Rp"),H=K("y8nQ"),P=K("Vl3Y"),x=K("5NDa"),U=K("5rEg"),V={labelCol:{span:4},wrapperCol:{span:20}},q=function(Se){var $e=Se.callback,dt=Se.onCancel;function St(Dt){$e(Dt)}return g.a.createElement(P.a,Object(R.a)({},V,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:St}),g.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},g.a.createElement(U.a,null)),g.a.createElement(P.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},g.a.createElement(U.a,null)),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(j.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))},ie=K("7ahc"),se=K("HmJG"),ve=K("BjJ7"),Te=P.a.useForm,fe={width:280,marginRight:10},_e={labelCol:{span:5},wrapperCol:{span:19}},ue=function(Se){var $e=Se.callback,dt=Se.onCancel,St=Te(),Dt=Object(z.a)(St,1),Mt=Dt[0];function hr(nn){$e(nn)}function on(nn,kn){if(nn.status===-1){B.b.error(nn.message);return}Mt.setFieldsValue({src:"/api/attachments/".concat(nn.id),type:kn.type})}function fn(nn){var kn=nn.target.files[0];Y(kn,on)}return g.a.createElement(P.a,Object(R.a)({form:Mt},_e,{className:"upload-image-panel",onFinish:hr}),g.a.createElement(P.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},g.a.createElement("div",{className:"flex-container"},g.a.createElement(P.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},g.a.createElement(U.a,{style:fe})),g.a.createElement(xe,{onFileChange:fn}))),g.a.createElement(P.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},g.a.createElement(U.a,{style:{width:264}})),g.a.createElement(P.a.Item,{style:{textAlign:"right"}},g.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(j.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))};function xe(Se){var $e=Se.onFileChange;return g.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",g.a.createElement("input",{type:"file",onChange:$e}))}function Y(Se,$e){if(!Se)throw new String("\u6CA1\u6709\u6587\u4EF6");var dt=new FormData;dt.append("editormd-image-file",Se),dt.append("file_param_name","editormd-image-file"),dt.append("byxhr","true");var St=new window.XMLHttpRequest;St.withCredentials=!0,St.addEventListener("load",function(Dt){$e(JSON.parse(Dt.target.responseText),Se)},!1),St.addEventListener("error",function(Dt){console.error(Dt)},!1),St.open("POST","".concat(ve.a,"/api/attachments.json")),St.send(dt)}var oe=K("giR+"),ce=K("fyUT"),Re=K("7Kak"),Ge=K("9yH6"),Ne=Ge.a.Group,Je={margin:"0 8px"},rt=function(Se){var $e=Se.callback,dt=Se.onCancel;function St(Dt){$e(Dt)}return g.a.createElement(P.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:St},g.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},g.a.createElement("span",{style:Je},"\u5355\u5143\u683C\u6570\uFF1A"),g.a.createElement("span",{style:Je},"\u884C\u6570"),g.a.createElement(P.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},g.a.createElement(ce.a,null)),g.a.createElement("span",{style:Je},"\u5217\u6570"),g.a.createElement(P.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},g.a.createElement(ce.a,null))),g.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},g.a.createElement("span",{style:Je},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),g.a.createElement(P.a.Item,{name:"align"},g.a.createElement(Ne,null,g.a.createElement(Ge.a,{value:"default"},g.a.createElement("i",{className:"fa fa-align-justify"})),g.a.createElement(Ge.a,{value:"left"},g.a.createElement("i",{className:"fa fa-align-left"})),g.a.createElement(Ge.a,{value:"center"},g.a.createElement("i",{className:"fa fa-align-center"})),g.a.createElement(Ge.a,{value:"right"},g.a.createElement("i",{className:"fa fa-align-right"}))))),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(j.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(j.a,{type:"ghost",onClick:dt},"\u53D6\u6D88")))},_t=K("ErOA"),ft=K("7Cbv"),ut="link",qe="upload-image",Ct="code-block",kt="add-table",Kt="------------",zt={default:Kt,left:":".concat(Kt),center:":".concat(Kt,":"),right:"".concat(Kt,":")},ln=K("9VGf"),un,We;function je(){}var ht=0,ct=1e4,He="\u2581",lt=`
**\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 Pe(Se){return/^\d+$/.test(Se)?"".concat(Se,"px"):Se}var Oe=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ce=Oe?"Cmd":"Ctrl",le=["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"],he=(un={},Object(G.a)(un,Ce+"-B","bold"),Object(G.a)(un,Ce+"-I","italic"),un),ye=(We={},Object(G.a)(We,ut,"\u6DFB\u52A0\u94FE\u63A5"),Object(G.a)(We,Ct,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(G.a)(We,qe,"\u6DFB\u52A0\u6587\u4EF6"),Object(G.a)(We,kt,"\u6DFB\u52A0\u8868\u683C"),We),ae=Ze.a=function(Se){var $e=Se.defaultValue,dt=$e===void 0?"":$e,St=Se.onChange,Dt=Se.width,Mt=Dt===void 0?"100%":Dt,hr=Se.height,on=hr===void 0?400:hr,fn=Se.miniToolbar,nn=fn===void 0?!1:fn,kn=Se.isFocus,dr=kn===void 0?!1:kn,pr=Se.watch,Yn=Se.insertTemp,Tr=Se.mode,Or=Tr===void 0?"markdown":Tr,Wt=Se.id,Ln=Wt===void 0?"markdown-editor-id":Wt,mr=Se.showResizeBar,vr=mr===void 0?!1:mr,Rr=Se.noStorage,Sr=Rr===void 0?!1:Rr,Wr=Se.showNullButton,Ar=Wr===void 0?!1:Wr,nt=Se.hidetoolBar,ke=nt===void 0?!1:nt,xt=Se.fullScreen,Ae=xt===void 0?!1:xt,me=Se.onBlur,pe=Se.onCMBeforeChange,ir=Se.onFullScreen,Vt=Se.className,we=Vt===void 0?"":Vt,at=Se.disablePaste,ge=at===void 0?!1:at,en=Se.placeholder,sr=en===void 0?"":en,ur=Se.values,Wn=ur===void 0?"":ur,Ft=Object(m.useState)(null),or=Object(z.a)(Ft,2),ot=or[0],Mn=or[1],bn=Object(m.useState)(dt),sn=Object(z.a)(bn,2),$t=sn[0],Dn=sn[1],hn=Object(m.useState)(pr),Jt=Object(z.a)(hn,2),It=Jt[0],jt=Jt[1],tr=Object(m.useState)(Ae),nr=Object(z.a)(tr,2),Un=nr[0],yn=nr[1],Nt=Object(m.useState)(""),Xt=Object(z.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=Object(m.useState)(0),An=Object(z.a)(Qn,2),pn=An[0],Gn=An[1],dn=Object(m.useState)(on),En=Object(z.a)(dn,2),qt=En[0],In=En[1],Jn=Object(m.useState)(!1),qn=Object(z.a)(Jn,2),wn=qn[0],Nn=qn[1],cn=Object(m.useRef)(Object(ft.a)()),rr=Object(m.useRef)(!1),zn=Object(m.useRef)(),fr=Object(m.useRef)(),cr=Object(m.useRef)(),Hn=Object(m.useRef)(),Fn=Object(m.useRef)(),gr=function(){var st=Object(I.a)(D.a.mark(function Ye(){var Be,ze;return D.a.wrap(function(tt){for(;;)switch(tt.prev=tt.next){case 0:return tt.next=2,Object(_t.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:cn.current}});case 2:ze=tt.sent,ze!=null&&(Be=ze.attachments)!==null&&Be!==void 0&&Be.length&&(console.log("cm:",ot,fr),ze.attachments.map(function(Ve){Ve.content_type.indexOf("image")>-1?ot.replaceSelection("![,](/api/attachments/".concat(Ve.id,"?type=").concat(Ve.content_type,")")):Ve.content_type.indexOf("video")>-1?ot.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):Ve.content_type.indexOf("pdf")>-1?ot.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(Ve.id,"?type=").concat(Ve.content_type,'&disposition=inline" target="_blank">').concat(Ve.name,"</a>")):ot.replaceSelection("[".concat(Ve.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(Ve.id,"?type=").concat(Ve.content_type,")"))}));case 4:case"end":return tt.stop()}},Ye)}));return function(){return st.apply(this,arguments)}}();Object(m.useEffect)(function(){Dn(Wn),ot==null||ot.setValue(Wn)},[Wn]),Object(m.useEffect)(function(){ir==null||ir(Un)},[Un]),Object(m.useEffect)(function(){if(fr.current){var st=o.a.fromTextArea(fr.current,{mode:Or,lineNumbers:!nn,lineWrapping:!0,value:dt,autoCloseTags:!0,autoCloseBrackets:!0});dr&&st.focus();function Ye(Be,ze){if(ge){ze.preventDefault();return}var Le=ze.clipboardData;if(Le){var tt=Le.types.toString(),Ve=Le.items;if(tt==="Files"||Le.types.indexOf("Files")>-1){if(ze.preventDefault(),Or=="stex")return;try{var pt,bt=Ve[1];((pt=Ve[0])===null||pt===void 0?void 0:pt.kind)==="file"&&(bt=Ve[0]);var mt=bt.getAsFile(),At=mt.name.split(".").pop();Y(mt,function(vt){if(vt.id){var Et,an,Yt;(mt==null||((Et=mt.type)===null||Et===void 0)?void 0:Et.indexOf("image"))>-1?st.replaceSelection("![,](/api/attachments/".concat(vt.id,"?type=").concat(vt.content_type,")")):(mt==null||((an=mt.type)===null||an===void 0)?void 0:an.indexOf("video"))>-1?st.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vt.id,'"></video>')):(mt==null||((Yt=mt.type)===null||Yt===void 0)?void 0:Yt.indexOf("pdf"))>-1?st.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(mt.type,'&disposition=inline" target="_blank">').concat(mt.name,"</a>")):le.includes(At)?st.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vt.id,'?type=office&disposition=inline" target="_blank">').concat(mt.name,"</a>")):st.replaceSelection("[".concat(mt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}else(vt==null?void 0:vt.status)===401&&(document.location.href="/user/login")})}catch(vt){B.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return st.on("paste",Ye),st.on("dragleave",function(Be,ze){cr.current.classList.remove("mouse-hover-md")}),st.on("dragover",function(Be,ze){cr.current.classList.add("mouse-hover-md")}),st.on("drop",function(Be,ze){cr.current.classList.add("mouse-hover-md");var Le;if(Le=ze.dataTransfer.files,Le.length>0){ze.preventDefault(),ze.stopPropagation();for(var tt=function(bt){var mt=Le[bt],At=mt.name.split(".").pop();Y(mt,function(vt){if(vt.id){var Et,an,Yt;(mt==null||((Et=mt.type)===null||Et===void 0)?void 0:Et.indexOf("image"))>-1?st.replaceSelection("![,](/api/attachments/".concat(vt.id,"?type=").concat(vt.content_type,")")):(mt==null||((an=mt.type)===null||an===void 0)?void 0:an.indexOf("video"))>-1?st.replaceSelection('<video width="100%" controls src="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vt.id,'"></video>')):(mt==null||((Yt=mt.type)===null||Yt===void 0)?void 0:Yt.indexOf("pdf"))>-1?st.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(mt.type,'&disposition=inline" target="_blank">').concat(mt.name,"</a>")):le.includes(At)?st.replaceSelection('<a href="'.concat(d.a.API_SERVER,"/api/attachments/").concat(vt.id,'?type=office&disposition=inline" target="_blank">').concat(mt.name,"</a>")):st.replaceSelection("[".concat(mt.name,"](").concat(d.a.API_SERVER,"/api/attachments/").concat(vt.id,"?type=").concat(vt.content_type,")"))}else(vt==null?void 0:vt.status)===401&&(document.location.href="/user/login")})},Ve=0;Ve<Le.length;Ve++)tt(Ve)}}),Mn(st),function(){st.off("paste",Ye)}}},[]);var Sn=Object(m.useCallback)(function(){if(cr.current)try{}catch(st){console.log(st,"---- to set md editor body height")}},[qt,cr,Un]);Object(m.useEffect)(function(){function st(){var Be=new l.default(function(ze){var Le=Object(k.a)(ze),tt;try{for(Le.s();!(tt=Le.n()).done;){var Ve=tt.value;(Ve.target.offsetHeight>0||Ve.target.offsetWidth>0)&&(Sn(),ot.setSize("100%","100%"),ot.refresh())}}catch(pt){Le.e(pt)}finally{Le.f()}});return Be.observe(fr.current.parentElement),Be}if(ot){var Ye=st();return function(){Ye.unobserve(fr.current.parentElement)}}},[ot,Sn]),Object(m.useEffect)(function(){if(ot){for(var st=[],Ye=function(){var Ve=ze[Be];Le=Object(z.a)(Ve,2);var pt=Le[0],bt=Le[1],mt=Object(G.a)({},pt,function(){xn(bt)});st.push(mt),ot.addKeyMap(mt)},Be=0,ze=Object.entries(he);Be<ze.length;Be++){var Le;Ye()}return zn.current=setInterval(function(){rr.current&&gr()},4e3),function(){clearInterval(zn.current);var tt=Object(k.a)(st),Ve;try{for(tt.s();!(Ve=tt.n()).done;){var pt=Ve.value;ot.removeKeyMap(pt)}}catch(bt){tt.e(bt)}finally{tt.f()}}}},[ot]),Object(m.useEffect)(function(){Ae!==Un&&yn(Ae)},[Ae]),Object(ln.a)(function(){if(!Sr&&pn>0){var st=new Date().getTime(),Ye=window.sessionStorage.getItem(Ln);st>=pn+ct&&(!Ye||Ye!==$t)&&(window.sessionStorage.setItem(Ln,$t),Nn(!0))}},ct),Object(m.useEffect)(function(){jt(pr)},[ot,pr]),Object(m.useEffect)(function(){ot&&(dr&&ot.focus())},[ot,dr]),Object(m.useEffect)(function(){if(It&&ot){var st=ot.getScrollerElement();function Ye(Be){var ze=Be.target;if(Fn.current){var Le=ze.scrollTop/ze.scrollHeight;Fn.current.scrollTop=Fn.current.scrollHeight*Le}}return st.addEventListener("scroll",Ye),function(){st.removeEventListener("scroll",Ye)}}},[ot,It]),Object(m.useEffect)(function(){if(ot&&pe){function st(Ye,Be){pe(Ye,Be)}return ot.on("beforeChange",st),function(){ot.off("beforeChange",st)}}},[ot,pe]),Object(m.useEffect)(function(){if(ot&&me){function st(){me(ot.getValue())}return ot.on("blur",st),function(){ot.off("blur",st)}}},[ot,me]),Object(m.useEffect)(function(){if(ot){function st(Ye){var Be=Ye.getValue();Dn(Be),Gn(new Date().getTime()),Ye.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),St&&St(Be)}return ot.on("change",st),function(){ot.off("change",st)}}},[ot,St]),Object(m.useEffect)(function(){ot&&(dt==null?(ot.setValue(""),Dn("")):dt!==ot.getValue()&&(ot.setValue(dt),Dn(dt),ot.setCursor(ot.lineCount(),0)))},[ot,dt]);var xn=Object(m.useCallback)(function(st){var Ye=ot.getCursor(),Be=ot.getSelection(),ze=Be.split(`
`);switch(st){case"bold":return ot.replaceSelection("**"+Be+"**"),Be===""&&ot.setCursor(Ye.line,Ye.ch+2),ot.focus();case"italic":return ot.replaceSelection("*"+Be+"*"),Be===""&&ot.setCursor(Ye.line,Ye.ch+1),ot.focus();case"code":return ot.replaceSelection("`"+Be+"`"),Be===""&&ot.setCursor(Ye.line,Ye.ch+1),ot.focus();case"inline-latex":return ot.replaceSelection("`$$"+Be+"$$`"),Be===""&&ot.setCursor(Ye.line,Ye.ch+3),ot.focus();case"latex":return ot.replaceSelection("```latex\n"+Be+"\n```"),ot.setCursor(Ye.line+1,Be.length+1),ot.focus();case"line-break":return ot.replaceSelection(`<br/>
`),ot.focus();case"list-ul":return Be===""?ot.replaceSelection("- "+Be):ot.replaceSelection(ze.map(function(Le){return Le===""?"":"- ".concat(Le)}).join(`
`)),ot.focus();case"list-ol":return Be===""?ot.replaceSelection("1. "+Be):ot.replaceSelection(ze.map(function(Le,tt){return Le===""?"":"".concat(tt+1,". ").concat(Le)}).join(`
`)),ot.focus();case"add-null-ch":return Be===""&&ot.setCursor(Ye.line,Ye.ch+1),ot.replaceSelection(He),ot.focus();case"inster-template-1":return Be===""&&ot.setCursor(Ye.line,Ye.ch),ot.replaceSelection(lt),ot.focus();case"eraser":return ot.setValue(""),ot.focus();case"trigger-watch":return jt(!It),ot.focus();case"trigger-full-screen":return yn(!Un),ot.focus();case ut:Ot(ut);return;case Ct:Ot(Ct);return;case qe:Ot(qe);return;case kt:Ot(kt);return;default:throw new Error}},[ot,It,Un]),Cn=Object(m.useCallback)(function(st){Ot("");switch(Ht){case ut:var Ye=st.title,Be=st.link;return ot.replaceSelection("[".concat(Ye,"](").concat(Be,")")),ot.focus();case Ct:var ze=st.language,Le=st.content;return ot.replaceSelection(["```"+ze,Le,"```"].join(`
`)),ot.focus();case qe:var tt=st.src,Ve=st.alt;return Ve?ot.replaceSelection("![ ".concat(Ve," ]( ").concat(tt,' "').concat(Ve,'" )')):ot.replaceSelection("![,](".concat(tt,")")),ot.focus();case kt:for(var pt=st.row,bt=st.col,mt=st.align,At=`
`,vt=0;vt<pt;vt++){for(var Et=[],an=[],Yt=0;Yt<bt;Yt++)vt===1&&an.push(zt[mt]),Et.push(" ");vt===1&&(At+="| ".concat(an.join(" | "),` |
`)),At+="| ".concat(Et.join(bt===1?"":" | "),` |
`)}return ot.replaceSelection(At+`
`),ot.focus();default:throw new Error}},[ot,Ht]),_n=Object(m.useMemo)(function(){switch(Ht){case ut:return g.a.createElement(q,{callback:Cn,onCancel:Qt});case Ct:return g.a.createElement(ie.b,{callback:Cn,onCancel:Qt});case qe:return g.a.createElement(ue,{callback:Cn,onCancel:Qt});case kt:return g.a.createElement(rt,{callback:Cn,onCancel:Qt});default:return null}},[Ht]);function Qt(){Ot("")}Object(m.useEffect)(function(){if(Hn.current){var st=Hn.current,Ye=!1,Be=0;function ze(Ve){Ye=!0,Be=Ve.pageY}function Le(){Ye=!1}function tt(Ve){if(Ye){var pt=Ve.pageY-Be;pt<0&&(pt=0),pt>300&&(pt=300);var bt=on+pt+"px";In(bt)}}return st.addEventListener("mousedown",ze),document.addEventListener("mousemove",tt),document.addEventListener("mouseup",Le),function(){st.removeEventListener("mousedown",ze),document.removeEventListener("mousemove",tt),document.removeEventListener("mouseup",Le)}}},[ot,Hn]),Object(m.useEffect)(function(){In(on)},[on]);var yt=Pe(Mt),Pt=Pe(qt),Lt={width:yt,height:Pt},wt=Object(m.useMemo)(function(){if(pn){var st=new Date(pn),Ye=st.getHours(),Be=st.getMinutes(),ze=st.getSeconds();return Ye=Ye<10?"0"+Ye:Ye,Be=Be<10?"0"+Be:Be,ze=ze<10?"0"+ze:ze,"".concat(Ye,":").concat(Be,":").concat(ze)}return 0},[pn]);function Gt(){window.sessionStorage.removeItem(Ln),Nn(!1),Gn(0)}function rn(){Nn(!1),Gn(0),ot.setValue(window.sessionStorage.getItem(Ln))}function tn(st,Ye){var Be=ot.getValue();Be=Be.replace(st,Ye),Dn(Be),ot==null||ot.setValue(Be)}return g.a.createElement(m.Fragment,null,g.a.createElement("div",{className:"markdown-editor-wrapper",ref:cr},g.a.createElement("div",{className:"markdown-editor-container ".concat(we," ").concat(It?"on-preview":""," ").concat(nn?"mini":""," ").concat(Un?"full-screen":""),style:Lt},g.a.createElement(E,{insertTemp:Yn,watch:It,fullScreen:Un,showNullButton:Ar,onActionCallback:xn,hidetoolBar:ke,uuid:cn.current,setOpenPhones:function(){rr.current=!0}}),g.a.createElement("div",{className:"markdown-editor-body"},g.a.createElement("div",{className:"codemirror-container"},g.a.createElement("textarea",{ref:fr,placeholder:sr})),It?g.a.createElement("div",{ref:Fn,className:"preview-container"},Or==="stex"&&g.a.createElement(O,{value:$t}),Or!=="stex"&&g.a.createElement(T.a,{edit:!0,value:$t,replaces:tn})):null))),vr?g.a.createElement("a",{ref:Hn,className:"editor-resize"}):null,g.a.createElement(M.a,null,ye[Ht]?g.a.createElement($.a,{centered:!0,title:ye[Ht],visible:!0,onCancel:Qt,footer:null,className:"markdown-popup-form"},_n):null))}},Pxm8:function(Rt,Ze,K){Rt.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(Rt,Ze,K){"use strict";var ee=K("cDcd"),$=K("uciX"),k=K("2W6z"),Q=K.n(k),B=K("4IlW"),I=K("uK0f"),z=K.n(I);function G(fe,_e){if(fe===_e)return!0;if(!fe||!_e)return!1;var ue=fe.length;if(_e.length!==ue)return!1;for(var xe=0;xe<ue;xe++)if(fe[xe]!==_e[xe])return!1;return!0}function L(fe){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?L=function(ue){return typeof ue}:L=function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},L(fe)}function D(fe,_e){if(!(fe instanceof _e))throw new TypeError("Cannot call a class as a function")}function m(fe,_e){for(var ue=0;ue<_e.length;ue++){var xe=_e[ue];xe.enumerable=xe.enumerable||!1,xe.configurable=!0,"value"in xe&&(xe.writable=!0),Object.defineProperty(fe,xe.key,xe)}}function g(fe,_e,ue){return _e&&m(fe.prototype,_e),ue&&m(fe,ue),fe}function h(fe,_e){if(typeof _e!="function"&&_e!==null)throw new TypeError("Super expression must either be null or a function");fe.prototype=Object.create(_e&&_e.prototype,{constructor:{value:fe,writable:!0,configurable:!0}}),_e&&o(fe,_e)}function o(fe,_e){return o=Object.setPrototypeOf||function(xe,Y){return xe.__proto__=Y,xe},o(fe,_e)}function l(fe){var _e=t();return function(){var ue=c(fe),xe;if(_e){var Y=c(this).constructor;xe=Reflect.construct(ue,arguments,Y)}else xe=ue.apply(this,arguments);return a(this,xe)}}function a(fe,_e){return _e&&(L(_e)==="object"||typeof _e=="function")?_e:r(fe)}function r(fe){if(fe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return fe}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(fe){return!1}}function c(fe){return c=Object.setPrototypeOf?Object.getPrototypeOf:function(ue){return ue.__proto__||Object.getPrototypeOf(ue)},c(fe)}var f=function(){var fe=function(_e){h(xe,_e);var ue=l(xe);function xe(){var Y;return D(this,xe),Y=ue.apply(this,arguments),Y.menuItems={},Y.saveMenuItem=function(oe){return function(ce){Y.menuItems[oe]=ce}},Y}return g(xe,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(oe){!oe.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(oe){var ce=this.props,Re=ce.fieldNames,Ge=ce.defaultFieldNames;return Re[oe]||Ge[oe]}},{key:"getOption",value:function(oe,ce){var Re=this.props,Ge=Re.prefixCls,Ne=Re.expandTrigger,Je=Re.expandIcon,rt=Re.loadingIcon,_t=this.props.onSelect.bind(this,oe,ce),ft=this.props.onItemDoubleClick.bind(this,oe,ce),ut={onClick:_t,onDoubleClick:ft},qe="".concat(Ge,"-menu-item"),Ct=null,kt=oe[this.getFieldName("children")]&&oe[this.getFieldName("children")].length>0;(kt||oe.isLeaf===!1)&&(qe+=" ".concat(Ge,"-menu-item-expand"),oe.loading||(Ct=ee.createElement("span",{className:"".concat(Ge,"-menu-item-expand-icon")},Je))),Ne==="hover"&&(kt||oe.isLeaf===!1)&&(ut={onMouseEnter:this.delayOnSelect.bind(this,_t),onMouseLeave:this.delayOnSelect.bind(this),onClick:_t}),this.isActiveOption(oe,ce)&&(qe+=" ".concat(Ge,"-menu-item-active"),ut.ref=this.saveMenuItem(ce)),oe.disabled&&(qe+=" ".concat(Ge,"-menu-item-disabled"));var Kt=null;oe.loading&&(qe+=" ".concat(Ge,"-menu-item-loading"),Kt=rt||null);var zt="";return"title"in oe?zt=oe.title:typeof oe[this.getFieldName("label")]=="string"&&(zt=oe[this.getFieldName("label")]),ee.createElement("li",Object.assign({key:oe[this.getFieldName("value")],className:qe,title:zt},ut,{role:"menuitem",onMouseDown:function(un){return un.preventDefault()}}),oe[this.getFieldName("label")],Ct,Kt)}},{key:"getActiveOptions",value:function(oe){var ce=this,Re=this.props.options,Ge=oe||this.props.activeValue;return z()(Re,function(Ne,Je){return Ne[ce.getFieldName("value")]===Ge[Je]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var oe=this,ce=this.props.options,Re=this.getActiveOptions().map(function(Ge){return Ge[oe.getFieldName("children")]}).filter(function(Ge){return!!Ge});return Re.unshift(ce),Re}},{key:"delayOnSelect",value:function(oe){for(var ce=this,Re=arguments.length,Ge=new Array(Re>1?Re-1:0),Ne=1;Ne<Re;Ne++)Ge[Ne-1]=arguments[Ne];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof oe=="function"&&(this.delayTimer=window.setTimeout(function(){oe(Ge),ce.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var oe=this.getShowOptions().length,ce=0;ce<oe;ce++){var Re=this.menuItems[ce];Re&&Re.parentElement&&(Re.parentElement.scrollTop=Re.offsetTop)}}},{key:"isActiveOption",value:function(oe,ce){var Re=this.props.activeValue,Ge=Re===void 0?[]:Re;return Ge[ce]===oe[this.getFieldName("value")]}},{key:"render",value:function(){var oe=this,ce=this.props,Re=ce.prefixCls,Ge=ce.dropdownMenuColumnStyle;return ee.createElement("div",null,this.getShowOptions().map(function(Ne,Je){return ee.createElement("ul",{className:"".concat(Re,"-menu"),key:Je,style:Ge},Ne.map(function(rt){return oe.getOption(rt,Je)}))}))}}]),xe}(ee.Component);return fe.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},fe}(),S=f,C={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}}},T=C;function O(fe){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?O=function(ue){return typeof ue}:O=function(ue){return ue&&typeof Symbol=="function"&&ue.constructor===Symbol&&ue!==Symbol.prototype?"symbol":typeof ue},O(fe)}function R(fe,_e){if(fe==null)return{};var ue=b(fe,_e),xe,Y;if(Object.getOwnPropertySymbols){var oe=Object.getOwnPropertySymbols(fe);for(Y=0;Y<oe.length;Y++){if(xe=oe[Y],_e.indexOf(xe)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(fe,xe))continue;ue[xe]=fe[xe]}}return ue}function b(fe,_e){if(fe==null)return{};var ue={},xe=Object.keys(fe),Y,oe;for(oe=0;oe<xe.length;oe++){if(Y=xe[oe],_e.indexOf(Y)>=0)continue;ue[Y]=fe[Y]}return ue}function _(fe){return v(fe)||y(fe)||d(fe)||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(fe,_e){if(!fe)return;if(typeof fe=="string")return E(fe,_e);var ue=Object.prototype.toString.call(fe).slice(8,-1);if(ue==="Object"&&fe.constructor&&(ue=fe.constructor.name),ue==="Map"||ue==="Set")return Array.from(fe);if(ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ue))return E(fe,_e)}function y(fe){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(fe))return Array.from(fe)}function v(fe){if(Array.isArray(fe))return E(fe)}function E(fe,_e){(_e==null||_e>fe.length)&&(_e=fe.length);for(var ue=0,xe=new Array(_e);ue<_e;ue++)xe[ue]=fe[ue];return xe}function M(fe,_e){if(!(fe instanceof _e))throw new TypeError("Cannot call a class as a function")}function N(fe,_e){for(var ue=0;ue<_e.length;ue++){var xe=_e[ue];xe.enumerable=xe.enumerable||!1,xe.configurable=!0,"value"in xe&&(xe.writable=!0),Object.defineProperty(fe,xe.key,xe)}}function j(fe,_e,ue){return _e&&N(fe.prototype,_e),ue&&N(fe,ue),fe}function H(fe,_e){if(typeof _e!="function"&&_e!==null)throw new TypeError("Super expression must either be null or a function");fe.prototype=Object.create(_e&&_e.prototype,{constructor:{value:fe,writable:!0,configurable:!0}}),_e&&P(fe,_e)}function P(fe,_e){return P=Object.setPrototypeOf||function(xe,Y){return xe.__proto__=Y,xe},P(fe,_e)}function x(fe){var _e=q();return function(){var ue=ie(fe),xe;if(_e){var Y=ie(this).constructor;xe=Reflect.construct(ue,arguments,Y)}else xe=ue.apply(this,arguments);return U(this,xe)}}function U(fe,_e){return _e&&(O(_e)==="object"||typeof _e=="function")?_e:V(fe)}function V(fe){if(fe===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return fe}function q(){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(fe){return!1}}function ie(fe){return ie=Object.setPrototypeOf?Object.getPrototypeOf:function(ue){return ue.__proto__||Object.getPrototypeOf(ue)},ie(fe)}var se=function(){var fe=function(_e){H(xe,_e);var ue=x(xe);function xe(Y){var oe;M(this,xe),oe=ue.call(this,Y),oe.setPopupVisible=function(Re){var Ge=oe.state.value;"popupVisible"in oe.props||oe.setState({popupVisible:Re}),Re&&!oe.state.popupVisible&&oe.setState({activeValue:Ge}),oe.props.onPopupVisibleChange(Re)},oe.handleChange=function(Re,Ge,Ne){var Je=Ge.visible;(Ne.type!=="keydown"||Ne.keyCode===B.a.ENTER)&&(oe.props.onChange(Re.map(function(rt){return rt[oe.getFieldName("value")]}),Re),oe.setPopupVisible(Je))},oe.handlePopupVisibleChange=function(Re){oe.setPopupVisible(Re)},oe.handleMenuSelect=function(Re,Ge,Ne){var Je=oe.trigger.getRootDomNode();Je&&Je.focus&&Je.focus();var rt=oe.props,_t=rt.changeOnSelect,ft=rt.loadData,ut=rt.expandTrigger;if(!Re||Re.disabled)return;var qe=oe.state.activeValue;qe=qe.slice(0,Ge+1),qe[Ge]=Re[oe.getFieldName("value")];var Ct=oe.getActiveOptions(qe);if(Re.isLeaf===!1&&!Re[oe.getFieldName("children")]&&ft){_t&&oe.handleChange(Ct,{visible:!0},Ne),oe.setState({activeValue:qe}),ft(Ct);return}var kt={};!Re[oe.getFieldName("children")]||!Re[oe.getFieldName("children")].length?(oe.handleChange(Ct,{visible:!1},Ne),kt.value=qe):_t&&(Ne.type==="click"||Ne.type==="keydown")&&(ut==="hover"?oe.handleChange(Ct,{visible:!1},Ne):oe.handleChange(Ct,{visible:!0},Ne),kt.value=qe),kt.activeValue=qe,("value"in oe.props||Ne.type==="keydown"&&Ne.keyCode!==B.a.ENTER)&&delete kt.value,oe.setState(kt)},oe.handleItemDoubleClick=function(){var Re=oe.props.changeOnSelect;Re&&oe.setPopupVisible(!1)},oe.handleKeyDown=function(Re){var Ge=oe.props.children;if(Ge&&Ge.props.onKeyDown){Ge.props.onKeyDown(Re);return}var Ne=_(oe.state.activeValue),Je=Ne.length-1<0?0:Ne.length-1,rt=oe.getCurrentLevelOptions(),_t=rt.map(function(Ct){return Ct[oe.getFieldName("value")]}).indexOf(Ne[Je]);if(Re.keyCode!==B.a.DOWN&&Re.keyCode!==B.a.UP&&Re.keyCode!==B.a.LEFT&&Re.keyCode!==B.a.RIGHT&&Re.keyCode!==B.a.ENTER&&Re.keyCode!==B.a.SPACE&&Re.keyCode!==B.a.BACKSPACE&&Re.keyCode!==B.a.ESC&&Re.keyCode!==B.a.TAB)return;if(!oe.state.popupVisible&&Re.keyCode!==B.a.BACKSPACE&&Re.keyCode!==B.a.LEFT&&Re.keyCode!==B.a.RIGHT&&Re.keyCode!==B.a.ESC&&Re.keyCode!==B.a.TAB){oe.setPopupVisible(!0);return}if(Re.keyCode===B.a.DOWN||Re.keyCode===B.a.UP){Re.preventDefault();var ft=_t;ft!==-1?Re.keyCode===B.a.DOWN?(ft+=1,ft=ft>=rt.length?0:ft):(ft-=1,ft=ft<0?rt.length-1:ft):ft=0,Ne[Je]=rt[ft][oe.getFieldName("value")]}else if(Re.keyCode===B.a.LEFT||Re.keyCode===B.a.BACKSPACE)Re.preventDefault(),Ne.splice(Ne.length-1,1);else if(Re.keyCode===B.a.RIGHT)Re.preventDefault(),rt[_t]&&rt[_t][oe.getFieldName("children")]&&Ne.push(rt[_t][oe.getFieldName("children")][0][oe.getFieldName("value")]);else if(Re.keyCode===B.a.ESC||Re.keyCode===B.a.TAB){oe.setPopupVisible(!1);return}(!Ne||Ne.length===0)&&oe.setPopupVisible(!1);var ut=oe.getActiveOptions(Ne),qe=ut[ut.length-1];oe.handleMenuSelect(qe,ut.length-1,Re),oe.props.onKeyDown&&oe.props.onKeyDown(Re)},oe.saveTrigger=function(Re){oe.trigger=Re};var ce=[];return"value"in Y?ce=Y.value||[]:"defaultValue"in Y&&(ce=Y.defaultValue||[]),Q()(!("filedNames"in Y),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),oe.state={popupVisible:Y.popupVisible,activeValue:ce,value:ce,prevProps:Y},oe.defaultFieldNames={label:"label",value:"value",children:"children"},oe}return j(xe,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(oe){var ce=this.defaultFieldNames,Re=this.props,Ge=Re.fieldNames,Ne=Re.filedNames;return"filedNames"in this.props?Ne[oe]||ce[oe]:Ge[oe]||ce[oe]}},{key:"getFieldNames",value:function(){var oe=this.props,ce=oe.fieldNames,Re=oe.filedNames;return"filedNames"in this.props?Re:ce}},{key:"getCurrentLevelOptions",value:function(){var oe=this,ce=this.props.options,Re=ce===void 0?[]:ce,Ge=this.state.activeValue,Ne=Ge===void 0?[]:Ge,Je=z()(Re,function(rt,_t){return rt[oe.getFieldName("value")]===Ne[_t]},{childrenKeyName:this.getFieldName("children")});return Je[Je.length-2]?Je[Je.length-2][this.getFieldName("children")]:_(Re).filter(function(rt){return!rt.disabled})}},{key:"getActiveOptions",value:function(oe){var ce=this;return z()(this.props.options||[],function(Re,Ge){return Re[ce.getFieldName("value")]===oe[Ge]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var oe=this.props,ce=oe.prefixCls,Re=oe.transitionName,Ge=oe.popupClassName,Ne=oe.options,Je=Ne===void 0?[]:Ne,rt=oe.disabled,_t=oe.builtinPlacements,ft=oe.popupPlacement,ut=oe.children,qe=oe.dropdownRender,Ct=R(oe,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),kt=ee.createElement("div",null),Kt="";Je&&Je.length>0?kt=ee.createElement(S,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Kt=" ".concat(ce,"-menus-empty");var zt=kt;return qe&&(zt=qe(kt)),ee.createElement($.a,Object.assign({ref:this.saveTrigger},Ct,{popupPlacement:ft,builtinPlacements:_t,popupTransitionName:Re,action:rt?[]:["click"],popupVisible:rt?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(ce,"-menus"),popupClassName:Ge+Kt,popup:zt}),ee.cloneElement(ut,{onKeyDown:this.handleKeyDown,tabIndex:rt?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(oe,ce){var Re=ce.prevProps,Ge=Re===void 0?{}:Re,Ne={prevProps:oe};return"value"in oe&&!G(Ge.value,oe.value)&&(Ne.value=oe.value||[],"loadData"in oe||(Ne.activeValue=oe.value||[])),"popupVisible"in oe&&(Ne.popupVisible=oe.popupVisible),Ne}}]),xe}(ee.Component);return fe.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:T,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},fe}(),ve=se,Te=Ze.a=ve},"SA+Z":function(Rt,Ze,K){var ee=K("wTVA"),$=K("EbDI"),k=K("ZhPi"),Q=K("wkBT");function B(I){return ee(I)||$(I)||k(I)||Q()}Rt.exports=B,Rt.exports.__esModule=!0,Rt.exports.default=Rt.exports},SJMd:function(Rt,Ze){/**
* @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 K,ee,$,k=!1,Q,B;window.PR_SHOULD_USE_CONTINUATION=!0;var I,z;(function(){var G=window,L=["break,continue,do,else,for,if,return,while"],D=[L,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],m=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],g=[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"],h=[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",a=[m,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],r="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=[L,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],c=[L,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],f=[L,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],S=[g,o,h,a,r,t,c,f],C=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,T="str",O="kwd",R="com",b="typ",_="lit",u="pun",d="pln",y="tag",v="dec",E="src",M="atn",N="atv",j="nocode",H="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function P(Ne){for(var Je=0,rt=!1,_t=!1,ft=0,ut=Ne.length;ft<ut;++ft){var qe=Ne[ft];if(qe.ignoreCase)_t=!0;else if(/[a-z]/i.test(qe.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){rt=!0,_t=!1;break}}var Ct={b:8,t:9,n:10,v:11,f:12,r:13};function kt(We){var je=We.charCodeAt(0);if(je!==92)return je;var ht=We.charAt(1);return je=Ct[ht],je||("0"<=ht&&ht<="7"?parseInt(We.substring(1),8):ht==="u"||ht==="x"?parseInt(We.substring(2),16):We.charCodeAt(1))}function Kt(We){if(We<32)return(We<16?"\\x0":"\\x")+We.toString(16);var je=String.fromCharCode(We);return je==="\\"||je==="-"||je==="]"||je==="^"?"\\"+je:je}function zt(We){var je=We.substring(1,We.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),ht=[],ct=je[0]==="^",He=["["];ct&&He.push("^");for(var lt=ct?1:0,Pe=je.length;lt<Pe;++lt){var Oe=je[lt];if(/\\[bdsw]/i.test(Oe))He.push(Oe);else{var Ce=kt(Oe),le;lt+2<Pe&&je[lt+1]==="-"?(le=kt(je[lt+2]),lt+=2):le=Ce,ht.push([Ce,le]),le<65||Ce>122||(le<65||Ce>90||ht.push([Math.max(65,Ce)|32,Math.min(le,90)|32]),le<97||Ce>122||ht.push([Math.max(97,Ce)&~32,Math.min(le,122)&~32]))}}ht.sort(function(Se,$e){return Se[0]-$e[0]||$e[1]-Se[1]});for(var he=[],ye=[],lt=0;lt<ht.length;++lt){var ae=ht[lt];ae[0]<=ye[1]+1?ye[1]=Math.max(ye[1],ae[1]):he.push(ye=ae)}for(var lt=0;lt<he.length;++lt){var ae=he[lt];He.push(Kt(ae[0])),ae[1]>ae[0]&&(ae[1]+1>ae[0]&&He.push("-"),He.push(Kt(ae[1])))}return He.push("]"),He.join("")}function ln(We){for(var je=We.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),ht=je.length,ct=[],He=0,lt=0;He<ht;++He){var Pe=je[He];if(Pe==="(")++lt;else if(Pe.charAt(0)==="\\"){var Oe=+Pe.substring(1);Oe&&(Oe<=lt?ct[Oe]=-1:je[He]=Kt(Oe))}}for(var He=1;He<ct.length;++He)ct[He]===-1&&(ct[He]=++Je);for(var He=0,lt=0;He<ht;++He){var Pe=je[He];if(Pe==="(")++lt,ct[lt]||(je[He]="(?:");else if(Pe.charAt(0)==="\\"){var Oe=+Pe.substring(1);Oe&&Oe<=lt&&(je[He]="\\"+ct[Oe])}}for(var He=0;He<ht;++He)je[He]==="^"&&je[He+1]!=="^"&&(je[He]="");if(We.ignoreCase&&rt)for(var He=0;He<ht;++He){var Pe=je[He],Ce=Pe.charAt(0);Pe.length>=2&&Ce==="["?je[He]=zt(Pe):Ce!=="\\"&&(je[He]=Pe.replace(/[a-zA-Z]/g,function(ye){var ae=ye.charCodeAt(0);return"["+String.fromCharCode(ae&~32,ae|32)+"]"}))}return je.join("")}for(var un=[],ft=0,ut=Ne.length;ft<ut;++ft){var qe=Ne[ft];if(qe.global||qe.multiline)throw new Error(""+qe);un.push("(?:"+ln(qe)+")")}return new RegExp(un.join("|"),_t?"gi":"g")}function x(Ne,Je){var rt=/(?:^|\s)nocode(?:\s|$)/,_t=[],ft=0,ut=[],qe=0;function Ct(kt){var Kt=kt.nodeType;if(Kt==1){if(rt.test(kt.className))return;for(var zt=kt.firstChild;zt;zt=zt.nextSibling)Ct(zt);var ln=kt.nodeName.toLowerCase();(ln==="br"||ln==="li")&&(_t[qe]=`
`,ut[qe<<1]=ft++,ut[qe++<<1|1]=kt)}else if(Kt==3||Kt==4){var un=kt.nodeValue;un.length&&(Je?un=un.replace(/\r\n?/g,`
`):un=un.replace(/[ \t\r\n]+/g," "),_t[qe]=un,ut[qe<<1]=ft,ft+=un.length,ut[qe++<<1|1]=kt)}}return Ct(Ne),{sourceCode:_t.join("").replace(/\n$/,""),spans:ut}}function U(Ne,Je,rt,_t,ft){if(!rt)return;var ut={sourceNode:Ne,pre:1,langExtension:null,numberLines:null,sourceCode:rt,spans:null,basePos:Je,decorations:null};_t(ut),ft.push.apply(ft,ut.decorations)}var V=/\S/;function q(Ne){for(var Je=void 0,rt=Ne.firstChild;rt;rt=rt.nextSibling){var _t=rt.nodeType;Je=_t===1?Je?Ne:rt:_t===3&&V.test(rt.nodeValue)?Ne:Je}return Je===Ne?void 0:Je}function ie(Ne,Je){var rt={},_t;(function(){for(var qe=Ne.concat(Je),Ct=[],kt={},Kt=0,zt=qe.length;Kt<zt;++Kt){var ln=qe[Kt],un=ln[3];if(un)for(var We=un.length;--We>=0;)rt[un.charAt(We)]=ln;var je=ln[1],ht=""+je;kt.hasOwnProperty(ht)||(Ct.push(je),kt[ht]=null)}Ct.push(/[\0-\uffff]/),_t=P(Ct)})();var ft=Je.length,ut=function(qe){for(var Ct=qe.sourceCode,kt=qe.basePos,Kt=qe.sourceNode,zt=[kt,d],ln=0,un=Ct.match(_t)||[],We={},je=0,ht=un.length;je<ht;++je){var ct=un[je],He=We[ct],lt=void 0,Pe;if(typeof He=="string")Pe=!1;else{var Oe=rt[ct.charAt(0)];if(Oe)lt=ct.match(Oe[1]),He=Oe[0];else{for(var Ce=0;Ce<ft;++Ce)if(Oe=Je[Ce],lt=ct.match(Oe[1]),lt){He=Oe[0];break}lt||(He=d)}Pe=He.length>=5&&He.substring(0,5)==="lang-",Pe&&!(lt&&typeof lt[1]=="string")&&(Pe=!1,He=E),Pe||(We[ct]=He)}var le=ln;if(ln+=ct.length,!Pe)zt.push(kt+le,He);else{var he=lt[1],ye=ct.indexOf(he),ae=ye+he.length;lt[2]&&(ae=ct.length-lt[2].length,ye=ae-he.length);var Se=He.substring(5);U(Kt,kt+le,ct.substring(0,ye),ut,zt),U(Kt,kt+le+ye,he,xe(Se,he),zt),U(Kt,kt+le+ae,ct.substring(ae),ut,zt)}}qe.decorations=zt};return ut}function se(Ne){var Je=[],rt=[];Ne.tripleQuotedStrings?Je.push([T,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Ne.multiLineStrings?Je.push([T,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Je.push([T,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Ne.verbatimStrings&&rt.push([T,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var _t=Ne.hashComments;_t&&(Ne.cStyleComments?(_t>1?Je.push([R,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Je.push([R,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),rt.push([T,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Je.push([R,/^#[^\r\n]*/,null,"#"])),Ne.cStyleComments&&(rt.push([R,/^\/\/[^\r\n]*/,null]),rt.push([R,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ft=Ne.regexLiterals;if(ft){var ut=ft>1?"":`
\r`,qe=ut?".":"[\\S\\s]",Ct="/(?=[^/*"+ut+"])(?:[^/\\x5B\\x5C"+ut+"]|\\x5C"+qe+"|\\x5B(?:[^\\x5C\\x5D"+ut+"]|\\x5C"+qe+")*(?:\\x5D|$))+/";rt.push(["lang-regex",RegExp("^"+H+"("+Ct+")")])}var kt=Ne.types;kt&&rt.push([b,kt]);var Kt=(""+Ne.keywords).replace(/^ | $/g,"");Kt.length&&rt.push([O,new RegExp("^(?:"+Kt.replace(/[\s,]+/g,"|")+")\\b"),null]),Je.push([d,/^\s+/,null,` \r
\xA0`]);var zt="^.[^\\s\\w.$@'\"`/\\\\]*";return Ne.regexLiterals&&(zt+="(?!s*/)"),rt.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(zt),null]),ie(Je,rt)}var ve=se({keywords:S,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Te(Ne,Je,rt){for(var _t=/(?:^|\s)nocode(?:\s|$)/,ft=/\r\n?|\n/,ut=Ne.ownerDocument,qe=ut.createElement("li");Ne.firstChild;)qe.appendChild(Ne.firstChild);var Ct=[qe];function kt(je){var ht=je.nodeType;if(ht==1&&!_t.test(je.className))if(je.nodeName==="br")Kt(je),je.parentNode&&je.parentNode.removeChild(je);else for(var ct=je.firstChild;ct;ct=ct.nextSibling)kt(ct);else if((ht==3||ht==4)&&rt){var He=je.nodeValue,lt=He.match(ft);if(lt){var Pe=He.substring(0,lt.index);je.nodeValue=Pe;var Oe=He.substring(lt.index+lt[0].length);if(Oe){var Ce=je.parentNode;Ce.insertBefore(ut.createTextNode(Oe),je.nextSibling)}Kt(je),Pe||je.parentNode.removeChild(je)}}}function Kt(je){for(;!je.nextSibling;)if(je=je.parentNode,!je)return;function ht(lt,Pe){var Oe=Pe?lt.cloneNode(!1):lt,Ce=lt.parentNode;if(Ce){var le=ht(Ce,1),he=lt.nextSibling;le.appendChild(Oe);for(var ye=he;ye;ye=he)he=ye.nextSibling,le.appendChild(ye)}return Oe}for(var ct=ht(je.nextSibling,0),He;(He=ct.parentNode)&&He.nodeType===1;)ct=He;Ct.push(ct)}for(var zt=0;zt<Ct.length;++zt)kt(Ct[zt]);Je===(Je|0)&&Ct[0].setAttribute("value",Je);var ln=ut.createElement("ol");ln.className="linenums";for(var un=Math.max(0,Je-1|0)||0,zt=0,We=Ct.length;zt<We;++zt)qe=Ct[zt],qe.className="L"+(zt+un)%10,qe.firstChild||qe.appendChild(ut.createTextNode("\xA0")),ln.appendChild(qe);Ne.appendChild(ln)}function fe(Ne){var Je=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Je=Je&&+Je[1]<=8;var rt=/\n/g,_t=Ne.sourceCode,ft=_t.length,ut=0,qe=Ne.spans,Ct=qe.length,kt=0,Kt=Ne.decorations,zt=Kt.length,ln=0;Kt[zt]=ft;var un,We;for(We=un=0;We<zt;)Kt[We]!==Kt[We+2]?(Kt[un++]=Kt[We++],Kt[un++]=Kt[We++]):We+=2;for(zt=un,We=un=0;We<zt;){for(var je=Kt[We],ht=Kt[We+1],ct=We+2;ct+2<=zt&&Kt[ct+1]===ht;)ct+=2;Kt[un++]=je,Kt[un++]=ht,We=ct}zt=Kt.length=un;var He=Ne.sourceNode,lt="";He&&(lt=He.style.display,He.style.display="none");try{for(var Pe=null;kt<Ct;){var Oe=qe[kt],Ce=qe[kt+2]||ft,le=Kt[ln+2]||ft,ct=Math.min(Ce,le),he=qe[kt+1],ye;if(he.nodeType!==1&&(ye=_t.substring(ut,ct))){Je&&(ye=ye.replace(rt,"\r")),he.nodeValue=ye;var ae=he.ownerDocument,Se=ae.createElement("span");Se.className=Kt[ln+1];var $e=he.parentNode;$e.replaceChild(Se,he),Se.appendChild(he),ut<Ce&&(qe[kt+1]=he=ae.createTextNode(_t.substring(ct,Ce)),$e.insertBefore(he,Se.nextSibling))}ut=ct,ut>=Ce&&(kt+=2),ut>=le&&(ln+=2)}}finally{He&&(He.style.display=lt)}}var _e={};function ue(Ne,Je){for(var rt=Je.length;--rt>=0;){var _t=Je[rt];_e.hasOwnProperty(_t)?G.console&&console.warn("cannot override language handler %s",_t):_e[_t]=Ne}}function xe(Ne,Je){return Ne&&_e.hasOwnProperty(Ne)||(Ne=/^\s*</.test(Je)?"default-markup":"default-code"),_e[Ne]}ue(ve,["default-code"]),ue(ie([],[[d,/^[^<?]+/],[v,/^<!\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"]),ue(ie([[d,/^[\s]+/,null,` \r
`],[N,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[y,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[M,/^(?!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"]),ue(ie([],[[N,/^[\s\S]+/]]),["uq.val"]),ue(se({keywords:g,hashComments:!0,cStyleComments:!0,types:C}),["c","cc","cpp","cxx","cyc","m"]),ue(se({keywords:"null,true,false"}),["json"]),ue(se({keywords:o,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:C}),["cs"]),ue(se({keywords:h,cStyleComments:!0}),["java"]),ue(se({keywords:f,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),ue(se({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),ue(se({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),ue(se({keywords:c,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),ue(se({keywords:a,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),ue(se({keywords:l,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),ue(ie([],[[T,/^[\s\S]+/]]),["regex"]);function Y(Ne){var Je=Ne.langExtension;try{var rt=x(Ne.sourceNode,Ne.pre),_t=rt.sourceCode;Ne.sourceCode=_t,Ne.spans=rt.spans,Ne.basePos=0,xe(Je,_t)(Ne),fe(Ne)}catch(ft){G.console&&console.log(ft&&ft.stack||ft)}}function oe(Ne,Je,rt){var _t=rt||!1,ft=Je||null,ut=document.createElement("div");ut.innerHTML="<pre>"+Ne+"</pre>",ut=ut.firstChild,_t&&Te(ut,_t,!0);var qe={langExtension:ft,numberLines:_t,sourceNode:ut,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return Y(qe),ut.innerHTML}function ce(Ne,Je){var rt=Je||document.body,_t=rt.ownerDocument||document;function ft(Oe){return rt.getElementsByTagName(Oe)}for(var ut=[ft("pre"),ft("code"),ft("xmp")],qe=[],Ct=0;Ct<ut.length;++Ct)for(var kt=0,Kt=ut[Ct].length;kt<Kt;++kt)qe.push(ut[Ct][kt]);ut=null;var zt=Date;zt.now||(zt={now:function(){return+new Date}});var ln=0,un=/\blang(?:uage)?-([\w.]+)(?!\S)/,We=/\bprettyprint\b/,je=/\bprettyprinted\b/,ht=/pre|xmp/i,ct=/^code$/i,He=/^(?:pre|code|xmp)$/i,lt={};function Pe(){for(var Oe=G.PR_SHOULD_USE_CONTINUATION?zt.now()+250:Infinity;ln<qe.length&&zt.now()<Oe;ln++){for(var Ce=qe[ln],le=lt,he=Ce;he=he.previousSibling;){var ye=he.nodeType,ae=(ye===7||ye===8)&&he.nodeValue;if(ae?!/^\??prettify\b/.test(ae):ye!==3||/\S/.test(he.nodeValue))break;if(ae){le={},ae.replace(/\b(\w+)=([\w:.%+-]+)/g,function(pr,Yn,Tr){le[Yn]=Tr});break}}var Se=Ce.className;if((le!==lt||We.test(Se))&&!je.test(Se)){for(var $e=!1,dt=Ce.parentNode;dt;dt=dt.parentNode){var St=dt.tagName;if(He.test(St)&&dt.className&&We.test(dt.className)){$e=!0;break}}if(!$e){Ce.className+=" prettyprinted";var Dt=le.lang;if(!Dt){Dt=Se.match(un);var Mt;!Dt&&(Mt=q(Ce))&&ct.test(Mt.tagName)&&(Dt=Mt.className.match(un)),Dt&&(Dt=Dt[1])}var hr;if(ht.test(Ce.tagName))hr=1;else{var on=Ce.currentStyle,fn=_t.defaultView,nn=on?on.whiteSpace:fn&&fn.getComputedStyle?fn.getComputedStyle(Ce,null).getPropertyValue("white-space"):0;hr=nn&&nn.substring(0,3)==="pre"}var kn=le.linenums;(kn=kn==="true"||+kn)||(kn=Se.match(/\blinenums\b(?::(\d+))?/),kn=kn?kn[1]&&kn[1].length?+kn[1]:!0:!1),kn&&Te(Ce,kn,hr);var dr={langExtension:Dt,sourceNode:Ce,numberLines:kn,pre:hr,sourceCode:null,basePos:null,spans:null,decorations:null};Y(dr)}}}ln<qe.length?G.setTimeout(Pe,250):typeof Ne=="function"&&Ne()}Pe()}var Re=G.PR={createSimpleLexer:ie,registerLangHandler:ue,sourceDecorator:se,PR_ATTRIB_NAME:M,PR_ATTRIB_VALUE:N,PR_COMMENT:R,PR_DECLARATION:v,PR_KEYWORD:O,PR_LITERAL:_,PR_NOCODE:j,PR_PLAIN:d,PR_PUNCTUATION:u,PR_SOURCE:E,PR_STRING:T,PR_TAG:y,PR_TYPE:b,prettyPrintOne:k?G.prettyPrintOne=oe:I=oe,prettyPrint:z=k?G.prettyPrint=ce:z=ce},Ge=G.define;typeof Ge=="function"&&Ge.amd&&Ge("google-code-prettify",[],function(){return Re})})()},T1X5:function(Rt,Ze){Rt.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(Rt,Ze,K){var ee,$;(function(){var k;(function(){"use strict";var B=[,,function(L){function D(h){this.__parent=h,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}D.prototype.clone_empty=function(){var h=new D(this.__parent);return h.set_indent(this.__indent_count,this.__alignment_count),h},D.prototype.item=function(h){return h<0?this.__items[this.__items.length+h]:this.__items[h]},D.prototype.has_match=function(h){for(var o=this.__items.length-1;o>=0;o--)if(this.__items[o].match(h))return!0;return!1},D.prototype.set_indent=function(h,o){this.is_empty()&&(this.__indent_count=h||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 h=this.__parent.current_line;return h.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),h.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),h.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,h.__items[0]===" "&&(h.__items.splice(0,1),h.__character_count-=1),!0}return!1},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(h){this.__items.push(h);var o=h.lastIndexOf(`
`);o!==-1?this.__character_count=h.length-o:this.__character_count+=h.length},D.prototype.pop=function(){var h=null;return this.is_empty()||(h=this.__items.pop(),this.__character_count-=h.length),h},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 h="";return this.is_empty()?this.__parent.indent_empty_lines&&(h=this.__parent.get_indent_string(this.__indent_count)):(h=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),h+=this.__items.join("")),h};function m(h,o){this.__cache=[""],this.__indent_size=h.indent_size,this.__indent_string=h.indent_char,h.indent_with_tabs||(this.__indent_string=new Array(h.indent_size+1).join(h.indent_char)),o=o||"",h.indent_level>0&&(o=new Array(h.indent_level+1).join(this.__indent_string)),this.__base_string=o,this.__base_string_length=o.length}m.prototype.get_indent_size=function(h,o){var l=this.__base_string_length;return o=o||0,h<0&&(l=0),l+=h*this.__indent_size,l+=o,l},m.prototype.get_indent_string=function(h,o){var l=this.__base_string;return o=o||0,h<0&&(h=0,l=""),o+=h*this.__indent_size,this.__ensure_cache(o),l+=this.__cache[o],l},m.prototype.__ensure_cache=function(h){for(;h>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var h=this.__cache.length,o=0,l="";this.__indent_size&&h>=this.__indent_size&&(o=Math.floor(h/this.__indent_size),h-=o*this.__indent_size,l=new Array(o+1).join(this.__indent_string)),h&&(l+=new Array(h+1).join(" ")),this.__cache.push(l)};function g(h,o){this.__indent_cache=new m(h,o),this.raw=!1,this._end_with_newline=h.end_with_newline,this.indent_size=h.indent_size,this.wrap_line_length=h.wrap_line_length,this.indent_empty_lines=h.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}g.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},g.prototype.get_line_number=function(){return this.__lines.length},g.prototype.get_indent_string=function(h,o){return this.__indent_cache.get_indent_string(h,o)},g.prototype.get_indent_size=function(h,o){return this.__indent_cache.get_indent_size(h,o)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(h){return this.is_empty()||!h&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(h){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 h!==`
`&&(l=l.replace(/[\n]/g,h)),l},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(h,o){return h=h||0,o=o||0,this.next_line.set_indent(h,o),this.__lines.length>1?(this.current_line.set_indent(h,o),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(h){for(var o=0;o<h.newlines;o++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(h.whitespace_before),this.current_line.push(h.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(h){this.__add_space_before_token(),this.current_line.push(h),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},g.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(" "))},g.prototype.remove_indent=function(h){for(var o=this.__lines.length;h<o;)this.__lines[h]._remove_indent(),h++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(h){for(h=h===void 0?!1:h,this.current_line.trim();h&&this.__lines.length>1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},g.prototype.just_added_newline=function(){return this.current_line.is_empty()},g.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},g.prototype.ensure_empty_line_above=function(h,o){for(var l=this.__lines.length-2;l>=0;){var a=this.__lines[l];if(a.is_empty())break;if(a.item(0).indexOf(h)!==0&&a.item(-1)!==o){this.__lines.splice(l+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},L.exports.Output=g},,,,function(L){function D(h,o){this.raw_options=m(h,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(h,o){var l=this.raw_options[h],a=o||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(a=l.concat()):typeof l=="string"&&(a=l.split(/[^a-zA-Z0-9_\/\-]+/)),a},D.prototype._get_boolean=function(h,o){var l=this.raw_options[h],a=l===void 0?!!o:!!l;return a},D.prototype._get_characters=function(h,o){var l=this.raw_options[h],a=o||"";return typeof l=="string"&&(a=l.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),a},D.prototype._get_number=function(h,o){var l=this.raw_options[h];o=parseInt(o,10),isNaN(o)&&(o=0);var a=parseInt(l,10);return isNaN(a)&&(a=o),a},D.prototype._get_selection=function(h,o,l){var a=this._get_selection_list(h,o,l);if(a.length!==1)throw new Error("Invalid Option Value: The option '"+h+`' can only be one of the following values:
`+o+`
You passed in: '`+this.raw_options[h]+"'");return a[0]},D.prototype._get_selection_list=function(h,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 a=this._get_array(h,l);if(!this._is_valid_selection(a,o))throw new Error("Invalid Option Value: The option '"+h+`' can contain only the following values:
`+o+`
You passed in: '`+this.raw_options[h]+"'");return a},D.prototype._is_valid_selection=function(h,o){return h.length&&o.length&&!h.some(function(l){return o.indexOf(l)===-1})};function m(h,o){var l={};h=g(h);var a;for(a in h)a!==o&&(l[a]=h[a]);if(o&&h[o])for(a in h[o])l[a]=h[o][a];return l}function g(h){var o={},l;for(l in h){var a=l.replace(/-/g,"_");o[a]=h[l]}return o}L.exports.Options=D,L.exports.normalizeOpts=g,L.exports.mergeOpts=m},,function(L){var D=RegExp.prototype.hasOwnProperty("sticky");function m(g){this.__input=g||"",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 g=null;return this.hasNext()&&(g=this.__input.charAt(this.__position),this.__position+=1),g},m.prototype.peek=function(g){var h=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(h=this.__input.charAt(g)),h},m.prototype.__match=function(g,h){g.lastIndex=h;var o=g.exec(this.__input);return o&&!(D&&g.sticky)&&(o.index!==h&&(o=null)),o},m.prototype.test=function(g,h){return h=h||0,h+=this.__position,h>=0&&h<this.__input_length?!!this.__match(g,h):!1},m.prototype.testChar=function(g,h){var o=this.peek(h);return g.lastIndex=0,o!==null&&g.test(o)},m.prototype.match=function(g){var h=this.__match(g,this.__position);return h?this.__position+=h[0].length:h=null,h},m.prototype.read=function(g,h,o){var l="",a;return g&&(a=this.match(g),a&&(l+=a[0])),h&&(a||!g)&&(l+=this.readUntil(h,o)),l},m.prototype.readUntil=function(g,h){var o="",l=this.__position;g.lastIndex=this.__position;var a=g.exec(this.__input);return a?(l=a.index,h&&(l+=a[0].length)):l=this.__input_length,o=this.__input.substring(this.__position,l),this.__position=l,o},m.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},m.prototype.get_regexp=function(g,h){var o=null,l="g";return h&&D&&(l="y"),typeof g=="string"&&g!==""?o=new RegExp(g,l):g&&(o=new RegExp(g.source,l)),o},m.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(g){var h=this.__position,o=this.readUntilAfter(g);return this.__position=h,o},m.prototype.lookBack=function(g){var h=this.__position-1;return h>=g.length&&this.__input.substring(h-g.length,h).toLowerCase()===g},L.exports.InputScanner=m},,,,,function(L){function D(m,g){m=typeof m=="string"?m:m.source,g=typeof g=="string"?g:g.source,this.__directives_block_pattern=new RegExp(m+/ beautify( \w+[:]\w+)+ /.source+g,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(m+/\sbeautify\signore:end\s/.source+g,"g")}D.prototype.get_directives=function(m){if(!m.match(this.__directives_block_pattern))return null;var g={};this.__directive_pattern.lastIndex=0;for(var h=this.__directive_pattern.exec(m);h;)g[h[1]]=h[2],h=this.__directive_pattern.exec(m);return g},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},L.exports.Directives=D},,function(L,D,m){var g=m(16).Beautifier,h=m(17).Options;function o(l,a){var r=new g(l,a);return r.beautify()}L.exports=o,L.exports.defaultOptions=function(){return new h}},function(L,D,m){var g=m(17).Options,h=m(2).Output,o=m(8).InputScanner,l=m(13).Directives,a=new l(/\/\*/,/\*\//),r=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,c=/\s/,f=/(?:\s|\n)+/g,S=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,C=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function T(O,R){this._source_text=O||"",this._options=new g(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"]}T.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},T.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},T.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},T.prototype.print_string=function(O){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(O)},T.prototype.preserveSingleSpace=function(O){O&&(this._output.space_before_token=!0)},T.prototype.indent=function(){this._indentLevel++},T.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},T.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O=this._source_text,R=this._options.eol;R==="auto"&&(R=`
`,O&&r.test(O||"")&&(R=O.match(r)[0])),O=O.replace(t,`
`);var b=O.match(/^[\t ]*/)[0];this._output=new h(this._options,b),this._input=new o(O),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var _=0,u=!1,d=!1,y=!1,v=!1,E=!1,M=!1,N=this._ch,j=!1,H,P,x;H=this._input.read(f),P=H!=="",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 U=this._input.read(S),V=a.get_directives(U);V&&V.ignore==="start"&&(U+=a.readIgnored(this._input)),this.print_string(U),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(C)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(P),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var q=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);q.match(/[ :]$/)&&(q=this.eatString(": ").replace(/\s$/,""),this.print_string(q),this._output.space_before_token=!0),q=q.replace(/\s$/,""),q==="extend"?v=!0:q==="import"&&(E=!0),q in this.NESTED_AT_RULE?(this._nestedLevel+=1,q in this.CONDITIONAL_GROUP_RULE&&(y=!0)):!u&&_===0&&q.indexOf(":")!==-1&&(d=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(P),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")d&&(d=!1,this.outdent()),y?(y=!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),E=!1,v=!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 ie=0;ie<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ie++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ie])){j=!0;break}(u||y)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!v&&_===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 se=x==='"'||x==="'";this.preserveSingleSpace(se||P),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")j=!1,_===0?(d&&(this.outdent(),d=!1),v=!1,E=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),_++,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 ve=!1;this._input.lookBack("with")&&(ve=!0),this.preserveSingleSpace(P||ve),this.print_string(this._ch),d&&x==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),M=!0):(this.eatWhitespace(),_++,this.indent())}else if(this._ch===")")_&&(_--,this.outdent()),M&&this._input.peek()===";"&&this._options.selector_separator_newline&&(M=!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||M)&&_===0&&!E&&!v?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(P),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 Te=x==='"'||x==="'";this.preserveSingleSpace(Te||P),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&j&&this._output.add_new_line()}var fe=this._output.get_code(R);return fe},L.exports.Beautifier=T},function(L,D,m){var g=m(6).Options;function h(o){g.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 a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var r=0;r<a.length;r++)a[r]!=="expand"?this.brace_style="collapse":this.brace_style=a[r]}h.prototype=new g,L.exports.Options=h}],I={};function z(L){var D=I[L];if(D!==void 0)return D.exports;var m=I[L]={exports:{}};return B[L](m,m.exports,z),m.exports}var G=z(15);k=G})();var Q=k;!(ee=[],$=function(){return{css_beautify:Q}}.apply(Ze,ee),$!==void 0&&(Rt.exports=$))})()},VYcG:function(Rt,Ze,K){"use strict";K.r(Ze),K.d(Ze,"useCourseOptions",function(){return P});var ee=K("T2oS"),$=K("W9HT"),k=K("+L6B"),Q=K("2/Rp"),B=K("7Kak"),I=K("9yH6"),z=K("giR+"),G=K("fyUT"),L=K("5NDa"),D=K("5rEg"),m=K("6UJt"),g=K("DFOY"),h=K("14J3"),o=K("BMrR"),l=K("jCWc"),a=K("kPKH"),r=K("sPJy"),t=K("bE4q"),c=K("k1fw"),f=K("rAM+"),S=K("y8nQ"),C=K("Vl3Y"),T=K("9og8"),O=K("tJVT"),R=K("WmNS"),b=K.n(R),_=K("cDcd"),u=K.n(_),d=K("Ty5D"),y=K("55Ip"),v=K("9kvl"),E=K("Pxm8"),M=K.n(E),N=K("vCeJ"),j=K("6fQ5"),H=K("ZWs3"),P=function(){var V=Object(_.useState)([]),q=Object(O.a)(V,2),ie=q[0],se=q[1];return Object(_.useEffect)(function(){var ve=function(){var Te=Object(T.a)(b.a.mark(function fe(){var _e;return b.a.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return xe.next=2,Object(N.k)({source:"new_question"});case 2:_e=xe.sent,_e!=null&&_e.disciplines&&se(Object(j.a)(_e==null?void 0:_e.disciplines));case 4:case"end":return xe.stop()}},fe)}));return function(){return Te.apply(this,arguments)}}();ve()},[]),ie},x=function(V){var q=V.user,ie=Object(d.i)(),se=P(),ve=C.a.useForm(),Te=Object(O.a)(ve,1),fe=Te[0],_e=Object(_.useState)(),ue=Object(O.a)(_e,2),xe=ue[0],Y=ue[1],oe=Object(_.useState)(!1),ce=Object(O.a)(oe,2),Re=ce[0],Ge=ce[1];return Object(_.useEffect)(function(){if(ie.id){var Ne=function(){var Je=Object(T.a)(b.a.mark(function rt(){var _t,ft,ut,qe,Ct,kt,Kt,zt,ln,un,We,je,ht;return b.a.wrap(function(He){for(;;)switch(He.prev=He.next){case 0:return Ge(!0),He.next=3,Object(N.l)({id:ie.id});case 3:ut=He.sent,Ge(!1),qe=ut==null||((_t=ut.exercise)===null||_t===void 0)?void 0:_t.sub_discipline_id,Ct=[],kt=Object(f.a)(se);try{for(kt.s();!(Kt=kt.n()).done;){zt=Kt.value,ln=Object(f.a)(zt.children);try{for(ln.s();!(un=ln.n()).done;)We=un.value,We.value===qe&&(Ct=[zt.value,We.value])}catch(lt){ln.e(lt)}finally{ln.f()}}}catch(lt){kt.e(lt)}finally{kt.f()}je=ut==null||((ft=ut.exercise)===null||ft===void 0)?void 0:ft.time,ht=Object(c.a)(Object(c.a)({},ut.exercise),{},{sub_discipline_id:Ct,time:je===-1?null:je}),Y(ht);case 12:case"end":return He.stop()}},rt)}));return function(){return Je.apply(this,arguments)}}();if(!se.length)return;Ne()}else Y({})},[se]),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(y.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),u.a.createElement(t.a.Item,null,"\u65B0\u5EFA\u8BD5\u5377"))),u.a.createElement("aside",{className:"".concat(M.a.title," mt20")},u.a.createElement(o.a,null,u.a.createElement(a.a,{flex:"1"},u.a.createElement("strong",{className:"font20 ml5"},"\u65B0\u5EFA\u8BD5\u5377"))))),u.a.createElement($.a,{spinning:Re,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},u.a.createElement("section",{className:[M.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},xe&&u.a.createElement(C.a,{layout:"vertical",form:fe,className:M.a.formWrap,initialValues:xe},u.a.createElement(C.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(g.a,{placeholder:"\u8BF7\u9009\u62E9...",options:se})),u.a.createElement(C.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(C.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F",style:{width:"300px"}},u.a.createElement("div",{style:{display:"flex"}},u.a.createElement(G.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(C.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},u.a.createElement(I.a.Group,null,u.a.createElement(I.a.Button,{value:1},"\u7B80\u5355"),u.a.createElement(I.a.Button,{value:2},"\u9002\u4E2D"),u.a.createElement(I.a.Button,{value:3},"\u56F0\u96BE"))),u.a.createElement(C.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(Q.a,{style:{marginRight:"5px"},onClick:function(){v.d.push("/paperlibrary")}},"\u53D6\u6D88"),u.a.createElement(H.a,{onClick:Object(T.a)(b.a.mark(function Ne(){var Je,rt,_t,ft;return b.a.wrap(function(qe){for(;;)switch(qe.prev=qe.next){case 0:return qe.next=2,fe.validateFields();case 2:if(Je=fe.getFieldsValue(),Je.sub_discipline_id=Je.sub_discipline_id[1],!ie.id){qe.next=10;break}return qe.next=7,Object(N.z)(Object(c.a)({id:ie.id},Je));case 7:return rt=qe.sent,rt.status===0&&v.d.push("/paperlibrary/edit/".concat(ie.id,"?fromadd=1")),qe.abrupt("return");case 10:return qe.next=12,Object(N.e)(Je);case 12:_t=qe.sent,_t.status===0&&v.d.push("/paperlibrary/edit/".concat(_t==null||((ft=_t.data)===null||ft===void 0)?void 0:ft.exam_id,"?fromadd=1"));case 14:case"end":return qe.stop()}},Ne)})),type:"primary",style:{marginLeft:"5px"}},"\u786E\u5B9A"))))};Ze.default=Object(v.a)(function(U){var V=U.user;return{user:V}})(x)},"VrN/":function(Rt,Ze,K){(function(ee,$){Rt.exports=$()})(this,function(){"use strict";var ee=navigator.userAgent,$=navigator.platform,k=/gecko\/\d/i.test(ee),Q=/MSIE \d/.test(ee),B=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ee),I=/Edge\/(\d+)/.exec(ee),z=Q||B||I,G=z&&(Q?document.documentMode||6:+(I||B)[1]),L=!I&&/WebKit\//.test(ee),D=L&&/Qt\/\d+\.\d+/.test(ee),m=!I&&/Chrome\//.test(ee),g=/Opera\//.test(ee),h=/Apple Computer/.test(navigator.vendor),o=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ee),l=/PhantomJS/.test(ee),a=!I&&/AppleWebKit/.test(ee)&&/Mobile\/\w+/.test(ee),r=/Android/.test(ee),t=a||r||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ee),c=a||/Mac/.test($),f=/\bCrOS\b/.test(ee),S=/win/i.test($),C=g&&ee.match(/Version\/(\d*\.\d*)/);C&&(C=Number(C[1])),C&&C>=15&&(g=!1,L=!0);var T=c&&(D||g&&(C==null||C<12.11)),O=k||z&&G>=9;function R(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var b=function(e,n){var s=e.className,i=R(n).exec(s);if(i){var p=s.slice(i.index+i[0].length);e.className=s.slice(0,i.index)+(p?i[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,i){var p=document.createElement(e);if(s&&(p.className=s),i&&(p.style.cssText=i),typeof n=="string")p.appendChild(document.createTextNode(n));else if(n)for(var F=0;F<n.length;++F)p.appendChild(n[F]);return p}function y(e,n,s,i){var p=d(e,n,s,i);return p.setAttribute("role","presentation"),p}var v;document.createRange?v=function(e,n,s,i){var p=document.createRange();return p.setEnd(i||e,s),p.setStart(e,n),p}:v=function(e,n,s){var i=document.body.createTextRange();try{i.moveToElementText(e.parentNode)}catch(p){return i}return i.collapse(!0),i.moveEnd("character",s),i.moveStart("character",n),i};function E(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 M(){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 j(e,n){for(var s=e.split(" "),i=0;i<s.length;i++)s[i]&&!R(s[i]).test(n)&&(n+=" "+s[i]);return n}var H=function(e){e.select()};a?H=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:z&&(H=function(e){try{e.select()}catch(n){}});function P(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 i in e)e.hasOwnProperty(i)&&(s!==!1||!n.hasOwnProperty(i))&&(n[i]=e[i]);return n}function U(e,n,s,i,p){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var F=i||0,X=p||0;;){var Z=e.indexOf(" ",F);if(Z<0||Z>=n)return X+(n-F);X+=Z-F,X+=s-X%s,F=Z+1}}var V=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};V.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},V.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 q(e,n){for(var s=0;s<e.length;++s)if(e[s]==n)return s;return-1}var ie=50,se={toString:function(){return"CodeMirror.Pass"}},ve={scroll:!1},Te={origin:"*mouse"},fe={origin:"+move"};function _e(e,n,s){for(var i=0,p=0;;){var F=e.indexOf(" ",i);F==-1&&(F=e.length);var X=F-i;if(F==e.length||p+X>=n)return i+Math.min(X,n-p);if(p+=F-i,p+=s-p%s,i=F+1,p>=n)return i}}var ue=[""];function xe(e){for(;ue.length<=e;)ue.push(Y(ue)+" ");return ue[e]}function Y(e){return e[e.length-1]}function oe(e,n){for(var s=[],i=0;i<e.length;i++)s[i]=n(e[i],i);return s}function ce(e,n,s){for(var i=0,p=s(n);i<e.length&&s(e[i])<=p;)i++;e.splice(i,0,n)}function Re(){}function Ge(e,n){var s;return Object.create?s=Object.create(e):(Re.prototype=e,s=new Re),n&&x(n,s),s}var Ne=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function Je(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Ne.test(e))}function rt(e,n){return n?n.source.indexOf("\\w")>-1&&Je(e)?!0:n.test(e):Je(e)}function _t(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var ft=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ut(e){return e.charCodeAt(0)>=768&&ft.test(e)}function qe(e,n,s){for(;(s<0?n>0:n<e.length)&&ut(e.charAt(n));)n+=s;return n}function Ct(e,n,s){for(var i=n>s?-1:1;;){if(n==s)return n;var p=(n+s)/2,F=i<0?Math.ceil(p):Math.floor(p);if(F==n)return e(F)?n:s;e(F)?s=F:n=F+i}}function kt(e,n,s,i){if(!e)return i(n,s,"ltr",0);for(var p=!1,F=0;F<e.length;++F){var X=e[F];(X.from<s&&X.to>n||n==s&&X.to==n)&&(i(Math.max(X.from,n),Math.min(X.to,s),X.level==1?"rtl":"ltr",F),p=!0)}p||i(n,s,"ltr")}var Kt=null;function zt(e,n,s){var i;Kt=null;for(var p=0;p<e.length;++p){var F=e[p];if(F.from<n&&F.to>n)return p;F.to==n&&(F.from!=F.to&&s=="before"?i=p:Kt=p),F.from==n&&(F.from!=F.to&&s!="before"?i=p:Kt=p)}return i!=null?i:Kt}var ln=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function s(de){return de<=247?e.charAt(de):1424<=de&&de<=1524?"R":1536<=de&&de<=1785?n.charAt(de-1536):1774<=de&&de<=2220?"r":8192<=de&&de<=8203?"w":de==8204?"b":"L"}var i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,p=/[stwN]/,F=/[LRr]/,X=/[Lb1n]/,Z=/[1n]/;function te(de,De,Fe){this.level=de,this.from=De,this.to=Fe}return function(de,De){var Fe=De=="ltr"?"L":"R";if(de.length==0||De=="ltr"&&!i.test(de))return!1;for(var it=de.length,et=[],Tt=0;Tt<it;++Tt)et.push(s(de.charCodeAt(Tt)));for(var Bt=0,Zt=Fe;Bt<it;++Bt){var On=et[Bt];On=="m"?et[Bt]=Zt:Zt=On}for(var Xn=0,Rn=Fe;Xn<it;++Xn){var ar=et[Xn];ar=="1"&&Rn=="r"?et[Xn]="n":F.test(ar)&&(Rn=ar,ar=="r"&&(et[Xn]="R"))}for(var Cr=1,xr=et[0];Cr<it-1;++Cr){var Dr=et[Cr];Dr=="+"&&xr=="1"&&et[Cr+1]=="1"?et[Cr]="1":Dr==","&&xr==et[Cr+1]&&(xr=="1"||xr=="n")&&(et[Cr]=xr),xr=Dr}for(var jr=0;jr<it;++jr){var ra=et[jr];if(ra==",")et[jr]="N";else if(ra=="%"){var zr=void 0;for(zr=jr+1;zr<it&&et[zr]=="%";++zr);for(var ya=jr&&et[jr-1]=="!"||zr<it&&et[zr]=="1"?"1":"N",va=jr;va<zr;++va)et[va]=ya;jr=zr-1}}for(var Qr=0,ga=Fe;Qr<it;++Qr){var sa=et[Qr];ga=="L"&&sa=="1"?et[Qr]="L":F.test(sa)&&(ga=sa)}for(var Zr=0;Zr<it;++Zr)if(p.test(et[Zr])){var Jr=void 0;for(Jr=Zr+1;Jr<it&&p.test(et[Jr]);++Jr);for(var Xr=(Zr?et[Zr-1]:Fe)=="L",_a=(Jr<it?et[Jr]:Fe)=="L",_o=Xr==_a?Xr?"L":"R":Fe,Ti=Zr;Ti<Jr;++Ti)et[Ti]=_o;Zr=Jr-1}for(var da=[],Ha,aa=0;aa<it;)if(X.test(et[aa])){var nu=aa;for(++aa;aa<it&&X.test(et[aa]);++aa);da.push(new te(0,nu,aa))}else{var Qa=aa,Gi=da.length,zi=De=="rtl"?1:0;for(++aa;aa<it&&et[aa]!="L";++aa);for(var fa=Qa;fa<aa;)if(Z.test(et[fa])){Qa<fa&&(da.splice(Gi,0,new te(1,Qa,fa)),Gi+=zi);var Eo=fa;for(++fa;fa<aa&&Z.test(et[fa]);++fa);da.splice(Gi,0,new te(2,Eo,fa)),Gi+=zi,Qa=fa}else++fa;Qa<aa&&da.splice(Gi,0,new te(1,Qa,aa))}return De=="ltr"&&(da[0].level==1&&(Ha=de.match(/^\s+/))&&(da[0].from=Ha[0].length,da.unshift(new te(0,0,Ha[0].length))),Y(da).level==1&&(Ha=de.match(/\s+$/))&&(Y(da).to-=Ha[0].length,da.push(new te(0,it-Ha[0].length,it)))),De=="rtl"?da.reverse():da}}();function un(e,n){var s=e.order;return s==null&&(s=e.order=ln(e.text,n)),s}var We=[],je=function(e,n,s){if(e.addEventListener)e.addEventListener(n,s,!1);else if(e.attachEvent)e.attachEvent("on"+n,s);else{var i=e._handlers||(e._handlers={});i[n]=(i[n]||We).concat(s)}};function ht(e,n){return e._handlers&&e._handlers[n]||We}function ct(e,n,s){if(e.removeEventListener)e.removeEventListener(n,s,!1);else if(e.detachEvent)e.detachEvent("on"+n,s);else{var i=e._handlers,p=i&&i[n];if(p){var F=q(p,s);F>-1&&(i[n]=p.slice(0,F).concat(p.slice(F+1)))}}}function He(e,n){var s=ht(e,n);if(!s.length)return;for(var i=Array.prototype.slice.call(arguments,2),p=0;p<s.length;++p)s[p].apply(null,i)}function lt(e,n,s){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),He(e,s||n.type,e,n),ye(n)||n.codemirrorIgnore}function Pe(e){var n=e._handlers&&e._handlers.cursorActivity;if(!n)return;for(var s=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),i=0;i<n.length;++i)q(s,n[i])==-1&&s.push(n[i])}function Oe(e,n){return ht(e,n).length>0}function Ce(e){e.prototype.on=function(n,s){je(this,n,s)},e.prototype.off=function(n,s){ct(this,n,s)}}function le(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function he(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function ye(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ae(e){le(e),he(e)}function Se(e){return e.target||e.srcElement}function $e(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 dt=function(){if(z&&G<9)return!1;var e=d("div");return"draggable"in e||"dragDrop"in e}(),St;function Dt(e){if(St==null){var n=d("span","\u200B");u(e,d("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(St=n.offsetWidth<=1&&n.offsetHeight>2&&!(z&&G<8))}var s=St?d("span","\u200B"):d("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return s.setAttribute("cm-text",""),s}var Mt;function hr(e){if(Mt!=null)return Mt;var n=u(e,document.createTextNode("A\u062EA")),s=v(n,0,1).getBoundingClientRect(),i=v(n,1,2).getBoundingClientRect();return _(e),!s||s.left==s.right?!1:Mt=i.right-s.right<3}var on=`
b`.split(/\n/).length!=3?function(e){for(var n=0,s=[],i=e.length;n<=i;){var p=e.indexOf(`
`,n);p==-1&&(p=e.length);var F=e.slice(n,e.charAt(p-1)=="\r"?p-1:p),X=F.indexOf("\r");X!=-1?(s.push(F.slice(0,X)),n+=X+1):(s.push(F),n=p+1)}return s}:function(e){return e.split(/\r\n?|\n/)},fn=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},nn=function(){var e=d("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),kn=null;function dr(e){if(kn!=null)return kn;var n=u(e,d("span","x")),s=n.getBoundingClientRect(),i=v(n,0,1).getBoundingClientRect();return kn=Math.abs(s.left-i.left)>1}var pr={},Yn={};function Tr(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),pr[e]=n}function Or(e,n){Yn[e]=n}function Wt(e){if(typeof e=="string"&&Yn.hasOwnProperty(e))e=Yn[e];else if(e&&typeof e.name=="string"&&Yn.hasOwnProperty(e.name)){var n=Yn[e.name];typeof n=="string"&&(n={name:n}),e=Ge(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Wt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Wt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ln(e,n){n=Wt(n);var s=pr[n.name];if(!s)return Ln(e,"text/plain");var i=s(e,n);if(mr.hasOwnProperty(n.name)){var p=mr[n.name];for(var F in p){if(!p.hasOwnProperty(F))continue;i.hasOwnProperty(F)&&(i["_"+F]=i[F]),i[F]=p[F]}}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var X in n.modeProps)i[X]=n.modeProps[X];return i}var mr={};function vr(e,n){var s=mr.hasOwnProperty(e)?mr[e]:mr[e]={};x(n,s)}function Rr(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var s={};for(var i in n){var p=n[i];p instanceof Array&&(p=p.concat([])),s[i]=p}return s}function Sr(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 Wr(e,n,s){return e.startState?e.startState(n,s):!0}var Ar=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};Ar.prototype.eol=function(){return this.pos>=this.string.length},Ar.prototype.sol=function(){return this.pos==this.lineStart},Ar.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},Ar.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},Ar.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},Ar.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},Ar.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},Ar.prototype.skipToEnd=function(){this.pos=this.string.length},Ar.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},Ar.prototype.backUp=function(e){this.pos-=e},Ar.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=U(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?U(this.string,this.lineStart,this.tabSize):0)},Ar.prototype.indentation=function(){return U(this.string,null,this.tabSize)-(this.lineStart?U(this.string,this.lineStart,this.tabSize):0)},Ar.prototype.match=function(e,n,s){if(typeof e=="string"){var i=function(X){return s?X.toLowerCase():X},p=this.string.substr(this.pos,e.length);if(i(p)==i(e))return n!==!1&&(this.pos+=e.length),!0}else{var F=this.string.slice(this.pos).match(e);return F&&F.index>0?null:(F&&n!==!1&&(this.pos+=F[0].length),F)}},Ar.prototype.current=function(){return this.string.slice(this.start,this.pos)},Ar.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},Ar.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},Ar.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function nt(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 i=0;;++i){var p=s.children[i],F=p.chunkSize();if(n<F){s=p;break}n-=F}return s.lines[n]}function ke(e,n,s){var i=[],p=n.line;return e.iter(n.line,s.line+1,function(F){var X=F.text;p==s.line&&(X=X.slice(0,s.ch)),p==n.line&&(X=X.slice(n.ch)),i.push(X),++p}),i}function xt(e,n,s){var i=[];return e.iter(n,s,function(p){i.push(p.text)}),i}function Ae(e,n){var s=n-e.height;if(s)for(var i=e;i;i=i.parent)i.height+=s}function me(e){if(e.parent==null)return null;for(var n=e.parent,s=q(n.lines,e),i=n.parent;i;n=i,i=i.parent)for(var p=0;!(i.children[p]==n);++p)s+=i.children[p].chunkSize();return s+n.first}function pe(e,n){var s=e.first;e:do{for(var i=0;i<e.children.length;++i){var p=e.children[i],F=p.height;if(n<F){e=p;continue e}n-=F,s+=p.chunkSize()}return s}while(!e.lines);for(var X=0;X<e.lines.length;++X){var Z=e.lines[X],te=Z.height;if(n<te)break;n-=te}return s+X}function ir(e,n){return n>=e.first&&n<e.first+e.size}function Vt(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function we(e,n,s){if(s===void 0&&(s=null),!(this instanceof we))return new we(e,n,s);this.line=e,this.ch=n,this.sticky=s}function at(e,n){return e.line-n.line||e.ch-n.ch}function ge(e,n){return e.sticky==n.sticky&&at(e,n)==0}function en(e){return we(e.line,e.ch)}function sr(e,n){return at(e,n)<0?n:e}function ur(e,n){return at(e,n)<0?e:n}function Wn(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function Ft(e,n){if(n.line<e.first)return we(e.first,0);var s=e.first+e.size-1;return n.line>s?we(s,nt(e,s).text.length):or(n,nt(e,n.line).text.length)}function or(e,n){var s=e.ch;return s==null||s>n?we(e.line,n):s<0?we(e.line,0):e}function ot(e,n){for(var s=[],i=0;i<n.length;i++)s[i]=Ft(e,n[i]);return s}var Mn=function(e,n){this.state=e,this.lookAhead=n},bn=function(e,n,s,i){this.state=n,this.doc=e,this.line=s,this.maxLookAhead=i||0,this.baseTokens=null,this.baseTokenPos=1};bn.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},bn.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}},bn.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},bn.fromSaved=function(e,n,s){return n instanceof Mn?new bn(e,Rr(e.mode,n.state),s,n.lookAhead):new bn(e,Rr(e.mode,n),s)},bn.prototype.save=function(e){var n=e!==!1?Rr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new Mn(n,this.maxLookAhead):n};function sn(e,n,s,i){var p=[e.state.modeGen],F={};Un(e,n.text,e.doc.mode,s,function(de,De){return p.push(de,De)},F,i);for(var X=s.state,Z=function(de){s.baseTokens=p;var De=e.state.overlays[de],Fe=1,it=0;s.state=!0,Un(e,n.text,De.mode,s,function(et,Tt){for(var Bt=Fe;it<et;){var Zt=p[Fe];Zt>et&&p.splice(Fe,1,et,p[Fe+1],Zt),Fe+=2,it=Math.min(et,Zt)}if(!Tt)return;if(De.opaque)p.splice(Bt,Fe-Bt,et,"overlay "+Tt),Fe=Bt+2;else for(;Bt<Fe;Bt+=2){var On=p[Bt+1];p[Bt+1]=(On?On+" ":"")+"overlay "+Tt}},F),s.state=X,s.baseTokens=null,s.baseTokenPos=1},te=0;te<e.state.overlays.length;++te)Z(te);return{styles:p,classes:F.bgClass||F.textClass?F:null}}function $t(e,n,s){if(!n.styles||n.styles[0]!=e.state.modeGen){var i=Dn(e,me(n)),p=n.text.length>e.options.maxHighlightLength&&Rr(e.doc.mode,i.state),F=sn(e,n,i);p&&(i.state=p),n.stateAfter=i.save(!p),n.styles=F.styles,F.classes?n.styleClasses=F.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 Dn(e,n,s){var i=e.doc,p=e.display;if(!i.mode.startState)return new bn(i,!0,n);var F=yn(e,n,s),X=F>i.first&&nt(i,F-1).stateAfter,Z=X?bn.fromSaved(i,X,F):new bn(i,Wr(i.mode),F);return i.iter(F,n,function(te){hn(e,te.text,Z);var de=Z.line;te.stateAfter=de==n-1||de%5==0||de>=p.viewFrom&&de<p.viewTo?Z.save():null,Z.nextLine()}),s&&(i.modeFrontier=Z.line),Z}function hn(e,n,s,i){var p=e.doc.mode,F=new Ar(n,e.options.tabSize,s);for(F.start=F.pos=i||0,n==""&&Jt(p,s.state);!F.eol();)It(p,F,s.state),F.start=F.pos}function Jt(e,n){if(e.blankLine)return e.blankLine(n);if(!e.innerMode)return;var s=Sr(e,n);if(s.mode.blankLine)return s.mode.blankLine(s.state)}function It(e,n,s,i){for(var p=0;p<10;p++){i&&(i[0]=Sr(e,s).mode);var F=e.token(n,s);if(n.pos>n.start)return F}throw new Error("Mode "+e.name+" failed to advance stream.")}var jt=function(e,n,s){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=s};function tr(e,n,s,i){var p=e.doc,F=p.mode,X;n=Ft(p,n);var Z=nt(p,n.line),te=Dn(e,n.line,s),de=new Ar(Z.text,e.options.tabSize,te),De;for(i&&(De=[]);(i||de.pos<n.ch)&&!de.eol();)de.start=de.pos,X=It(F,de,te.state),i&&De.push(new jt(de,X,Rr(p.mode,te.state)));return i?De:new jt(de,X,te.state)}function nr(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 i=s[1]?"bgClass":"textClass";n[i]==null?n[i]=s[2]:new RegExp("(?:^|\\s)"+s[2]+"(?:$|\\s)").test(n[i])||(n[i]+=" "+s[2])}return e}function Un(e,n,s,i,p,F,X){var Z=s.flattenSpans;Z==null&&(Z=e.options.flattenSpans);var te=0,de=null,De=new Ar(n,e.options.tabSize,i),Fe,it=e.options.addModeClass&&[null];for(n==""&&nr(Jt(s,i.state),F);!De.eol();){if(De.pos>e.options.maxHighlightLength?(Z=!1,X&&hn(e,n,i,De.pos),De.pos=n.length,Fe=null):Fe=nr(It(s,De,i.state,it),F),it){var et=it[0].name;et&&(Fe="m-"+(Fe?et+" "+Fe:et))}if(!Z||de!=Fe){for(;te<De.start;)te=Math.min(De.start,te+5e3),p(te,de);de=Fe}De.start=De.pos}for(;te<De.pos;){var Tt=Math.min(De.pos,te+5e3);p(Tt,de),te=Tt}}function yn(e,n,s){for(var i,p,F=e.doc,X=s?-1:n-(e.doc.mode.innerMode?1e3:100),Z=n;Z>X;--Z){if(Z<=F.first)return F.first;var te=nt(F,Z-1),de=te.stateAfter;if(de&&(!s||Z+(de instanceof Mn?de.lookAhead:0)<=F.modeFrontier))return Z;var De=U(te.text,null,e.options.tabSize);(p==null||i>De)&&(p=Z-1,i=De)}return p}function Nt(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),e.highlightFrontier<n-10)return;for(var s=e.first,i=n-1;i>s;i--){var p=nt(e,i).stateAfter;if(p&&(!(p instanceof Mn)||i+p.lookAhead<n)){s=i+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,s)}var Xt=!1,Ht=!1;function Ot(){Xt=!0}function Qn(){Ht=!0}function An(e,n,s){this.marker=e,this.from=n,this.to=s}function pn(e,n){if(e)for(var s=0;s<e.length;++s){var i=e[s];if(i.marker==n)return i}}function Gn(e,n){for(var s,i=0;i<e.length;++i)e[i]!=n&&(s||(s=[])).push(e[i]);return s}function dn(e,n){e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],n.marker.attachLine(e)}function En(e,n,s){var i;if(e)for(var p=0;p<e.length;++p){var F=e[p],X=F.marker,Z=F.from==null||(X.inclusiveLeft?F.from<=n:F.from<n);if(Z||F.from==n&&X.type=="bookmark"&&(!s||!F.marker.insertLeft)){var te=F.to==null||(X.inclusiveRight?F.to>=n:F.to>n);(i||(i=[])).push(new An(X,F.from,te?null:F.to))}}return i}function qt(e,n,s){var i;if(e)for(var p=0;p<e.length;++p){var F=e[p],X=F.marker,Z=F.to==null||(X.inclusiveRight?F.to>=n:F.to>n);if(Z||F.from==n&&X.type=="bookmark"&&(!s||F.marker.insertLeft)){var te=F.from==null||(X.inclusiveLeft?F.from<=n:F.from<n);(i||(i=[])).push(new An(X,te?null:F.from-n,F.to==null?null:F.to-n))}}return i}function In(e,n){if(n.full)return null;var s=ir(e,n.from.line)&&nt(e,n.from.line).markedSpans,i=ir(e,n.to.line)&&nt(e,n.to.line).markedSpans;if(!s&&!i)return null;var p=n.from.ch,F=n.to.ch,X=at(n.from,n.to)==0,Z=En(s,p,X),te=qt(i,F,X),de=n.text.length==1,De=Y(n.text).length+(de?p:0);if(Z)for(var Fe=0;Fe<Z.length;++Fe){var it=Z[Fe];if(it.to==null){var et=pn(te,it.marker);et?de&&(it.to=et.to==null?null:et.to+De):it.to=p}}if(te)for(var Tt=0;Tt<te.length;++Tt){var Bt=te[Tt];if(Bt.to!=null&&(Bt.to+=De),Bt.from==null){var Zt=pn(Z,Bt.marker);Zt||(Bt.from=De,de&&(Z||(Z=[])).push(Bt))}else Bt.from+=De,de&&(Z||(Z=[])).push(Bt)}Z&&(Z=Jn(Z)),te&&te!=Z&&(te=Jn(te));var On=[Z];if(!de){var Xn=n.text.length-2,Rn;if(Xn>0&&Z)for(var ar=0;ar<Z.length;++ar)Z[ar].to==null&&(Rn||(Rn=[])).push(new An(Z[ar].marker,null,null));for(var Cr=0;Cr<Xn;++Cr)On.push(Rn);On.push(te)}return On}function Jn(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 qn(e,n,s){var i=null;if(e.iter(n.line,s.line+1,function(et){if(et.markedSpans)for(var Tt=0;Tt<et.markedSpans.length;++Tt){var Bt=et.markedSpans[Tt].marker;Bt.readOnly&&(!i||q(i,Bt)==-1)&&(i||(i=[])).push(Bt)}}),!i)return null;for(var p=[{from:n,to:s}],F=0;F<i.length;++F)for(var X=i[F],Z=X.find(0),te=0;te<p.length;++te){var de=p[te];if(at(de.to,Z.from)<0||at(de.from,Z.to)>0)continue;var De=[te,1],Fe=at(de.from,Z.from),it=at(de.to,Z.to);(Fe<0||!X.inclusiveLeft&&!Fe)&&De.push({from:de.from,to:Z.from}),(it>0||!X.inclusiveRight&&!it)&&De.push({from:Z.to,to:de.to}),p.splice.apply(p,De),te+=De.length-3}return p}function wn(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 Nn(e,n){if(!n)return;for(var s=0;s<n.length;++s)n[s].marker.attachLine(e);e.markedSpans=n}function cn(e){return e.inclusiveLeft?-1:0}function rr(e){return e.inclusiveRight?1:0}function zn(e,n){var s=e.lines.length-n.lines.length;if(s!=0)return s;var i=e.find(),p=n.find(),F=at(i.from,p.from)||cn(e)-cn(n);if(F)return-F;var X=at(i.to,p.to)||rr(e)-rr(n);return X||n.id-e.id}function fr(e,n){var s=Ht&&e.markedSpans,i;if(s)for(var p=void 0,F=0;F<s.length;++F)p=s[F],p.marker.collapsed&&(n?p.from:p.to)==null&&(!i||zn(i,p.marker)<0)&&(i=p.marker);return i}function cr(e){return fr(e,!0)}function Hn(e){return fr(e,!1)}function Fn(e,n){var s=Ht&&e.markedSpans,i;if(s)for(var p=0;p<s.length;++p){var F=s[p];F.marker.collapsed&&(F.from==null||F.from<n)&&(F.to==null||F.to>n)&&(!i||zn(i,F.marker)<0)&&(i=F.marker)}return i}function gr(e,n,s,i,p){var F=nt(e,n),X=Ht&&F.markedSpans;if(X)for(var Z=0;Z<X.length;++Z){var te=X[Z];if(!te.marker.collapsed)continue;var de=te.marker.find(0),De=at(de.from,s)||cn(te.marker)-cn(p),Fe=at(de.to,i)||rr(te.marker)-rr(p);if(De>=0&&Fe<=0||De<=0&&Fe>=0)continue;if(De<=0&&(te.marker.inclusiveRight&&p.inclusiveLeft?at(de.to,s)>=0:at(de.to,s)>0)||De>=0&&(te.marker.inclusiveRight&&p.inclusiveLeft?at(de.from,i)<=0:at(de.from,i)<0))return!0}}function Sn(e){for(var n;n=cr(e);)e=n.find(-1,!0).line;return e}function xn(e){for(var n;n=Hn(e);)e=n.find(1,!0).line;return e}function Cn(e){for(var n,s;n=Hn(e);)e=n.find(1,!0).line,(s||(s=[])).push(e);return s}function _n(e,n){var s=nt(e,n),i=Sn(s);return s==i?n:me(i)}function Qt(e,n){if(n>e.lastLine())return n;var s=nt(e,n),i;if(!yt(e,s))return n;for(;i=Hn(s);)s=i.find(1,!0).line;return me(s)+1}function yt(e,n){var s=Ht&&n.markedSpans;if(s)for(var i=void 0,p=0;p<s.length;++p){if(i=s[p],!i.marker.collapsed)continue;if(i.from==null)return!0;if(i.marker.widgetNode)continue;if(i.from==0&&i.marker.inclusiveLeft&&Pt(e,n,i))return!0}}function Pt(e,n,s){if(s.to==null){var i=s.marker.find(1,!0);return Pt(e,i.line,pn(i.line.markedSpans,s.marker))}if(s.marker.inclusiveRight&&s.to==n.text.length)return!0;for(var p=void 0,F=0;F<n.markedSpans.length;++F)if(p=n.markedSpans[F],p.marker.collapsed&&!p.marker.widgetNode&&p.from==s.to&&(p.to==null||p.to!=s.from)&&(p.marker.inclusiveLeft||s.marker.inclusiveRight)&&Pt(e,n,p))return!0}function Lt(e){e=Sn(e);for(var n=0,s=e.parent,i=0;i<s.lines.length;++i){var p=s.lines[i];if(p==e)break;n+=p.height}for(var F=s.parent;F;s=F,F=s.parent)for(var X=0;X<F.children.length;++X){var Z=F.children[X];if(Z==s)break;n+=Z.height}return n}function wt(e){if(e.height==0)return 0;for(var n=e.text.length,s,i=e;s=cr(i);){var p=s.find(0,!0);i=p.from.line,n+=p.from.ch-p.to.ch}for(i=e;s=Hn(i);){var F=s.find(0,!0);n-=i.text.length-F.from.ch,i=F.to.line,n+=i.text.length-F.to.ch}return n}function Gt(e){var n=e.display,s=e.doc;n.maxLine=nt(s,s.first),n.maxLineLength=wt(n.maxLine),n.maxLineChanged=!0,s.iter(function(i){var p=wt(i);p>n.maxLineLength&&(n.maxLineLength=p,n.maxLine=i)})}var rn=function(e,n,s){this.text=e,Nn(this,n),this.height=s?s(this):1};rn.prototype.lineNo=function(){return me(this)},Ce(rn);function tn(e,n,s,i){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),wn(e),Nn(e,s);var p=i?i(e):1;p!=e.height&&Ae(e,p)}function st(e){e.parent=null,wn(e)}var Ye={},Be={};function ze(e,n){if(!e||/^\s*$/.test(e))return null;var s=n.addModeClass?Be:Ye;return s[e]||(s[e]=e.replace(/\S+/g,"cm-$&"))}function Le(e,n){var s=y("span",null,null,L?"padding-right: .1px":null),i={pre:y("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 F=p?n.rest[p-1]:n.line,X=void 0;i.pos=0,i.addToken=Ve,hr(e.display.measure)&&(X=un(F,e.doc.direction))&&(i.addToken=bt(i.addToken,X)),i.map=[];var Z=n!=e.display.externalMeasured&&me(F);At(F,i,$t(e,F,Z)),F.styleClasses&&(F.styleClasses.bgClass&&(i.bgClass=j(F.styleClasses.bgClass,i.bgClass||"")),F.styleClasses.textClass&&(i.textClass=j(F.styleClasses.textClass,i.textClass||""))),i.map.length==0&&i.map.push(0,0,i.content.appendChild(Dt(e.display.measure))),p==0?(n.measure.map=i.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(i.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(L){var te=i.content.lastChild;(/\bcm-tab\b/.test(te.className)||te.querySelector&&te.querySelector(".cm-tab"))&&(i.content.className="cm-tab-wrap-hack")}return He(e,"renderLine",e,n.line,i.pre),i.pre.className&&(i.textClass=j(i.pre.className,i.textClass||"")),i}function tt(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 Ve(e,n,s,i,p,F,X){if(!n)return;var Z=e.splitSpaces?pt(n,e.trailingSpace):n,te=e.cm.state.specialChars,de=!1,De;if(!te.test(n))e.col+=n.length,De=document.createTextNode(Z),e.map.push(e.pos,e.pos+n.length,De),z&&G<9&&(de=!0),e.pos+=n.length;else{De=document.createDocumentFragment();for(var Fe=0;;){te.lastIndex=Fe;var it=te.exec(n),et=it?it.index-Fe:n.length-Fe;if(et){var Tt=document.createTextNode(Z.slice(Fe,Fe+et));z&&G<9?De.appendChild(d("span",[Tt])):De.appendChild(Tt),e.map.push(e.pos,e.pos+et,Tt),e.col+=et,e.pos+=et}if(!it)break;Fe+=et+1;var Bt=void 0;if(it[0]==" "){var Zt=e.cm.options.tabSize,On=Zt-e.col%Zt;Bt=De.appendChild(d("span",xe(On),"cm-tab")),Bt.setAttribute("role","presentation"),Bt.setAttribute("cm-text"," "),e.col+=On}else it[0]=="\r"||it[0]==`
`?(Bt=De.appendChild(d("span",it[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Bt.setAttribute("cm-text",it[0]),e.col+=1):(Bt=e.cm.options.specialCharPlaceholder(it[0]),Bt.setAttribute("cm-text",it[0]),z&&G<9?De.appendChild(d("span",[Bt])):De.appendChild(Bt),e.col+=1);e.map.push(e.pos,e.pos+1,Bt),e.pos++}}if(e.trailingSpace=Z.charCodeAt(n.length-1)==32,s||i||p||de||F||X){var Xn=s||"";i&&(Xn+=i),p&&(Xn+=p);var Rn=d("span",[De],Xn,F);if(X)for(var ar in X)X.hasOwnProperty(ar)&&ar!="style"&&ar!="class"&&Rn.setAttribute(ar,X[ar]);return e.content.appendChild(Rn)}e.content.appendChild(De)}function pt(e,n){if(e.length>1&&!/ /.test(e))return e;for(var s=n,i="",p=0;p<e.length;p++){var F=e.charAt(p);F==" "&&s&&(p==e.length-1||e.charCodeAt(p+1)==32)&&(F="\xA0"),i+=F,s=F==" "}return i}function bt(e,n){return function(s,i,p,F,X,Z,te){p=p?p+" cm-force-border":"cm-force-border";for(var de=s.pos,De=de+i.length;;){for(var Fe=void 0,it=0;it<n.length&&!(Fe=n[it],Fe.to>de&&Fe.from<=de);it++);if(Fe.to>=De)return e(s,i,p,F,X,Z,te);e(s,i.slice(0,Fe.to-de),p,F,null,Z,te),F=null,i=i.slice(Fe.to-de),de=Fe.to}}}function mt(e,n,s,i){var p=!i&&s.widgetNode;p&&e.map.push(e.pos,e.pos+n,p),!i&&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 At(e,n,s){var i=e.markedSpans,p=e.text,F=0;if(!i){for(var X=1;X<s.length;X+=2)n.addToken(n,p.slice(F,F=s[X]),ze(s[X+1],n.cm.options));return}for(var Z=p.length,te=0,de=1,De="",Fe,it,et=0,Tt,Bt,Zt,On,Xn;;){if(et==te){Tt=Bt=Zt=it="",Xn=null,On=null,et=Infinity;for(var Rn=[],ar=void 0,Cr=0;Cr<i.length;++Cr){var xr=i[Cr],Dr=xr.marker;if(Dr.type=="bookmark"&&xr.from==te&&Dr.widgetNode)Rn.push(Dr);else if(xr.from<=te&&(xr.to==null||xr.to>te||Dr.collapsed&&xr.to==te&&xr.from==te)){if(xr.to!=null&&xr.to!=te&&et>xr.to&&(et=xr.to,Bt=""),Dr.className&&(Tt+=" "+Dr.className),Dr.css&&(it=(it?it+";":"")+Dr.css),Dr.startStyle&&xr.from==te&&(Zt+=" "+Dr.startStyle),Dr.endStyle&&xr.to==et&&(ar||(ar=[])).push(Dr.endStyle,xr.to),Dr.title&&((Xn||(Xn={})).title=Dr.title),Dr.attributes)for(var jr in Dr.attributes)(Xn||(Xn={}))[jr]=Dr.attributes[jr];Dr.collapsed&&(!On||zn(On.marker,Dr)<0)&&(On=xr)}else xr.from>te&&et>xr.from&&(et=xr.from)}if(ar)for(var ra=0;ra<ar.length;ra+=2)ar[ra+1]==et&&(Bt+=" "+ar[ra]);if(!On||On.from==te)for(var zr=0;zr<Rn.length;++zr)mt(n,0,Rn[zr]);if(On&&(On.from||0)==te){if(mt(n,(On.to==null?Z+1:On.to)-te,On.marker,On.from==null),On.to==null)return;On.to==te&&(On=!1)}}if(te>=Z)break;for(var ya=Math.min(Z,et);;){if(De){var va=te+De.length;if(!On){var Qr=va>ya?De.slice(0,ya-te):De;n.addToken(n,Qr,Fe?Fe+Tt:Tt,Zt,te+Qr.length==et?Bt:"",it,Xn)}if(va>=ya){De=De.slice(ya-te),te=ya;break}te=va,Zt=""}De=p.slice(F,F=s[de++]),Fe=ze(s[de++],n.cm.options)}}}function vt(e,n,s){this.line=n,this.rest=Cn(n),this.size=this.rest?me(Y(this.rest))-s+1:1,this.node=this.text=null,this.hidden=yt(e,n)}function Et(e,n,s){for(var i=[],p,F=n;F<s;F=p){var X=new vt(e.doc,nt(e.doc,F),F);p=F+X.size,i.push(X)}return i}var an=null;function Yt(e){an?an.ops.push(e):e.ownsGroup=an={ops:[e],delayedCallbacks:[]}}function lr(e){var n=e.delayedCallbacks,s=0;do{for(;s<n.length;s++)n[s].call(null);for(var i=0;i<e.ops.length;i++){var p=e.ops[i];if(p.cursorActivityHandlers)for(;p.cursorActivityCalled<p.cursorActivityHandlers.length;)p.cursorActivityHandlers[p.cursorActivityCalled++].call(null,p.cm)}}while(s<n.length)}function Bn(e,n){var s=e.ownsGroup;if(!s)return;try{lr(s)}finally{an=null,n(s)}}var jn=null;function Ut(e,n){var s=ht(e,n);if(!s.length)return;var i=Array.prototype.slice.call(arguments,2),p;an?p=an.delayedCallbacks:jn?p=jn:(p=jn=[],setTimeout(mn,0));for(var F=function(Z){p.push(function(){return s[Z].apply(null,i)})},X=0;X<s.length;++X)F(X)}function mn(){var e=jn;jn=null;for(var n=0;n<e.length;++n)e[n]()}function Pn(e,n,s,i){for(var p=0;p<n.changes.length;p++){var F=n.changes[p];F=="text"?Br(e,n):F=="gutter"?$n(e,n,s,i):F=="class"?Er(e,n):F=="widget"&&br(e,n,i)}n.changes=null}function Kn(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),z&&G<8&&(e.node.style.zIndex=2)),e.node}function vn(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 i=Kn(n);n.background=i.insertBefore(d("div",null,s),i.firstChild),e.display.input.setUneditable(n.background)}}function Lr(e,n){var s=e.display.externalMeasured;return s&&s.line==n.line?(e.display.externalMeasured=null,n.measure=s.measure,s.built):Le(e,n)}function Br(e,n){var s=n.text.className,i=Lr(e,n);n.text==n.node&&(n.node=i.pre),n.text.parentNode.replaceChild(i.pre,n.text),n.text=i.pre,i.bgClass!=n.bgClass||i.textClass!=n.textClass?(n.bgClass=i.bgClass,n.textClass=i.textClass,Er(e,n)):s&&(n.text.className=s)}function Er(e,n){vn(e,n),n.line.wrapClass?Kn(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 $n(e,n,s,i){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=Kn(n);n.gutterBackground=d("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px; width: "+i.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),p.insertBefore(n.gutterBackground,n.text)}var F=n.line.gutterMarkers;if(e.options.lineNumbers||F){var X=Kn(n),Z=n.gutter=d("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?i.fixedPos:-i.gutterTotalWidth)+"px");if(e.display.input.setUneditable(Z),X.insertBefore(Z,n.text),n.line.gutterClass&&(Z.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!F||!F["CodeMirror-linenumbers"])&&(n.lineNumber=Z.appendChild(d("div",Vt(e.options,s),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+i.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),F)for(var te=0;te<e.display.gutterSpecs.length;++te){var de=e.display.gutterSpecs[te].className,De=F.hasOwnProperty(de)&&F[de];De&&Z.appendChild(d("div",[De],"CodeMirror-gutter-elt","left: "+i.gutterLeft[de]+"px; width: "+i.gutterWidth[de]+"px"))}}}function br(e,n,s){n.alignable&&(n.alignable=null);for(var i=R("CodeMirror-linewidget"),p=n.node.firstChild,F=void 0;p;p=F)F=p.nextSibling,i.test(p.className)&&n.node.removeChild(p);yr(e,n,s)}function _r(e,n,s,i){var p=Lr(e,n);return n.text=n.node=p.pre,p.bgClass&&(n.bgClass=p.bgClass),p.textClass&&(n.textClass=p.textClass),Er(e,n),$n(e,n,s,i),yr(e,n,i),n.node}function yr(e,n,s){if(Mr(e,n.line,n,s,!0),n.rest)for(var i=0;i<n.rest.length;i++)Mr(e,n.rest[i],n,s,!1)}function Mr(e,n,s,i,p){if(!n.widgets)return;for(var F=Kn(s),X=0,Z=n.widgets;X<Z.length;++X){var te=Z[X],de=d("div",[te.node],"CodeMirror-linewidget"+(te.className?" "+te.className:""));te.handleMouseEvents||de.setAttribute("cm-ignore-events","true"),Vr(te,de,s,i),e.display.input.setUneditable(de),p&&te.above?F.insertBefore(de,s.gutter||s.text):F.appendChild(de),Ut(te,"redraw")}}function Vr(e,n,s,i){if(e.noHScroll){(s.alignable||(s.alignable=[])).push(n);var p=i.wrapperWidth;n.style.left=i.fixedPos+"px",e.coverGutter||(p-=i.gutterTotalWidth,n.style.paddingLeft=i.gutterTotalWidth+"px"),n.style.width=p+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-i.gutterTotalWidth+"px"))}function Ur(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!E(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 Ir(e,n){for(var s=Se(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 Ca(e){return e.lineSpace.offsetTop}function Kr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Oa(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,i={left:parseInt(s.paddingLeft),right:parseInt(s.paddingRight)};return!isNaN(i.left)&&!isNaN(i.right)&&(e.cachedPaddingH=i),i}function qr(e){return ie-e.display.nativeBarWidth}function ea(e){return e.display.scroller.clientWidth-qr(e)-e.display.barWidth}function Ea(e){return e.display.scroller.clientHeight-qr(e)-e.display.barHeight}function Ra(e,n,s){var i=e.options.lineWrapping,p=i&&ea(e);if(!n.measure.heights||i&&n.measure.width!=p){var F=n.measure.heights=[];if(i){n.measure.width=p;for(var X=n.text.firstChild.getClientRects(),Z=0;Z<X.length-1;Z++){var te=X[Z],de=X[Z+1];Math.abs(te.bottom-de.bottom)>2&&F.push((te.bottom+de.top)/2-s.top)}}F.push(s.bottom-s.top)}}function Vi(e,n,s){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};for(var i=0;i<e.rest.length;i++)if(e.rest[i]==n)return{map:e.measure.maps[i],cache:e.measure.caches[i]};for(var p=0;p<e.rest.length;p++)if(me(e.rest[p])>s)return{map:e.measure.maps[p],cache:e.measure.caches[p],before:!0}}function ha(e,n){n=Sn(n);var s=me(n),i=e.display.externalMeasured=new vt(e.doc,n,s);i.lineN=s;var p=i.built=Le(e,i);return i.text=p.pre,u(e.display.lineMeasure,p.pre),i}function Xi(e,n,s,i){return ia(e,Na(e,n),s,i)}function Ka(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[za(e,n)];var s=e.display.externalMeasured;if(s&&n>=s.lineN&&n<s.lineN+s.size)return s}function Na(e,n){var s=me(n),i=Ka(e,s);i&&!i.text?i=null:i&&i.changes&&(Pn(e,i,s,Do(e)),e.curOp.forceUpdate=!0),i||(i=ha(e,n));var p=Vi(i,n,s);return{line:n,view:i,rect:null,map:p.map,cache:p.cache,before:p.before,hasHeights:!1}}function ia(e,n,s,i,p){n.before&&(s=-1);var F=s+(i||""),X;return n.cache.hasOwnProperty(F)?X=n.cache[F]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Ra(e,n.view,n.rect),n.hasHeights=!0),X=xo(e,n,s,i),X.bogus||(n.cache[F]=X)),{left:X.left,right:X.right,top:p?X.rtop:X.top,bottom:p?X.rbottom:X.bottom}}var Ja={left:0,right:0,top:0,bottom:0};function bo(e,n,s){for(var i,p,F,X,Z,te,de=0;de<e.length;de+=3)if(Z=e[de],te=e[de+1],n<Z?(p=0,F=1,X="left"):n<te?(p=n-Z,F=p+1):(de==e.length-3||n==te&&e[de+3]>n)&&(F=te-Z,p=F-1,n>=te&&(X="right")),p!=null){if(i=e[de+2],Z==te&&s==(i.insertLeft?"left":"right")&&(X=s),s=="left"&&p==0)for(;de&&e[de-2]==e[de-3]&&e[de-1].insertLeft;)i=e[(de-=3)+2],X="left";if(s=="right"&&p==te-Z)for(;de<e.length-3&&e[de+3]==e[de+4]&&!e[de+5].insertLeft;)i=e[(de+=3)+2],X="right";break}return{node:i,start:p,end:F,collapse:X,coverStart:Z,coverEnd:te}}function yo(e,n){var s=Ja;if(n=="left")for(var i=0;i<e.length&&!((s=e[i]).left!=s.right);i++);else for(var p=e.length-1;p>=0&&!((s=e[p]).left!=s.right);p--);return s}function xo(e,n,s,i){var p=bo(n.map,s,i),F=p.node,X=p.start,Z=p.end,te=p.collapse,de;if(F.nodeType==3){for(var De=0;De<4;De++){for(;X&&ut(n.line.text.charAt(p.coverStart+X));)--X;for(;p.coverStart+Z<p.coverEnd&&ut(n.line.text.charAt(p.coverStart+Z));)++Z;if(z&&G<9&&X==0&&Z==p.coverEnd-p.coverStart?de=F.parentNode.getBoundingClientRect():de=yo(v(F,X,Z).getClientRects(),i),de.left||de.right||X==0)break;Z=X,X=X-1,te="right"}z&&G<11&&(de=cs(e.display.measure,de))}else{X>0&&(te=i="right");var Fe;e.options.lineWrapping&&(Fe=F.getClientRects()).length>1?de=Fe[i=="right"?Fe.length-1:0]:de=F.getBoundingClientRect()}if(z&&G<9&&!X&&(!de||!de.left&&!de.right)){var it=F.parentNode.getClientRects()[0];it?de={left:it.left,right:it.left+Za(e.display),top:it.top,bottom:it.bottom}:de=Ja}for(var et=de.top-n.rect.top,Tt=de.bottom-n.rect.top,Bt=(et+Tt)/2,Zt=n.view.measure.heights,On=0;On<Zt.length-1&&!(Bt<Zt[On]);On++);var Xn=On?Zt[On-1]:0,Rn=Zt[On],ar={left:(te=="right"?de.right:de.left)-n.rect.left,right:(te=="left"?de.left:de.right)-n.rect.left,top:Xn,bottom:Rn};return!de.left&&!de.right&&(ar.bogus=!0),e.options.singleCursorHeightPerLine||(ar.rtop=et,ar.rbottom=Tt),ar}function cs(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!dr(e))return n;var s=screen.logicalXDPI/screen.deviceXDPI,i=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*s,right:n.right*s,top:n.top*i,bottom:n.bottom*i}}function fs(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 To(e){e.display.externalMeasure=null,_(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)fs(e.display.view[n])}function wi(e){To(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function hs(){return m&&r?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ps(){return m&&r?-(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+=Ur(e.widgets[s]));return n}function $i(e,n,s,i,p){if(!p){var F=wo(n);s.top+=F,s.bottom+=F}if(i=="line")return s;i||(i="local");var X=Lt(n);if(i=="local"?X+=Ca(e.display):X-=e.display.viewOffset,i=="page"||i=="window"){var Z=e.display.lineSpace.getBoundingClientRect();X+=Z.top+(i=="window"?0:ps());var te=Z.left+(i=="window"?0:hs());s.left+=te,s.right+=te}return s.top+=X,s.bottom+=X,s}function Co(e,n,s){if(s=="div")return n;var i=n.left,p=n.top;if(s=="page")i-=hs(),p-=ps();else if(s=="local"||!s){var F=e.display.sizer.getBoundingClientRect();i+=F.left,p+=F.top}var X=e.display.lineSpace.getBoundingClientRect();return{left:i-X.left,top:p-X.top}}function Oo(e,n,s,i,p){return i||(i=nt(e.doc,n.line)),$i(e,i,Xi(e,i,n.ch,p),s)}function xa(e,n,s,i,p,F){i=i||nt(e.doc,n.line),p||(p=Na(e,i));function X(Tt,Bt){var Zt=ia(e,p,Tt,Bt?"right":"left",F);return Bt?Zt.left=Zt.right:Zt.right=Zt.left,$i(e,i,Zt,s)}var Z=un(i,e.doc.direction),te=n.ch,de=n.sticky;if(te>=i.text.length?(te=i.text.length,de="before"):te<=0&&(te=0,de="after"),!Z)return X(de=="before"?te-1:te,de=="before");function De(Tt,Bt,Zt){var On=Z[Bt],Xn=On.level==1;return X(Zt?Tt-1:Tt,Xn!=Zt)}var Fe=zt(Z,te,de),it=Kt,et=De(te,Fe,de=="before");return it!=null&&(et.other=De(te,it,de!="before")),et}function ms(e,n){var s=0;n=Ft(e.doc,n),e.options.lineWrapping||(s=Za(e.display)*n.ch);var i=nt(e.doc,n.line),p=Lt(i)+Ca(e.display);return{left:s,right:s,top:p,bottom:p+i.height}}function Ro(e,n,s,i,p){var F=we(e,n,s);return F.xRel=p,i&&(F.outside=i),F}function So(e,n,s){var i=e.doc;if(s+=e.display.viewOffset,s<0)return Ro(i.first,0,null,-1,-1);var p=pe(i,s),F=i.first+i.size-1;if(p>F)return Ro(i.first+i.size-1,nt(i,F).text.length,null,1,1);n<0&&(n=0);for(var X=nt(i,p);;){var Z=yl(e,X,p,n,s),te=Fn(X,Z.ch+(Z.xRel>0||Z.outside>0?1:0));if(!te)return Z;var de=te.find(1);if(de.line==p)return de;X=nt(i,p=de.line)}}function vs(e,n,s,i){i-=wo(n);var p=n.text.length,F=Ct(function(X){return ia(e,s,X-1).bottom<=i},p,0);return p=Ct(function(X){return ia(e,s,X).top>i},F,p),{begin:F,end:p}}function gs(e,n,s,i){s||(s=Na(e,n));var p=$i(e,n,ia(e,s,i),"line").top;return vs(e,n,s,p)}function Ao(e,n,s,i){return e.bottom<=s?!1:e.top>s?!0:(i?e.left:e.right)>n}function yl(e,n,s,i,p){p-=Lt(n);var F=Na(e,n),X=wo(n),Z=0,te=n.text.length,de=!0,De=un(n,e.doc.direction);if(De){var Fe=(e.options.lineWrapping?Yi:Ci)(e,n,s,F,De,i,p);de=Fe.level!=1,Z=de?Fe.from:Fe.to-1,te=de?Fe.to:Fe.from-1}var it=null,et=null,Tt=Ct(function(Cr){var xr=ia(e,F,Cr);return xr.top+=X,xr.bottom+=X,Ao(xr,i,p,!1)?(xr.top<=p&&xr.left<=i&&(it=Cr,et=xr),!0):!1},Z,te),Bt,Zt,On=!1;if(et){var Xn=i-et.left<et.right-i,Rn=Xn==de;Tt=it+(Rn?0:1),Zt=Rn?"after":"before",Bt=Xn?et.left:et.right}else{!de&&(Tt==te||Tt==Z)&&Tt++,Zt=Tt==0?"after":Tt==n.text.length?"before":ia(e,F,Tt-(de?1:0)).bottom+X<=p==de?"after":"before";var ar=xa(e,we(s,Tt,Zt),"line",n,F);Bt=ar.left,On=p<ar.top?-1:p>=ar.bottom?1:0}return Tt=qe(n.text,Tt,1),Ro(s,Tt,Zt,On,i-Bt)}function Ci(e,n,s,i,p,F,X){var Z=Ct(function(Fe){var it=p[Fe],et=it.level!=1;return Ao(xa(e,we(s,et?it.to:it.from,et?"before":"after"),"line",n,i),F,X,!0)},0,p.length-1),te=p[Z];if(Z>0){var de=te.level!=1,De=xa(e,we(s,de?te.from:te.to,de?"after":"before"),"line",n,i);Ao(De,F,X,!0)&&De.top>X&&(te=p[Z-1])}return te}function Yi(e,n,s,i,p,F,X){var Z=vs(e,n,i,X),te=Z.begin,de=Z.end;/\s/.test(n.text.charAt(de-1))&&de--;for(var De=null,Fe=null,it=0;it<p.length;it++){var et=p[it];if(et.from>=de||et.to<=te)continue;var Tt=et.level!=1,Bt=ia(e,i,Tt?Math.min(de,et.to)-1:Math.max(te,et.from)).right,Zt=Bt<F?F-Bt+1e9:Bt-F;(!De||Fe>Zt)&&(De=et,Fe=Zt)}return De||(De=p[p.length-1]),De.from<te&&(De={from:te,to:De.to,level:De.level}),De.to>de&&(De={from:De.from,to:de,level:De.level}),De}var Sa;function qa(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Sa==null){Sa=d("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)Sa.appendChild(document.createTextNode("x")),Sa.appendChild(d("br"));Sa.appendChild(document.createTextNode("x"))}u(e.measure,Sa);var s=Sa.offsetHeight/50;return s>3&&(e.cachedTextHeight=s),_(e.measure),s||1}function Za(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 i=n.getBoundingClientRect(),p=(i.right-i.left)/10;return p>2&&(e.cachedCharWidth=p),p||10}function Do(e){for(var n=e.display,s={},i={},p=n.gutters.clientLeft,F=n.gutters.firstChild,X=0;F;F=F.nextSibling,++X){var Z=e.display.gutterSpecs[X].className;s[Z]=F.offsetLeft+F.clientLeft+p,i[Z]=F.clientWidth}return{fixedPos:Po(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:s,gutterWidth:i,wrapperWidth:n.wrapper.clientWidth}}function Po(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function _s(e){var n=qa(e.display),s=e.options.lineWrapping,i=s&&Math.max(5,e.display.scroller.clientWidth/Za(e.display)-3);return function(p){if(yt(e.doc,p))return 0;var F=0;if(p.widgets)for(var X=0;X<p.widgets.length;X++)p.widgets[X].height&&(F+=p.widgets[X].height);return s?F+(Math.ceil(p.text.length/i)||1)*n:F+n}}function Lo(e){var n=e.doc,s=_s(e);n.iter(function(i){var p=s(i);p!=i.height&&Ae(i,p)})}function Ga(e,n,s,i){var p=e.display;if(!s&&Se(n).getAttribute("cm-not-content")=="true")return null;var F,X,Z=p.lineSpace.getBoundingClientRect();try{F=n.clientX-Z.left,X=n.clientY-Z.top}catch(Fe){return null}var te=So(e,F,X),de;if(i&&te.xRel>0&&(de=nt(e.doc,te.line).text).length==te.ch){var De=U(de,de.length,e.options.tabSize)-de.length;te=we(te.line,Math.max(0,Math.round((F-Oa(e.display).left)/Za(e.display))-De))}return te}function za(e,n){if(n>=e.display.viewTo)return null;if(n-=e.display.viewFrom,n<0)return null;for(var s=e.display.view,i=0;i<s.length;i++)if(n-=s[i].size,n<0)return i}function la(e,n,s,i){n==null&&(n=e.doc.first),s==null&&(s=e.doc.first+e.doc.size),i||(i=0);var p=e.display;if(i&&s<p.viewTo&&(p.updateLineNumbers==null||p.updateLineNumbers>n)&&(p.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=p.viewTo)Ht&&_n(e.doc,n)<p.viewTo&&Ma(e);else if(s<=p.viewFrom)Ht&&Qt(e.doc,s+i)>p.viewFrom?Ma(e):(p.viewFrom+=i,p.viewTo+=i);else if(n<=p.viewFrom&&s>=p.viewTo)Ma(e);else if(n<=p.viewFrom){var F=ei(e,s,s+i,1);F?(p.view=p.view.slice(F.index),p.viewFrom=F.lineN,p.viewTo+=i):Ma(e)}else if(s>=p.viewTo){var X=ei(e,n,n,-1);X?(p.view=p.view.slice(0,X.index),p.viewTo=X.lineN):Ma(e)}else{var Z=ei(e,n,n,-1),te=ei(e,s,s+i,1);Z&&te?(p.view=p.view.slice(0,Z.index).concat(Et(e,Z.lineN,te.lineN)).concat(p.view.slice(te.index)),p.viewTo+=i):Ma(e)}var de=p.externalMeasured;de&&(s<de.lineN?de.lineN+=i:n<de.lineN+de.size&&(p.externalMeasured=null))}function ka(e,n,s){e.curOp.viewChanged=!0;var i=e.display,p=e.display.externalMeasured;if(p&&n>=p.lineN&&n<p.lineN+p.size&&(i.externalMeasured=null),n<i.viewFrom||n>=i.viewTo)return;var F=i.view[za(e,n)];if(F.node==null)return;var X=F.changes||(F.changes=[]);q(X,s)==-1&&X.push(s)}function Ma(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ei(e,n,s,i){var p=za(e,n),F,X=e.display.view;if(!Ht||s==e.doc.first+e.doc.size)return{index:p,lineN:s};for(var Z=e.display.viewFrom,te=0;te<p;te++)Z+=X[te].size;if(Z!=n){if(i>0){if(p==X.length-1)return null;F=Z+X[p].size-n,p++}else F=Z-n;n+=F,s+=F}for(;_n(e.doc,s)!=s;){if(p==(i<0?0:X.length-1))return null;s+=i*X[p-(i<0?1:0)].size,p+=i}return{index:p,lineN:s}}function xl(e,n,s){var i=e.display,p=i.view;p.length==0||n>=i.viewTo||s<=i.viewFrom?(i.view=Et(e,n,s),i.viewFrom=n):(i.viewFrom>n?i.view=Et(e,n,i.viewFrom).concat(i.view):i.viewFrom<n&&(i.view=i.view.slice(za(e,n))),i.viewFrom=n,i.viewTo<s?i.view=i.view.concat(Et(e,i.viewTo,s)):i.viewTo>s&&(i.view=i.view.slice(0,za(e,s)))),i.viewTo=s}function Io(e){for(var n=e.display.view,s=0,i=0;i<n.length;i++){var p=n[i];!p.hidden&&(!p.node||p.changes)&&++s}return s}function ti(e){e.display.input.showSelection(e.display.input.prepareSelection())}function No(e,n){n===void 0&&(n=!0);for(var s=e.doc,i={},p=i.cursors=document.createDocumentFragment(),F=i.selection=document.createDocumentFragment(),X=0;X<s.sel.ranges.length;X++){if(!n&&X==s.sel.primIndex)continue;var Z=s.sel.ranges[X];if(Z.from().line>=e.display.viewTo||Z.to().line<e.display.viewFrom)continue;var te=Z.empty();(te||e.options.showCursorWhenSelecting)&&Es(e,Z.head,p),te||bs(e,Z,F)}return i}function Es(e,n,s){var i=xa(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),p=s.appendChild(d("div","\xA0","CodeMirror-cursor"));if(p.style.left=i.left+"px",p.style.top=i.top+"px",p.style.height=Math.max(0,i.bottom-i.top)*e.options.cursorHeight+"px",i.other){var F=s.appendChild(d("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));F.style.display="",F.style.left=i.other.left+"px",F.style.top=i.other.top+"px",F.style.height=(i.other.bottom-i.other.top)*.85+"px"}}function Qi(e,n){return e.top-n.top||e.left-n.left}function bs(e,n,s){var i=e.display,p=e.doc,F=document.createDocumentFragment(),X=Oa(e.display),Z=X.left,te=Math.max(i.sizerWidth,ea(e)-i.sizer.offsetLeft)-X.right,de=p.direction=="ltr";function De(Rn,ar,Cr,xr){ar<0&&(ar=0),ar=Math.round(ar),xr=Math.round(xr),F.appendChild(d("div",null,"CodeMirror-selected","position: absolute; left: "+Rn+`px;
top: `+ar+"px; width: "+(Cr==null?te-Rn:Cr)+`px;
height: `+(xr-ar)+"px"))}function Fe(Rn,ar,Cr){var xr=nt(p,Rn),Dr=xr.text.length,jr,ra;function zr(Qr,ga){return Oo(e,we(Rn,Qr),"div",xr,ga)}function ya(Qr,ga,sa){var Zr=gs(e,xr,null,Qr),Jr=ga=="ltr"==(sa=="after")?"left":"right",Xr=sa=="after"?Zr.begin:Zr.end-(/\s/.test(xr.text.charAt(Zr.end-1))?2:1);return zr(Xr,Jr)[Jr]}var va=un(xr,p.direction);return kt(va,ar||0,Cr==null?Dr:Cr,function(Qr,ga,sa,Zr){var Jr=sa=="ltr",Xr=zr(Qr,Jr?"left":"right"),_a=zr(ga-1,Jr?"right":"left"),_o=ar==null&&Qr==0,Ti=Cr==null&&ga==Dr,da=Zr==0,Ha=!va||Zr==va.length-1;if(_a.top-Xr.top<=3){var aa=(de?_o:Ti)&&da,nu=(de?Ti:_o)&&Ha,Qa=aa?Z:(Jr?Xr:_a).left,Gi=nu?te:(Jr?_a:Xr).right;De(Qa,Xr.top,Gi-Qa,Xr.bottom)}else{var zi,fa,Eo,ru;Jr?(zi=de&&_o&&da?Z:Xr.left,fa=de?te:ya(Qr,sa,"before"),Eo=de?Z:ya(ga,sa,"after"),ru=de&&Ti&&Ha?te:_a.right):(zi=de?ya(Qr,sa,"before"):Z,fa=!de&&_o&&da?te:Xr.right,Eo=!de&&Ti&&Ha?Z:_a.left,ru=de?ya(ga,sa,"after"):te),De(zi,Xr.top,fa-zi,Xr.bottom),Xr.bottom<_a.top&&De(Z,Xr.bottom,null,_a.top),De(Eo,_a.top,ru-Eo,_a.bottom)}(!jr||Qi(Xr,jr)<0)&&(jr=Xr),Qi(_a,jr)<0&&(jr=_a),(!ra||Qi(Xr,ra)<0)&&(ra=Xr),Qi(_a,ra)<0&&(ra=_a)}),{start:jr,end:ra}}var it=n.from(),et=n.to();if(it.line==et.line)Fe(it.line,it.ch,et.ch);else{var Tt=nt(p,it.line),Bt=nt(p,et.line),Zt=Sn(Tt)==Sn(Bt),On=Fe(it.line,it.ch,Zt?Tt.text.length+1:null).end,Xn=Fe(et.line,Zt?0:null,et.ch).start;Zt&&(On.top<Xn.top-2?(De(On.right,On.top,null,On.bottom),De(Z,Xn.top,Xn.left,Xn.bottom)):De(On.right,On.top,Xn.left-On.right,On.bottom)),On.bottom<Xn.top&&De(Z,On.bottom,null,Xn.top)}s.appendChild(F)}function ko(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()||ni(e),n.cursorDiv.style.visibility=(s=!s)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}function Mo(e){e.state.focused||(e.display.input.focus(),Uo(e))}function ys(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,ni(e))},100)}function Uo(e,n){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(He(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(),L&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ko(e)}function ni(e,n){if(e.state.delayingBlurEvent)return;e.state.focused&&(He(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 Ji(e){for(var n=e.display,s=n.lineDiv.offsetTop,i=0;i<n.view.length;i++){var p=n.view[i],F=e.options.lineWrapping,X=void 0,Z=0;if(p.hidden)continue;if(z&&G<8){var te=p.node.offsetTop+p.node.offsetHeight;X=te-s,s=te}else{var de=p.node.getBoundingClientRect();X=de.bottom-de.top,!F&&p.text.firstChild&&(Z=p.text.firstChild.getBoundingClientRect().right-de.left-1)}var De=p.line.height-X;if((De>.005||De<-.005)&&(Ae(p.line,X),Aa(p.line),p.rest))for(var Fe=0;Fe<p.rest.length;Fe++)Aa(p.rest[Fe]);if(Z>e.display.sizerWidth){var it=Math.ceil(Z/Za(e.display));it>e.display.maxLineLength&&(e.display.maxLineLength=it,e.display.maxLine=p.line,e.display.maxLineChanged=!0)}}}function Aa(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var s=e.widgets[n],i=s.node.parentNode;i&&(s.height=i.offsetHeight)}}function qi(e,n,s){var i=s&&s.top!=null?Math.max(0,s.top):e.scroller.scrollTop;i=Math.floor(i-Ca(e));var p=s&&s.bottom!=null?s.bottom:i+e.wrapper.clientHeight,F=pe(n,i),X=pe(n,p);if(s&&s.ensure){var Z=s.ensure.from.line,te=s.ensure.to.line;Z<F?(F=Z,X=pe(n,Lt(nt(n,Z))+e.wrapper.clientHeight)):Math.min(te,n.lastLine())>=X&&(F=pe(n,Lt(nt(n,te))-e.wrapper.clientHeight),X=te)}return{from:F,to:Math.max(X,F+1)}}function xs(e,n){if(lt(e,"scrollCursorIntoView"))return;var s=e.display,i=s.sizer.getBoundingClientRect(),p=null;if(n.top+i.top<0?p=!0:n.bottom+i.top>(window.innerHeight||document.documentElement.clientHeight)&&(p=!1),p!=null&&!l){var F=d("div","\u200B",null,`position: absolute;
top: `+(n.top-s.viewOffset-Ca(e.display))+`px;
height: `+(n.bottom-n.top+qr(e)+s.barHeight)+`px;
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(F),F.scrollIntoView(p),e.display.lineSpace.removeChild(F)}}function Fo(e,n,s,i){i==null&&(i=0);var p;!e.options.lineWrapping&&n==s&&(n=n.ch?we(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n,s=n.sticky=="before"?we(n.line,n.ch+1,"before"):n);for(var F=0;F<5;F++){var X=!1,Z=xa(e,n),te=!s||s==n?Z:xa(e,s);p={left:Math.min(Z.left,te.left),top:Math.min(Z.top,te.top)-i,right:Math.max(Z.left,te.left),bottom:Math.max(Z.bottom,te.bottom)+i};var de=Zi(e,p),De=e.doc.scrollTop,Fe=e.doc.scrollLeft;if(de.scrollTop!=null&&(ii(e,de.scrollTop),Math.abs(e.doc.scrollTop-De)>1&&(X=!0)),de.scrollLeft!=null&&(Da(e,de.scrollLeft),Math.abs(e.doc.scrollLeft-Fe)>1&&(X=!0)),!X)break}return p}function Tl(e,n){var s=Zi(e,n);s.scrollTop!=null&&ii(e,s.scrollTop),s.scrollLeft!=null&&Da(e,s.scrollLeft)}function Zi(e,n){var s=e.display,i=qa(e.display);n.top<0&&(n.top=0);var p=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:s.scroller.scrollTop,F=Ea(e),X={};n.bottom-n.top>F&&(n.bottom=n.top+F);var Z=e.doc.height+Kr(s),te=n.top<i,de=n.bottom>Z-i;if(n.top<p)X.scrollTop=te?0:n.top;else if(n.bottom>p+F){var De=Math.min(n.top,(de?Z:n.bottom)-F);De!=p&&(X.scrollTop=De)}var Fe=e.options.fixedGutter?0:s.gutters.offsetWidth,it=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:s.scroller.scrollLeft-Fe,et=ea(e)-s.gutters.offsetWidth,Tt=n.right-n.left>et;return Tt&&(n.right=n.left+et),n.left<10?X.scrollLeft=0:n.left<it?X.scrollLeft=Math.max(0,n.left+Fe-(Tt?0:10)):n.right>et+it-3&&(X.scrollLeft=n.right+(Tt?0:10)-et),X}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 ri(e){to(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function ai(e,n,s){(n!=null||s!=null)&&to(e),n!=null&&(e.curOp.scrollLeft=n),s!=null&&(e.curOp.scrollTop=s)}function Ts(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),i=ms(e,n.to);ws(e,s,i,n.margin)}}function ws(e,n,s,i){var p=Zi(e,{left:Math.min(n.left,s.left),top:Math.min(n.top,s.top)-i,right:Math.max(n.right,s.right),bottom:Math.max(n.bottom,s.bottom)+i});ai(e,p.scrollLeft,p.scrollTop)}function ii(e,n){if(Math.abs(e.doc.scrollTop-n)<2)return;k||Wo(e,{top:n}),Cs(e,n,!0),k&&Wo(e),ta(e,100)}function Cs(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 Da(e,n,s,i){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)&&!i)return;e.doc.scrollLeft=n,Is(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n)}function oi(e){var n=e.display,s=n.gutters.offsetWidth,i=Math.round(e.doc.height+Kr(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:i,scrollHeight:i+qr(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:s}}var Pa=function(e,n,s){this.cm=s;var i=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");i.tabIndex=p.tabIndex=-1,e(i),e(p),je(i,"scroll",function(){i.clientHeight&&n(i.scrollTop,"vertical")}),je(p,"scroll",function(){p.clientWidth&&n(p.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,z&&G<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Pa.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,s=e.scrollHeight>e.clientHeight+1,i=e.nativeBarWidth;if(s){this.vert.style.display="block",this.vert.style.bottom=n?i+"px":"0";var p=e.viewHeight-(n?i: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?i+"px":"0",this.horiz.style.left=e.barLeft+"px";var F=e.viewWidth-e.barLeft-(s?i:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+F)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(i==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:s?i:0,bottom:n?i:0}},Pa.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Pa.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Pa.prototype.zeroWidthHack=function(){var e=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 V,this.disableVert=new V},Pa.prototype.enableZeroWidthBar=function(e,n,s){e.style.pointerEvents="auto";function i(){var p=e.getBoundingClientRect(),F=s=="vert"?document.elementFromPoint(p.right-1,(p.top+p.bottom)/2):document.elementFromPoint((p.right+p.left)/2,p.bottom-1);F!=e?e.style.pointerEvents="none":n.set(1e3,i)}n.set(1e3,i)},Pa.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Oi=function(){};Oi.prototype.update=function(){return{bottom:0,right:0}},Oi.prototype.setScrollLeft=function(){},Oi.prototype.setScrollTop=function(){},Oi.prototype.clear=function(){};function Ua(e,n){n||(n=oi(e));var s=e.display.barWidth,i=e.display.barHeight;Os(e,n);for(var p=0;p<4&&s!=e.display.barWidth||i!=e.display.barHeight;p++)s!=e.display.barWidth&&e.options.lineWrapping&&Ji(e),Os(e,oi(e)),s=e.display.barWidth,i=e.display.barHeight}function Os(e,n){var s=e.display,i=s.scrollbars.update(n);s.sizer.style.paddingRight=(s.barWidth=i.right)+"px",s.sizer.style.paddingBottom=(s.barHeight=i.bottom)+"px",s.heightForcer.style.borderBottom=i.bottom+"px solid transparent",i.right&&i.bottom?(s.scrollbarFiller.style.display="block",s.scrollbarFiller.style.height=i.bottom+"px",s.scrollbarFiller.style.width=i.right+"px"):s.scrollbarFiller.style.display="",i.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(s.gutterFiller.style.display="block",s.gutterFiller.style.height=i.bottom+"px",s.gutterFiller.style.width=n.gutterWidth+"px"):s.gutterFiller.style.display=""}var Rs={native:Pa,null:Oi};function Ss(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&b(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Rs[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),je(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"?Da(e,n):ii(e,n)},e),e.display.scrollbars.addClass&&N(e.display.wrapper,e.display.scrollbars.addClass)}var As=0;function Va(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},Yt(e.curOp)}function Xa(e){var n=e.curOp;n&&Bn(n,function(s){for(var i=0;i<s.ops.length;i++)s.ops[i].cm.curOp=null;wl(s)})}function wl(e){for(var n=e.ops,s=0;s<n.length;s++)si(n[s]);for(var i=0;i<n.length;i++)li(n[i]);for(var p=0;p<n.length;p++)Bo(n[p]);for(var F=0;F<n.length;F++)Cl(n[F]);for(var X=0;X<n.length;X++)Ds(n[X])}function si(e){var n=e.cm,s=n.display;Ol(n),e.updateMaxLine&&Gt(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 Ri(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function li(e){e.updatedDisplay=e.mustUpdate&&no(e.cm,e.update)}function Bo(e){var n=e.cm,s=n.display;e.updatedDisplay&&Ji(n),e.barMeasure=oi(n),s.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Xi(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+qr(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,s.sizer.offsetLeft+e.adjustWidthTo-ea(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=s.input.prepareSelection())}function Cl(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&Da(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var s=e.focus&&e.focus==M();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,s),(e.updatedDisplay||e.startHeight!=n.doc.height)&&Ua(n,e.barMeasure),e.updatedDisplay&&$a(n,e.barMeasure),e.selectionChanged&&ko(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),s&&Mo(e.cm)}function Ds(e){var n=e.cm,s=n.display,i=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&&Cs(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Da(n,e.scrollLeft,!0,!0),e.scrollToPos){var p=Fo(n,Ft(i,e.scrollToPos.from),Ft(i,e.scrollToPos.to),e.scrollToPos.margin);xs(n,p)}var F=e.maybeHiddenMarkers,X=e.maybeUnhiddenMarkers;if(F)for(var Z=0;Z<F.length;++Z)F[Z].lines.length||He(F[Z],"hide");if(X)for(var te=0;te<X.length;++te)X[te].lines.length&&He(X[te],"unhide");s.wrapper.offsetHeight&&(i.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&He(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function ca(e,n){if(e.curOp)return n();Va(e);try{return n()}finally{Xa(e)}}function Gr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Va(e);try{return n.apply(e,arguments)}finally{Xa(e)}}}function oa(e){return function(){if(this.curOp)return e.apply(this,arguments);Va(this);try{return e.apply(this,arguments)}finally{Xa(this)}}}function Yr(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Va(n);try{return e.apply(this,arguments)}finally{Xa(n)}}}function ta(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,P(jo,e))}function jo(e){var n=e.doc;if(n.highlightFrontier>=e.display.viewTo)return;var s=+new Date+e.options.workTime,i=Dn(e,n.highlightFrontier),p=[];n.iter(i.line,Math.min(n.first+n.size,e.display.viewTo+500),function(F){if(i.line>=e.display.viewFrom){var X=F.styles,Z=F.text.length>e.options.maxHighlightLength?Rr(n.mode,i.state):null,te=sn(e,F,i,!0);Z&&(i.state=Z),F.styles=te.styles;var de=F.styleClasses,De=te.classes;De?F.styleClasses=De:de&&(F.styleClasses=null);for(var Fe=!X||X.length!=F.styles.length||de!=De&&(!de||!De||de.bgClass!=De.bgClass||de.textClass!=De.textClass),it=0;!Fe&&it<X.length;++it)Fe=X[it]!=F.styles[it];Fe&&p.push(i.line),F.stateAfter=i.save(),i.nextLine()}else F.text.length<=e.options.maxHighlightLength&&hn(e,F.text,i),F.stateAfter=i.line%5==0?i.save():null,i.nextLine();if(+new Date>s)return ta(e,e.options.workDelay),!0}),n.highlightFrontier=i.line,n.modeFrontier=Math.max(n.modeFrontier,i.line),p.length&&ca(e,function(){for(var F=0;F<p.length;F++)ka(e,p[F],"text")})}var Ri=function(e,n,s){var i=e.display;this.viewport=n,this.visible=qi(i,e.doc,n),this.editorIsHidden=!i.wrapper.offsetWidth,this.wrapperHeight=i.wrapper.clientHeight,this.wrapperWidth=i.wrapper.clientWidth,this.oldDisplayWidth=ea(e),this.force=s,this.dims=Do(e),this.events=[]};Ri.prototype.signal=function(e,n){Oe(e,n)&&this.events.push(arguments)},Ri.prototype.finish=function(){for(var e=0;e<this.events.length;e++)He.apply(null,this.events[e])};function Ol(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=qr(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=qr(e)+"px",n.scrollbarsClipped=!0)}function Ps(e){if(e.hasFocus())return null;var n=M();if(!n||!E(e.display.lineDiv,n))return null;var s={activeElt:n};if(window.getSelection){var i=window.getSelection();i.anchorNode&&i.extend&&E(e.display.lineDiv,i.anchorNode)&&(s.anchorNode=i.anchorNode,s.anchorOffset=i.anchorOffset,s.focusNode=i.focusNode,s.focusOffset=i.focusOffset)}return s}function Si(e){if(!e||!e.activeElt||e.activeElt==M())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&E(document.body,e.anchorNode)&&E(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,i=e.doc;if(n.editorIsHidden)return Ma(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;Ns(e)&&(Ma(e),n.dims=Do(e));var p=i.first+i.size,F=Math.max(n.visible.from-e.options.viewportMargin,i.first),X=Math.min(p,n.visible.to+e.options.viewportMargin);s.viewFrom<F&&F-s.viewFrom<20&&(F=Math.max(i.first,s.viewFrom)),s.viewTo>X&&s.viewTo-X<20&&(X=Math.min(p,s.viewTo)),Ht&&(F=_n(e.doc,F),X=Qt(e.doc,X));var Z=F!=s.viewFrom||X!=s.viewTo||s.lastWrapHeight!=n.wrapperHeight||s.lastWrapWidth!=n.wrapperWidth;xl(e,F,X),s.viewOffset=Lt(nt(e.doc,s.viewFrom)),e.display.mover.style.top=s.viewOffset+"px";var te=Io(e);if(!Z&&te==0&&!n.force&&s.renderedView==s.view&&(s.updateLineNumbers==null||s.updateLineNumbers>=s.viewTo))return!1;var de=Ps(e);return te>4&&(s.lineDiv.style.display="none"),Rl(e,s.updateLineNumbers,n.dims),te>4&&(s.lineDiv.style.display=""),s.renderedView=s.view,Si(de),_(s.cursorDiv),_(s.selectionDiv),s.gutters.style.height=s.sizer.style.minHeight=0,Z&&(s.lastWrapHeight=n.wrapperHeight,s.lastWrapWidth=n.wrapperWidth,ta(e,400)),s.updateLineNumbers=null,!0}function Ls(e,n){for(var s=n.viewport,i=!0;;i=!1){if(!i||!e.options.lineWrapping||n.oldDisplayWidth==ea(e)){if(s&&s.top!=null&&(s={top:Math.min(e.doc.height+Kr(e.display)-Ea(e),s.top)}),n.visible=qi(e.display,e.doc,s),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else i&&(n.visible=qi(e.display,e.doc,s));if(!no(e,n))break;Ji(e);var p=oi(e);ti(e),Ua(e,p),$a(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 Ri(e,n);if(no(e,s)){Ji(e),Ls(e,s);var i=oi(e);ti(e),Ua(e,i),$a(e,i),s.finish()}}function Rl(e,n,s){var i=e.display,p=e.options.lineNumbers,F=i.lineDiv,X=F.firstChild;function Z(Tt){var Bt=Tt.nextSibling;return L&&c&&e.display.currentWheelTarget==Tt?Tt.style.display="none":Tt.parentNode.removeChild(Tt),Bt}for(var te=i.view,de=i.viewFrom,De=0;De<te.length;De++){var Fe=te[De];if(!Fe.hidden)if(!Fe.node||Fe.node.parentNode!=F){var it=_r(e,Fe,de,s);F.insertBefore(it,X)}else{for(;X!=Fe.node;)X=Z(X);var et=p&&n!=null&&n<=de&&Fe.lineNumber;Fe.changes&&(q(Fe.changes,"gutter")>-1&&(et=!1),Pn(e,Fe,de,s)),et&&(_(Fe.lineNumber),Fe.lineNumber.appendChild(document.createTextNode(Vt(e.options,de)))),X=Fe.node.nextSibling}de+=Fe.size}for(;X;)X=Z(X)}function Ai(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px"}function $a(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+qr(e)+"px"}function Is(e){var n=e.display,s=n.view;if(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))return;for(var i=Po(n)-n.scroller.scrollLeft+e.doc.scrollLeft,p=n.gutters.offsetWidth,F=i+"px",X=0;X<s.length;X++)if(!s[X].hidden){e.options.fixedGutter&&(s[X].gutter&&(s[X].gutter.style.left=F),s[X].gutterBackground&&(s[X].gutterBackground.style.left=F));var Z=s[X].alignable;if(Z)for(var te=0;te<Z.length;te++)Z[te].style.left=F}e.options.fixedGutter&&(n.gutters.style.left=i+p+"px")}function Ns(e){if(!e.options.lineNumbers)return!1;var n=e.doc,s=Vt(e.options,n.first+n.size-1),i=e.display;if(s.length!=i.lineNumChars){var p=i.measure.appendChild(d("div",[d("div",s)],"CodeMirror-linenumber CodeMirror-gutter-elt")),F=p.firstChild.offsetWidth,X=p.offsetWidth-F;return i.lineGutter.style.width="",i.lineNumInnerWidth=Math.max(F,i.lineGutter.offsetWidth-X)+1,i.lineNumWidth=i.lineNumInnerWidth+X,i.lineNumChars=i.lineNumInnerWidth?s.length:-1,i.lineGutter.style.width=i.lineNumWidth+"px",Ai(e.display),!0}return!1}function Ho(e,n){for(var s=[],i=!1,p=0;p<e.length;p++){var F=e[p],X=null;if(typeof F!="string"&&(X=F.style,F=F.className),F=="CodeMirror-linenumbers")if(n)i=!0;else continue;s.push({className:F,style:X})}return n&&!i&&s.push({className:"CodeMirror-linenumbers",style:null}),s}function Ko(e){var n=e.gutters,s=e.gutterSpecs;_(n),e.lineGutter=null;for(var i=0;i<s.length;++i){var p=s[i],F=p.className,X=p.style,Z=n.appendChild(d("div",null,"CodeMirror-gutter "+F));X&&(Z.style.cssText=X),F=="CodeMirror-linenumbers"&&(e.lineGutter=Z,Z.style.width=(e.lineNumWidth||1)+"px")}n.style.display=s.length?"":"none",Ai(e)}function Di(e){Ko(e.display),la(e),Is(e)}function Sl(e,n,s,i){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=y("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=y("div",[p.measure,p.lineMeasure,p.selectionDiv,p.cursorDiv,p.lineDiv],null,"position: relative; outline: none");var F=y("div",[p.lineSpace],"CodeMirror-lines");p.mover=d("div",[F],null,"position: relative"),p.sizer=d("div",[p.mover],"CodeMirror-sizer"),p.sizerWidth=null,p.heightForcer=d("div",null,null,"position: absolute; height: "+ie+"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"),z&&G<8&&(p.gutters.style.zIndex=-1,p.scroller.style.paddingRight=0),!L&&!(k&&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(i.gutters,i.lineNumbers),Ko(p),s.init(p)}var ui=0,pa=null;z?pa=-.53:k?pa=15:m?pa=-.7:h&&(pa=-1/3);function ks(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 ro(e){var n=ks(e);return n.x*=pa,n.y*=pa,n}function Ms(e,n){var s=ks(n),i=s.x,p=s.y,F=e.display,X=F.scroller,Z=X.scrollWidth>X.clientWidth,te=X.scrollHeight>X.clientHeight;if(!(i&&Z||p&&te))return;if(p&&c&&L){e:for(var de=n.target,De=F.view;de!=X;de=de.parentNode)for(var Fe=0;Fe<De.length;Fe++)if(De[Fe].node==de){e.display.currentWheelTarget=de;break e}}if(i&&!k&&!g&&pa!=null){p&&te&&ii(e,Math.max(0,X.scrollTop+p*pa)),Da(e,Math.max(0,X.scrollLeft+i*pa)),(!p||p&&te)&&le(n),F.wheelStartX=null;return}if(p&&pa!=null){var it=p*pa,et=e.doc.scrollTop,Tt=et+F.wrapper.clientHeight;it<0?et=Math.max(0,et+it-50):Tt=Math.min(e.doc.height,Tt+it+50),Wo(e,{top:et,bottom:Tt})}ui<20&&(F.wheelStartX==null?(F.wheelStartX=X.scrollLeft,F.wheelStartY=X.scrollTop,F.wheelDX=i,F.wheelDY=p,setTimeout(function(){if(F.wheelStartX==null)return;var Bt=X.scrollLeft-F.wheelStartX,Zt=X.scrollTop-F.wheelStartY,On=Zt&&F.wheelDY&&Zt/F.wheelDY||Bt&&F.wheelDX&&Bt/F.wheelDX;if(F.wheelStartX=F.wheelStartY=null,!On)return;pa=(pa*ui+On)/(ui+1),++ui},200)):(F.wheelDX+=i,F.wheelDY+=p))}var ma=function(e,n){this.ranges=e,this.primIndex=n};ma.prototype.primary=function(){return this.ranges[this.primIndex]},ma.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],i=e.ranges[n];if(!ge(s.anchor,i.anchor)||!ge(s.head,i.head))return!1}return!0},ma.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new kr(en(this.ranges[n].anchor),en(this.ranges[n].head));return new ma(e,this.primIndex)},ma.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},ma.prototype.contains=function(e,n){n||(n=e);for(var s=0;s<this.ranges.length;s++){var i=this.ranges[s];if(at(n,i.from())>=0&&at(e,i.to())<=0)return s}return-1};var kr=function(e,n){this.anchor=e,this.head=n};kr.prototype.from=function(){return ur(this.anchor,this.head)},kr.prototype.to=function(){return sr(this.anchor,this.head)},kr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Ta(e,n,s){var i=e&&e.options.selectionsMayTouch,p=n[s];n.sort(function(it,et){return at(it.from(),et.from())}),s=q(n,p);for(var F=1;F<n.length;F++){var X=n[F],Z=n[F-1],te=at(Z.to(),X.from());if(i&&!X.empty()?te>0:te>=0){var de=ur(Z.from(),X.from()),De=sr(Z.to(),X.to()),Fe=Z.empty()?X.from()==X.head:Z.from()==Z.head;F<=s&&--s,n.splice(--F,2,new kr(Fe?De:de,Fe?de:De))}}return new ma(n,s)}function Fa(e,n){return new ma([new kr(e,n||e)],0)}function Ya(e){return e.text?we(e.from.line+e.text.length-1,Y(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Us(e,n){if(at(e,n.from)<0)return e;if(at(e,n.to)<=0)return Ya(n);var s=e.line+n.text.length-(n.to.line-n.from.line)-1,i=e.ch;return e.line==n.to.line&&(i+=Ya(n).ch-n.to.ch),we(s,i)}function Pi(e,n){for(var s=[],i=0;i<e.sel.ranges.length;i++){var p=e.sel.ranges[i];s.push(new kr(Us(p.anchor,n),Us(p.head,n)))}return Ta(e.cm,s,e.sel.primIndex)}function di(e,n,s){return e.line==n.line?we(s.line,e.ch-n.ch+s.ch):we(s.line+(e.line-n.line),e.ch)}function Al(e,n,s){for(var i=[],p=we(e.first,0),F=p,X=0;X<n.length;X++){var Z=n[X],te=di(Z.from,p,F),de=di(Ya(Z),p,F);if(p=Z.to,F=de,s=="around"){var De=e.sel.ranges[X],Fe=at(De.head,De.anchor)<0;i[X]=new kr(Fe?de:te,Fe?te:de)}else i[X]=new kr(te,te)}return new ma(i,e.sel.primIndex)}function Li(e){e.doc.mode=Ln(e.options,e.doc.modeOption),Ii(e)}function Ii(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,ta(e,100),e.state.modeGen++,e.curOp&&la(e)}function Fs(e,n){return n.from.ch==0&&n.to.ch==0&&Y(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Go(e,n,s,i){function p(Xn){return s?s[Xn]:null}function F(Xn,Rn,ar){tn(Xn,Rn,ar,i),Ut(Xn,"change",Xn,n)}function X(Xn,Rn){for(var ar=[],Cr=Xn;Cr<Rn;++Cr)ar.push(new rn(de[Cr],p(Cr),i));return ar}var Z=n.from,te=n.to,de=n.text,De=nt(e,Z.line),Fe=nt(e,te.line),it=Y(de),et=p(de.length-1),Tt=te.line-Z.line;if(n.full)e.insert(0,X(0,de.length)),e.remove(de.length,e.size-de.length);else if(Fs(e,n)){var Bt=X(0,de.length-1);F(Fe,Fe.text,et),Tt&&e.remove(Z.line,Tt),Bt.length&&e.insert(Z.line,Bt)}else if(De==Fe)if(de.length==1)F(De,De.text.slice(0,Z.ch)+it+De.text.slice(te.ch),et);else{var Zt=X(1,de.length-1);Zt.push(new rn(it+De.text.slice(te.ch),et,i)),F(De,De.text.slice(0,Z.ch)+de[0],p(0)),e.insert(Z.line+1,Zt)}else if(de.length==1)F(De,De.text.slice(0,Z.ch)+de[0]+Fe.text.slice(te.ch),p(0)),e.remove(Z.line+1,Tt);else{F(De,De.text.slice(0,Z.ch)+de[0],p(0)),F(Fe,it+Fe.text.slice(te.ch),et);var On=X(1,de.length-1);Tt>1&&e.remove(Z.line+1,Tt-1),e.insert(Z.line+1,On)}Ut(e,"change",e,n)}function wa(e,n,s){function i(p,F,X){if(p.linked)for(var Z=0;Z<p.linked.length;++Z){var te=p.linked[Z];if(te.doc==F)continue;var de=X&&te.sharedHist;if(s&&!de)continue;n(te.doc,de),i(te.doc,p,de)}}i(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),Li(e),Bs(e),e.options.lineWrapping||Gt(e),e.options.mode=n.modeOption,la(e)}function Bs(e){(e.doc.direction=="rtl"?N:b)(e.display.lineDiv,"CodeMirror-rtl")}function Dl(e){ca(e,function(){Bs(e),la(e)})}function ao(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:en(n.from),to:Ya(n),text:ke(e,n.from,n.to)};return Xo(e,s,n.from.line,n.to.line+1),wa(e,function(i){return Xo(i,s,n.from.line,n.to.line+1)},!0),s}function js(e){for(;e.length;){var n=Y(e);if(n.ranges)e.pop();else break}}function Pl(e,n){if(n)return js(e.done),Y(e.done);if(e.done.length&&!Y(e.done).ranges)return Y(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),Y(e.done)}function Ws(e,n,s,i){var p=e.history;p.undone.length=0;var F=+new Date,X,Z;if((p.lastOp==i||p.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&p.lastModTime>F-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(X=Pl(p,p.lastOp==i)))Z=Y(X.changes),at(n.from,n.to)==0&&at(n.from,Z.to)==0?Z.to=Ya(n):X.changes.push(Vo(e,n));else{var te=Y(p.done);for((!te||!te.ranges)&&oo(e.sel,p.done),X={changes:[Vo(e,n)],generation:p.generation},p.done.push(X);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=F,p.lastOp=p.lastSelOp=i,p.lastOrigin=p.lastSelOrigin=n.origin,Z||He(e,"historyAdded")}function Ll(e,n,s,i){var p=n.charAt(0);return p=="*"||p=="+"&&s.ranges.length==i.ranges.length&&s.somethingSelected()==i.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function io(e,n,s,i){var p=e.history,F=i&&i.origin;s==p.lastSelOp||F&&p.lastSelOrigin==F&&(p.lastModTime==p.lastSelTime&&p.lastOrigin==F||Ll(e,F,Y(p.done),n))?p.done[p.done.length-1]=n:oo(n,p.done),p.lastSelTime=+new Date,p.lastSelOrigin=F,p.lastSelOp=s,i&&i.clearRedo!==!1&&js(p.undone)}function oo(e,n){var s=Y(n);s&&s.ranges&&s.equals(e)||n.push(e)}function Xo(e,n,s,i){var p=n["spans_"+e.id],F=0;e.iter(Math.max(e.first,s),Math.min(e.first+e.size,i),function(X){X.markedSpans&&((p||(p=n["spans_"+e.id]={}))[F]=X.markedSpans),++F})}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 i=[],p=0;p<n.text.length;++p)i.push(so(s[p]));return i}function $o(e,n){var s=Hs(e,n),i=In(e,n);if(!s)return i;if(!i)return s;for(var p=0;p<s.length;++p){var F=s[p],X=i[p];if(F&&X){e:for(var Z=0;Z<X.length;++Z){for(var te=X[Z],de=0;de<F.length;++de)if(F[de].marker==te.marker)continue e;F.push(te)}}else X&&(s[p]=X)}return s}function ci(e,n,s){for(var i=[],p=0;p<e.length;++p){var F=e[p];if(F.ranges){i.push(s?ma.prototype.deepCopy.call(F):F);continue}var X=F.changes,Z=[];i.push({changes:Z});for(var te=0;te<X.length;++te){var de=X[te],De=void 0;if(Z.push({from:de.from,to:de.to,text:de.text}),n)for(var Fe in de)(De=Fe.match(/^spans_(\d+)$/))&&(q(n,Number(De[1]))>-1&&(Y(Z)[Fe]=de[Fe],delete de[Fe]))}}return i}function lo(e,n,s,i){if(i){var p=e.anchor;if(s){var F=at(n,p)<0;F!=at(s,p)<0?(p=n,n=s):F!=at(n,s)<0&&(n=s)}return new kr(p,n)}else return new kr(s||n,n)}function uo(e,n,s,i,p){p==null&&(p=e.cm&&(e.cm.display.shift||e.extend)),na(e,new ma([lo(e.sel.primary(),n,s,p)],0),i)}function Ks(e,n,s){for(var i=[],p=e.cm&&(e.cm.display.shift||e.extend),F=0;F<e.sel.ranges.length;F++)i[F]=lo(e.sel.ranges[F],n[F],null,p);var X=Ta(e.cm,i,e.sel.primIndex);na(e,X,s)}function Ba(e,n,s,i){var p=e.sel.ranges.slice(0);p[n]=s,na(e,Ta(e.cm,p,e.sel.primIndex),i)}function Gs(e,n,s,i){na(e,Fa(n,s),i)}function Il(e,n,s){var i={ranges:n.ranges,update:function(p){this.ranges=[];for(var F=0;F<p.length;F++)this.ranges[F]=new kr(Ft(e,p[F].anchor),Ft(e,p[F].head))},origin:s&&s.origin};return He(e,"beforeSelectionChange",e,i),e.cm&&He(e.cm,"beforeSelectionChange",e.cm,i),i.ranges!=n.ranges?Ta(e.cm,i.ranges,i.ranges.length-1):n}function zs(e,n,s){var i=e.history.done,p=Y(i);p&&p.ranges?(i[i.length-1]=n,fi(e,n,s)):na(e,n,s)}function na(e,n,s){fi(e,n,s),io(e,e.sel,e.cm?e.cm.curOp.id:NaN,s)}function fi(e,n,s){(Oe(e,"beforeSelectionChange")||e.cm&&Oe(e.cm,"beforeSelectionChange"))&&(n=Il(e,n,s));var i=s&&s.bias||(at(n.primary().head,e.sel.primary().head)<0?-1:1);Vs(e,$s(e,n,i,!0)),!(s&&s.scroll===!1)&&e.cm&&ri(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,Pe(e.cm)),Ut(e,"cursorActivity",e)}function Xs(e){Vs(e,$s(e,e.sel,null,!1))}function $s(e,n,s,i){for(var p,F=0;F<n.ranges.length;F++){var X=n.ranges[F],Z=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[F],te=co(e,X.anchor,Z&&Z.anchor,s,i),de=co(e,X.head,Z&&Z.head,s,i);(p||te!=X.anchor||de!=X.head)&&(p||(p=n.ranges.slice(0,F)),p[F]=new kr(te,de))}return p?Ta(e.cm,p,n.primIndex):n}function hi(e,n,s,i,p){var F=nt(e,n.line);if(F.markedSpans)for(var X=0;X<F.markedSpans.length;++X){var Z=F.markedSpans[X],te=Z.marker,de="selectLeft"in te?!te.selectLeft:te.inclusiveLeft,De="selectRight"in te?!te.selectRight:te.inclusiveRight;if((Z.from==null||(de?Z.from<=n.ch:Z.from<n.ch))&&(Z.to==null||(De?Z.to>=n.ch:Z.to>n.ch))){if(p&&(He(te,"beforeCursorEnter"),te.explicitlyCleared))if(F.markedSpans){--X;continue}else break;if(!te.atomic)continue;if(s){var Fe=te.find(i<0?1:-1),it=void 0;if((i<0?De:de)&&(Fe=Ys(e,Fe,-i,Fe&&Fe.line==n.line?F:null)),Fe&&Fe.line==n.line&&(it=at(Fe,s))&&(i<0?it<0:it>0))return hi(e,Fe,n,i,p)}var et=te.find(i<0?-1:1);return(i<0?de:De)&&(et=Ys(e,et,i,et.line==n.line?F:null)),et?hi(e,et,n,i,p):null}}return n}function co(e,n,s,i,p){var F=i||1,X=hi(e,n,s,F,p)||!p&&hi(e,n,s,F,!0)||hi(e,n,s,-F,p)||!p&&hi(e,n,s,-F,!0);return X||(e.cantEdit=!0,we(e.first,0))}function Ys(e,n,s,i){return s<0&&n.ch==0?n.line>e.first?Ft(e,we(n.line-1)):null:s>0&&n.ch==(i||nt(e,n.line)).text.length?n.line<e.first+e.size-1?we(n.line+1,0):null:new we(n.line,n.ch+s)}function Qs(e){e.setSelection(we(e.firstLine(),0),we(e.lastLine()),ve)}function Yo(e,n,s){var i={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return i.canceled=!0}};return s&&(i.update=function(p,F,X,Z){p&&(i.from=Ft(e,p)),F&&(i.to=Ft(e,F)),X&&(i.text=X),Z!==void 0&&(i.origin=Z)}),He(e,"beforeChange",e,i),e.cm&&He(e.cm,"beforeChange",e.cm,i),i.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:i.from,to:i.to,text:i.text,origin:i.origin}}function pi(e,n,s){if(e.cm){if(!e.cm.curOp)return Gr(e.cm,pi)(e,n,s);if(e.cm.state.suppressEdits)return}if((Oe(e,"beforeChange")||e.cm&&Oe(e.cm,"beforeChange"))&&(n=Yo(e,n,!0),!n))return;var i=Xt&&!s&&qn(e,n.from,n.to);if(i)for(var p=i.length-1;p>=0;--p)Js(e,{from:i[p].from,to:i[p].to,text:p?[""]:n.text,origin:n.origin});else Js(e,n)}function Js(e,n){if(n.text.length==1&&n.text[0]==""&&at(n.from,n.to)==0)return;var s=Pi(e,n);Ws(e,n,s,e.cm?e.cm.curOp.id:NaN),mi(e,n,s,In(e,n));var i=[];wa(e,function(p,F){!F&&q(i,p.history)==-1&&(tl(p.history,n),i.push(p.history)),mi(p,n,null,In(p,n))})}function fo(e,n,s){var i=e.cm&&e.cm.state.suppressEdits;if(i&&!s)return;for(var p=e.history,F,X=e.sel,Z=n=="undo"?p.done:p.undone,te=n=="undo"?p.undone:p.done,de=0;de<Z.length&&!(F=Z[de],s?F.ranges&&!F.equals(e.sel):!F.ranges);de++);if(de==Z.length)return;for(p.lastOrigin=p.lastSelOrigin=null;;)if(F=Z.pop(),F.ranges){if(oo(F,te),s&&!F.equals(e.sel)){na(e,F,{clearRedo:!1});return}X=F}else if(i){Z.push(F);return}else break;var De=[];oo(X,te),te.push({changes:De,generation:p.generation}),p.generation=F.generation||++p.maxGeneration;for(var Fe=Oe(e,"beforeChange")||e.cm&&Oe(e.cm,"beforeChange"),it=function(Bt){var Zt=F.changes[Bt];if(Zt.origin=n,Fe&&!Yo(e,Zt,!1))return Z.length=0,{};De.push(Vo(e,Zt));var On=Bt?Pi(e,Zt):Y(Z);mi(e,Zt,On,$o(e,Zt)),!Bt&&e.cm&&e.cm.scrollIntoView({from:Zt.from,to:Ya(Zt)});var Xn=[];wa(e,function(Rn,ar){!ar&&q(Xn,Rn.history)==-1&&(tl(Rn.history,Zt),Xn.push(Rn.history)),mi(Rn,Zt,null,$o(Rn,Zt))})},et=F.changes.length-1;et>=0;--et){var Tt=it(et);if(Tt)return Tt.v}}function qs(e,n){if(n==0)return;if(e.first+=n,e.sel=new ma(oe(e.sel.ranges,function(p){return new kr(we(p.anchor.line+n,p.anchor.ch),we(p.head.line+n,p.head.ch))}),e.sel.primIndex),e.cm){la(e.cm,e.first,e.first-n,n);for(var s=e.cm.display,i=s.viewFrom;i<s.viewTo;i++)ka(e.cm,i,"gutter")}}function mi(e,n,s,i){if(e.cm&&!e.cm.curOp)return Gr(e.cm,mi)(e,n,s,i);if(n.to.line<e.first){qs(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);qs(e,p),n={from:we(e.first,0),to:we(n.to.line+p,n.to.ch),text:[Y(n.text)],origin:n.origin}}var F=e.lastLine();n.to.line>F&&(n={from:n.from,to:we(F,nt(e,F).text.length),text:[n.text[0]],origin:n.origin}),n.removed=ke(e,n.from,n.to),s||(s=Pi(e,n)),e.cm?Nl(e.cm,n,i):Go(e,n,i),fi(e,s,ve),e.cantEdit&&co(e,we(e.firstLine(),0))&&(e.cantEdit=!1)}function Nl(e,n,s){var i=e.doc,p=e.display,F=n.from,X=n.to,Z=!1,te=F.line;e.options.lineWrapping||(te=me(Sn(nt(i,F.line))),i.iter(te,X.line+1,function(et){if(et==p.maxLine)return Z=!0,!0})),i.sel.contains(n.from,n.to)>-1&&Pe(e),Go(i,n,s,_s(e)),e.options.lineWrapping||(i.iter(te,F.line+n.text.length,function(et){var Tt=wt(et);Tt>p.maxLineLength&&(p.maxLine=et,p.maxLineLength=Tt,p.maxLineChanged=!0,Z=!1)}),Z&&(e.curOp.updateMaxLine=!0)),Nt(i,F.line),ta(e,400);var de=n.text.length-(X.line-F.line)-1;n.full?la(e):F.line==X.line&&n.text.length==1&&!Fs(e.doc,n)?ka(e,F.line,"text"):la(e,F.line,X.line+1,de);var De=Oe(e,"changes"),Fe=Oe(e,"change");if(Fe||De){var it={from:F,to:X,text:n.text,removed:n.removed,origin:n.origin};Fe&&Ut(e,"change",e,it),De&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(it)}e.display.selForContextMenu=null}function vi(e,n,s,i,p){var F;i||(i=s),at(i,s)<0&&(F=[i,s],s=F[0],i=F[1]),typeof n=="string"&&(n=e.splitLines(n)),pi(e,{from:s,to:i,text:n,origin:p})}function Zs(e,n,s,i){s<e.line?e.line+=i:n<e.line&&(e.line=n,e.ch=0)}function el(e,n,s,i){for(var p=0;p<e.length;++p){var F=e[p],X=!0;if(F.ranges){F.copied||(F=e[p]=F.deepCopy(),F.copied=!0);for(var Z=0;Z<F.ranges.length;Z++)Zs(F.ranges[Z].anchor,n,s,i),Zs(F.ranges[Z].head,n,s,i);continue}for(var te=0;te<F.changes.length;++te){var de=F.changes[te];if(s<de.from.line)de.from=we(de.from.line+i,de.from.ch),de.to=we(de.to.line+i,de.to.ch);else if(n<=de.to.line){X=!1;break}}X||(e.splice(0,p+1),p=0)}}function tl(e,n){var s=n.from.line,i=n.to.line,p=n.text.length-(i-s)-1;el(e.done,s,i,p),el(e.undone,s,i,p)}function Ni(e,n,s,i){var p=n,F=n;return typeof n=="number"?F=nt(e,Wn(e,n)):p=me(n),p==null?null:(i(F,p)&&e.cm&&ka(e.cm,p,s),F)}function ja(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}ja.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var s=e,i=e+n;s<i;++s){var p=this.lines[s];this.height-=p.height,st(p),Ut(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 i=0;i<n.length;++i)n[i].parent=this},iterN:function(e,n,s){for(var i=e+n;e<i;++e)if(s(this.lines[e]))return!0}};function gi(e){this.children=e;for(var n=0,s=0,i=0;i<e.length;++i){var p=e[i];n+=p.chunkSize(),s+=p.height,p.parent=this}this.size=n,this.height=s,this.parent=null}gi.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var s=0;s<this.children.length;++s){var i=this.children[s],p=i.chunkSize();if(e<p){var F=Math.min(n,p-e),X=i.height;if(i.removeInner(e,F),this.height-=X-i.height,p==F&&(this.children.splice(s--,1),i.parent=null),(n-=F)==0)break;e=0}else e-=p}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof ja))){var Z=[];this.collapse(Z),this.children=[new ja(Z)],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 i=0;i<this.children.length;++i){var p=this.children[i],F=p.chunkSize();if(e<=F){if(p.insertInner(e,n,s),p.lines&&p.lines.length>50){for(var X=p.lines.length%25+25,Z=X;Z<p.lines.length;){var te=new ja(p.lines.slice(Z,Z+=25));p.height-=te.height,this.children.splice(++i,0,te),te.parent=this}p.lines=p.lines.slice(0,X),this.maybeSpill()}break}e-=F}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var n=e.children.splice(e.children.length-5,5),s=new gi(n);if(e.parent){e.size-=s.size,e.height-=s.height;var p=q(e.parent.children,e);e.parent.children.splice(p+1,0,s)}else{var i=new gi(e.children);i.parent=e,e.children=[i,s],e=i}s.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,n,s){for(var i=0;i<this.children.length;++i){var p=this.children[i],F=p.chunkSize();if(e<F){var X=Math.min(n,F-e);if(p.iterN(e,X,s))return!0;if((n-=X)==0)break;e=0}else e-=F}}};var ki=function(e,n,s){if(s)for(var i in s)s.hasOwnProperty(i)&&(this[i]=s[i]);this.doc=e,this.node=n};ki.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,s=this.line,i=me(s);if(i==null||!n)return;for(var p=0;p<n.length;++p)n[p]==this&&n.splice(p--,1);n.length||(s.widgets=null);var F=Ur(this);Ae(s,Math.max(0,s.height-F)),e&&(ca(e,function(){nl(e,s,-F),ka(e,i,"widget")}),Ut(e,"lineWidgetCleared",e,this,i))},ki.prototype.changed=function(){var e=this,n=this.height,s=this.doc.cm,i=this.line;this.height=null;var p=Ur(this)-n;if(!p)return;yt(this.doc,i)||Ae(i,i.height+p),s&&ca(s,function(){s.curOp.forceUpdate=!0,nl(s,i,p),Ut(s,"lineWidgetChanged",s,e,me(i))})},Ce(ki);function nl(e,n,s){Lt(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&eo(e,s)}function kl(e,n,s,i){var p=new ki(e,s,i),F=e.cm;return F&&p.noHScroll&&(F.display.alignWidgets=!0),Ni(e,n,"widget",function(X){var Z=X.widgets||(X.widgets=[]);if(p.insertAt==null?Z.push(p):Z.splice(Math.min(Z.length-1,Math.max(0,p.insertAt)),0,p),p.line=X,F&&!yt(e,X)){var te=Lt(X)<e.scrollTop;Ae(X,X.height+Ur(p)),te&&eo(F,p.height),F.curOp.forceUpdate=!0}return!0}),F&&Ut(F,"lineWidgetAdded",F,p,typeof n=="number"?n:me(n)),p}var rl=0,ba=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++rl};ba.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,n=e&&!e.curOp;if(n&&Va(e),Oe(this,"clear")){var s=this.find();s&&Ut(this,"clear",s.from,s.to)}for(var i=null,p=null,F=0;F<this.lines.length;++F){var X=this.lines[F],Z=pn(X.markedSpans,this);e&&!this.collapsed?ka(e,me(X),"text"):e&&(Z.to!=null&&(p=me(X)),Z.from!=null&&(i=me(X))),X.markedSpans=Gn(X.markedSpans,Z),Z.from==null&&this.collapsed&&!yt(this.doc,X)&&e&&Ae(X,qa(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var te=0;te<this.lines.length;++te){var de=Sn(this.lines[te]),De=wt(de);De>e.display.maxLineLength&&(e.display.maxLine=de,e.display.maxLineLength=De,e.display.maxLineChanged=!0)}i!=null&&e&&this.collapsed&&la(e,i,p+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xs(e.doc)),e&&Ut(e,"markerCleared",e,this,i,p),n&&Xa(e),this.parent&&this.parent.clear()},ba.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var s,i,p=0;p<this.lines.length;++p){var F=this.lines[p],X=pn(F.markedSpans,this);if(X.from!=null&&(s=we(n?F:me(F),X.from),e==-1))return s;if(X.to!=null&&(i=we(n?F:me(F),X.to),e==1))return i}return s&&{from:s,to:i}},ba.prototype.changed=function(){var e=this,n=this.find(-1,!0),s=this,i=this.doc.cm;if(!n||!i)return;ca(i,function(){var p=n.line,F=me(n.line),X=Ka(i,F);if(X&&(fs(X),i.curOp.selectionChanged=i.curOp.forceUpdate=!0),i.curOp.updateMaxLine=!0,!yt(s.doc,p)&&s.height!=null){var Z=s.height;s.height=null;var te=Ur(s)-Z;te&&Ae(p,p.height+te)}Ut(i,"markerChanged",i,e)})},ba.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||q(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},ba.prototype.detachLine=function(e){if(this.lines.splice(q(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Ce(ba);function _i(e,n,s,i,p){if(i&&i.shared)return Ml(e,n,s,i,p);if(e.cm&&!e.cm.curOp)return Gr(e.cm,_i)(e,n,s,i,p);var F=new ba(e,p),X=at(n,s);if(i&&x(i,F,!1),X>0||X==0&&F.clearWhenEmpty!==!1)return F;if(F.replacedWith&&(F.collapsed=!0,F.widgetNode=y("span",[F.replacedWith],"CodeMirror-widget"),i.handleMouseEvents||F.widgetNode.setAttribute("cm-ignore-events","true"),i.insertLeft&&(F.widgetNode.insertLeft=!0)),F.collapsed){if(gr(e,n.line,n,s,F)||n.line!=s.line&&gr(e,s.line,n,s,F))throw new Error("Inserting collapsed marker partially overlapping an existing one");Qn()}F.addToHistory&&Ws(e,{from:n,to:s,origin:"markText"},e.sel,NaN);var Z=n.line,te=e.cm,de;if(e.iter(Z,s.line+1,function(Fe){te&&F.collapsed&&!te.options.lineWrapping&&Sn(Fe)==te.display.maxLine&&(de=!0),F.collapsed&&Z!=n.line&&Ae(Fe,0),dn(Fe,new An(F,Z==n.line?n.ch:null,Z==s.line?s.ch:null)),++Z}),F.collapsed&&e.iter(n.line,s.line+1,function(Fe){yt(e,Fe)&&Ae(Fe,0)}),F.clearOnEnter&&je(F,"beforeCursorEnter",function(){return F.clear()}),F.readOnly&&(Ot(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),F.collapsed&&(F.id=++rl,F.atomic=!0),te){if(de&&(te.curOp.updateMaxLine=!0),F.collapsed)la(te,n.line,s.line+1);else if(F.className||F.startStyle||F.endStyle||F.css||F.attributes||F.title)for(var De=n.line;De<=s.line;De++)ka(te,De,"text");F.atomic&&Xs(te.doc),Ut(te,"markerAdded",te,F)}return F}var Ei=function(e,n){this.markers=e,this.primary=n;for(var s=0;s<e.length;++s)e[s].parent=this};Ei.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Ut(this,"clear")},Ei.prototype.find=function(e,n){return this.primary.find(e,n)},Ce(Ei);function Ml(e,n,s,i,p){i=x(i),i.shared=!1;var F=[_i(e,n,s,i,p)],X=F[0],Z=i.widgetNode;return wa(e,function(te){Z&&(i.widgetNode=Z.cloneNode(!0)),F.push(_i(te,Ft(te,n),Ft(te,s),i,p));for(var de=0;de<te.linked.length;++de)if(te.linked[de].isParent)return;X=Y(F)}),new Ei(F,X)}function al(e){return e.findMarks(we(e.first,0),e.clipPos(we(e.lastLine())),function(n){return n.parent})}function au(e,n){for(var s=0;s<n.length;s++){var i=n[s],p=i.find(),F=e.clipPos(p.from),X=e.clipPos(p.to);if(at(F,X)){var Z=_i(e,F,X,i.primary,i.primary.type);i.markers.push(Z),Z.parent=i}}}function Ul(e){for(var n=function(i){var p=e[i],F=[p.primary.doc];wa(p.primary.doc,function(te){return F.push(te)});for(var X=0;X<p.markers.length;X++){var Z=p.markers[X];q(F,Z.doc)==-1&&(Z.parent=null,p.markers.splice(X--,1))}},s=0;s<e.length;s++)n(s)}var Qo=0,ua=function(e,n,s,i,p){if(!(this instanceof ua))return new ua(e,n,s,i,p);s==null&&(s=0),gi.call(this,[new ja([new rn("",null)])]),this.first=s,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=s;var F=we(s,0);this.sel=Fa(F),this.history=new ao(null),this.id=++Qo,this.modeOption=n,this.lineSep=i,this.direction=p=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Go(this,{from:F,to:F,text:e}),na(this,Fa(F),ve)};ua.prototype=Ge(gi.prototype,{constructor:ua,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,i=0;i<n.length;++i)s+=n[i].height;this.insertInner(e-this.first,n,s)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=xt(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Yr(function(e){var n=we(this.first,0),s=this.first+this.size-1;pi(this,{from:n,to:we(s,nt(this,s).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ai(this.cm,0,0),na(this,Fa(n),ve)}),replaceRange:function(e,n,s,i){n=Ft(this,n),s=s?Ft(this,s):n,vi(this,e,n,s,i)},getRange:function(e,n,s){var i=ke(this,Ft(this,e),Ft(this,n));return s===!1?i:i.join(s||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(ir(this,e))return nt(this,e)},getLineNumber:function(e){return me(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=nt(this,e)),Sn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return Ft(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:Yr(function(e,n,s){Gs(this,Ft(this,typeof e=="number"?we(e,n||0):e),null,s)}),setSelection:Yr(function(e,n,s){Gs(this,Ft(this,e),Ft(this,n||e),s)}),extendSelection:Yr(function(e,n,s){uo(this,Ft(this,e),n&&Ft(this,n),s)}),extendSelections:Yr(function(e,n){Ks(this,ot(this,e),n)}),extendSelectionsBy:Yr(function(e,n){var s=oe(this.sel.ranges,e);Ks(this,ot(this,s),n)}),setSelections:Yr(function(e,n,s){if(!e.length)return;for(var i=[],p=0;p<e.length;p++)i[p]=new kr(Ft(this,e[p].anchor),Ft(this,e[p].head));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),na(this,Ta(this.cm,i,n),s)}),addSelection:Yr(function(e,n,s){var i=this.sel.ranges.slice(0);i.push(new kr(Ft(this,e),Ft(this,n||e))),na(this,Ta(this.cm,i,i.length-1),s)}),getSelection:function(e){for(var n=this.sel.ranges,s,i=0;i<n.length;i++){var p=ke(this,n[i].from(),n[i].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,i=0;i<s.length;i++){var p=ke(this,s[i].from(),s[i].to());e!==!1&&(p=p.join(e||this.lineSeparator())),n[i]=p}return n},replaceSelection:function(e,n,s){for(var i=[],p=0;p<this.sel.ranges.length;p++)i[p]=e;this.replaceSelections(i,n,s||"+input")},replaceSelections:Yr(function(e,n,s){for(var i=[],p=this.sel,F=0;F<p.ranges.length;F++){var X=p.ranges[F];i[F]={from:X.from(),to:X.to(),text:this.splitLines(e[F]),origin:s}}for(var Z=n&&n!="end"&&Al(this,i,n),te=i.length-1;te>=0;te--)pi(this,i[te]);Z?zs(this,Z):this.cm&&ri(this.cm)}),undo:Yr(function(){fo(this,"undo")}),redo:Yr(function(){fo(this,"redo")}),undoSelection:Yr(function(){fo(this,"undo",!0)}),redoSelection:Yr(function(){fo(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,i=0;i<e.done.length;i++)e.done[i].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 ao(this.history.maxGeneration),wa(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:ci(this.history.done),undone:ci(this.history.undone)}},setHistory:function(e){var n=this.history=new ao(this.history.maxGeneration);n.done=ci(e.done.slice(0),null,!0),n.undone=ci(e.undone.slice(0),null,!0)},setGutterMarker:Yr(function(e,n,s){return Ni(this,e,"gutter",function(i){var p=i.gutterMarkers||(i.gutterMarkers={});return p[n]=s,!s&&_t(p)&&(i.gutterMarkers=null),!0})}),clearGutter:Yr(function(e){var n=this;this.iter(function(s){s.gutterMarkers&&s.gutterMarkers[e]&&Ni(n,s,"gutter",function(){return s.gutterMarkers[e]=null,_t(s.gutterMarkers)&&(s.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!ir(this,e))return null;if(n=e,e=nt(this,e),!e)return null}else if(n=me(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:Yr(function(e,n,s){return Ni(this,e,n=="gutter"?"gutter":"class",function(i){var p=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!i[p])i[p]=s;else{if(R(s).test(i[p]))return!1;i[p]+=" "+s}return!0})}),removeLineClass:Yr(function(e,n,s){return Ni(this,e,n=="gutter"?"gutter":"class",function(i){var p=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",F=i[p];if(F)if(s==null)i[p]=null;else{var X=F.match(R(s));if(!X)return!1;var Z=X.index+X[0].length;i[p]=F.slice(0,X.index)+(!X.index||Z==F.length?"":" ")+F.slice(Z)||null}else return!1;return!0})}),addLineWidget:Yr(function(e,n,s){return kl(this,e,n,s)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,s){return _i(this,Ft(this,e),Ft(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=Ft(this,e),_i(this,e,e,s,"bookmark")},findMarksAt:function(e){e=Ft(this,e);var n=[],s=nt(this,e.line).markedSpans;if(s)for(var i=0;i<s.length;++i){var p=s[i];(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=Ft(this,e),n=Ft(this,n);var i=[],p=e.line;return this.iter(e.line,n.line+1,function(F){var X=F.markedSpans;if(X)for(var Z=0;Z<X.length;Z++){var te=X[Z];!(te.to!=null&&p==e.line&&e.ch>=te.to||te.from==null&&p!=e.line||te.from!=null&&p==n.line&&te.from>=n.ch)&&(!s||s(te.marker))&&i.push(te.marker.parent||te.marker)}++p}),i},getAllMarks:function(){var e=[];return this.iter(function(n){var s=n.markedSpans;if(s)for(var i=0;i<s.length;++i)s[i].from!=null&&e.push(s[i].marker)}),e},posFromIndex:function(e){var n,s=this.first,i=this.lineSeparator().length;return this.iter(function(p){var F=p.text.length+i;if(F>e)return n=e,!0;e-=F,++s}),Ft(this,we(s,n))},indexFromPos:function(e){e=Ft(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(i){n+=i.text.length+s}),n},copy:function(e){var n=new ua(xt(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 i=new ua(xt(this,n,s),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(i.history=this.history),(this.linked||(this.linked=[])).push({doc:i,sharedHist:e.sharedHist}),i.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],au(i,al(this)),i},unlinkDoc:function(e){if(e instanceof Hr&&(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(al(this));break}if(e.history==this.history){var i=[e.id];wa(e,function(p){return i.push(p.id)},!0),e.history=new ao(null),e.history.done=ci(this.history.done,i),e.history.undone=ci(this.history.undone,i)}},iterLinkedDocs:function(e){wa(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):on(e)},lineSeparator:function(){return this.lineSep||`
`},setDirection:Yr(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)})}),ua.prototype.eachLine=ua.prototype.iter;var il=0;function Fl(e){var n=this;if(Jo(n),lt(n,e)||Ir(n.display,e))return;le(e),z&&(il=+new Date);var s=Ga(n,e,!0),i=e.dataTransfer.files;if(!s||n.isReadOnly())return;if(i&&i.length&&window.FileReader&&window.File)for(var p=i.length,F=Array(p),X=0,Z=function(){++X==p&&Gr(n,function(){s=Ft(n.doc,s);var et={from:s,to:s,text:n.doc.splitLines(F.filter(function(Tt){return Tt!=null}).join(n.doc.lineSeparator())),origin:"paste"};pi(n.doc,et),zs(n.doc,Fa(Ft(n.doc,s),Ft(n.doc,Ya(et))))})()},te=function(et,Tt){if(n.options.allowDropFileTypes&&q(n.options.allowDropFileTypes,et.type)==-1){Z();return}var Bt=new FileReader;Bt.onerror=function(){return Z()},Bt.onload=function(){var Zt=Bt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Zt)){Z();return}F[Tt]=Zt,Z()},Bt.readAsText(et)},de=0;de<i.length;de++)te(i[de],de);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 De=e.dataTransfer.getData("Text");if(De){var Fe;if(n.state.draggingText&&!n.state.draggingText.copy&&(Fe=n.listSelections()),fi(n.doc,Fa(s,s)),Fe)for(var it=0;it<Fe.length;++it)vi(n.doc,"",Fe[it].anchor,Fe[it].head,"drag");n.replaceSelection(De,"around","paste"),n.display.input.focus()}}catch(et){}}}function ol(e,n){if(z&&(!e.state.draggingText||+new Date-il<100)){ae(n);return}if(lt(e,n)||Ir(e.display,n))return;if(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!h){var s=d("img",null,null,"position: fixed; left: 0; top: 0;");s.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(s.width=s.height=1,e.display.wrapper.appendChild(s),s._top=s.offsetTop),n.dataTransfer.setDragImage(s,0,0),g&&s.parentNode.removeChild(s)}}function Bl(e,n){var s=Ga(e,n);if(!s)return;var i=document.createDocumentFragment();Es(e,s,i),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,i)}function Jo(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=[],i=0;i<n.length;i++){var p=n[i].CodeMirror;p&&s.push(p)}s.length&&s[0].operation(function(){for(var F=0;F<s.length;F++)e(s[F])})}var qo=!1;function iu(){if(qo)return;Zo(),qo=!0}function Zo(){var e;je(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,sl(jl)},100))}),je(window,"blur",function(){return sl(ni)})}function jl(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var Wa={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"},Mi=0;Mi<10;Mi++)Wa[Mi+48]=Wa[Mi+96]=String(Mi);for(var ho=65;ho<=90;ho++)Wa[ho]=String.fromCharCode(ho);for(var Ui=1;Ui<=12;Ui++)Wa[Ui+111]=Wa[Ui+63235]="F"+Ui;var La={};La.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"},La.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"},La.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"},La.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"]},La.default=c?La.macDefault:La.pcDefault;function Wl(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var s,i,p,F,X=0;X<n.length-1;X++){var Z=n[X];if(/^(cmd|meta|m)$/i.test(Z))F=!0;else if(/^a(lt)?$/i.test(Z))s=!0;else if(/^(c|ctrl|control)$/i.test(Z))i=!0;else if(/^s(hift)?$/i.test(Z))p=!0;else throw new Error("Unrecognized modifier name: "+Z)}return s&&(e="Alt-"+e),i&&(e="Ctrl-"+e),F&&(e="Cmd-"+e),p&&(e="Shift-"+e),e}function ll(e){var n={};for(var s in e)if(e.hasOwnProperty(s)){var i=e[s];if(/^(name|fallthrough|(de|at)tach)$/.test(s))continue;if(i=="..."){delete e[s];continue}for(var p=oe(s.split(" "),Wl),F=0;F<p.length;F++){var X=void 0,Z=void 0;F==p.length-1?(Z=p.join(" "),X=i):(Z=p.slice(0,F+1).join(" "),X="...");var te=n[Z];if(!te)n[Z]=X;else if(te!=X)throw new Error("Inconsistent bindings for "+Z)}delete e[s]}for(var de in n)e[de]=n[de];return e}function Ia(e,n,s,i){n=Bi(n);var p=n.call?n.call(e,i):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 Ia(e,n.fallthrough,s,i);for(var F=0;F<n.fallthrough.length;F++){var X=Ia(e,n.fallthrough[F],s,i);if(X)return X}}}function Fi(e){var n=typeof e=="string"?e:Wa[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function ul(e,n,s){var i=e;return n.altKey&&i!="Alt"&&(e="Alt-"+e),(T?n.metaKey:n.ctrlKey)&&i!="Ctrl"&&(e="Ctrl-"+e),(T?n.ctrlKey:n.metaKey)&&i!="Mod"&&(e="Cmd-"+e),!s&&n.shiftKey&&i!="Shift"&&(e="Shift-"+e),e}function po(e,n){if(g&&e.keyCode==34&&e.char)return!1;var s=Wa[e.keyCode];return s==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(s=e.code),ul(s,e,n))}function Bi(e){return typeof e=="string"?La[e]:e}function bi(e,n){for(var s=e.doc.sel.ranges,i=[],p=0;p<s.length;p++){for(var F=n(s[p]);i.length&&at(F.from,Y(i).to)<=0;){var X=i.pop();if(at(X.from,F.from)<0){F.from=X.from;break}}i.push(F)}ca(e,function(){for(var Z=i.length-1;Z>=0;Z--)vi(e.doc,"",i[Z].from,i[Z].to,"+delete");ri(e)})}function es(e,n,s){var i=qe(e.text,n+s,s);return i<0||i>e.text.length?null:i}function ts(e,n,s){var i=es(e,n.ch,s);return i==null?null:new we(n.line,i,s<0?"after":"before")}function ns(e,n,s,i,p){if(e){n.doc.direction=="rtl"&&(p=-p);var F=un(s,n.doc.direction);if(F){var X=p<0?Y(F):F[0],Z=p<0==(X.level==1),te=Z?"after":"before",de;if(X.level>0||n.doc.direction=="rtl"){var De=Na(n,s);de=p<0?s.text.length-1:0;var Fe=ia(n,De,de).top;de=Ct(function(it){return ia(n,De,it).top==Fe},p<0==(X.level==1)?X.from:X.to-1,de),te=="before"&&(de=es(s,de,1))}else de=p<0?X.to:X.from;return new we(i,de,te)}}return new we(i,p<0?s.text.length:0,p<0?"before":"after")}function rs(e,n,s,i){var p=un(n,e.doc.direction);if(!p)return ts(n,s,i);s.ch>=n.text.length?(s.ch=n.text.length,s.sticky="before"):s.ch<=0&&(s.ch=0,s.sticky="after");var F=zt(p,s.ch,s.sticky),X=p[F];if(e.doc.direction=="ltr"&&X.level%2==0&&(i>0?X.to>s.ch:X.from<s.ch))return ts(n,s,i);var Z=function(On,Xn){return es(n,On instanceof we?On.ch:On,Xn)},te,de=function(On){return e.options.lineWrapping?(te=te||Na(e,n),gs(e,n,te,On)):{begin:0,end:n.text.length}},De=de(s.sticky=="before"?Z(s,-1):s.ch);if(e.doc.direction=="rtl"||X.level==1){var Fe=X.level==1==i<0,it=Z(s,Fe?1:-1);if(it!=null&&(Fe?it<=X.to&&it<=De.end:it>=X.from&&it>=De.begin)){var et=Fe?"before":"after";return new we(s.line,it,et)}}var Tt=function(On,Xn,Rn){for(var ar=function(jr,ra){return ra?new we(s.line,Z(jr,1),"before"):new we(s.line,jr,"after")};On>=0&&On<p.length;On+=Xn){var Cr=p[On],xr=Xn>0==(Cr.level!=1),Dr=xr?Rn.begin:Z(Rn.end,-1);if(Cr.from<=Dr&&Dr<Cr.to)return ar(Dr,xr);if(Dr=xr?Cr.from:Z(Cr.to,-1),Rn.begin<=Dr&&Dr<Rn.end)return ar(Dr,xr)}},Bt=Tt(F+i,i,De);if(Bt)return Bt;var Zt=i>0?De.end:Z(De.begin,-1);return Zt!=null&&!(i>0&&Zt==n.text.length)&&(Bt=Tt(i>0?0:p.length-1,i,de(Zt)),Bt)?Bt:null}var yi={selectAll:Qs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),ve)},killLine:function(e){return bi(e,function(n){if(n.empty()){var s=nt(e.doc,n.head.line).text.length;return n.head.ch==s&&n.head.line<e.lastLine()?{from:n.head,to:we(n.head.line+1,0)}:{from:n.head,to:we(n.head.line,s)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return bi(e,function(n){return{from:we(n.from().line,0),to:Ft(e.doc,we(n.to().line+1,0))}})},delLineLeft:function(e){return bi(e,function(n){return{from:we(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return bi(e,function(n){var s=e.charCoords(n.head,"div").top+5,i=e.coordsChar({left:0,top:s},"div");return{from:i,to:n.from()}})},delWrappedLineRight:function(e){return bi(e,function(n){var s=e.charCoords(n.head,"div").top+5,i=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:s},"div");return{from:n.from(),to:i}})},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(we(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(we(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 as(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")},fe)},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")},fe)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var s=e.cursorCoords(n.head,"div").top+5,i=e.coordsChar({left:0,top:s},"div");return i.ch<e.getLine(i.line).search(/\S/)?dl(e,n.head):i},fe)},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(),i=e.options.tabSize,p=0;p<s.length;p++){var F=s[p].from(),X=U(e.getLine(F.line),F.ch,i);n.push(xe(i-X%i))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return ca(e,function(){for(var n=e.listSelections(),s=[],i=0;i<n.length;i++){if(!n[i].empty())continue;var p=n[i].head,F=nt(e.doc,p.line).text;if(F){if(p.ch==F.length&&(p=new we(p.line,p.ch-1)),p.ch>0)p=new we(p.line,p.ch+1),e.replaceRange(F.charAt(p.ch-1)+F.charAt(p.ch-2),we(p.line,p.ch-2),p,"+transpose");else if(p.line>e.doc.first){var X=nt(e.doc,p.line-1).text;X&&(p=new we(p.line,1),e.replaceRange(F.charAt(0)+e.doc.lineSeparator()+X.charAt(X.length-1),we(p.line-1,X.length-1),p,"+transpose"))}}s.push(new kr(p,p))}e.setSelections(s)})},newlineAndIndent:function(e){return ca(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 i=0;i<n.length;i++)e.indentLine(n[i].from().line,null,!0);ri(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function mo(e,n){var s=nt(e.doc,n),i=Sn(s);return i!=s&&(n=me(i)),ns(!0,e,i,n,1)}function as(e,n){var s=nt(e.doc,n),i=xn(s);return i!=s&&(n=me(i)),ns(!0,e,s,n,-1)}function dl(e,n){var s=mo(e,n.line),i=nt(e.doc,s.line),p=un(i,e.doc.direction);if(!p||p[0].level==0){var F=Math.max(s.ch,i.text.search(/\S/)),X=n.line==s.line&&n.ch<=F&&n.ch;return we(s.line,X?0:F,s.sticky)}return s}function vo(e,n,s){if(typeof n=="string"&&(n=yi[n],!n))return!1;e.display.input.ensurePolled();var i=e.display.shift,p=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),s&&(e.display.shift=!1),p=n(e)!=se}finally{e.display.shift=i,e.state.suppressEdits=!1}return p}function Hl(e,n,s){for(var i=0;i<e.state.keyMaps.length;i++){var p=Ia(n,e.state.keyMaps[i],s,e);if(p)return p}return e.options.extraKeys&&Ia(n,e.options.extraKeys,s,e)||Ia(n,e.options.keyMap,s,e)}var Kl=new V;function ji(e,n,s,i){var p=e.state.keySeq;if(p){if(Fi(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())}),is(e,p+" "+n,s,i))return!0}return is(e,n,s,i)}function is(e,n,s,i){var p=Hl(e,n,i);return p=="multi"&&(e.state.keySeq=n),p=="handled"&&Ut(e,"keyHandled",e,n,s),(p=="handled"||p=="multi")&&(le(s),ko(e)),!!p}function cl(e,n){var s=po(n,!0);return s?n.shiftKey&&!e.state.keySeq?ji(e,"Shift-"+s,n,function(i){return vo(e,i,!0)})||ji(e,s,n,function(i){if(typeof i=="string"?/^go[A-Z]/.test(i):i.motion)return vo(e,i)}):ji(e,s,n,function(i){return vo(e,i)}):!1}function Gl(e,n,s){return ji(e,"'"+s+"'",n,function(i){return vo(e,i,!0)})}var os=null;function fl(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(n.curOp.focus=M(),lt(n,e))return;z&&G<11&&e.keyCode==27&&(e.returnValue=!1);var s=e.keyCode;n.display.shift=s==16||e.shiftKey;var i=cl(n,e);g&&(os=i?s:null,!i&&s==88&&!nn&&(c?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),k&&!c&&!i&&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(i){(i.keyCode==18||!i.altKey)&&(b(n,"CodeMirror-crosshair"),ct(document,"keyup",s),ct(document,"mouseover",s))}je(document,"keyup",s),je(document,"mouseover",s)}function hl(e){e.keyCode==16&&(this.doc.sel.shift=!1),lt(this,e)}function pl(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(Ir(n.display,e)||lt(n,e)||e.ctrlKey&&!e.altKey||c&&e.metaKey)return;var s=e.keyCode,i=e.charCode;if(g&&s==os){os=null,le(e);return}if(g&&(!e.which||e.which<10)&&cl(n,e))return;var p=String.fromCharCode(i==null?s:i);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&&at(n,this.pos)==0&&s==this.button};var Wi,Hi;function Xl(e,n){var s=+new Date;return Hi&&Hi.compare(s,e,n)?(Wi=Hi=null,"triple"):Wi&&Wi.compare(s,e,n)?(Hi=new ss(s,e,n),Wi=null,"double"):(Wi=new ss(s,e,n),Hi=null,"single")}function ls(e){var n=this,s=n.display;if(lt(n,e)||s.activeTouch&&s.input.supportsTouch())return;if(s.input.ensurePolled(),s.shift=e.shiftKey,Ir(s,e)){L||(s.scroller.draggable=!1,setTimeout(function(){return s.scroller.draggable=!0},100));return}if(ds(n,e))return;var i=Ga(n,e),p=$e(e),F=i?Xl(i,p):"single";if(window.focus(),p==1&&n.state.selectingText&&n.state.selectingText(e),i&&ml(n,p,i,F,e))return;p==1?i?Yl(n,i,F,e):Se(e)==s.scroller&&le(e):p==2?(i&&uo(n.doc,i),setTimeout(function(){return s.input.focus()},20)):p==3&&(O?n.display.input.onContextMenu(e):ys(n))}function ml(e,n,s,i,p){var F="Click";return i=="double"?F="Double"+F:i=="triple"&&(F="Triple"+F),F=(n==1?"Left":n==2?"Middle":"Right")+F,ji(e,ul(F,p),p,function(X){if(typeof X=="string"&&(X=yi[X]),!X)return!1;var Z=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),Z=X(e,s)!=se}finally{e.state.suppressEdits=!1}return Z})}function $l(e,n,s){var i=e.getOption("configureMouse"),p=i?i(e,n,s):{};if(p.unit==null){var F=f?s.shiftKey&&s.metaKey:s.altKey;p.unit=F?"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,i){z?setTimeout(P(Mo,e),0):e.curOp.focus=M();var p=$l(e,s,i),F=e.doc.sel,X;e.options.dragDrop&&dt&&!e.isReadOnly()&&s=="single"&&(X=F.contains(n))>-1&&(at((X=F.ranges[X]).from(),n)<0||n.xRel>0)&&(at(X.to(),n)>0||n.xRel<0)?Ql(e,i,n,p):Jl(e,i,n,p)}function Ql(e,n,s,i){var p=e.display,F=!1,X=Gr(e,function(de){L&&(p.scroller.draggable=!1),e.state.draggingText=!1,ct(p.wrapper.ownerDocument,"mouseup",X),ct(p.wrapper.ownerDocument,"mousemove",Z),ct(p.scroller,"dragstart",te),ct(p.scroller,"drop",X),F||(le(de),i.addNew||uo(e.doc,s,null,null,i.extend),L&&!h||z&&G==9?setTimeout(function(){p.wrapper.ownerDocument.body.focus({preventScroll:!0}),p.input.focus()},20):p.input.focus())}),Z=function(de){F=F||Math.abs(n.clientX-de.clientX)+Math.abs(n.clientY-de.clientY)>=10},te=function(){return F=!0};L&&(p.scroller.draggable=!0),e.state.draggingText=X,X.copy=!i.moveOnDrag,p.scroller.dragDrop&&p.scroller.dragDrop(),je(p.wrapper.ownerDocument,"mouseup",X),je(p.wrapper.ownerDocument,"mousemove",Z),je(p.scroller,"dragstart",te),je(p.scroller,"drop",X),ys(e),setTimeout(function(){return p.input.focus()},20)}function us(e,n,s){if(s=="char")return new kr(n,n);if(s=="word")return e.findWordAt(n);if(s=="line")return new kr(we(n.line,0),Ft(e.doc,we(n.line+1,0)));var i=s(e,n);return new kr(i.from,i.to)}function Jl(e,n,s,i){var p=e.display,F=e.doc;le(n);var X,Z,te=F.sel,de=te.ranges;if(i.addNew&&!i.extend?(Z=F.sel.contains(s),Z>-1?X=de[Z]:X=new kr(s,s)):(X=F.sel.primary(),Z=F.sel.primIndex),i.unit=="rectangle")i.addNew||(X=new kr(s,s)),s=Ga(e,n,!0,!0),Z=-1;else{var De=us(e,s,i.unit);i.extend?X=lo(X,De.anchor,De.head,i.extend):X=De}i.addNew?Z==-1?(Z=de.length,na(F,Ta(e,de.concat([X]),Z),{scroll:!1,origin:"*mouse"})):de.length>1&&de[Z].empty()&&i.unit=="char"&&!i.extend?(na(F,Ta(e,de.slice(0,Z).concat(de.slice(Z+1)),0),{scroll:!1,origin:"*mouse"}),te=F.sel):Ba(F,Z,X,Te):(Z=0,na(F,new ma([X],0),Te),te=F.sel);var Fe=s;function it(Rn){if(at(Fe,Rn)==0)return;if(Fe=Rn,i.unit=="rectangle"){for(var ar=[],Cr=e.options.tabSize,xr=U(nt(F,s.line).text,s.ch,Cr),Dr=U(nt(F,Rn.line).text,Rn.ch,Cr),jr=Math.min(xr,Dr),ra=Math.max(xr,Dr),zr=Math.min(s.line,Rn.line),ya=Math.min(e.lastLine(),Math.max(s.line,Rn.line));zr<=ya;zr++){var va=nt(F,zr).text,Qr=_e(va,jr,Cr);jr==ra?ar.push(new kr(we(zr,Qr),we(zr,Qr))):va.length>Qr&&ar.push(new kr(we(zr,Qr),we(zr,_e(va,ra,Cr))))}ar.length||ar.push(new kr(s,s)),na(F,Ta(e,te.ranges.slice(0,Z).concat(ar),Z),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Rn)}else{var ga=X,sa=us(e,Rn,i.unit),Zr=ga.anchor,Jr;at(sa.anchor,Zr)>0?(Jr=sa.head,Zr=ur(ga.from(),sa.anchor)):(Jr=sa.anchor,Zr=sr(ga.to(),sa.head));var Xr=te.ranges.slice(0);Xr[Z]=ql(e,new kr(Ft(F,Zr),Jr)),na(F,Ta(e,Xr,Z),Te)}}var et=p.wrapper.getBoundingClientRect(),Tt=0;function Bt(Rn){var ar=++Tt,Cr=Ga(e,Rn,!0,i.unit=="rectangle");if(!Cr)return;if(at(Cr,Fe)!=0){e.curOp.focus=M(),it(Cr);var xr=qi(p,F);(Cr.line>=xr.to||Cr.line<xr.from)&&setTimeout(Gr(e,function(){Tt==ar&&Bt(Rn)}),150)}else{var Dr=Rn.clientY<et.top?-20:Rn.clientY>et.bottom?20:0;Dr&&setTimeout(Gr(e,function(){if(Tt!=ar)return;p.scroller.scrollTop+=Dr,Bt(Rn)}),50)}}function Zt(Rn){e.state.selectingText=!1,Tt=Infinity,Rn&&(le(Rn),p.input.focus()),ct(p.wrapper.ownerDocument,"mousemove",On),ct(p.wrapper.ownerDocument,"mouseup",Xn),F.history.lastSelOrigin=null}var On=Gr(e,function(Rn){Rn.buttons===0||!$e(Rn)?Zt(Rn):Bt(Rn)}),Xn=Gr(e,Zt);e.state.selectingText=Xn,je(p.wrapper.ownerDocument,"mousemove",On),je(p.wrapper.ownerDocument,"mouseup",Xn)}function ql(e,n){var s=n.anchor,i=n.head,p=nt(e.doc,s.line);if(at(s,i)==0&&s.sticky==i.sticky)return n;var F=un(p);if(!F)return n;var X=zt(F,s.ch,s.sticky),Z=F[X];if(Z.from!=s.ch&&Z.to!=s.ch)return n;var te=X+(Z.from==s.ch==(Z.level!=1)?0:1);if(te==0||te==F.length)return n;var de;if(i.line!=s.line)de=(i.line-s.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var De=zt(F,i.ch,i.sticky),Fe=De-X||(i.ch-s.ch)*(Z.level==1?-1:1);De==te-1||De==te?de=Fe<0:de=Fe>0}var it=F[te+(de?-1:0)],et=de==(it.level==1),Tt=et?it.from:it.to,Bt=et?"after":"before";return s.ch==Tt&&s.sticky==Bt?n:new kr(new we(s.line,Tt,Bt),i)}function vl(e,n,s,i){var p,F;if(n.touches)p=n.touches[0].clientX,F=n.touches[0].clientY;else try{p=n.clientX,F=n.clientY}catch(it){return!1}if(p>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;i&&le(n);var X=e.display,Z=X.lineDiv.getBoundingClientRect();if(F>Z.bottom||!Oe(e,s))return ye(n);F-=Z.top-X.viewOffset;for(var te=0;te<e.display.gutterSpecs.length;++te){var de=X.gutters.childNodes[te];if(de&&de.getBoundingClientRect().right>=p){var De=pe(e.doc,F),Fe=e.display.gutterSpecs[te];return He(e,s,e,De,Fe.className,n),ye(n)}}}function ds(e,n){return vl(e,n,"gutterClick",!0)}function gl(e,n){if(Ir(e.display,n)||_l(e,n))return;if(lt(e,n,"contextmenu"))return;O||e.display.input.onContextMenu(n)}function _l(e,n){return Oe(e,"gutterContextMenu")?vl(e,n,"gutterContextMenu",!1):!1}function El(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),wi(e)}var xi={toString:function(){return"CodeMirror.Init"}},go={},Ki={};function Zl(e){var n=e.optionHandlers;function s(i,p,F,X){e.defaults[i]=p,F&&(n[i]=X?function(Z,te,de){de!=xi&&F(Z,te,de)}:F)}e.defineOption=s,e.Init=xi,s("value","",function(i,p){return i.setValue(p)},!0),s("mode",null,function(i,p){i.doc.modeOption=p,Li(i)},!0),s("indentUnit",2,Li,!0),s("indentWithTabs",!1),s("smartIndent",!0),s("tabSize",4,function(i){Ii(i),wi(i),la(i)},!0),s("lineSeparator",null,function(i,p){if(i.doc.lineSep=p,!p)return;var F=[],X=i.doc.first;i.doc.iter(function(te){for(var de=0;;){var De=te.text.indexOf(p,de);if(De==-1)break;de=De+p.length,F.push(we(X,De))}X++});for(var Z=F.length-1;Z>=0;Z--)vi(i.doc,p,F[Z],we(F[Z].line,F[Z].ch+p.length))}),s("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(i,p,F){i.state.specialChars=new RegExp(p.source+(p.test(" ")?"":"| "),"g"),F!=xi&&i.refresh()}),s("specialCharPlaceholder",tt,function(i){return i.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(i,p){return i.getInputField().spellcheck=p},!0),s("autocorrect",!1,function(i,p){return i.getInputField().autocorrect=p},!0),s("autocapitalize",!1,function(i,p){return i.getInputField().autocapitalize=p},!0),s("rtlMoveVisually",!S),s("wholeLineUpdateBefore",!0),s("theme","default",function(i){El(i),Di(i)},!0),s("keyMap","default",function(i,p,F){var X=Bi(p),Z=F!=xi&&Bi(F);Z&&Z.detach&&Z.detach(i,X),X.attach&&X.attach(i,Z||null)}),s("extraKeys",null),s("configureMouse",null),s("lineWrapping",!1,tu,!0),s("gutters",[],function(i,p){i.display.gutterSpecs=Ho(p,i.options.lineNumbers),Di(i)},!0),s("fixedGutter",!0,function(i,p){i.display.gutters.style.left=p?Po(i.display)+"px":"0",i.refresh()},!0),s("coverGutterNextToScrollbar",!1,function(i){return Ua(i)},!0),s("scrollbarStyle","native",function(i){Ss(i),Ua(i),i.display.scrollbars.setScrollTop(i.doc.scrollTop),i.display.scrollbars.setScrollLeft(i.doc.scrollLeft)},!0),s("lineNumbers",!1,function(i,p){i.display.gutterSpecs=Ho(i.options.gutters,p),Di(i)},!0),s("firstLineNumber",1,Di,!0),s("lineNumberFormatter",function(i){return i},Di,!0),s("showCursorWhenSelecting",!1,ti,!0),s("resetSelectionOnContextMenu",!0),s("lineWiseCopyCut",!0),s("pasteLinesPerSelection",!0),s("selectionsMayTouch",!1),s("readOnly",!1,function(i,p){p=="nocursor"&&(ni(i),i.display.input.blur()),i.display.input.readOnlyChanged(p)}),s("screenReaderLabel",null,function(i,p){p=p===""?null:p,i.display.input.screenReaderLabelChanged(p)}),s("disableInput",!1,function(i,p){p||i.display.input.reset()},!0),s("dragDrop",!0,eu),s("allowDropFileTypes",null),s("cursorBlinkRate",530),s("cursorScrollMargin",0),s("cursorHeight",1,ti,!0),s("singleCursorHeightPerLine",!0,ti,!0),s("workTime",100),s("workDelay",100),s("flattenSpans",!0,Ii,!0),s("addModeClass",!1,Ii,!0),s("pollInterval",100),s("undoDepth",200,function(i,p){return i.doc.history.undoDepth=p}),s("historyEventDelay",1250),s("viewportMargin",10,function(i){return i.refresh()},!0),s("maxHighlightLength",1e4,Ii,!0),s("moveInputWithCursor",!0,function(i,p){p||i.display.input.resetPosition()}),s("tabindex",null,function(i,p){return i.display.input.getField().tabIndex=p||""}),s("autofocus",null),s("direction","ltr",function(i,p){return i.doc.setDirection(p)},!0),s("phrases",null)}function eu(e,n,s){var i=s&&s!=xi;if(!n!=!i){var p=e.display.dragFunctions,F=n?je:ct;F(e.display.scroller,"dragstart",p.start),F(e.display.scroller,"dragenter",p.enter),F(e.display.scroller,"dragover",p.over),F(e.display.scroller,"dragleave",p.leave),F(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"),Gt(e)),Lo(e),la(e),wi(e),setTimeout(function(){return Ua(e)},100)}function Hr(e,n){var s=this;if(!(this instanceof Hr))return new Hr(e,n);this.options=n=n?x(n):{},x(go,n,!1);var i=n.value;typeof i=="string"?i=new ua(i,n.mode,null,n.lineSeparator,n.direction):n.mode&&(i.modeOption=n.mode),this.doc=i;var p=new Hr.inputStyles[n.inputStyle](this),F=this.display=new Sl(e,i,p,n);F.wrapper.CodeMirror=this,El(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Ss(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 V,keySeq:null,specialChars:null},n.autofocus&&!t&&F.input.focus(),z&&G<11&&setTimeout(function(){return s.display.input.reset(!0)},20),bl(this),iu(),Va(this),this.curOp.forceUpdate=!0,zo(this,i),n.autofocus&&!t||this.hasFocus()?setTimeout(function(){s.hasFocus()&&!s.state.focused&&Uo(s)},20):ni(this);for(var X in Ki)Ki.hasOwnProperty(X)&&Ki[X](this,n[X],xi);Ns(this),n.finishInit&&n.finishInit(this);for(var Z=0;Z<w.length;++Z)w[Z](this);Xa(this),L&&n.lineWrapping&&getComputedStyle(F.lineDiv).textRendering=="optimizelegibility"&&(F.lineDiv.style.textRendering="auto")}Hr.defaults=go,Hr.optionHandlers=Ki;function bl(e){var n=e.display;je(n.scroller,"mousedown",Gr(e,ls)),z&&G<11?je(n.scroller,"dblclick",Gr(e,function(te){if(lt(e,te))return;var de=Ga(e,te);if(!de||ds(e,te)||Ir(e.display,te))return;le(te);var De=e.findWordAt(de);uo(e.doc,De.anchor,De.head)})):je(n.scroller,"dblclick",function(te){return lt(e,te)||le(te)}),je(n.scroller,"contextmenu",function(te){return gl(e,te)}),je(n.input.getField(),"contextmenu",function(te){n.scroller.contains(te.target)||gl(e,te)});var s,i={end:0};function p(){n.activeTouch&&(s=setTimeout(function(){return n.activeTouch=null},1e3),i=n.activeTouch,i.end=+new Date)}function F(te){if(te.touches.length!=1)return!1;var de=te.touches[0];return de.radiusX<=1&&de.radiusY<=1}function X(te,de){if(de.left==null)return!0;var De=de.left-te.left,Fe=de.top-te.top;return De*De+Fe*Fe>20*20}je(n.scroller,"touchstart",function(te){if(!lt(e,te)&&!F(te)&&!ds(e,te)){n.input.ensurePolled(),clearTimeout(s);var de=+new Date;n.activeTouch={start:de,moved:!1,prev:de-i.end<=300?i:null},te.touches.length==1&&(n.activeTouch.left=te.touches[0].pageX,n.activeTouch.top=te.touches[0].pageY)}}),je(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),je(n.scroller,"touchend",function(te){var de=n.activeTouch;if(de&&!Ir(n,te)&&de.left!=null&&!de.moved&&new Date-de.start<300){var De=e.coordsChar(n.activeTouch,"page"),Fe;!de.prev||X(de,de.prev)?Fe=new kr(De,De):!de.prev.prev||X(de,de.prev.prev)?Fe=e.findWordAt(De):Fe=new kr(we(De.line,0),Ft(e.doc,we(De.line+1,0))),e.setSelection(Fe.anchor,Fe.head),e.focus(),le(te)}p()}),je(n.scroller,"touchcancel",p),je(n.scroller,"scroll",function(){n.scroller.clientHeight&&(ii(e,n.scroller.scrollTop),Da(e,n.scroller.scrollLeft,!0),He(e,"scroll",e))}),je(n.scroller,"mousewheel",function(te){return Ms(e,te)}),je(n.scroller,"DOMMouseScroll",function(te){return Ms(e,te)}),je(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(te){lt(e,te)||ae(te)},over:function(te){lt(e,te)||(Bl(e,te),ae(te))},start:function(te){return ol(e,te)},drop:Gr(e,Fl),leave:function(te){lt(e,te)||Jo(e)}};var Z=n.input.getField();je(Z,"keyup",function(te){return hl.call(e,te)}),je(Z,"keydown",Gr(e,fl)),je(Z,"keypress",Gr(e,pl)),je(Z,"focus",function(te){return Uo(e,te)}),je(Z,"blur",function(te){return ni(e,te)})}var w=[];Hr.defineInitHook=function(e){return w.push(e)};function A(e,n,s,i){var p=e.doc,F;s==null&&(s="add"),s=="smart"&&(p.mode.indent?F=Dn(e,n).state:s="prev");var X=e.options.tabSize,Z=nt(p,n),te=U(Z.text,null,X);Z.stateAfter&&(Z.stateAfter=null);var de=Z.text.match(/^\s*/)[0],De;if(!i&&!/\S/.test(Z.text))De=0,s="not";else if(s=="smart"&&(De=p.mode.indent(F,Z.text.slice(de.length),Z.text),De==se||De>150)){if(!i)return;s="prev"}s=="prev"?n>p.first?De=U(nt(p,n-1).text,null,X):De=0:s=="add"?De=te+e.options.indentUnit:s=="subtract"?De=te-e.options.indentUnit:typeof s=="number"&&(De=te+s),De=Math.max(0,De);var Fe="",it=0;if(e.options.indentWithTabs)for(var et=Math.floor(De/X);et;--et)it+=X,Fe+=" ";if(it<De&&(Fe+=xe(De-it)),Fe!=de)return vi(p,Fe,we(n,0),we(n,de.length),"+input"),Z.stateAfter=null,!0;for(var Tt=0;Tt<p.sel.ranges.length;Tt++){var Bt=p.sel.ranges[Tt];if(Bt.head.line==n&&Bt.head.ch<de.length){var Zt=we(n,de.length);Ba(p,Tt,new kr(Zt,Zt));break}}}var W=null;function J(e){W=e}function ne(e,n,s,i,p){var F=e.doc;e.display.shift=!1,i||(i=F.sel);var X=+new Date-200,Z=p=="paste"||e.state.pasteIncoming>X,te=on(n),de=null;if(Z&&i.ranges.length>1)if(W&&W.text.join(`
`)==n){if(i.ranges.length%W.text.length==0){de=[];for(var De=0;De<W.text.length;De++)de.push(F.splitLines(W.text[De]))}}else te.length==i.ranges.length&&e.options.pasteLinesPerSelection&&(de=oe(te,function(On){return[On]}));for(var Fe=e.curOp.updateInput,it=i.ranges.length-1;it>=0;it--){var et=i.ranges[it],Tt=et.from(),Bt=et.to();et.empty()&&(s&&s>0?Tt=we(Tt.line,Tt.ch-s):e.state.overwrite&&!Z?Bt=we(Bt.line,Math.min(nt(F,Bt.line).text.length,Bt.ch+Y(te).length)):Z&&W&&W.lineWise&&W.text.join(`
`)==te.join(`
`)&&(Tt=Bt=we(Tt.line,0)));var Zt={from:Tt,to:Bt,text:de?de[it%de.length]:te,origin:p||(Z?"paste":e.state.cutIncoming>X?"cut":"+input")};pi(e.doc,Zt),Ut(e,"inputRead",e,Zt)}n&&!Z&&Ee(e,n),ri(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Fe),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function re(e,n){var s=e.clipboardData&&e.clipboardData.getData("Text");if(s)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&ca(n,function(){return ne(n,s,0,null,"paste")}),!0}function Ee(e,n){if(!e.options.electricChars||!e.options.smartIndent)return;for(var s=e.doc.sel,i=s.ranges.length-1;i>=0;i--){var p=s.ranges[i];if(p.head.ch>100||i&&s.ranges[i-1].head.line==p.head.line)continue;var F=e.getModeAt(p.head),X=!1;if(F.electricChars){for(var Z=0;Z<F.electricChars.length;Z++)if(n.indexOf(F.electricChars.charAt(Z))>-1){X=A(e,p.head.line,"smart");break}}else F.electricInput&&(F.electricInput.test(nt(e.doc,p.head.line).text.slice(0,p.head.ch))&&(X=A(e,p.head.line,"smart")));X&&Ut(e,"electricInput",e,p.head.line)}}function be(e){for(var n=[],s=[],i=0;i<e.doc.sel.ranges.length;i++){var p=e.doc.sel.ranges[i].head.line,F={anchor:we(p,0),head:we(p+1,0)};s.push(F),n.push(e.getRange(F.anchor,F.head))}return{text:n,ranges:s}}function Ie(e,n,s,i){e.setAttribute("autocorrect",s?"":"off"),e.setAttribute("autocapitalize",i?"":"off"),e.setAttribute("spellcheck",!!n)}function Xe(){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 L?e.style.width="1000px":e.setAttribute("wrap","off"),a&&(e.style.border="1px solid black"),Ie(e),n}function Qe(e){var n=e.optionHandlers,s=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(i,p){var F=this.options,X=F[i];if(F[i]==p&&i!="mode")return;F[i]=p,n.hasOwnProperty(i)&&Gr(this,n[i])(this,p,X),He(this,"optionChange",this,i)},getOption:function(i){return this.options[i]},getDoc:function(){return this.doc},addKeyMap:function(i,p){this.state.keyMaps[p?"push":"unshift"](Bi(i))},removeKeyMap:function(i){for(var p=this.state.keyMaps,F=0;F<p.length;++F)if(p[F]==i||p[F].name==i)return p.splice(F,1),!0},addOverlay:oa(function(i,p){var F=i.token?i:e.getMode(this.options,i);if(F.startState)throw new Error("Overlays may not be stateful.");ce(this.state.overlays,{mode:F,modeSpec:i,opaque:p&&p.opaque,priority:p&&p.priority||0},function(X){return X.priority}),this.state.modeGen++,la(this)}),removeOverlay:oa(function(i){for(var p=this.state.overlays,F=0;F<p.length;++F){var X=p[F].modeSpec;if(X==i||typeof i=="string"&&X.name==i){p.splice(F,1),this.state.modeGen++,la(this);return}}}),indentLine:oa(function(i,p,F){typeof p!="string"&&typeof p!="number"&&(p==null?p=this.options.smartIndent?"smart":"prev":p=p?"add":"subtract"),ir(this.doc,i)&&A(this,i,p,F)}),indentSelection:oa(function(i){for(var p=this.doc.sel.ranges,F=-1,X=0;X<p.length;X++){var Z=p[X];if(Z.empty())Z.head.line>F&&(A(this,Z.head.line,i,!0),F=Z.head.line,X==this.doc.sel.primIndex&&ri(this));else{var te=Z.from(),de=Z.to(),De=Math.max(F,te.line);F=Math.min(this.lastLine(),de.line-(de.ch?0:1))+1;for(var Fe=De;Fe<F;++Fe)A(this,Fe,i);var it=this.doc.sel.ranges;te.ch==0&&p.length==it.length&&it[X].from().ch>0&&Ba(this.doc,X,new kr(te,it[X].to()),ve)}}}),getTokenAt:function(i,p){return tr(this,i,p)},getLineTokens:function(i,p){return tr(this,we(i),p,!0)},getTokenTypeAt:function(i){i=Ft(this.doc,i);var p=$t(this,nt(this.doc,i.line)),F=0,X=(p.length-1)/2,Z=i.ch,te;if(Z==0)te=p[2];else for(;;){var de=F+X>>1;if((de?p[de*2-1]:0)>=Z)X=de;else if(p[de*2+1]<Z)F=de+1;else{te=p[de*2+2];break}}var De=te?te.indexOf("overlay "):-1;return De<0?te:De==0?null:te.slice(0,De-1)},getModeAt:function(i){var p=this.doc.mode;return p.innerMode?e.innerMode(p,this.getTokenAt(i).state).mode:p},getHelper:function(i,p){return this.getHelpers(i,p)[0]},getHelpers:function(i,p){var F=[];if(!s.hasOwnProperty(p))return F;var X=s[p],Z=this.getModeAt(i);if(typeof Z[p]=="string")X[Z[p]]&&F.push(X[Z[p]]);else if(Z[p])for(var te=0;te<Z[p].length;te++){var de=X[Z[p][te]];de&&F.push(de)}else Z.helperType&&X[Z.helperType]?F.push(X[Z.helperType]):X[Z.name]&&F.push(X[Z.name]);for(var De=0;De<X._global.length;De++){var Fe=X._global[De];Fe.pred(Z,this)&&q(F,Fe.val)==-1&&F.push(Fe.val)}return F},getStateAfter:function(i,p){var F=this.doc;return i=Wn(F,i==null?F.first+F.size-1:i),Dn(this,i+1,p).state},cursorCoords:function(i,p){var F,X=this.doc.sel.primary();return i==null?F=X.head:typeof i=="object"?F=Ft(this.doc,i):F=i?X.from():X.to(),xa(this,F,p||"page")},charCoords:function(i,p){return Oo(this,Ft(this.doc,i),p||"page")},coordsChar:function(i,p){return i=Co(this,i,p||"page"),So(this,i.left,i.top)},lineAtHeight:function(i,p){return i=Co(this,{top:i,left:0},p||"page").top,pe(this.doc,i+this.display.viewOffset)},heightAtLine:function(i,p,F){var X=!1,Z;if(typeof i=="number"){var te=this.doc.first+this.doc.size-1;i<this.doc.first?i=this.doc.first:i>te&&(i=te,X=!0),Z=nt(this.doc,i)}else Z=i;return $i(this,Z,{top:0,left:0},p||"page",F||X).top+(X?this.doc.height-Lt(Z):0)},defaultTextHeight:function(){return qa(this.display)},defaultCharWidth:function(){return Za(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(i,p,F,X,Z){var te=this.display;i=xa(this,Ft(this.doc,i));var de=i.bottom,De=i.left;if(p.style.position="absolute",p.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(p),te.sizer.appendChild(p),X=="over")de=i.top;else if(X=="above"||X=="near"){var Fe=Math.max(te.wrapper.clientHeight,this.doc.height),it=Math.max(te.sizer.clientWidth,te.lineSpace.clientWidth);(X=="above"||i.bottom+p.offsetHeight>Fe)&&i.top>p.offsetHeight?de=i.top-p.offsetHeight:i.bottom+p.offsetHeight<=Fe&&(de=i.bottom),De+p.offsetWidth>it&&(De=it-p.offsetWidth)}p.style.top=de+"px",p.style.left=p.style.right="",Z=="right"?(De=te.sizer.clientWidth-p.offsetWidth,p.style.right="0px"):(Z=="left"?De=0:Z=="middle"&&(De=(te.sizer.clientWidth-p.offsetWidth)/2),p.style.left=De+"px"),F&&Tl(this,{left:De,top:de,right:De+p.offsetWidth,bottom:de+p.offsetHeight})},triggerOnKeyDown:oa(fl),triggerOnKeyPress:oa(pl),triggerOnKeyUp:hl,triggerOnMouseDown:oa(ls),execCommand:function(i){if(yi.hasOwnProperty(i))return yi[i].call(null,this)},triggerElectric:oa(function(i){Ee(this,i)}),findPosH:function(i,p,F,X){var Z=1;p<0&&(Z=-1,p=-p);for(var te=Ft(this.doc,i),de=0;de<p&&!(te=Ue(this.doc,te,Z,F,X),te.hitSide);++de);return te},moveH:oa(function(i,p){var F=this;this.extendSelectionsBy(function(X){return F.display.shift||F.doc.extend||X.empty()?Ue(F.doc,X.head,i,p,F.options.rtlMoveVisually):i<0?X.from():X.to()},fe)}),deleteH:oa(function(i,p){var F=this.doc.sel,X=this.doc;F.somethingSelected()?X.replaceSelection("",null,"+delete"):bi(this,function(Z){var te=Ue(X,Z.head,i,p,!1);return i<0?{from:te,to:Z.head}:{from:Z.head,to:te}})}),findPosV:function(i,p,F,X){var Z=1,te=X;p<0&&(Z=-1,p=-p);for(var de=Ft(this.doc,i),De=0;De<p;++De){var Fe=xa(this,de,"div");if(te==null?te=Fe.left:Fe.left=te,de=Me(this,Fe,Z,F),de.hitSide)break}return de},moveV:oa(function(i,p){var F=this,X=this.doc,Z=[],te=!this.display.shift&&!X.extend&&X.sel.somethingSelected();if(X.extendSelectionsBy(function(De){if(te)return i<0?De.from():De.to();var Fe=xa(F,De.head,"div");De.goalColumn!=null&&(Fe.left=De.goalColumn),Z.push(Fe.left);var it=Me(F,Fe,i,p);return p=="page"&&De==X.sel.primary()&&eo(F,Oo(F,it,"div").top-Fe.top),it},fe),Z.length)for(var de=0;de<X.sel.ranges.length;de++)X.sel.ranges[de].goalColumn=Z[de]}),findWordAt:function(i){var p=this.doc,F=nt(p,i.line).text,X=i.ch,Z=i.ch;if(F){var te=this.getHelper(i,"wordChars");(i.sticky=="before"||Z==F.length)&&X?--X:++Z;for(var de=F.charAt(X),De=rt(de,te)?function(Fe){return rt(Fe,te)}:/\s/.test(de)?function(Fe){return/\s/.test(Fe)}:function(Fe){return!/\s/.test(Fe)&&!rt(Fe)};X>0&&De(F.charAt(X-1));)--X;for(;Z<F.length&&De(F.charAt(Z));)++Z}return new kr(we(i.line,X),we(i.line,Z))},toggleOverwrite:function(i){if(i!=null&&i==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?N(this.display.cursorDiv,"CodeMirror-overwrite"):b(this.display.cursorDiv,"CodeMirror-overwrite"),He(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==M()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:oa(function(i,p){ai(this,i,p)}),getScrollInfo:function(){var i=this.display.scroller;return{left:i.scrollLeft,top:i.scrollTop,height:i.scrollHeight-qr(this)-this.display.barHeight,width:i.scrollWidth-qr(this)-this.display.barWidth,clientHeight:Ea(this),clientWidth:ea(this)}},scrollIntoView:oa(function(i,p){i==null?(i={from:this.doc.sel.primary().head,to:null},p==null&&(p=this.options.cursorScrollMargin)):typeof i=="number"?i={from:we(i,0),to:null}:i.from==null&&(i={from:i,to:null}),i.to||(i.to=i.from),i.margin=p||0,i.from.line!=null?Ts(this,i):ws(this,i.from,i.to,i.margin)}),setSize:oa(function(i,p){var F=this,X=function(te){return typeof te=="number"||/^\d+$/.test(String(te))?te+"px":te};i!=null&&(this.display.wrapper.style.width=X(i)),p!=null&&(this.display.wrapper.style.height=X(p)),this.options.lineWrapping&&To(this);var Z=this.display.viewFrom;this.doc.iter(Z,this.display.viewTo,function(te){if(te.widgets){for(var de=0;de<te.widgets.length;de++)if(te.widgets[de].noHScroll){ka(F,Z,"widget");break}}++Z}),this.curOp.forceUpdate=!0,He(this,"refresh",this)}),operation:function(i){return ca(this,i)},startOperation:function(){return Va(this)},endOperation:function(){return Xa(this)},refresh:oa(function(){var i=this.display.cachedTextHeight;la(this),this.curOp.forceUpdate=!0,wi(this),ai(this,this.doc.scrollLeft,this.doc.scrollTop),Ai(this.display),(i==null||Math.abs(i-qa(this.display))>.5||this.options.lineWrapping)&&Lo(this),He(this,"refresh",this)}),swapDoc:oa(function(i){var p=this.doc;return p.cm=null,this.state.selectingText&&this.state.selectingText(),zo(this,i),wi(this),this.display.input.reset(),ai(this,i.scrollLeft,i.scrollTop),this.curOp.forceScroll=!0,Ut(this,"swapDoc",this,p),p}),phrase:function(i){var p=this.options.phrases;return p&&Object.prototype.hasOwnProperty.call(p,i)?p[i]:i},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ce(e),e.registerHelper=function(i,p,F){s.hasOwnProperty(i)||(s[i]=e[i]={_global:[]}),s[i][p]=F},e.registerGlobalHelper=function(i,p,F,X){e.registerHelper(i,p,X),s[i]._global.push({pred:F,val:X})}}function Ue(e,n,s,i,p){var F=n,X=s,Z=nt(e,n.line),te=p&&e.direction=="rtl"?-s:s;function de(){var Xn=n.line+te;return Xn<e.first||Xn>=e.first+e.size?!1:(n=new we(Xn,n.ch,n.sticky),Z=nt(e,Xn))}function De(Xn){var Rn;if(i=="codepoint"){var ar=Z.text.charCodeAt(n.ch+(i>0?0:-1));isNaN(ar)?Rn=null:Rn=new we(n.line,Math.max(0,Math.min(Z.text.length,n.ch+s*(ar>=55296&&ar<56320?2:1))),-s)}else p?Rn=rs(e.cm,Z,n,s):Rn=ts(Z,n,s);if(Rn==null)if(!Xn&&de())n=ns(p,e.cm,Z,n.line,te);else return!1;else n=Rn;return!0}if(i=="char"||i=="codepoint")De();else if(i=="column")De(!0);else if(i=="word"||i=="group")for(var Fe=null,it=i=="group",et=e.cm&&e.cm.getHelper(n,"wordChars"),Tt=!0;!(s<0&&!De(!Tt));Tt=!1){var Bt=Z.text.charAt(n.ch)||`
`,Zt=rt(Bt,et)?"w":it&&Bt==`
`?"n":!it||/\s/.test(Bt)?null:"p";if(it&&!Tt&&!Zt&&(Zt="s"),Fe&&Fe!=Zt){s<0&&(s=1,De(),n.sticky="after");break}if(Zt&&(Fe=Zt),s>0&&!De(!Tt))break}var On=co(e,n,F,X,!0);return ge(F,On)&&(On.hitSide=!0),On}function Me(e,n,s,i){var p=e.doc,F=n.left,X;if(i=="page"){var Z=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),te=Math.max(Z-.5*qa(e.display),3);X=(s>0?n.bottom:n.top)+s*te}else i=="line"&&(X=s>0?n.bottom+3:n.top-3);for(var de;!(de=So(e,F,X),!de.outside);){if(s<0?X<=0:X>=p.height){de.hitSide=!0;break}X+=s*5}return de}var Ke=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new V,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Ke.prototype.init=function(e){var n=this,s=this,i=s.cm,p=s.div=e.lineDiv;Ie(p,i.options.spellcheck,i.options.autocorrect,i.options.autocapitalize);function F(Z){for(var te=Z.target;te;te=te.parentNode){if(te==p)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(te.className))break}return!1}je(p,"paste",function(Z){if(!F(Z)||lt(i,Z)||re(Z,i))return;G<=11&&setTimeout(Gr(i,function(){return n.updateFromDOM()}),20)}),je(p,"compositionstart",function(Z){n.composing={data:Z.data,done:!1}}),je(p,"compositionupdate",function(Z){n.composing||(n.composing={data:Z.data,done:!1})}),je(p,"compositionend",function(Z){n.composing&&(Z.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),je(p,"touchstart",function(){return s.forceCompositionEnd()}),je(p,"input",function(){n.composing||n.readFromDOMSoon()});function X(Z){if(!F(Z)||lt(i,Z))return;if(i.somethingSelected())J({lineWise:!1,text:i.getSelections()}),Z.type=="cut"&&i.replaceSelection("",null,"cut");else if(i.options.lineWiseCopyCut){var te=be(i);J({lineWise:!0,text:te.text}),Z.type=="cut"&&i.operation(function(){i.setSelections(te.ranges,0,ve),i.replaceSelection("",null,"cut")})}else return;if(Z.clipboardData){Z.clipboardData.clearData();var de=W.text.join(`
`);if(Z.clipboardData.setData("Text",de),Z.clipboardData.getData("Text")==de){Z.preventDefault();return}}var De=Xe(),Fe=De.firstChild;i.display.lineSpace.insertBefore(De,i.display.lineSpace.firstChild),Fe.value=W.text.join(`
`);var it=document.activeElement;H(Fe),setTimeout(function(){i.display.lineSpace.removeChild(De),it.focus(),it==p&&s.showPrimarySelection()},50)}je(p,"copy",X),je(p,"cut",X)},Ke.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Ke.prototype.prepareSelection=function(){var e=No(this.cm,!1);return e.focus=document.activeElement==this.div,e},Ke.prototype.showSelection=function(e,n){if(!e||!this.cm.display.view.length)return;(e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Ke.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Ke.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,s=n.doc.sel.primary(),i=s.from(),p=s.to();if(n.display.viewTo==n.display.viewFrom||i.line>=n.display.viewTo||p.line<n.display.viewFrom){e.removeAllRanges();return}var F=er(n,e.anchorNode,e.anchorOffset),X=er(n,e.focusNode,e.focusOffset);if(F&&!F.bad&&X&&!X.bad&&at(ur(F,X),i)==0&&at(sr(F,X),p)==0)return;var Z=n.display.view,te=i.line>=n.display.viewFrom&&gt(n,i)||{node:Z[0].measure.map[2],offset:0},de=p.line<n.display.viewTo&&gt(n,p);if(!de){var De=Z[Z.length-1].measure,Fe=De.maps?De.maps[De.maps.length-1]:De.map;de={node:Fe[Fe.length-1],offset:Fe[Fe.length-2]-Fe[Fe.length-3]}}if(!te||!de){e.removeAllRanges();return}var it=e.rangeCount&&e.getRangeAt(0),et;try{et=v(te.node,te.offset,de.offset,de.node)}catch(Tt){}et&&(!k&&n.state.focused?(e.collapse(te.node,te.offset),et.collapsed||(e.removeAllRanges(),e.addRange(et))):(e.removeAllRanges(),e.addRange(et)),it&&e.anchorNode==null?e.addRange(it):k&&this.startGracePeriod()),this.rememberSelection()},Ke.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)},Ke.prototype.showMultipleSelections=function(e){u(this.cm.display.cursorDiv,e.cursors),u(this.cm.display.selectionDiv,e.selection)},Ke.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},Ke.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return E(this.div,n)},Ke.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Ke.prototype.blur=function(){this.div.blur()},Ke.prototype.getField=function(){return this.div},Ke.prototype.supportsTouch=function(){return!0},Ke.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():ca(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)},Ke.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},Ke.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),n=this.cm;if(r&&m&&this.cm.display.gutterSpecs.length&&gn(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=er(n,e.anchorNode,e.anchorOffset),i=er(n,e.focusNode,e.focusOffset);s&&i&&ca(n,function(){na(n.doc,Fa(s,i),ve),(s.bad||i.bad)&&(n.curOp.selectionChanged=!0)})},Ke.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,s=e.doc.sel.primary(),i=s.from(),p=s.to();if(i.ch==0&&i.line>e.firstLine()&&(i=we(i.line-1,nt(e.doc,i.line-1).length)),p.ch==nt(e.doc,p.line).text.length&&p.line<e.lastLine()&&(p=we(p.line+1,0)),i.line<n.viewFrom||p.line>n.viewTo-1)return!1;var F,X,Z;i.line==n.viewFrom||(F=za(e,i.line))==0?(X=me(n.view[0].line),Z=n.view[0].node):(X=me(n.view[F].line),Z=n.view[F-1].node.nextSibling);var te=za(e,p.line),de,De;if(te==n.view.length-1?(de=n.viewTo-1,De=n.lineDiv.lastChild):(de=me(n.view[te+1].line)-1,De=n.view[te+1].node.previousSibling),!Z)return!1;for(var Fe=e.doc.splitLines(Vn(e,Z,De,X,de)),it=ke(e.doc,we(X,0),we(de,nt(e.doc,de).text.length));Fe.length>1&&it.length>1;)if(Y(Fe)==Y(it))Fe.pop(),it.pop(),de--;else if(Fe[0]==it[0])Fe.shift(),it.shift(),X++;else break;for(var et=0,Tt=0,Bt=Fe[0],Zt=it[0],On=Math.min(Bt.length,Zt.length);et<On&&Bt.charCodeAt(et)==Zt.charCodeAt(et);)++et;for(var Xn=Y(Fe),Rn=Y(it),ar=Math.min(Xn.length-(Fe.length==1?et:0),Rn.length-(it.length==1?et:0));Tt<ar&&Xn.charCodeAt(Xn.length-Tt-1)==Rn.charCodeAt(Rn.length-Tt-1);)++Tt;if(Fe.length==1&&it.length==1&&X==i.line)for(;et&&et>i.ch&&Xn.charCodeAt(Xn.length-Tt-1)==Rn.charCodeAt(Rn.length-Tt-1);)et--,Tt++;Fe[Fe.length-1]=Xn.slice(0,Xn.length-Tt).replace(/^\u200b+/,""),Fe[0]=Fe[0].slice(et).replace(/\u200b+$/,"");var Cr=we(X,et),xr=we(de,it.length?Y(it).length-Tt:0);if(Fe.length>1||Fe[0]||at(Cr,xr))return vi(e.doc,Fe,Cr,xr,"+input"),!0},Ke.prototype.ensurePolled=function(){this.forceCompositionEnd()},Ke.prototype.reset=function(){this.forceCompositionEnd()},Ke.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Ke.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)},Ke.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&ca(this.cm,function(){return la(e.cm)})},Ke.prototype.setUneditable=function(e){e.contentEditable="false"},Ke.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Gr(this.cm,ne)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Ke.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Ke.prototype.onContextMenu=function(){},Ke.prototype.resetPosition=function(){},Ke.prototype.needsContentAttribute=!0;function gt(e,n){var s=Ka(e,n.line);if(!s||s.hidden)return null;var i=nt(e.doc,n.line),p=Vi(s,i,n.line),F=un(i,e.doc.direction),X="left";if(F){var Z=zt(F,n.ch);X=Z%2?"right":"left"}var te=bo(p.map,n.ch,X);return te.offset=te.collapse=="right"?te.end:te.start,te}function gn(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function Tn(e,n){return n&&(e.bad=!0),e}function Vn(e,n,s,i,p){var F="",X=!1,Z=e.doc.lineSeparator(),te=!1;function de(et){return function(Tt){return Tt.id==et}}function De(){X&&(F+=Z,te&&(F+=Z),X=te=!1)}function Fe(et){et&&(De(),F+=et)}function it(et){if(et.nodeType==1){var Tt=et.getAttribute("cm-text");if(Tt){Fe(Tt);return}var Bt=et.getAttribute("cm-marker"),Zt;if(Bt){var On=e.findMarks(we(i,0),we(p+1,0),de(+Bt));On.length&&(Zt=On[0].find(0))&&Fe(ke(e.doc,Zt.from,Zt.to).join(Z));return}if(et.getAttribute("contenteditable")=="false")return;var Xn=/^(pre|div|p|li|table|br)$/i.test(et.nodeName);if(!/^br$/i.test(et.nodeName)&&et.textContent.length==0)return;Xn&&De();for(var Rn=0;Rn<et.childNodes.length;Rn++)it(et.childNodes[Rn]);/^(pre|p)$/i.test(et.nodeName)&&(te=!0),Xn&&(X=!0)}else et.nodeType==3&&Fe(et.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(it(n),n==s);)n=n.nextSibling,te=!1;return F}function er(e,n,s){var i;if(n==e.display.lineDiv){if(i=e.display.lineDiv.childNodes[s],!i)return Tn(e.clipPos(we(e.display.viewTo-1)),!0);n=null,s=0}else for(i=n;;i=i.parentNode){if(!i||i==e.display.lineDiv)return null;if(i.parentNode&&i.parentNode==e.display.lineDiv)break}for(var p=0;p<e.display.view.length;p++){var F=e.display.view[p];if(F.node==i)return wr(F,n,s)}}function wr(e,n,s){var i=e.text.firstChild,p=!1;if(!n||!E(i,n))return Tn(we(me(e.line),0),!0);if(n==i&&(p=!0,n=i.childNodes[s],s=0,!n)){var F=e.rest?Y(e.rest):e.line;return Tn(we(me(F),F.text.length),p)}var X=n.nodeType==3?n:null,Z=n;for(!X&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(X=n.firstChild,s&&(s=X.nodeValue.length));Z.parentNode!=i;)Z=Z.parentNode;var te=e.measure,de=te.maps;function De(Zt,On,Xn){for(var Rn=-1;Rn<(de?de.length:0);Rn++)for(var ar=Rn<0?te.map:de[Rn],Cr=0;Cr<ar.length;Cr+=3){var xr=ar[Cr+2];if(xr==Zt||xr==On){var Dr=me(Rn<0?e.line:e.rest[Rn]),jr=ar[Cr]+Xn;return(Xn<0||xr!=Zt)&&(jr=ar[Cr+(Xn?1:0)]),we(Dr,jr)}}}var Fe=De(X,Z,s);if(Fe)return Tn(Fe,p);for(var it=Z.nextSibling,et=X?X.nodeValue.length-s:0;it;it=it.nextSibling){if(Fe=De(it,it.firstChild,0),Fe)return Tn(we(Fe.line,Fe.ch-et),p);et+=it.textContent.length}for(var Tt=Z.previousSibling,Bt=s;Tt;Tt=Tt.previousSibling){if(Fe=De(Tt,Tt.firstChild,-1),Fe)return Tn(we(Fe.line,Fe.ch+Bt),p);Bt+=Tt.textContent.length}}var Zn=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new V,this.hasSelection=!1,this.composing=null};Zn.prototype.init=function(e){var n=this,s=this,i=this.cm;this.createField(e);var p=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),a&&(p.style.width="0px"),je(p,"input",function(){z&&G>=9&&n.hasSelection&&(n.hasSelection=null),s.poll()}),je(p,"paste",function(X){if(lt(i,X)||re(X,i))return;i.state.pasteIncoming=+new Date,s.fastPoll()});function F(X){if(lt(i,X))return;if(i.somethingSelected())J({lineWise:!1,text:i.getSelections()});else if(i.options.lineWiseCopyCut){var Z=be(i);J({lineWise:!0,text:Z.text}),X.type=="cut"?i.setSelections(Z.ranges,null,ve):(s.prevInput="",p.value=Z.text.join(`
`),H(p))}else return;X.type=="cut"&&(i.state.cutIncoming=+new Date)}je(p,"cut",F),je(p,"copy",F),je(e.scroller,"paste",function(X){if(Ir(e,X)||lt(i,X))return;if(!p.dispatchEvent){i.state.pasteIncoming=+new Date,s.focus();return}var Z=new Event("paste");Z.clipboardData=X.clipboardData,p.dispatchEvent(Z)}),je(e.lineSpace,"selectstart",function(X){Ir(e,X)||le(X)}),je(p,"compositionstart",function(){var X=i.getCursor("from");s.composing&&s.composing.range.clear(),s.composing={start:X,range:i.markText(X,i.getCursor("to"),{className:"CodeMirror-composing"})}}),je(p,"compositionend",function(){s.composing&&(s.poll(),s.composing.range.clear(),s.composing=null)})},Zn.prototype.createField=function(e){this.wrapper=Xe(),this.textarea=this.wrapper.firstChild},Zn.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},Zn.prototype.prepareSelection=function(){var e=this.cm,n=e.display,s=e.doc,i=No(e);if(e.options.moveInputWithCursor){var p=xa(e,s.sel.primary().head,"div"),F=n.wrapper.getBoundingClientRect(),X=n.lineDiv.getBoundingClientRect();i.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,p.top+X.top-F.top)),i.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,p.left+X.left-F.left))}return i},Zn.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")},Zn.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&&H(this.textarea),z&&G>=9&&(this.hasSelection=s)}else e||(this.prevInput=this.textarea.value="",z&&G>=9&&(this.hasSelection=null))},Zn.prototype.getField=function(){return this.textarea},Zn.prototype.supportsTouch=function(){return!1},Zn.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!t||M()!=this.textarea))try{this.textarea.focus()}catch(e){}},Zn.prototype.blur=function(){this.textarea.blur()},Zn.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},Zn.prototype.receivedFocus=function(){this.slowPoll()},Zn.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()})},Zn.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function s(){var i=n.poll();!i&&!e?(e=!0,n.polling.set(60,s)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,s)},Zn.prototype.poll=function(){var e=this,n=this.cm,s=this.textarea,i=this.prevInput;if(this.contextMenuPending||!n.state.focused||fn(s)&&!i&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var p=s.value;if(p==i&&!n.somethingSelected())return!1;if(z&&G>=9&&this.hasSelection===p||c&&/[\uf700-\uf7ff]/.test(p))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var F=p.charCodeAt(0);if(F==8203&&!i&&(i="\u200B"),F==8666)return this.reset(),this.cm.execCommand("undo")}for(var X=0,Z=Math.min(i.length,p.length);X<Z&&i.charCodeAt(X)==p.charCodeAt(X);)++X;return ca(n,function(){ne(n,p.slice(X),i.length-X,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},Zn.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},Zn.prototype.onKeyPress=function(){z&&G>=9&&(this.hasSelection=null),this.fastPoll()},Zn.prototype.onContextMenu=function(e){var n=this,s=n.cm,i=s.display,p=n.textarea;n.contextMenuPending&&n.contextMenuPending();var F=Ga(s,e),X=i.scroller.scrollTop;if(!F||g)return;var Z=s.options.resetSelectionOnContextMenu;Z&&s.doc.sel.contains(F)==-1&&Gr(s,na)(s.doc,Fa(F),ve);var te=p.style.cssText,de=n.wrapper.style.cssText,De=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",p.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-De.top-5)+"px; left: "+(e.clientX-De.left-5)+`px;
z-index: 1000; background: `+(z?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Fe;L&&(Fe=window.scrollY),i.input.focus(),L&&window.scrollTo(null,Fe),i.input.reset(),s.somethingSelected()||(p.value=n.prevInput=" "),n.contextMenuPending=et,i.selForContextMenu=s.doc.sel,clearTimeout(i.detectingSelectAll);function it(){if(p.selectionStart!=null){var Bt=s.somethingSelected(),Zt="\u200B"+(Bt?p.value:"");p.value="\u21DA",p.value=Zt,n.prevInput=Bt?"":"\u200B",p.selectionStart=1,p.selectionEnd=Zt.length,i.selForContextMenu=s.doc.sel}}function et(){if(n.contextMenuPending!=et)return;if(n.contextMenuPending=!1,n.wrapper.style.cssText=de,p.style.cssText=te,z&&G<9&&i.scrollbars.setScrollTop(i.scroller.scrollTop=X),p.selectionStart!=null){(!z||z&&G<9)&&it();var Bt=0,Zt=function(){i.selForContextMenu==s.doc.sel&&p.selectionStart==0&&p.selectionEnd>0&&n.prevInput=="\u200B"?Gr(s,Qs)(s):Bt++<10?i.detectingSelectAll=setTimeout(Zt,500):(i.selForContextMenu=null,i.input.reset())};i.detectingSelectAll=setTimeout(Zt,200)}}if(z&&G>=9&&it(),O){ae(e);var Tt=function(){ct(window,"mouseup",Tt),setTimeout(et,20)};je(window,"mouseup",Tt)}else setTimeout(et,50)},Zn.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},Zn.prototype.setUneditable=function(){},Zn.prototype.needsContentAttribute=!1;function Nr(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=M();n.autofocus=s==e||e.getAttribute("autofocus")!=null&&s==document.body}function i(){e.value=Z.getValue()}var p;if(e.form&&(je(e.form,"submit",i),!n.leaveSubmitMethodAlone)){var F=e.form;p=F.submit;try{var X=F.submit=function(){i(),F.submit=p,F.submit(),F.submit=X}}catch(te){}}n.finishInit=function(te){te.save=i,te.getTextArea=function(){return e},te.toTextArea=function(){te.toTextArea=isNaN,i(),e.parentNode.removeChild(te.getWrapperElement()),e.style.display="",e.form&&(ct(e.form,"submit",i),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=p))}},e.style.display="none";var Z=Hr(function(te){return e.parentNode.insertBefore(te,e.nextSibling)},n);return Z}function Pr(e){e.off=ct,e.on=je,e.wheelEventPixels=ro,e.Doc=ua,e.splitLines=on,e.countColumn=U,e.findColumn=_e,e.isWordChar=Je,e.Pass=se,e.signal=He,e.Line=rn,e.changeEnd=Ya,e.scrollbarModel=Rs,e.Pos=we,e.cmpPos=at,e.modes=pr,e.mimeModes=Yn,e.resolveMode=Wt,e.getMode=Ln,e.modeExtensions=mr,e.extendMode=vr,e.copyState=Rr,e.startState=Wr,e.innerMode=Sr,e.commands=yi,e.keyMap=La,e.keyName=po,e.isModifierKey=Fi,e.lookupKey=Ia,e.normalizeKeyMap=ll,e.StringStream=Ar,e.SharedTextMarker=Ei,e.TextMarker=ba,e.LineWidget=ki,e.e_preventDefault=le,e.e_stopPropagation=he,e.e_stop=ae,e.addClass=N,e.contains=E,e.rmClass=b,e.keyNames=Wa}Zl(Hr),Qe(Hr);var Fr="iter insert remove copy getEditor constructor".split(" ");for(var $r in ua.prototype)ua.prototype.hasOwnProperty($r)&&q(Fr,$r)<0&&(Hr.prototype[$r]=function(e){return function(){return e.apply(this.doc,arguments)}}(ua.prototype[$r]));return Ce(ua),Hr.inputStyles={textarea:Zn,contenteditable:Ke},Hr.defineMode=function(e){!Hr.defaults.mode&&e!="null"&&(Hr.defaults.mode=e),Tr.apply(this,arguments)},Hr.defineMIME=Or,Hr.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),Hr.defineMIME("text/plain","null"),Hr.defineExtension=function(e,n){Hr.prototype[e]=n},Hr.defineDocExtension=function(e,n){ua.prototype[e]=n},Hr.fromTextArea=Nr,Pr(Hr),Hr.version="5.58.2",Hr})},WaYH:function(Rt,Ze,K){"use strict";var ee=K("rePB"),$=K("Ff2n"),k=K("VTBJ"),Q=K("1OyB"),B=K("vuIU"),I=K("JX7q"),z=K("Ji7U"),G=K("LK+K"),L=K("cDcd"),D=K("TSYQ"),m=K.n(D),g=K("sboe"),h=K("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"),y=[],v=0;v<b;v+=1){var E;y.push(L.createElement("span",{key:v,className:m()(d,(E={},Object(ee.a)(E,"".concat(d,"-start"),_[v+1]),Object(ee.a)(E,"".concat(d,"-end"),u[v+1]),Object(ee.a)(E,"".concat(d,"-end-first-level"),!v&&u[0]),E))}))}return L.createElement("span",{"aria-hidden":"true",className:"".concat(R,"-indent")},y)},l=o,a=K("815F"),r="open",t="close",c="---",f=function(T){Object(z.a)(R,T);var O=Object(G.a)(R);function R(){var b;return Object(Q.a)(this,R),b=O.apply(this,arguments),b.state={dragNodeHighlight:!1},b.onSelectorClick=function(_){var u=b.props.context.onNodeClick;u(_,Object(a.b)(b.props)),b.isSelectable()?b.onSelect(_):b.onCheck(_)},b.onSelectorDoubleClick=function(_){var u=b.props.context.onNodeDoubleClick;u(_,Object(a.b)(b.props))},b.onSelect=function(_){if(b.isDisabled())return;var u=b.props.context.onNodeSelect;_.preventDefault(),u(_,Object(a.b)(b.props))},b.onCheck=function(_){if(b.isDisabled())return;var u=b.props,d=u.disableCheckbox,y=u.checked,v=b.props.context.onNodeCheck;if(!b.isCheckable()||d)return;_.preventDefault();var E=!y;v(_,Object(a.b)(b.props),E)},b.onMouseEnter=function(_){var u=b.props.context.onNodeMouseEnter;u(_,Object(a.b)(b.props))},b.onMouseLeave=function(_){var u=b.props.context.onNodeMouseLeave;u(_,Object(a.b)(b.props))},b.onContextMenu=function(_){var u=b.props.context.onNodeContextMenu;u(_,Object(a.b)(b.props))},b.onDragStart=function(_){var u=b.props.context.onNodeDragStart;_.stopPropagation(),b.setState({dragNodeHighlight:!0}),u(_,Object(I.a)(b));try{_.dataTransfer.setData("text/plain","")}catch(d){}},b.onDragEnter=function(_){var u=b.props.context.onNodeDragEnter;_.preventDefault(),_.stopPropagation(),u(_,Object(I.a)(b))},b.onDragOver=function(_){var u=b.props.context.onNodeDragOver;_.preventDefault(),_.stopPropagation(),u(_,Object(I.a)(b))},b.onDragLeave=function(_){var u=b.props.context.onNodeDragLeave;_.stopPropagation(),u(_,Object(I.a)(b))},b.onDragEnd=function(_){var u=b.props.context.onNodeDragEnd;_.stopPropagation(),b.setState({dragNodeHighlight:!1}),u(_,Object(I.a)(b))},b.onDrop=function(_){var u=b.props.context.onNodeDrop;_.preventDefault(),_.stopPropagation(),b.setState({dragNodeHighlight:!1}),u(_,Object(I.a)(b))},b.onExpand=function(_){var u=b.props.context.onNodeExpand;u(_,Object(a.b)(b.props))},b.setSelectHandle=function(_){b.selectHandle=_},b.getNodeState=function(){var _=b.props.expanded;return b.isLeaf()?null:_?r:t},b.hasChildren=function(){var _=b.props.eventKey,u=b.props.context.keyEntities,d=u[_]||{},y=d.children;return!!(y||[]).length},b.isLeaf=function(){var _=b.props,u=_.isLeaf,d=_.loaded,y=b.props.context.loadData,v=b.hasChildren();return u===!1?!1:u||!y&&!v||y&&d&&!v},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,y=_.loaded,v=b.props.context,E=v.loadData,M=v.onNodeLoad;if(d)return;E&&u&&!b.isLeaf()&&(!b.hasChildren()&&!y&&M(Object(a.b)(b.props)))},b.renderSwitcher=function(){var _=b.props,u=_.expanded,d=_.switcherIcon,y=b.props.context,v=y.prefixCls,E=y.switcherIcon,M=d||E;if(b.isLeaf())return L.createElement("span",{className:m()("".concat(v,"-switcher"),"".concat(v,"-switcher-noop"))},typeof M=="function"?M(Object(k.a)(Object(k.a)({},b.props),{},{isLeaf:!0})):M);var N=m()("".concat(v,"-switcher"),"".concat(v,"-switcher_").concat(u?r:t));return L.createElement("span",{onClick:b.onExpand,className:N},typeof M=="function"?M(Object(k.a)(Object(k.a)({},b.props),{},{isLeaf:!1})):M)},b.renderCheckbox=function(){var _=b.props,u=_.checked,d=_.halfChecked,y=_.disableCheckbox,v=b.props.context.prefixCls,E=b.isDisabled(),M=b.isCheckable();if(!M)return null;var N=typeof M!="boolean"?M:null;return L.createElement("span",{className:m()("".concat(v,"-checkbox"),u&&"".concat(v,"-checkbox-checked"),!u&&d&&"".concat(v,"-checkbox-indeterminate"),(E||y)&&"".concat(v,"-checkbox-disabled")),onClick:b.onCheck},N)},b.renderIcon=function(){var _=b.props.loading,u=b.props.context.prefixCls;return L.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,y=u.selected,v=u.icon,E=u.loading,M=u.data,N=b.props.context,j=N.prefixCls,H=N.showIcon,P=N.icon,x=N.draggable,U=N.loadData,V=N.titleRender,q=b.isDisabled(),ie="".concat(j,"-node-content-wrapper"),se;if(H){var ve=v||P;se=ve?L.createElement("span",{className:m()("".concat(j,"-iconEle"),"".concat(j,"-icon__customize"))},typeof ve=="function"?ve(b.props):ve):b.renderIcon()}else U&&E&&(se=b.renderIcon());var Te;typeof d=="function"?Te=d(M):V?Te=V(M):Te=d;var fe=L.createElement("span",{className:"".concat(j,"-title")},Te);return L.createElement("span",{ref:b.setSelectHandle,title:typeof d=="string"?d:"",className:m()("".concat(ie),"".concat(ie,"-").concat(b.getNodeState()||"normal"),!q&&(y||_)&&"".concat(j,"-node-selected"),!q&&x&&"draggable"),draggable:!q&&x||void 0,"aria-grabbed":!q&&x||void 0,onMouseEnter:b.onMouseEnter,onMouseLeave:b.onMouseLeave,onContextMenu:b.onContextMenu,onClick:b.onSelectorClick,onDoubleClick:b.onSelectorDoubleClick,onDragStart:x?b.onDragStart:void 0},se,fe)},b}return Object(B.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,y=u.className,v=u.style,E=u.dragOver,M=u.dragOverGapTop,N=u.dragOverGapBottom,j=u.isLeaf,H=u.isStart,P=u.isEnd,x=u.expanded,U=u.selected,V=u.checked,q=u.halfChecked,ie=u.loading,se=u.domRef,ve=u.active,Te=u.onMouseMove,fe=Object($.a)(u,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),_e=this.props.context,ue=_e.prefixCls,xe=_e.filterTreeNode,Y=_e.draggable,oe=_e.keyEntities,ce=this.isDisabled(),Re=Object(h.f)(fe),Ge=oe[d]||{},Ne=Ge.level,Je=P[P.length-1];return L.createElement("div",Object.assign({ref:se,className:m()(y,"".concat(ue,"-treenode"),(_={},Object(ee.a)(_,"".concat(ue,"-treenode-disabled"),ce),Object(ee.a)(_,"".concat(ue,"-treenode-switcher-").concat(x?"open":"close"),!j),Object(ee.a)(_,"".concat(ue,"-treenode-checkbox-checked"),V),Object(ee.a)(_,"".concat(ue,"-treenode-checkbox-indeterminate"),q),Object(ee.a)(_,"".concat(ue,"-treenode-selected"),U),Object(ee.a)(_,"".concat(ue,"-treenode-loading"),ie),Object(ee.a)(_,"".concat(ue,"-treenode-active"),ve),Object(ee.a)(_,"".concat(ue,"-treenode-leaf-last"),Je),Object(ee.a)(_,"drag-over",!ce&&E),Object(ee.a)(_,"drag-over-gap-top",!ce&&M),Object(ee.a)(_,"drag-over-gap-bottom",!ce&&N),Object(ee.a)(_,"filter-node",xe&&xe(Object(a.b)(this.props))),_)),style:v,onDragEnter:Y?this.onDragEnter:void 0,onDragOver:Y?this.onDragOver:void 0,onDragLeave:Y?this.onDragLeave:void 0,onDrop:Y?this.onDrop:void 0,onDragEnd:Y?this.onDragEnd:void 0,onMouseMove:Te},Re),L.createElement(l,{prefixCls:ue,level:Ne,isStart:H,isEnd:P}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),R}(L.Component),S=function(O){return L.createElement(g.a.Consumer,null,function(R){return L.createElement(f,Object.assign({},O,{context:R}))})};S.displayName="TreeNode",S.defaultProps={title:c},S.isTreeNode=1;var C=Ze.a=S},XIdC:function(Rt,Ze,K){"use strict";var ee=K("rePB"),$=K("ODXe"),k=K("Ff2n"),Q=K("cDcd"),B=K.n(Q),I=K("TSYQ"),z=K.n(I),G=K("6cGi"),L=K("4IlW"),D=Q.forwardRef(function(m,g){var h,o=m.prefixCls,l=o===void 0?"rc-switch":o,a=m.className,r=m.checked,t=m.defaultChecked,c=m.disabled,f=m.loadingIcon,S=m.checkedChildren,C=m.unCheckedChildren,T=m.onClick,O=m.onChange,R=m.onKeyDown,b=Object(k.a)(m,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),_=Object(G.a)(!1,{value:r,defaultValue:t}),u=Object($.a)(_,2),d=u[0],y=u[1];function v(j,H){var P=d;return c||(P=j,y(P),O==null||O(P,H)),P}function E(j){j.which===L.a.LEFT?v(!1,j):j.which===L.a.RIGHT&&v(!0,j),R==null||R(j)}function M(j){var H=v(!d,j);T==null||T(H,j)}var N=z()(l,a,(h={},Object(ee.a)(h,"".concat(l,"-checked"),d),Object(ee.a)(h,"".concat(l,"-disabled"),c),h));return Q.createElement("button",Object.assign({},b,{type:"button",role:"switch","aria-checked":d,disabled:c,className:N,ref:g,onKeyDown:E,onClick:M}),f,Q.createElement("span",{className:"".concat(l,"-inner")},d?S:C))});D.displayName="Switch",Ze.a=D},Y1PL:function(Rt,Ze,K){"use strict";K.r(Ze),K.d(Ze,"ResizableTextArea",function(){return q});var ee=K("wx14"),$=K("1OyB"),k=K("vuIU"),Q=K("Ji7U"),B=K("LK+K"),I=K("cDcd"),z=K("VTBJ"),G=K("rePB"),L=K("Zm9Q"),D=K("Kwbf"),m=K("c+Xe"),g=K("m+aA"),h=K("bdgK"),o=new Map;function l(ve){ve.forEach(function(Te){var fe,_e=Te.target;(fe=o.get(_e))===null||fe===void 0||fe.forEach(function(ue){return ue(_e)})})}var a=new h.default(l),r=null,t=null;function c(ve,Te){o.has(ve)||(o.set(ve,new Set),a.observe(ve)),o.get(ve).add(Te)}function f(ve,Te){o.has(ve)&&(o.get(ve).delete(Te),o.get(ve).size||(a.unobserve(ve),o.delete(ve)))}var S=function(ve){Object(Q.a)(fe,ve);var Te=Object(B.a)(fe);function fe(){return Object($.a)(this,fe),Te.apply(this,arguments)}return Object(k.a)(fe,[{key:"render",value:function(){return this.props.children}}]),fe}(I.Component),C=I.createContext(null);function T(ve){var Te=ve.children,fe=ve.onBatchResize,_e=I.useRef(0),ue=I.useRef([]),xe=I.useContext(C),Y=I.useCallback(function(oe,ce,Re){_e.current+=1;var Ge=_e.current;ue.current.push({size:oe,element:ce,data:Re}),Promise.resolve().then(function(){Ge===_e.current&&(fe==null||fe(ue.current),ue.current=[])}),xe==null||xe(oe,ce,Re)},[fe,xe]);return I.createElement(C.Provider,{value:Y},Te)}function O(ve){var Te=ve.children,fe=ve.disabled,_e=I.useRef(null),ue=I.useRef(null),xe=I.useContext(C),Y=I.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),oe=I.isValidElement(Te)&&Object(m.c)(Te),ce=oe?Te.ref:null,Re=I.useMemo(function(){return Object(m.a)(ce,_e)},[ce,_e]),Ge=I.useRef(ve);Ge.current=ve;var Ne=I.useCallback(function(Je){var rt=Ge.current,_t=rt.onResize,ft=rt.data,ut=Je.getBoundingClientRect(),qe=ut.width,Ct=ut.height,kt=Je.offsetWidth,Kt=Je.offsetHeight,zt=Math.floor(qe),ln=Math.floor(Ct);if(Y.current.width!==zt||Y.current.height!==ln||Y.current.offsetWidth!==kt||Y.current.offsetHeight!==Kt){var un={width:zt,height:ln,offsetWidth:kt,offsetHeight:Kt};Y.current=un;var We=kt===Math.round(qe)?qe:kt,je=Kt===Math.round(Ct)?Ct:Kt,ht=Object(z.a)(Object(z.a)({},un),{},{offsetWidth:We,offsetHeight:je});xe==null||xe(ht,Je,ft),_t&&Promise.resolve().then(function(){_t(ht,Je)})}},[]);return I.useEffect(function(){var Je=Object(g.a)(_e.current)||Object(g.a)(ue.current);return Je&&!fe&&c(Je,Ne),function(){return f(Je,Ne)}},[_e.current,fe]),I.createElement(S,{ref:ue},oe?I.cloneElement(Te,{ref:Re}):Te)}var R="rc-observer-key";function b(ve){var Te=ve.children,fe=Object(L.a)(Te);return fe.map(function(_e,ue){var xe=(_e==null?void 0:_e.key)||"".concat(R,"-").concat(ue);return I.createElement(O,Object(ee.a)({},ve,{key:xe}),_e)})}b.Collection=T;var _=b,u=K("bT9E"),d=K("TSYQ"),y=K.n(d),v=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,E=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","font-variant","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing","word-break"],M={},N;function j(ve){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fe=ve.getAttribute("id")||ve.getAttribute("data-reactid")||ve.getAttribute("name");if(Te&&M[fe])return M[fe];var _e=window.getComputedStyle(ve),ue=_e.getPropertyValue("box-sizing")||_e.getPropertyValue("-moz-box-sizing")||_e.getPropertyValue("-webkit-box-sizing"),xe=parseFloat(_e.getPropertyValue("padding-bottom"))+parseFloat(_e.getPropertyValue("padding-top")),Y=parseFloat(_e.getPropertyValue("border-bottom-width"))+parseFloat(_e.getPropertyValue("border-top-width")),oe=E.map(function(Re){return"".concat(Re,":").concat(_e.getPropertyValue(Re))}).join(";"),ce={sizingStyle:oe,paddingSize:xe,borderSize:Y,boxSizing:ue};return Te&&fe&&(M[fe]=ce),ce}function H(ve){var Te=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,fe=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,_e=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)),ve.getAttribute("wrap")?N.setAttribute("wrap",ve.getAttribute("wrap")):N.removeAttribute("wrap");var ue=j(ve,Te),xe=ue.paddingSize,Y=ue.borderSize,oe=ue.boxSizing,ce=ue.sizingStyle;N.setAttribute("style","".concat(ce,";").concat(v)),N.value=ve.value||ve.placeholder||"";var Re=Number.MIN_SAFE_INTEGER,Ge=Number.MAX_SAFE_INTEGER,Ne=N.scrollHeight,Je;if(oe==="border-box"?Ne+=Y:oe==="content-box"&&(Ne-=xe),fe!==null||_e!==null){N.value=" ";var rt=N.scrollHeight-xe;fe!==null&&(Re=rt*fe,oe==="border-box"&&(Re=Re+xe+Y),Ne=Math.max(Re,Ne)),_e!==null&&(Ge=rt*_e,oe==="border-box"&&(Ge=Ge+xe+Y),Je=Ne>Ge?"":"hidden",Ne=Math.min(Ge,Ne))}return{height:Ne,minHeight:Re,maxHeight:Ge,overflowY:Je,resize:"none"}}var P=K("Gytx"),x=K.n(P),U;(function(ve){ve[ve.NONE=0]="NONE",ve[ve.RESIZING=1]="RESIZING",ve[ve.RESIZED=2]="RESIZED"})(U||(U={}));var V=function(ve){Object(Q.a)(fe,ve);var Te=Object(B.a)(fe);function fe(_e){var ue;return Object($.a)(this,fe),ue=Te.call(this,_e),ue.nextFrameActionId=void 0,ue.resizeFrameId=void 0,ue.textArea=void 0,ue.saveTextArea=function(xe){ue.textArea=xe},ue.handleResize=function(xe){var Y=ue.state.resizeStatus,oe=ue.props,ce=oe.autoSize,Re=oe.onResize;if(Y!==U.NONE)return;typeof Re=="function"&&Re(xe),ce&&ue.resizeOnNextFrame()},ue.resizeOnNextFrame=function(){cancelAnimationFrame(ue.nextFrameActionId),ue.nextFrameActionId=requestAnimationFrame(ue.resizeTextarea)},ue.resizeTextarea=function(){var xe=ue.props.autoSize;if(!xe||!ue.textArea)return;var Y=xe.minRows,oe=xe.maxRows,ce=H(ue.textArea,!1,Y,oe);ue.setState({textareaStyles:ce,resizeStatus:U.RESIZING},function(){cancelAnimationFrame(ue.resizeFrameId),ue.resizeFrameId=requestAnimationFrame(function(){ue.setState({resizeStatus:U.RESIZED},function(){ue.resizeFrameId=requestAnimationFrame(function(){ue.setState({resizeStatus:U.NONE}),ue.fixFirefoxAutoScroll()})})})})},ue.renderTextArea=function(){var xe=ue.props,Y=xe.prefixCls,oe=Y===void 0?"rc-textarea":Y,ce=xe.autoSize,Re=xe.onResize,Ge=xe.className,Ne=xe.disabled,Je=ue.state,rt=Je.textareaStyles,_t=Je.resizeStatus,ft=Object(u.a)(ue.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),ut=y()(oe,Ge,Object(G.a)({},"".concat(oe,"-disabled"),Ne));"value"in ft&&(ft.value=ft.value||"");var qe=Object(z.a)(Object(z.a)(Object(z.a)({},ue.props.style),rt),_t===U.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return I.createElement(_,{onResize:ue.handleResize,disabled:!(ce||Re)},I.createElement("textarea",Object(ee.a)({},ft,{className:ut,style:qe,ref:ue.saveTextArea})))},ue.state={textareaStyles:{},resizeStatus:U.NONE},ue}return Object(k.a)(fe,[{key:"componentDidUpdate",value:function(ue){(ue.value!==this.props.value||!x()(ue.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 ue=this.textArea.selectionStart,xe=this.textArea.selectionEnd;this.textArea.setSelectionRange(ue,xe)}}catch(Y){}}},{key:"render",value:function(){return this.renderTextArea()}}]),fe}(I.Component),q=V,ie=function(ve){Object(Q.a)(fe,ve);var Te=Object(B.a)(fe);function fe(_e){var ue;Object($.a)(this,fe),ue=Te.call(this,_e),ue.resizableTextArea=void 0,ue.focus=function(){ue.resizableTextArea.textArea.focus()},ue.saveTextArea=function(Y){ue.resizableTextArea=Y},ue.handleChange=function(Y){var oe=ue.props.onChange;ue.setValue(Y.target.value,function(){ue.resizableTextArea.resizeTextarea()}),oe&&oe(Y)},ue.handleKeyDown=function(Y){var oe=ue.props,ce=oe.onPressEnter,Re=oe.onKeyDown;Y.keyCode===13&&ce&&ce(Y),Re&&Re(Y)};var xe=typeof _e.value=="undefined"||_e.value===null?_e.defaultValue:_e.value;return ue.state={value:xe},ue}return Object(k.a)(fe,[{key:"setValue",value:function(ue,xe){"value"in this.props||this.setState({value:ue},xe)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return I.createElement(q,Object(ee.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(ue){return"value"in ue?{value:ue.value}:null}}]),fe}(I.Component),se=Ze.default=ie},YIbm:function(Rt,Ze,K){Rt.exports={content:"content___24s9X"}},"YJx+":function(Rt,Ze,K){Rt.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(Rt,Ze,K){"use strict";var ee=K("+BJd"),$=K("mr32"),k=K("14J3"),Q=K("BMrR"),B=K("5NDa"),I=K("5rEg"),z=K("oBTY"),G=K("5Dmo"),L=K("3S7+"),D=K("miYZ"),m=K("tsqr"),g=K("tJVT"),h=K("cDcd"),o=K.n(h),l=function(r){var t,c,f=r.value,S=f===void 0?[[],[]]:f,C=r.onChange,T=Object(h.useState)(""),O=Object(g.a)(T,2),R=O[0],b=O[1],_=Object(h.useState)(""),u=Object(g.a)(_,2),d=u[0],y=u[1],v=function(M){if(!M)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(M)?(m.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u542B\u6709\u7279\u6B8A\u5B57\u7B26\uFF01"),!1):M==="|"?(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(L.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(Q.a,{align:"middle",className:"font14"},"\u666E\u901A\u5173\u952E\u8BCD\uFF1A",o.a.createElement(I.a,{value:R,onChange:function(M){b(M.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(M){var N,j=(N=M.target)===null||N===void 0?void 0:N.value;if(v(j)){var H,P;(H=S[0])===null||H===void 0||H.push(j==null||((P=j.split("|"))===null||P===void 0)?void 0:P.filter(function(x){return!!x})),C(Object(z.a)(S)),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"},S==null||((t=S[0])===null||t===void 0)?void 0:t.map(function(E,M){return o.a.createElement($.a,{className:"mb10",key:M,closable:!0,onClose:function(j){var H;j.preventDefault(),S[0]=(H=S[0])===null||H===void 0?void 0:H.filter(function(P,x){return x!==M}),C(Object(z.a)(S))}},E==null?void 0:E.join(" \u6216 "))})),o.a.createElement(Q.a,{align:"middle",className:"font14"},"\u6838\u5FC3\u5173\u952E\u8BCD\uFF1A",o.a.createElement(I.a,{value:d,onChange:function(M){y(M.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(M){var N,j=(N=M.target)===null||N===void 0?void 0:N.value;if(v(j)){var H,P;(H=S[1])===null||H===void 0||H.push(j==null||((P=j.split("|"))===null||P===void 0)?void 0:P.filter(function(x){return!!x})),C(Object(z.a)(S)),y("")}},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"},S==null||((c=S[1])===null||c===void 0)?void 0:c.map(function(E,M){return o.a.createElement($.a,{className:"mb10",key:M,closable:!0,onClose:function(j){var H;j.preventDefault(),S[1]=(H=S[1])===null||H===void 0?void 0:H.filter(function(P,x){return x!==M}),C(Object(z.a)(S))}},E==null?void 0:E.join(" \u6216 "))})))};Ze.a=l},ZW9T:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return H});var ee=K("k1fw"),$=K("miYZ"),k=K("tsqr"),Q=K("rAM+"),B=K("tJVT"),I=K("PpiC"),z=K("cDcd"),G=K.n(z),L=K("bdgK"),D=K("oBTY"),m=K("9og8"),g=K("WmNS"),h=K.n(g),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"]},a={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","for","friend","gcnew","generic","goto","if","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"#include",content:'include "$0"'},{label:"printf",content:"printf($0)"},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"for",content:["for( ; ; ){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"#include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"#include <vector>",content:["#include <vector>"].join(`
`)},{label:"#include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"#include <string>",content:["#include <string>"].join(`
`)},{label:"#include <cmath>",content:["#include <cmath>"].join(`
`)}]},r={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=K("5VLF"),c=K.n(t),f={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},S=function(x,U){return U.map(function(V){return{label:V,kind:x.languages.CompletionItemKind.Keyword,insertText:V}})},C=function(x){return Object.keys(f.tables).map(function(U){return{label:U,kind:x.languages.CompletionItemKind.Variable,insertText:U}})},T=function(x,U){var V=f.tables[x];return V?V.map(function(q){return{label:q,kind:U.languages.CompletionItemKind.Field,insertText:q}}):[]};function O(P,x,U,V,q){var ie=x.getWordUntilPosition(U),se={startLineNumber:U.lineNumber,endLineNumber:U.lineNumber,startColumn:ie.startColumn,endColumn:ie.endColumn},ve=V.map(function(Te){return{label:Te,kind:P.languages.CompletionItemKind.Keyword,insertText:Te,insertTextRules:P.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:se}});return q.map(function(Te){ve.push(Object(ee.a)(Object(ee.a)({},Te),{},{range:se}))}),ve}var R=function(P){f.languages.map(function(q){return P.languages.registerDocumentFormattingEditProvider(q,{provideDocumentFormattingEdits:function(se,ve,Te){return Object(m.a)(h.a.mark(function fe(){var _e;return h.a.wrap(function(xe){for(;;)switch(xe.prev=xe.next){case 0:return _e=c()(se.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}),xe.abrupt("return",[{range:se.getFullModelRange(),text:_e}]);case 2:case"end":return xe.stop()}},fe)}))()}}),q});var x=a.quickKey.map(function(q){return{label:q.label,kind:P.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:P.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),U=r.quickKey.map(function(q){return{label:q.label,kind:P.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:P.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),V=l.quickKey.map(function(q){return{label:q.label,kind:P.languages.CompletionItemKind.Method,insertText:q.content,insertTextRules:P.languages.CompletionItemInsertTextRule.InsertAsSnippet}});P.languages.registerCompletionItemProvider("cpp",{triggerCharacters:["."," ","#"].concat(Object(D.a)(a.keywords),Object(D.a)(a.quickKey.map(function(q){return q.label}))),provideCompletionItems:function(ie,se){var ve=ie.getValueInRange({startLineNumber:se.lineNumber,startColumn:1,endLineNumber:se.lineNumber,endColumn:se.column}),Te=ve.match(/cu/gim);console.log("match:",Te,se,ve,ie);var fe=[],_e=se.lineNumber,ue=se.column,xe=ie.getValueInRange({startLineNumber:_e,startColumn:0,endLineNumber:_e,endColumn:ue}),Y=xe.trim().split(/\s+/),oe=Y[Y.length-1];if(oe.endsWith(".")){var ce=oe.slice(0,oe.length-1);Object.keys(f.tables).includes(ce)&&(fe=Object(D.a)(T(ce,P)))}else oe==="."?fe=[]:fe=[].concat(Object(D.a)(C(P)),Object(D.a)(S(P,a.keywords)),Object(D.a)(x));return{suggestions:fe}}}),P.languages.registerCompletionItemProvider("c",{triggerCharacters:["."," ","#"].concat(Object(D.a)(o.keywords)),provideCompletionItems:function(ie,se){var ve=ie.getValueInRange({startLineNumber:se.lineNumber,startColumn:1,endLineNumber:se.lineNumber,endColumn:se.column}),Te=ve.match(/cu/gim);console.log("match:",Te,se,ve,ie);var fe=[],_e=se.lineNumber,ue=se.column,xe=ie.getValueInRange({startLineNumber:_e,startColumn:0,endLineNumber:_e,endColumn:ue}),Y=xe.trim().split(/\s+/),oe=Y[Y.length-1];if(oe.endsWith(".")){var ce=oe.slice(0,oe.length-1);Object.keys(f.tables).includes(ce)&&(fe=Object(D.a)(T(ce,P)))}else oe==="."?fe=[]:fe=[].concat(Object(D.a)(C(P)),Object(D.a)(S(P,o.keywords)));return{suggestions:fe}}}),P.languages.registerCompletionItemProvider("java",{triggerCharacters:["."," "].concat(Object(D.a)(l.keywords)),provideCompletionItems:function(ie,se){var ve=[],Te=se.lineNumber,fe=se.column,_e=ie.getValueInRange({startLineNumber:Te,startColumn:0,endLineNumber:Te,endColumn:fe}),ue=_e.trim().split(/\s+/),xe=ue[ue.length-1];if(xe.endsWith(".")){var Y=xe.slice(0,xe.length-1);Object.keys(f.tables).includes(Y)&&(ve=Object(D.a)(T(Y,P)))}else xe==="."?ve=[]:ve=[].concat(Object(D.a)(C(P)),Object(D.a)(S(P,l.keywords)),Object(D.a)(V));return{suggestions:ve}}}),P.languages.registerCompletionItemProvider("python",{triggerCharacters:["."," "].concat(Object(D.a)(r.keywords)),provideCompletionItems:function(ie,se){var ve=[],Te=se.lineNumber,fe=se.column,_e=ie.getValueInRange({startLineNumber:Te,startColumn:0,endLineNumber:Te,endColumn:fe}),ue=_e.trim().split(/\s+/),xe=ue[ue.length-1];if(xe.endsWith(".")){var Y=xe.slice(0,xe.length-1);Object.keys(f.tables).includes(Y)&&(ve=Object(D.a)(T(Y,P)))}else xe==="."?ve=[]:ve=[].concat(Object(D.a)(C(P)),Object(D.a)(S(P,r.keywords)),Object(D.a)(U));return{suggestions:ve}}})},b="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",_=K("LvDl"),u=K("+ua5");function d(P){return/^\d+$/.test(P)?"".concat(P,"px"):P}function y(){}var v=!1,E={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python"};function M(){var P=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],x=P;if(Array.isArray(P)){for(var U=0;U<P.length;U++){var V=E[P[U]];if(V)return V}return x[0]}return E[x]||x}var N=null,j=Ze.b=function(P){var x=P.width,U=x===void 0?"100%":x,V=P.height,q=V===void 0?"100%":V,ie=P.value,se=P.language,ve=se===void 0?"javascript":se,Te=P.style,fe=Te===void 0?{}:Te,_e=P.options,ue=_e===void 0?{}:_e,xe=P.overrideServices,Y=xe===void 0?{}:xe,oe=P.theme,ce=oe===void 0?"vs-dark":oe,Re=P.onEditBlur,Ge=P.onSave,Ne=P.autoHeight,Je=Ne===void 0?!1:Ne,rt=P.forbidCopy,_t=rt===void 0?!1:rt,ft=P.onChange,ut=ft===void 0?y:ft,qe=P.editorDidMount,Ct=qe===void 0?y:qe,kt=P.onFocus,Kt=kt===void 0?y:kt,zt=P.filename,ln=zt===void 0?"educoder.txt":zt,un=P.errorLine,We=P.errorContent,je=We===void 0?"":We,ht=Object(I.a)(P,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ct=Object(z.useRef)(),He=Object(z.useRef)({}),lt=Object(z.useRef)(),Pe=Object(z.useRef)(!1),Oe=Object(z.useRef)(),Ce=Object(z.useState)(!1),le=Object(B.a)(Ce,2),he=le[0],ye=le[1];function ae(){var Wt;return ct.current&&(Wt=new L.default(function(Ln){var mr=Object(Q.a)(Ln),vr;try{for(mr.s();!(vr=mr.n()).done;){var Rr=vr.value;(Rr.target.offsetHeight>0||Rr.target.offsetWidth>0)&&He.current.instance.layout()}}catch(Sr){mr.e(Sr)}finally{mr.f()}}),Wt.observe(ct.current)),Wt}function Se(){k.b.warn(decodeURIComponent(b))}var $e=function(){var Ln=He.current.instance;if(ie!=null&&Ln&&he){var mr=Ln.getModel();mr&&ie!==mr.getValue()&&(v=!0,mr.setValue(ie),Ln.layout(),v=!1)}};Object(z.useEffect)(function(){lt.current&&clearTimeout(lt.current),lt.current=setTimeout(function(){$e()},500)},[ie,he,He.current]),Object(z.useEffect)(function(){if(un&&He.current&&He.current.instance){var Wt=He.current.instance;Wt.changeViewZones(function(mr){var vr=document.createElement("div");vr.style.padding="10px 20px",vr.style.width="calc(100% - 20px)",vr.className="my-error-line-wrp",vr.innerHTML=je,mr.addZone({afterLineNumber:un||11,heightInLines:3,domNode:vr})});var Ln={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}};Wt.addOverlayWidget(Ln),Wt.revealPositionInCenter({lineNumber:20,column:1})}},[un,He.current,he]);function dt(){var Wt=He.current.instance;if(Wt){var Ln=Wt.getSelection(),mr=He.current.pastePos||{},vr=new N.Range(mr.startLineNumber||Ln.endLineNumber,mr.startColumn||Ln.endColumn,mr.endLineNumber||Ln.endLineNumber,mr.endColumn||Ln.endColumn);setTimeout(function(){Wt.executeEdits("",[{range:vr,text:""}])},300)}}function St(Wt){(window.navigator.platform.match("Mac")?Wt.metaKey:Wt.ctrlKey)&&Wt.keyCode==83&&(Wt.preventDefault(),Ge())}var Dt=function(){if(Je&&He.current.instance){var Ln=He.current.instance.getContentHeight();Tr(Ln<q?q:Ln)}else Tr(q)};function Mt(Wt){var Ln=document.createEvent("MouseEvents");Ln.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Wt.dispatchEvent(Ln)}function hr(Wt,Ln){var mr=window.URL||window.webkitURL||window,vr=new Blob([Ln]),Rr=document.createElementNS("http://www.w3.org/1999/xhtml","a");Rr.href=mr.createObjectURL(vr),Rr.download=Wt,Mt(Rr)}Object(z.useEffect)(function(){Dt()},[Dt]),Object(z.useEffect)(function(){ct.current&&!he&&K.e(27).then(K.t.bind(null,"M/lh",7)).then(function(Wt){try{N=Wt,He.current.instance=N.editor.create(ct.current,{value:ie,language:M(ve),theme:ce,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0},Y);var Ln=He.current.instance;if(Ct(Ln,N),setTimeout(function(){Dt(),He.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){hr(ln||"educoder.txt",Ln.getValue())}})},500),He.current.subscription=Ln.onDidChangeModelContent(function(vr){Pe.current?clearTimeout(Oe.current):(Dt(),ut(Ln.getValue(),vr)),Oe.current=setTimeout(function(){Pe.current=!1},500)}),window.Monaco||R(N),_t&&(Ln.addCommand(N.KeyMod.CtrlCmd|N.KeyMod.Shift|N.KeyCode.KEY_V,function(){return Se(),null}),Ln.addCommand(N.KeyMod.CtrlCmd|N.KeyCode.KEY_C,function(){return Se(),null})),window.Monaco=N,Re&&Ln.onDidBlurEditorWidget(function(){Re(Ln.getValue())}),Kt&&Ln.onDidFocusEditorText(function(){Kt(Ln.getValue())}),_t){Ln.addCommand(N.KeyMod.CtrlCmd|N.KeyCode.KEY_V,function(){return Se(),null}),Ln.onDidPaste(function(vr){He.current.pastePos=vr});try{window.addEventListener("paste",dt)}catch(vr){}}var mr=ae();return ye(!0),function(){var vr=He.current.instance;vr.dispose();var Rr=vr.getModel();Rr&&Rr.dispose(),He.current.subscription&&He.current.subscription.dispose(),_t&&window.removeEventListener("paste",dt),mr.unobserve(ct.current)}}catch(vr){}})},[]),Object(z.useEffect)(function(){var Wt=He.current.instance;if(Wt&&he)return document.addEventListener("keydown",St,!1),function(){document.removeEventListener("keydown",St)}},[Ge,he]),Object(z.useEffect)(function(){var Wt=He.current.instance;if(Wt&&he){var Ln=M(ve);N.editor.setModelLanguage(Wt.getModel(),Ln),console.log("language:",ve,Wt.getModel(),Ln)}},[ve,he]),Object(z.useEffect)(function(){var Wt=He.current.instance;Wt&&he&&N.editor.setTheme(ce)},[ce,he]),Object(z.useEffect)(function(){var Wt=He.current.instance;Wt&&he&&(Wt.updateOptions(Object(ee.a)({},ue)),setTimeout(function(){Wt.getModel().updateOptions(Object(ee.a)({},ue))},200))},[JSON.stringify(ue),he]),Object(z.useEffect)(function(){var Wt=He.current.instance;Wt&&he&&Wt.layout()},[U,q,he]);var on=Object(z.useState)(d(U)),fn=Object(B.a)(on,2),nn=fn[0],kn=fn[1],dr=Object(z.useState)(d(q)),pr=Object(B.a)(dr,2),Yn=pr[0],Tr=pr[1],Or=Object(ee.a)(Object(ee.a)({},fe),{},{width:nn,height:Yn});return G.a.createElement("div",{className:"my-monaco-editor",ref:ct,style:Or})};function H(P){var x=P.width,U=x===void 0?"100%":x,V=P.height,q=V===void 0?"100%":V,ie=P.original,se=P.modified,ve=P.language,Te=P.options,fe=Te===void 0?{}:Te,_e=Object(z.useRef)(),ue=Object(z.useState)(null),xe=Object(B.a)(ue,2),Y=xe[0],oe=xe[1];function ce(Je){var rt;return _e.current&&(rt=new L.default(function(_t){var ft=Object(Q.a)(_t),ut;try{for(ft.s();!(ut=ft.n()).done;){var qe=ut.value;(qe.target.offsetHeight>0||qe.target.offsetWidth>0)&&Je.layout()}}catch(Ct){ft.e(Ct)}finally{ft.f()}}),rt.observe(_e.current)),rt}Object(z.useEffect)(function(){_e.current&&K.e(27).then(K.t.bind(null,"M/lh",7)).then(function(Je){N=Je;var rt=N.editor.createDiffEditor(_e.current,Object(ee.a)(Object(ee.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},fe),{},{wordWrap:!0}));oe(rt);var _t=ce(rt);return function(){rt.dispose();var ft=rt.getModel();ft&&ft.dispose(),_t.unobserve(_e.current)}})},[]),Object(z.useEffect)(function(){Y&&Y.setModel({original:N.editor.createModel(ie,ve),modified:N.editor.createModel(se,ve)})},[ie,se,ve,Y]);var Re=d(U),Ge=d(q),Ne={width:Re,height:Ge};return G.a.createElement("div",{className:"my-diff-editor",ref:_e,style:Ne})}},ZWs3:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return m});var ee=K("+L6B"),$=K("2/Rp"),k=K("0Owb"),Q=K("9og8"),B=K("tJVT"),I=K("PpiC"),z=K("WmNS"),G=K.n(z),L=K("cDcd"),D=K.n(L),m=function(h){var o=h.children,l=Object(I.a)(h,["children"]),a=Object(L.useState)(!1),r=Object(B.a)(a,2),t=r[0],c=r[1];return D.a.createElement($.a,Object(k.a)({},l,{loading:t,onClick:function(){var f=Object(Q.a)(G.a.mark(function S(C){return G.a.wrap(function(O){for(;;)switch(O.prev=O.next){case 0:return O.prev=0,c(!0),O.next=4,l.onClick(C);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()}},S,null,[[0,7]])}));return function(S){return f.apply(this,arguments)}}()}),o)}},ZpRC:function(Rt,Ze,K){"use strict";function ee(m){return typeof m=="object"&&m!=null&&m.nodeType===1}function $(m,g){return(!g||m!=="hidden")&&m!=="visible"&&m!=="clip"}function k(m,g){if(m.clientHeight<m.scrollHeight||m.clientWidth<m.scrollWidth){var h=getComputedStyle(m,null);return $(h.overflowY,g)||$(h.overflowX,g)||function(o){var l=function(a){if(!a.ownerDocument||!a.ownerDocument.defaultView)return null;try{return a.ownerDocument.defaultView.frameElement}catch(r){return null}}(o);return!!l&&(l.clientHeight<o.scrollHeight||l.clientWidth<o.scrollWidth)}(m)}return!1}function Q(m,g,h,o,l,a,r,t){return a<m&&r>g||a>m&&r<g?0:a<=m&&t<=h||r>=g&&t>=h?a-m-o:r>g&&t<h||a<m&&t>h?r-g+l:0}var B=function(m,g){var h=window,o=g.scrollMode,l=g.block,a=g.inline,r=g.boundary,t=g.skipOverflowHiddenElements,c=typeof r=="function"?r:function(rt){return rt!==r};if(!ee(m))throw new TypeError("Invalid target");for(var f=document.scrollingElement||document.documentElement,S=[],C=m;ee(C)&&c(C);){if((C=C.parentElement)===f){S.push(C);break}C!=null&&C===document.body&&k(C)&&!k(document.documentElement)||C!=null&&k(C,t)&&S.push(C)}for(var T=h.visualViewport?h.visualViewport.width:innerWidth,O=h.visualViewport?h.visualViewport.height:innerHeight,R=window.scrollX||pageXOffset,b=window.scrollY||pageYOffset,_=m.getBoundingClientRect(),u=_.height,d=_.width,y=_.top,v=_.right,E=_.bottom,M=_.left,N=l==="start"||l==="nearest"?y:l==="end"?E:y+u/2,j=a==="center"?M+d/2:a==="end"?v:M,H=[],P=0;P<S.length;P++){var x=S[P],U=x.getBoundingClientRect(),V=U.height,q=U.width,ie=U.top,se=U.right,ve=U.bottom,Te=U.left;if(o==="if-needed"&&y>=0&&M>=0&&E<=O&&v<=T&&y>=ie&&E<=ve&&M>=Te&&v<=se)return H;var fe=getComputedStyle(x),_e=parseInt(fe.borderLeftWidth,10),ue=parseInt(fe.borderTopWidth,10),xe=parseInt(fe.borderRightWidth,10),Y=parseInt(fe.borderBottomWidth,10),oe=0,ce=0,Re="offsetWidth"in x?x.offsetWidth-x.clientWidth-_e-xe:0,Ge="offsetHeight"in x?x.offsetHeight-x.clientHeight-ue-Y:0;if(f===x)oe=l==="start"?N:l==="end"?N-O:l==="nearest"?Q(b,b+O,O,ue,Y,b+N,b+N+u,u):N-O/2,ce=a==="start"?j:a==="center"?j-T/2:a==="end"?j-T:Q(R,R+T,T,_e,xe,R+j,R+j+d,d),oe=Math.max(0,oe+b),ce=Math.max(0,ce+R);else{oe=l==="start"?N-ie-ue:l==="end"?N-ve+Y+Ge:l==="nearest"?Q(ie,ve,V,ue,Y+Ge,N,N+u,u):N-(ie+V/2)+Ge/2,ce=a==="start"?j-Te-_e:a==="center"?j-(Te+q/2)+Re/2:a==="end"?j-se+xe+Re:Q(Te,se,q,_e,xe+Re,j,j+d,d);var Ne=x.scrollLeft,Je=x.scrollTop;N+=Je-(oe=Math.max(0,Math.min(Je+oe,x.scrollHeight-V+Ge))),j+=Ne-(ce=Math.max(0,Math.min(Ne+ce,x.scrollWidth-q+Re)))}H.push({el:x,top:oe,left:ce})}return H};function I(m){return m===Object(m)&&Object.keys(m).length!==0}function z(m,g){g===void 0&&(g="auto");var h="scrollBehavior"in document.body.style;m.forEach(function(o){var l=o.el,a=o.top,r=o.left;l.scroll&&h?l.scroll({top:a,left:r,behavior:g}):(l.scrollTop=a,l.scrollLeft=r)})}function G(m){return m===!1?{block:"end",inline:"nearest"}:I(m)?m:{block:"start",inline:"nearest"}}function L(m,g){var h=!m.ownerDocument.documentElement.contains(m);if(I(g)&&typeof g.behavior=="function")return g.behavior(h?[]:B(m,g));if(h)return;var o=G(g);return z(B(m,o),o.behavior)}var D=Ze.a=L},Zss7:function(Rt,Ze,K){var ee;(function($){var k=/^\s+/,Q=/\s+$/,B=0,I=$.round,z=$.min,G=$.max,L=$.random;function D(Y,oe){if(Y=Y||"",oe=oe||{},Y instanceof D)return Y;if(!(this instanceof D))return new D(Y,oe);var ce=m(Y);this._originalInput=Y,this._r=ce.r,this._g=ce.g,this._b=ce.b,this._a=ce.a,this._roundA=I(100*this._a)/100,this._format=oe.format||ce.format,this._gradientType=oe.gradientType,this._r<1&&(this._r=I(this._r)),this._g<1&&(this._g=I(this._g)),this._b<1&&(this._b=I(this._b)),this._ok=ce.ok,this._tc_id=B++}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 Y=this.toRgb();return(Y.r*299+Y.g*587+Y.b*114)/1e3},getLuminance:function(){var Y=this.toRgb(),oe,ce,Re,Ge,Ne,Je;return oe=Y.r/255,ce=Y.g/255,Re=Y.b/255,oe<=.03928?Ge=oe/12.92:Ge=$.pow((oe+.055)/1.055,2.4),ce<=.03928?Ne=ce/12.92:Ne=$.pow((ce+.055)/1.055,2.4),Re<=.03928?Je=Re/12.92:Je=$.pow((Re+.055)/1.055,2.4),.2126*Ge+.7152*Ne+.0722*Je},setAlpha:function(Y){return this._a=H(Y),this._roundA=I(100*this._a)/100,this},toHsv:function(){var Y=l(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,v:Y.v,a:this._a}},toHsvString:function(){var Y=l(this._r,this._g,this._b),oe=I(Y.h*360),ce=I(Y.s*100),Re=I(Y.v*100);return this._a==1?"hsv("+oe+", "+ce+"%, "+Re+"%)":"hsva("+oe+", "+ce+"%, "+Re+"%, "+this._roundA+")"},toHsl:function(){var Y=h(this._r,this._g,this._b);return{h:Y.h*360,s:Y.s,l:Y.l,a:this._a}},toHslString:function(){var Y=h(this._r,this._g,this._b),oe=I(Y.h*360),ce=I(Y.s*100),Re=I(Y.l*100);return this._a==1?"hsl("+oe+", "+ce+"%, "+Re+"%)":"hsla("+oe+", "+ce+"%, "+Re+"%, "+this._roundA+")"},toHex:function(Y){return r(this._r,this._g,this._b,Y)},toHexString:function(Y){return"#"+this.toHex(Y)},toHex8:function(Y){return t(this._r,this._g,this._b,this._a,Y)},toHex8String:function(Y){return"#"+this.toHex8(Y)},toRgb:function(){return{r:I(this._r),g:I(this._g),b:I(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+I(this._r)+", "+I(this._g)+", "+I(this._b)+")":"rgba("+I(this._r)+", "+I(this._g)+", "+I(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:I(P(this._r,255)*100)+"%",g:I(P(this._g,255)*100)+"%",b:I(P(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+I(P(this._r,255)*100)+"%, "+I(P(this._g,255)*100)+"%, "+I(P(this._b,255)*100)+"%)":"rgba("+I(P(this._r,255)*100)+"%, "+I(P(this._g,255)*100)+"%, "+I(P(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:N[r(this._r,this._g,this._b,!0)]||!1},toFilter:function(Y){var oe="#"+c(this._r,this._g,this._b,this._a),ce=oe,Re=this._gradientType?"GradientType = 1, ":"";if(Y){var Ge=D(Y);ce="#"+c(Ge._r,Ge._g,Ge._b,Ge._a)}return"progid:DXImageTransform.Microsoft.gradient("+Re+"startColorstr="+oe+",endColorstr="+ce+")"},toString:function(Y){var oe=!!Y;Y=Y||this._format;var ce=!1,Re=this._a<1&&this._a>=0,Ge=!oe&&Re&&(Y==="hex"||Y==="hex6"||Y==="hex3"||Y==="hex4"||Y==="hex8"||Y==="name");return Ge?Y==="name"&&this._a===0?this.toName():this.toRgbString():(Y==="rgb"&&(ce=this.toRgbString()),Y==="prgb"&&(ce=this.toPercentageRgbString()),(Y==="hex"||Y==="hex6")&&(ce=this.toHexString()),Y==="hex3"&&(ce=this.toHexString(!0)),Y==="hex4"&&(ce=this.toHex8String(!0)),Y==="hex8"&&(ce=this.toHex8String()),Y==="name"&&(ce=this.toName()),Y==="hsl"&&(ce=this.toHslString()),Y==="hsv"&&(ce=this.toHsvString()),ce||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(Y,oe){var ce=Y.apply(null,[this].concat([].slice.call(oe)));return this._r=ce._r,this._g=ce._g,this._b=ce._b,this.setAlpha(ce._a),this},lighten:function(){return this._applyModification(T,arguments)},brighten:function(){return this._applyModification(O,arguments)},darken:function(){return this._applyModification(R,arguments)},desaturate:function(){return this._applyModification(f,arguments)},saturate:function(){return this._applyModification(S,arguments)},greyscale:function(){return this._applyModification(C,arguments)},spin:function(){return this._applyModification(b,arguments)},_applyCombination:function(Y,oe){return Y.apply(null,[this].concat([].slice.call(oe)))},analogous:function(){return this._applyCombination(v,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(E,arguments)},splitcomplement:function(){return this._applyCombination(y,arguments)},triad:function(){return this._applyCombination(u,arguments)},tetrad:function(){return this._applyCombination(d,arguments)}},D.fromRatio=function(Y,oe){if(typeof Y=="object"){var ce={};for(var Re in Y)Y.hasOwnProperty(Re)&&(Re==="a"?ce[Re]=Y[Re]:ce[Re]=se(Y[Re]));Y=ce}return D(Y,oe)};function m(Y){var oe={r:0,g:0,b:0},ce=1,Re=null,Ge=null,Ne=null,Je=!1,rt=!1;return typeof Y=="string"&&(Y=ue(Y)),typeof Y=="object"&&(_e(Y.r)&&_e(Y.g)&&_e(Y.b)?(oe=g(Y.r,Y.g,Y.b),Je=!0,rt=String(Y.r).substr(-1)==="%"?"prgb":"rgb"):_e(Y.h)&&_e(Y.s)&&_e(Y.v)?(Re=se(Y.s),Ge=se(Y.v),oe=a(Y.h,Re,Ge),Je=!0,rt="hsv"):_e(Y.h)&&_e(Y.s)&&_e(Y.l)&&(Re=se(Y.s),Ne=se(Y.l),oe=o(Y.h,Re,Ne),Je=!0,rt="hsl"),Y.hasOwnProperty("a")&&(ce=Y.a)),ce=H(ce),{ok:Je,format:Y.format||rt,r:z(255,G(oe.r,0)),g:z(255,G(oe.g,0)),b:z(255,G(oe.b,0)),a:ce}}function g(Y,oe,ce){return{r:P(Y,255)*255,g:P(oe,255)*255,b:P(ce,255)*255}}function h(Y,oe,ce){Y=P(Y,255),oe=P(oe,255),ce=P(ce,255);var Re=G(Y,oe,ce),Ge=z(Y,oe,ce),Ne,Je,rt=(Re+Ge)/2;if(Re==Ge)Ne=Je=0;else{var _t=Re-Ge;Je=rt>.5?_t/(2-Re-Ge):_t/(Re+Ge);switch(Re){case Y:Ne=(oe-ce)/_t+(oe<ce?6:0);break;case oe:Ne=(ce-Y)/_t+2;break;case ce:Ne=(Y-oe)/_t+4;break}Ne/=6}return{h:Ne,s:Je,l:rt}}function o(Y,oe,ce){var Re,Ge,Ne;Y=P(Y,360),oe=P(oe,100),ce=P(ce,100);function Je(ft,ut,qe){return qe<0&&(qe+=1),qe>1&&(qe-=1),qe<1/6?ft+(ut-ft)*6*qe:qe<1/2?ut:qe<2/3?ft+(ut-ft)*(2/3-qe)*6:ft}if(oe===0)Re=Ge=Ne=ce;else{var rt=ce<.5?ce*(1+oe):ce+oe-ce*oe,_t=2*ce-rt;Re=Je(_t,rt,Y+1/3),Ge=Je(_t,rt,Y),Ne=Je(_t,rt,Y-1/3)}return{r:Re*255,g:Ge*255,b:Ne*255}}function l(Y,oe,ce){Y=P(Y,255),oe=P(oe,255),ce=P(ce,255);var Re=G(Y,oe,ce),Ge=z(Y,oe,ce),Ne,Je,rt=Re,_t=Re-Ge;if(Je=Re===0?0:_t/Re,Re==Ge)Ne=0;else{switch(Re){case Y:Ne=(oe-ce)/_t+(oe<ce?6:0);break;case oe:Ne=(ce-Y)/_t+2;break;case ce:Ne=(Y-oe)/_t+4;break}Ne/=6}return{h:Ne,s:Je,v:rt}}function a(Y,oe,ce){Y=P(Y,360)*6,oe=P(oe,100),ce=P(ce,100);var Re=$.floor(Y),Ge=Y-Re,Ne=ce*(1-oe),Je=ce*(1-Ge*oe),rt=ce*(1-(1-Ge)*oe),_t=Re%6,ft=[ce,Je,Ne,Ne,rt,ce][_t],ut=[rt,ce,ce,Je,Ne,Ne][_t],qe=[Ne,Ne,rt,ce,ce,Je][_t];return{r:ft*255,g:ut*255,b:qe*255}}function r(Y,oe,ce,Re){var Ge=[ie(I(Y).toString(16)),ie(I(oe).toString(16)),ie(I(ce).toString(16))];return Re&&Ge[0].charAt(0)==Ge[0].charAt(1)&&Ge[1].charAt(0)==Ge[1].charAt(1)&&Ge[2].charAt(0)==Ge[2].charAt(1)?Ge[0].charAt(0)+Ge[1].charAt(0)+Ge[2].charAt(0):Ge.join("")}function t(Y,oe,ce,Re,Ge){var Ne=[ie(I(Y).toString(16)),ie(I(oe).toString(16)),ie(I(ce).toString(16)),ie(ve(Re))];return Ge&&Ne[0].charAt(0)==Ne[0].charAt(1)&&Ne[1].charAt(0)==Ne[1].charAt(1)&&Ne[2].charAt(0)==Ne[2].charAt(1)&&Ne[3].charAt(0)==Ne[3].charAt(1)?Ne[0].charAt(0)+Ne[1].charAt(0)+Ne[2].charAt(0)+Ne[3].charAt(0):Ne.join("")}function c(Y,oe,ce,Re){var Ge=[ie(ve(Re)),ie(I(Y).toString(16)),ie(I(oe).toString(16)),ie(I(ce).toString(16))];return Ge.join("")}D.equals=function(Y,oe){return!Y||!oe?!1:D(Y).toRgbString()==D(oe).toRgbString()},D.random=function(){return D.fromRatio({r:L(),g:L(),b:L()})};function f(Y,oe){oe=oe===0?0:oe||10;var ce=D(Y).toHsl();return ce.s-=oe/100,ce.s=x(ce.s),D(ce)}function S(Y,oe){oe=oe===0?0:oe||10;var ce=D(Y).toHsl();return ce.s+=oe/100,ce.s=x(ce.s),D(ce)}function C(Y){return D(Y).desaturate(100)}function T(Y,oe){oe=oe===0?0:oe||10;var ce=D(Y).toHsl();return ce.l+=oe/100,ce.l=x(ce.l),D(ce)}function O(Y,oe){oe=oe===0?0:oe||10;var ce=D(Y).toRgb();return ce.r=G(0,z(255,ce.r-I(255*-(oe/100)))),ce.g=G(0,z(255,ce.g-I(255*-(oe/100)))),ce.b=G(0,z(255,ce.b-I(255*-(oe/100)))),D(ce)}function R(Y,oe){oe=oe===0?0:oe||10;var ce=D(Y).toHsl();return ce.l-=oe/100,ce.l=x(ce.l),D(ce)}function b(Y,oe){var ce=D(Y).toHsl(),Re=(ce.h+oe)%360;return ce.h=Re<0?360+Re:Re,D(ce)}function _(Y){var oe=D(Y).toHsl();return oe.h=(oe.h+180)%360,D(oe)}function u(Y){var oe=D(Y).toHsl(),ce=oe.h;return[D(Y),D({h:(ce+120)%360,s:oe.s,l:oe.l}),D({h:(ce+240)%360,s:oe.s,l:oe.l})]}function d(Y){var oe=D(Y).toHsl(),ce=oe.h;return[D(Y),D({h:(ce+90)%360,s:oe.s,l:oe.l}),D({h:(ce+180)%360,s:oe.s,l:oe.l}),D({h:(ce+270)%360,s:oe.s,l:oe.l})]}function y(Y){var oe=D(Y).toHsl(),ce=oe.h;return[D(Y),D({h:(ce+72)%360,s:oe.s,l:oe.l}),D({h:(ce+216)%360,s:oe.s,l:oe.l})]}function v(Y,oe,ce){oe=oe||6,ce=ce||30;var Re=D(Y).toHsl(),Ge=360/ce,Ne=[D(Y)];for(Re.h=(Re.h-(Ge*oe>>1)+720)%360;--oe;)Re.h=(Re.h+Ge)%360,Ne.push(D(Re));return Ne}function E(Y,oe){oe=oe||6;for(var ce=D(Y).toHsv(),Re=ce.h,Ge=ce.s,Ne=ce.v,Je=[],rt=1/oe;oe--;)Je.push(D({h:Re,s:Ge,v:Ne})),Ne=(Ne+rt)%1;return Je}D.mix=function(Y,oe,ce){ce=ce===0?0:ce||50;var Re=D(Y).toRgb(),Ge=D(oe).toRgb(),Ne=ce/100,Je={r:(Ge.r-Re.r)*Ne+Re.r,g:(Ge.g-Re.g)*Ne+Re.g,b:(Ge.b-Re.b)*Ne+Re.b,a:(Ge.a-Re.a)*Ne+Re.a};return D(Je)},D.readability=function(Y,oe){var ce=D(Y),Re=D(oe);return($.max(ce.getLuminance(),Re.getLuminance())+.05)/($.min(ce.getLuminance(),Re.getLuminance())+.05)},D.isReadable=function(Y,oe,ce){var Re=D.readability(Y,oe),Ge,Ne;Ne=!1,Ge=xe(ce);switch(Ge.level+Ge.size){case"AAsmall":case"AAAlarge":Ne=Re>=4.5;break;case"AAlarge":Ne=Re>=3;break;case"AAAsmall":Ne=Re>=7;break}return Ne},D.mostReadable=function(Y,oe,ce){var Re=null,Ge=0,Ne,Je,rt,_t;ce=ce||{},Je=ce.includeFallbackColors,rt=ce.level,_t=ce.size;for(var ft=0;ft<oe.length;ft++)Ne=D.readability(Y,oe[ft]),Ne>Ge&&(Ge=Ne,Re=D(oe[ft]));return D.isReadable(Y,Re,{level:rt,size:_t})||!Je?Re:(ce.includeFallbackColors=!1,D.mostReadable(Y,["#fff","#000"],ce))};var M=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=j(M);function j(Y){var oe={};for(var ce in Y)Y.hasOwnProperty(ce)&&(oe[Y[ce]]=ce);return oe}function H(Y){return Y=parseFloat(Y),(isNaN(Y)||Y<0||Y>1)&&(Y=1),Y}function P(Y,oe){V(Y)&&(Y="100%");var ce=q(Y);return Y=z(oe,G(0,parseFloat(Y))),ce&&(Y=parseInt(Y*oe,10)/100),$.abs(Y-oe)<1e-6?1:Y%oe/parseFloat(oe)}function x(Y){return z(1,G(0,Y))}function U(Y){return parseInt(Y,16)}function V(Y){return typeof Y=="string"&&Y.indexOf(".")!=-1&&parseFloat(Y)===1}function q(Y){return typeof Y=="string"&&Y.indexOf("%")!=-1}function ie(Y){return Y.length==1?"0"+Y:""+Y}function se(Y){return Y<=1&&(Y=Y*100+"%"),Y}function ve(Y){return $.round(parseFloat(Y)*255).toString(16)}function Te(Y){return U(Y)/255}var fe=function(){var Y="[-\\+]?\\d+%?",oe="[-\\+]?\\d*\\.\\d+%?",ce="(?:"+oe+")|(?:"+Y+")",Re="[\\s|\\(]+("+ce+")[,|\\s]+("+ce+")[,|\\s]+("+ce+")\\s*\\)?",Ge="[\\s|\\(]+("+ce+")[,|\\s]+("+ce+")[,|\\s]+("+ce+")[,|\\s]+("+ce+")\\s*\\)?";return{CSS_UNIT:new RegExp(ce),rgb:new RegExp("rgb"+Re),rgba:new RegExp("rgba"+Ge),hsl:new RegExp("hsl"+Re),hsla:new RegExp("hsla"+Ge),hsv:new RegExp("hsv"+Re),hsva:new RegExp("hsva"+Ge),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 _e(Y){return!!fe.CSS_UNIT.exec(Y)}function ue(Y){Y=Y.replace(k,"").replace(Q,"").toLowerCase();var oe=!1;if(M[Y])Y=M[Y],oe=!0;else if(Y=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var ce;return(ce=fe.rgb.exec(Y))?{r:ce[1],g:ce[2],b:ce[3]}:(ce=fe.rgba.exec(Y))?{r:ce[1],g:ce[2],b:ce[3],a:ce[4]}:(ce=fe.hsl.exec(Y))?{h:ce[1],s:ce[2],l:ce[3]}:(ce=fe.hsla.exec(Y))?{h:ce[1],s:ce[2],l:ce[3],a:ce[4]}:(ce=fe.hsv.exec(Y))?{h:ce[1],s:ce[2],v:ce[3]}:(ce=fe.hsva.exec(Y))?{h:ce[1],s:ce[2],v:ce[3],a:ce[4]}:(ce=fe.hex8.exec(Y))?{r:U(ce[1]),g:U(ce[2]),b:U(ce[3]),a:Te(ce[4]),format:oe?"name":"hex8"}:(ce=fe.hex6.exec(Y))?{r:U(ce[1]),g:U(ce[2]),b:U(ce[3]),format:oe?"name":"hex"}:(ce=fe.hex4.exec(Y))?{r:U(ce[1]+""+ce[1]),g:U(ce[2]+""+ce[2]),b:U(ce[3]+""+ce[3]),a:Te(ce[4]+""+ce[4]),format:oe?"name":"hex8"}:(ce=fe.hex3.exec(Y))?{r:U(ce[1]+""+ce[1]),g:U(ce[2]+""+ce[2]),b:U(ce[3]+""+ce[3]),format:oe?"name":"hex"}:!1}function xe(Y){var oe,ce;return Y=Y||{level:"AA",size:"small"},oe=(Y.level||"AA").toUpperCase(),ce=(Y.size||"small").toLowerCase(),oe!=="AA"&&oe!=="AAA"&&(oe="AA"),ce!=="small"&&ce!=="large"&&(ce="small"),{level:oe,size:ce}}Rt.exports?Rt.exports=D:!(ee=function(){return D}.call(Ze,K,Ze,Rt),ee!==void 0&&(Rt.exports=ee))})(Math)},a99f:function(Rt,Ze,K){"use strict";K.r(Ze);var ee=K("T2oS"),$=K("W9HT"),k=K("14J3"),Q=K("BMrR"),B=K("jCWc"),I=K("kPKH"),z=K("sPJy"),G=K("bE4q"),L=K("k1fw"),D=K("oBTY"),m=K("miYZ"),g=K("tsqr"),h=K("9og8"),o=K("tJVT"),l=K("WmNS"),a=K.n(l),r=K("cDcd"),t=K.n(r),c=K("Ty5D"),f=K("9kvl"),S=K("55Ip"),C=K("LvDl"),T=K("bbsP"),O=K("/wGt"),R=K("DjyN"),b=K("NUBc"),_=K("/zsF"),u=K("PArb"),d=K("5Dmo"),y=K("3S7+"),v=K("sRBo"),E=K("kaz8"),M=K("+L6B"),N=K("2/Rp"),j=K("5NDa"),H=K("5rEg"),P=K("xKgJ"),x=K("kCvp"),U=K.n(x),V=K("NLgs"),q=K("9z17"),ie=H.a.Search,se=[{id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]}],ve=[{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"}]}],Te=function(ae){var Se,$e=ae.classroomList,dt=ae.shixunsList,St=ae.dispatch,Dt=ae.callback,Mt=ae.inNewPaperLibrary,hr=Object(r.useState)(Object(L.a)({},Object(c.i)())),on=Object(o.a)(hr,2),fn=on[0],nn=on[1],kn=$e.shixunLists,dr=Object(r.useState)([]),pr=Object(o.a)(dr,2),Yn=pr[0],Tr=pr[1],Or=Object(r.useState)(""),Wt=Object(o.a)(Or,2),Ln=Wt[0],mr=Wt[1],vr=Object(r.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1,keyword:""}),Rr=Object(o.a)(vr,2),Sr=Rr[0],Wr=Rr[1];Object(r.useEffect)(function(){return $e.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")}},[$e.actionTabs.key]);var Ar=$e.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE";Object(r.useEffect)(function(){Ar&&St({type:"classroomList/getShixunLists",payload:Object(L.a)({},Sr)})},[fn.categoryId,Ar,Sr]),Object(r.useEffect)(function(){St({type:"shixunsList/getMenus",payload:{}})},[]),Object(r.useEffect)(function(){Tr([])},[$e.actionTabs.key]);var nt=Object(q.b)(),ke=Object(o.a)(nt,4),xt=ke[0],Ae=ke[1],me=ke[2],pe=ke[3],ir=function(at,ge,en){Sr.tag_level=at,Sr.sub_discipline_id=ge,Sr.discipline_id=en,Wr(Object(L.a)({},Sr))},Vt=function(){var we=Object(h.a)(a.a.mark(function at(ge){var en,sr;return a.a.wrap(function(Wn){for(;;)switch(Wn.prev=Wn.next){case 0:Dt&&Dt(kn==null||((en=kn.shixun_list)===null||en===void 0)?void 0:en.filter(function(Ft){return Ft.identifier===Yn[0]})[0],(sr=$e.actionTabs)===null||sr===void 0?void 0:sr.editData,ge),St({type:"classroomList/setActionTabs",payload:{}}),Ae();case 3:case"end":return Wn.stop()}},at)}));return function(ge){return we.apply(this,arguments)}}();return $e.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(){St({type:"classroomList/setActionTabs",payload:{key:""}})},visible:!!Ar,key:"bottom",className:U.a.drawer,footer:t.a.createElement("div",{className:"tc"},t.a.createElement(N.a,{size:"large",onClick:function(){St({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8}},"\u53D6\u6D88"),t.a.createElement(N.a,{size:"large",onClick:Object(h.a)(a.a.mark(function we(){var at;return a.a.wrap(function(en){for(;;)switch(en.prev=en.next){case 0:if(!(Yn.length>1)){en.next=4;break}g.b.error("\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u5B9E\u8DF5\u9879\u76EE"),en.next=16;break;case 4:if(!(Yn.length===0)){en.next=8;break}g.b.error("\u8BF7\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE"),en.next=16;break;case 8:if(!Mt){en.next=12;break}Vt(0),en.next=16;break;case 12:return en.next=14,pe({id:Yn[0],course_id:fn.coursesId,type:"shixun"});case 14:at=en.sent,at||Vt(0);case 16:case"end":return en.stop()}},we)})),type:"primary"},"\u786E\u5B9A"))},t.a.createElement("section",{className:"tc"},t.a.createElement(ie,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"large",value:Ln,onChange:function(at){return mr(at.target.value)},className:U.a.search,onSearch:function(at){Sr.keyword=at,Sr.page=1,Wr(Object(L.a)({},Sr))}})),t.a.createElement("section",{className:"edu-container"},se.map(function(we,at){var ge;return t.a.createElement("ul",{className:U.a.menu,key:at},t.a.createElement("li",null,we.name),we==null||((ge=we.children)===null||ge===void 0)?void 0:ge.map(function(en,sr){return t.a.createElement("li",{key:sr,className:Sr[we.id]==en.id?U.a.actived:"",onClick:function(){Sr[we.id]=en.id,Wr(Object(L.a)({},Sr)),St({type:"classroomList/getShixunLists",payload:Object(L.a)({},Sr)})}},t.a.createElement("strong",null,en.name))}))}),t.a.createElement("ul",{className:U.a.menut},t.a.createElement("span",{style:{padding:"18px",fontWeight:"600"}},"\u65B9\u5411\uFF1A"),t.a.createElement("li",{className:Sr.discipline_id?"":U.a.actived3,onClick:function(){ir(null,null,null)}},t.a.createElement("strong",null,"\u5168\u90E8")),dt.menus&&dt.menus.map(function(we,at){return t.a.createElement("li",{key:at,className:Sr.discipline_id==we.id?U.a.actived3:""},t.a.createElement("strong",{onClick:function(){ir(1,null,we.id)}},we.name),t.a.createElement("div",null,we.sub_repertoires.map(function(ge,en){return t.a.createElement("div",{key:en,className:"mt5"},t.a.createElement("div",{className:Sr.sub_discipline_id==ge.id?"".concat(U.a.actived4," ").concat(U.a.subTag):U.a.subTag,onClick:function(){ir(2,ge.id,we.id)}},ge.name),t.a.createElement("ul",{className:"mt5"},ge.tags&&ge.tags.map(function(sr,ur){return t.a.createElement("li",{key:ur,className:Sr.sub_discipline_id==sr.id?U.a.actived4:"",onClick:function(){ir(3,sr.id,we.id)}},sr.name)})))})))})),ve.map(function(we,at){var ge;return t.a.createElement("ul",{className:U.a.menu,key:at},t.a.createElement("li",null,we.name),we==null||((ge=we.children)===null||ge===void 0)?void 0:ge.map(function(en,sr){return t.a.createElement("li",{key:sr,className:Sr[we.id]==en.id?U.a.actived:"",onClick:function(){Sr[we.id]=en.id,Wr(Object(L.a)({},Sr)),St({type:"classroomList/getShixunLists",payload:Object(L.a)({},Sr)})}},t.a.createElement("strong",null,en.name))}))}),t.a.createElement("div",{className:U.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"},Yn.length),"\u4E2A\u5B9E\u8BAD"),t.a.createElement("li",null,"\u5171",t.a.createElement("span",{className:"c-blue"},kn.shixuns_count),"\u4E2A\u8BFE\u7A0B"),t.a.createElement("li",{className:"current",onClick:function(){Sr.order=Sr.order==="asc"?"desc":"asc",Wr(Object(L.a)({},Sr))}},"\u5B66\u4E60\u4EBA\u6570",t.a.createElement("p",{className:"edu-sorter current ".concat(Sr.order)},Sr.order==="asc"?t.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):t.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"}))))),t.a.createElement(E.a.Group,{style:{display:"block"},value:Yn,onChange:function(at){Tr(at)}},kn==null||((Se=kn.shixun_list)===null||Se===void 0)?void 0:Se.map(function(we,at){return t.a.createElement("div",{className:U.a.listItem,key:we.identifier},t.a.createElement(E.a,{value:we.identifier,disabled:we==null?void 0:we.need_authorize}),t.a.createElement("div",{className:U.a.info},t.a.createElement("div",{className:U.a.title},t.a.createElement("div",{className:U.a.titleLeft},t.a.createElement(S.a,{to:"/shixuns/".concat(we.identifier,"/challenges"),target:"_blank"},t.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:we.title}})),(we==null?void 0:we.need_authorize)&&t.a.createElement("span",{onClick:function(){Object(V.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(P.v)()&&(we==null?void 0:we.mark_status)===1&&t.a.createElement(y.a,{title:we==null?void 0:we.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(P.v)()&&(we==null?void 0:we.mark_status)===2&&t.a.createElement(y.a,{title:we==null?void 0:we.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(P.v)()&&(we==null?void 0:we.mark_status)===3&&t.a.createElement(y.a,{title:we==null?void 0:we.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:U.a.description,dangerouslySetInnerHTML:{__html:we.description}})),t.a.createElement("div",{className:"flex-wrp mt15"},we.challenge_names.map(function(ge,en){return t.a.createElement("span",{key:en,className:"mr30"},"\u7B2C",en+1,"\u5173 ",ge," ")})),t.a.createElement(u.a,{dashed:!0}),t.a.createElement("div",{className:"c-light-black mt20"},t.a.createElement("span",null,we.author_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,we.author_school_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",we.level),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),t.a.createElement("span",null,we.study_count))))})),t.a.createElement("p",null)),t.a.createElement("div",{className:"tc"},t.a.createElement(b.a,{defaultCurrent:1,current:Sr.page||1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,showSizeChanger:!1,total:kn==null?void 0:kn.shixuns_count,onChange:function(at){Sr.page=at,Wr(Object(L.a)({},Sr)),Tr([])}})),t.a.createElement(q.a,{visible:xt,onCancel:Ae,onOk:Vt,renderData:me,inPaper:!0,modalType:"single",type:"shixun"}))},fe=Object(f.a)(function(ye){var ae=ye.classroomList,Se=ye.shixunsList,$e=ye.user;return{classroomList:ae,shixunsList:Se,user:$e}})(Te),_e=K("sZF6"),ue=K("2aBv"),xe=K("zWo0"),Y=K.n(xe),oe=K("LYsE"),ce=K("1vsH"),Re=K("vCeJ"),Ge=K("7Kak"),Ne=K("9yH6"),Je=K("giR+"),rt=K("fyUT"),_t=K("6UJt"),ft=K("DFOY"),ut=K("rAM+"),qe=K("y8nQ"),Ct=K("Vl3Y"),kt=K("ZWs3"),Kt=function(ae){var Se=ae.initValue,$e=ae.courseOptions,dt=ae.setIsEdit,St=ae.setEditKey,Dt=ae.reload,Mt=Ct.a.useForm(),hr=Object(o.a)(Mt,1),on=hr[0],fn=Object(c.i)(),nn=Object(r.useMemo)(function(){var kn=Se==null?void 0:Se.sub_discipline_id,dr=[],pr=Object(ut.a)($e),Yn;try{for(pr.s();!(Yn=pr.n()).done;){var Tr=Yn.value,Or=Object(ut.a)(Tr.children),Wt;try{for(Or.s();!(Wt=Or.n()).done;){var Ln=Wt.value;Ln.value===kn&&(dr=[Tr.value,Ln.value])}}catch(vr){Or.e(vr)}finally{Or.f()}}}catch(vr){pr.e(vr)}finally{pr.f()}var mr=Se.time;return Object(L.a)(Object(L.a)({},Se),{},{sub_discipline_id:dr,time:mr===-1?null:mr})},[Se,$e]);return t.a.createElement(Ct.a,{initialValues:nn,layout:"vertical",form:on,className:Y.a.formWrap},t.a.createElement(Ct.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(ft.a,{placeholder:"\u8BF7\u9009\u62E9...",options:$e})),t.a.createElement(Ct.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(H.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(Ct.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F"},t.a.createElement(rt.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(Ct.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},t.a.createElement(Ne.a.Group,null,t.a.createElement(Ne.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(Ne.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(Ne.a.Button,{value:3},"\u56F0\u96BE"))),t.a.createElement(Ct.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},t.a.createElement(H.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(Ct.a.Item,{className:"tr"},t.a.createElement(kt.a,{type:"primary",onClick:Object(h.a)(a.a.mark(function kn(){var dr,pr;return a.a.wrap(function(Tr){for(;;)switch(Tr.prev=Tr.next){case 0:return Tr.next=2,on.validateFields();case 2:return dr=on.getFieldsValue(),dr.sub_discipline_id=dr.sub_discipline_id[1],Tr.next=6,Object(Re.z)(Object(L.a)({id:fn.id},dr));case 6:pr=Tr.sent,pr.status===0&&(dt(!1),St(-1),Dt());case 8:case"end":return Tr.stop()}},kn)}))},"\u4FDD\u5B58"),t.a.createElement(N.a,{style:{marginLeft:10},onClick:function(){on.resetFields(),dt(!1)}},"\u53D6\u6D88")))},zt=Kt,ln=K("g9YV"),un=K("wCAj"),We=K("+BqJ"),je=K.n(We),ht=K("9Bee"),ct=function(ae){var Se=ae.isPreview,$e=Se===void 0?!1:Se,dt=ae.isExportBlank,St=dt===void 0?!1:dt,Dt=ae.newExercisePaper,Mt=ae.setIsEdit,hr=Object(c.i)(),on=Object(r.useState)(),fn=Object(o.a)(on,2),nn=fn[0],kn=fn[1],dr=Object(r.useState)(),pr=Object(o.a)(dr,2),Yn=pr[0],Tr=pr[1],Or=Object(r.useRef)(null),Wt=Object(r.useState)(21),Ln=Object(o.a)(Wt,2),mr=Ln[0],vr=Ln[1];Object(r.useEffect)(function(){Rr()},[]),Object(r.useEffect)(function(){Or.current&&vr(Or.current.clientHeight)},[Or.current]),Object(r.useEffect)(function(){var nt;if((nt=Dt.exerciseExportHeadData)!==null&&nt!==void 0&&nt.title){var ke=Dt.exerciseExportHeadData;kn(Object(L.a)({},ke||{}));var xt=ke||{},Ae=xt.table,me,pe;(Ae!=null&&Ae.total_singles_scores||Ae!=null&&Ae.total_doubles_scores||Ae!=null&&Ae.total_nulls_scores||Ae!=null&&Ae.total_judges_scores||Ae!=null&&Ae.total_pros_scores||Ae!=null&&Ae.total_shixuns_scores||Ae!=null&&Ae.total_mains_scores||Ae!=null&&Ae.total_combination_scores)&&(me=Number(Ae==null?void 0:Ae.total_singles_scores)+Number(Ae==null?void 0:Ae.total_doubles_scores)+Number(Ae==null?void 0:Ae.total_nulls_scores)+Number(Ae==null?void 0:Ae.total_judges_scores)+Number(Ae==null?void 0:Ae.total_pros_scores)+Number(Ae==null?void 0:Ae.total_shixuns_scores)+Number(Ae==null?void 0:Ae.total_mains_scores)+Number(Ae==null?void 0:Ae.total_combination_scores)),(Ae!=null&&Ae.singles_scores||Ae!=null&&Ae.doubles_scores||Ae!=null&&Ae.nulls_scores||Ae!=null&&Ae.judges_scores||Ae!=null&&Ae.pros_scores||Ae!=null&&Ae.shixuns_scores||Ae!=null&&Ae.mains_scores||Ae!=null&&Ae.combination_scores)&&(pe=Number(Ae==null?void 0:Ae.singles_scores)+Number(Ae==null?void 0:Ae.doubles_scores)+Number(Ae==null?void 0:Ae.nulls_scores)+Number(Ae==null?void 0:Ae.judges_scores)+Number(Ae==null?void 0:Ae.pros_scores)+Number(Ae==null?void 0:Ae.shixuns_scores)+Number(Ae==null?void 0:Ae.mains_scores)+Number(Ae==null?void 0:Ae.combination_scores));var ir=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Ae==null?void 0:Ae.total_singles_scores,doubles_score:Ae==null?void 0:Ae.total_doubles_scores,nulls_score:Ae==null?void 0:Ae.total_nulls_scores,judges_score:Ae==null?void 0:Ae.total_judges_scores,pros_score:Ae==null?void 0:Ae.total_pros_scores,shixuns_score:Ae==null?void 0:Ae.total_shixuns_scores,mains_score:Ae==null?void 0:Ae.total_mains_scores,combinations_score:Ae==null?void 0:Ae.total_combination_scores,total_score:me},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:Ae==null?void 0:Ae.singles_scores,doubles_score:Ae==null?void 0:Ae.doubles_scores,nulls_score:Ae==null?void 0:Ae.nulls_scores,judges_score:Ae==null?void 0:Ae.judges_scores,pros_score:Ae==null?void 0:Ae.pros_scores,shixuns_score:Ae==null?void 0:Ae.shixuns_scores,mains_score:Ae==null?void 0:Ae.mains_scores,combinations_score:Ae==null?void 0:Ae.combination_scores,total_score:pe},{key:"3",name:"\u8BC4\u5377\u4EBA"}],Vt=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:Ae==null?void 0:Ae.total_singles_scores,doubles_score:Ae==null?void 0:Ae.total_doubles_scores,nulls_score:Ae==null?void 0:Ae.total_nulls_scores,judges_score:Ae==null?void 0:Ae.total_judges_scores,pros_score:Ae==null?void 0:Ae.total_pros_scores,shixuns_score:Ae==null?void 0:Ae.total_shixuns_scores,mains_score:Ae==null?void 0:Ae.total_mains_scores,combinations_score:Ae==null?void 0:Ae.combination_scores,total_score:me},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}];Tr(Object(D.a)(St?Vt:ir))}},[Dt.exerciseExportHeadData]);var Rr=function(){var nt=Object(h.a)(a.a.mark(function ke(){var xt,Ae,me,pe,ir,Vt,we;return a.a.wrap(function(ge){for(;;)switch(ge.prev=ge.next){case 0:return ge.next=2,Object(Re.m)(hr.id);case 2:xt=ge.sent,kn(xt||{}),Ae=xt||{},me=Ae.table,(me!=null&&me.total_singles_scores||me!=null&&me.total_doubles_scores||me!=null&&me.total_nulls_scores||me!=null&&me.total_judges_scores||me!=null&&me.total_pros_scores||me!=null&&me.total_shixuns_scores||me!=null&&me.total_mains_scores||me!=null&&me.total_combination_scores)&&(pe=Number(me==null?void 0:me.total_singles_scores)+Number(me==null?void 0:me.total_doubles_scores)+Number(me==null?void 0:me.total_nulls_scores)+Number(me==null?void 0:me.total_judges_scores)+Number(me==null?void 0:me.total_pros_scores)+Number(me==null?void 0:me.total_shixuns_scores)+Number(me==null?void 0:me.total_mains_scores)+Number(me==null?void 0:me.total_combination_scores)),(me!=null&&me.singles_scores||me!=null&&me.doubles_scores||me!=null&&me.nulls_scores||me!=null&&me.judges_scores||me!=null&&me.pros_scores||me!=null&&me.shixuns_scores||me!=null&&me.mains_scores||me!=null&&me.combinations_score)&&(ir=Number(me==null?void 0:me.singles_scores)+Number(me==null?void 0:me.doubles_scores)+Number(me==null?void 0:me.nulls_scores)+Number(me==null?void 0:me.judges_scores)+Number(me==null?void 0:me.pros_scores)+Number(me==null?void 0:me.shixuns_scores)+Number(me==null?void 0:me.mains_scores)+Number(me==null?void 0:me.combinations_score)),Vt=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:me==null?void 0:me.total_singles_scores,doubles_score:me==null?void 0:me.total_doubles_scores,nulls_score:me==null?void 0:me.total_nulls_scores,judges_score:me==null?void 0:me.total_judges_scores,pros_score:me==null?void 0:me.total_pros_scores,shixuns_score:me==null?void 0:me.total_shixuns_scores,combinations_score:me==null?void 0:me.total_combination_scores,mains_score:me==null?void 0:me.total_mains_scores,total_score:pe},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:me==null?void 0:me.singles_scores,doubles_score:me==null?void 0:me.doubles_scores,nulls_score:me==null?void 0:me.nulls_scores,judges_score:me==null?void 0:me.judges_scores,pros_score:me==null?void 0:me.pros_scores,shixuns_score:me==null?void 0:me.shixuns_scores,mains_score:me==null?void 0:me.mains_scores,combinations_score:me==null?void 0:me.combination_scores,total_score:ir},{key:"3",name:"\u8BC4\u5377\u4EBA"}],we=[{key:"1",name:"\u5E94\u5F97\u5206"},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}],Tr(St?we:Vt);case 10:case"end":return ge.stop()}},ke)}));return function(){return nt.apply(this,arguments)}}(),Sr=[{width:"10%",title:"\u9898\u578B",align:"center",dataIndex:"name",render:function(ke){return t.a.createElement("a",null,ke)}},{width:"10%",title:"\u5355\u9009\u9898",align:"center",dataIndex:"singles_score",render:function(ke){return t.a.createElement("a",null,ke==="0.0"?0:ke)}},{width:"10%",title:"\u591A\u9009\u9898",align:"center",dataIndex:"doubles_score",render:function(ke){return t.a.createElement("a",null,ke==="0.0"?0:ke)}},{width:"10%",title:"\u586B\u7A7A\u9898",align:"center",dataIndex:"nulls_score",render:function(ke){return t.a.createElement("a",null,ke==="0.0"?0:ke)}},{width:"10%",title:"\u5224\u65AD\u9898",align:"center",dataIndex:"judges_score",render:function(ke){return t.a.createElement("a",null,ke==="0.0"?0:ke)}},{width:"10%",title:"\u7F16\u7A0B\u9898",align:"center",dataIndex:"pros_score",render:function(ke){return t.a.createElement("a",null,ke==="0.0"?0:ke)}},{width:"10%",title:"\u5B9E\u8BAD\u9898",align:"center",dataIndex:"shixuns_score",render:function(ke){return t.a.createElement("a",null,ke==="0.0"?0:ke)}},{width:"10%",title:"\u7B80\u7B54\u9898",align:"center",dataIndex:"mains_score",render:function(ke){return t.a.createElement("a",null,ke==="0.0"?0:ke)}},{width:"10%",title:"\u7EC4\u5408\u9898",align:"center",dataIndex:"combinations_score",render:function(ke){return t.a.createElement("a",null,ke==="0.0"?0:ke)}},{width:"10%",title:"\u603B\u5206",align:"center",dataIndex:"total_score",render:function(ke){return t.a.createElement("a",null,ke==="0.0"?0:ke)}}],Wr=nn||{},Ar=Wr.exercise_header;return t.a.createElement(t.a.Fragment,null,t.a.createElement("section",{className:"".concat(je.a.wrap," ").concat($e?"pl20":""," ")},(nn==null?void 0:nn.photo_url)&&t.a.createElement("img",{className:je.a.img,src:nn==null?void 0:nn.photo_url}),t.a.createElement("div",{style:{width:"100%",textAlign:"end"}},t.a.createElement(N.a,{onClick:function(){return Mt(!0)}},"\u7F16\u8F91\u8BD5\u5377")),(Ar==null?void 0:Ar.show_title)&&t.a.createElement("p",{className:"font16 tc c-grey-333"},t.a.createElement("strong",null,nn==null?void 0:nn.title)),(nn==null?void 0:nn.exercise_description)&&t.a.createElement("span",{ref:Or,style:{justifyContent:mr===21?"center":"left",wordBreak:"break-all",display:"flex",textAlign:"left",marginBottom:12},className:"tc c-grey-333"},"\u8BD5\u5377\u987B\u77E5\uFF1A".concat(nn==null?void 0:nn.exercise_description)),(Ar==null?void 0:Ar.show_info)&&t.a.createElement("p",{className:"tc c-grey-666"},"\u5171:\u3010",nn==null?void 0:nn.large_counts,"\u5927\u9898\u3011\u3010",nn==null?void 0:nn.total_count,"\u5C0F\u9898\u3011\u3010 \u6EE1\u5206",nn==null?void 0:nn.score,"\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010",(nn==null?void 0:nn.time)>-1?"".concat(nn==null?void 0:nn.time,"\u5206\u949F"):"\u4E0D\u9650","\u3011"),(Ar==null?void 0:Ar.show_desc)&&t.a.createElement("div",{className:"mt10"},t.a.createElement("p",{className:"font16"},"\u8003\u8BD5\u8BF4\u660E\uFF1A"),t.a.createElement(ht.a,{value:nn==null?void 0:nn.description})),(Ar==null?void 0:Ar.show_table)&&t.a.createElement("div",{className:"mt10"},t.a.createElement(un.a,{className:je.a.table,columns:Sr,dataSource:Object(D.a)(Yn||[]),bordered:!0,pagination:!1}))))},He=Object(f.a)(function(ye){var ae=ye.newExercisePaper;return{newExercisePaper:ae}})(ct),lt=K("VYcG"),Pe=function(ae){var Se=ae.onImport,$e=ae.questionType,dt=ae.onAdd,St=ae.onSort,Dt=ae.user,Mt=Object(c.i)(),hr=function(){var on=Object(h.a)(a.a.mark(function fn(){var nn,kn;return a.a.wrap(function(pr){for(;;)switch(pr.prev=pr.next){case 0:return pr.next=2,Object(Re.h)(Mt.id);case 2:nn=pr.sent,nn.status===0&&f.d.push("/classrooms/coursesId/exercise/".concat(nn.exercise_id,"/").concat((kn=Dt.userInfo)===null||kn===void 0?void 0:kn.login,"/initate_answer"));case 4:case"end":return pr.stop()}},fn)}));return function(){return on.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:[Y.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(){f.d.push("/paperlibrary/edit_select/".concat(Mt.id))}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),t.a.createElement(N.a,{style:{height:30,marginRight:27,width:104},type:"primary",onClick:Se},"\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}},$e.map(function(on){return t.a.createElement("span",{key:on.id,className:Y.a.button,onClick:function(){return dt(on.id)}},t.a.createElement("i",{className:"iconfont icon-tianjiashitixiaojiahao mr5",style:{fontSize:"10px",color:"#B1BACD"}}),on.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:St},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(S.a,{to:"/paperlibrary/see/".concat(Mt.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(C.throttle)(hr,3500)},t.a.createElement("i",{className:"iconfont icon-monikaoshi1 mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u6A21\u62DF\u8003\u8BD5")))},Oe=Object(f.a)(function(ye){var ae=ye.user;return{user:ae}})(Pe),Ce=K("hQp1"),le=function(ae){var Se,$e,dt,St=ae.exercise,Dt=ae.newExercisePaper,Mt=ae.user,hr=ae.dispatch,on=Object(c.i)(),fn=Object(r.useState)(!1),nn=Object(o.a)(fn,2),kn=nn[0],dr=nn[1],pr=Object(r.useState)(!1),Yn=Object(o.a)(pr,2),Tr=Yn[0],Or=Yn[1],Wt=Object(r.useState)(-1),Ln=Object(o.a)(Wt,2),mr=Ln[0],vr=Ln[1],Rr=Object(r.useRef)(),Sr=[{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"}],Wr=Object(ce.J)();Object(r.useEffect)(function(){return hr({type:"globalSetting/footerToggle",payload:!1}),function(){hr({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(r.useEffect)(function(){ir()},[]);var Ar=Object(lt.useCourseOptions)();Object(r.useEffect)(function(){var bn,sn,$t;if(Dt!=null&&(bn=Dt.editData)!==null&&bn!==void 0&&bn.exercise_question_types){var Dn,hn;me(Object(C.cloneDeep)(Dt==null||((Dn=Dt.editData)===null||Dn===void 0)?void 0:Dn.exercise_question_types)),pe.current=Object(C.cloneDeep)(Dt==null||((hn=Dt.editData)===null||hn===void 0)?void 0:hn.exercise_question_types)}var Jt=(sn=Dt.editData)===null||sn===void 0||(($t=sn.exercise)===null||$t===void 0)?void 0:$t.sub_discipline_id;Jt&&nt(Jt)},[Dt.editData]);var nt=function(){var bn=Object(h.a)(a.a.mark(function sn($t){return a.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:return hn.next=2,hr({type:"newExercisePaper/getTagDiscipline",payload:{sub_discipline_id:$t}});case 2:case"end":return hn.stop()}},sn)}));return function($t){return bn.apply(this,arguments)}}(),ke=Object(r.useState)(),xt=Object(o.a)(ke,2),Ae=xt[0],me=xt[1],pe=Object(r.useRef)(Ae),ir=function(){var bn=Object(h.a)(a.a.mark(function sn(){var $t;return a.a.wrap(function(hn){for(;;)switch(hn.prev=hn.next){case 0:$t=hr({type:"newExercisePaper/editExercise",payload:{id:on.id}}),$t.status===0&&me($t.exercise_question_types);case 2:case"end":return hn.stop()}},sn)}));return function(){return bn.apply(this,arguments)}}(),Vt=function(){var bn=Object(h.a)(a.a.mark(function sn($t){var Dn,hn,Jt,It,jt,tr,nr;return a.a.wrap(function(yn){for(;;)switch(yn.prev=yn.next){case 0:if(!(mr!==-1)){yn.next=3;break}return g.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898"),yn.abrupt("return");case 3:if(!($t===Ce.a.Shixun)){yn.next=7;break}hr({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}),yn.next=21;break;case 7:if(!($t===Ce.a.Program)){yn.next=11;break}f.d.push("/problems/new?difficult=".concat((Dn=Dt.editData)===null||Dn===void 0||((hn=Dn.exercise)===null||hn===void 0)?void 0:hn.difficulty,"&sub_discipline_id=").concat((Jt=Dt.editData)===null||Jt===void 0||((It=Jt.exercise)===null||It===void 0)?void 0:It.sub_discipline_id,"&express_id=").concat(on.id,"&callback_url=").concat(location.pathname)),yn.next=21;break;case 11:if(tr=Ae.find(function(Nt){return Nt.question_type===$t}),tr){yn.next=18;break}return pe.current=Object(C.cloneDeep)(Ae),Ae.push({name:Sr.find(function(Nt){return Nt.id===$t}).name,question_type:$t,count:0,score:0,items:[{key:1,insert_id:1,question_type:$t}]}),me(Object(D.a)(Ae)),vr("".concat($t,"-",1)),yn.abrupt("return");case 18:setTimeout(function(){var Nt;(Nt=document.getElementById("".concat($t,"-").concat(tr.count-1)))===null||Nt===void 0||Nt.scrollIntoView()},400),nr={key:tr.count,insert_id:(jt=tr.items[tr.count])===null||jt===void 0?void 0:jt.question_id,question_type:$t},at(nr);case 21:case"end":return yn.stop()}},sn)}));return function($t){return bn.apply(this,arguments)}}(),we=function(){vr(-1),me(pe.current)},at=function(){var sn=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(pe.current=Object(C.cloneDeep)(Ae),sn.question_type===Ce.a.Program){var $t,Dn,hn,Jt;return f.d.push("/problems/new?difficult=".concat(($t=Dt.editData)===null||$t===void 0||((Dn=$t.exercise)===null||Dn===void 0)?void 0:Dn.difficulty,"&sub_discipline_id=").concat((hn=Dt.editData)===null||hn===void 0||((Jt=hn.exercise)===null||Jt===void 0)?void 0:Jt.sub_discipline_id,"&express_id=").concat(on.id,"&callback_url=").concat(location.pathname)),!1}Ae.map(function(It){if(It.question_type===sn.question_type){var jt=Object(C.cloneDeep)(It.items);jt.splice(sn==null?void 0:sn.key,0,Object(L.a)({insert_id:sn==null?void 0:sn.insert_id},sn)),It.items=jt}return It}),me(Object(D.a)(Ae)),vr("".concat(sn.question_type,"-").concat(sn.key+1))},ge={ref:Rr,editKey:mr,hideAction:!1,cancelAdd:function(){return we()},setEditKey:function(sn){return vr(sn)},addCallback:function(sn){return at(sn)}},en=Object(r.useState)(!1),sr=Object(o.a)(en,2),ur=sr[0],Wn=sr[1],Ft=function(){var bn=Object(h.a)(a.a.mark(function sn($t,Dn){var hn,Jt;return a.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:if(!($t.length===0)){jt.next=4;break}return g.b.warn("\u8BF7\u4E0A\u4F20\u6587\u4EF6"),Dn(),jt.abrupt("return");case 4:return jt.next=6,Object(Re.s)(on.id,(hn=$t[0])===null||hn===void 0?void 0:hn.file);case 6:Jt=jt.sent,Jt.status===0&&(g.b.success("\u6210\u529F\u5BFC\u5165".concat(Jt==null?void 0:Jt.success,"\u6761")),Wn(!1),ir());case 8:case"end":return jt.stop()}},sn)}));return function($t,Dn){return bn.apply(this,arguments)}}(),or=function(){var bn=Object(h.a)(a.a.mark(function sn($t,Dn){var hn;return a.a.wrap(function(It){for(;;)switch(It.prev=It.next){case 0:return It.next=2,Object(Re.y)(on.id,{question_type:$t});case 2:hn=It.sent,(hn==null?void 0:hn.status)===0&&(g.b.success(hn==null?void 0:hn.message),Or(!1),ir()),Dn();case 5:case"end":return It.stop()}},sn)}));return function($t,Dn){return bn.apply(this,arguments)}}(),ot=function(){if(mr!==-1){g.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002");return}Wn(!0)},Mn=function(){var bn=Object(h.a)(a.a.mark(function sn($t,Dn,hn){var Jt,It,jt;return a.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:return pe.current=Object(C.cloneDeep)(Ae),Jt=Ae.findIndex(function(Un){return Un.question_type===hn}),It=Ae,It[Jt].items=Dn,me(Object(D.a)(It)),nr.next=7,Object(Re.a)({id:on.id,itemId:parseInt($t.draggableId),position:$t.destination.index+1});case 7:jt=nr.sent;case 8:case"end":return nr.stop()}},sn)}));return function($t,Dn,hn){return bn.apply(this,arguments)}}();return t.a.createElement("div",null,t.a.createElement("section",{className:"edu-container minH500"},t.a.createElement($.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(G.a,{separator:">"},t.a.createElement(G.a.Item,null,t.a.createElement(S.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),t.a.createElement(G.a.Item,null,"\u7F16\u8F91\u8BD5\u5377"))),t.a.createElement("aside",{className:"".concat(Y.a.title," mt20")},t.a.createElement(Q.a,{style:{width:"100%"}},t.a.createElement(I.a,{flex:"1"},t.a.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91\u8BD5\u5377")),t.a.createElement(I.a,null,t.a.createElement(S.a,{className:"font16 c-light-black",to:(Wr==null?void 0:Wr.fromadd)==="1"?"/paperlibrary/add/".concat(on.id):"/paperlibrary"},"\u8FD4\u56DE"))))),t.a.createElement("section",{className:[Y.a.bg,"pt30","pl30","pr30","pb60","mt20"].join(" ")},!kn&&t.a.createElement(He,{setIsEdit:dr,isExportBlank:!1}),kn&&t.a.createElement(zt,{initValue:(Se=Dt.editData)===null||Se===void 0?void 0:Se.exercise,setIsEdit:dr,courseOptions:Ar,reload:ir,setEditKey:vr})),Ae&&t.a.createElement("section",{className:[Y.a.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},t.a.createElement(oe.a,{inNewPaperLibrary:!0,data:Ae,editorProps:ge,isDragDisabled:mr!==-1,onDragEnd:Mn,batchScore:["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u7F16\u7A0B\u9898"],reload:ir})),t.a.createElement(fe,{inNewPaperLibrary:!0,callback:function(sn,$t,Dn){var hn;pe.current=Object(C.cloneDeep)(Ae);var Jt={shixun:sn.challenge_names.map(function(tr){return{challenge_name:tr,challenge_score:5}}),shixun_name:sn==null||((hn=sn.title)===null||hn===void 0)?void 0:hn.replace(/<.*?>/gi,""),shixun_id:sn.id,question_type:5,edit:!0,is_copy:Dn};if($t&&(Ae.map(function(tr){if(tr.question_type===5){var nr=Object(C.cloneDeep)(tr.items);nr.splice($t==null?void 0:$t.key,0,Jt),tr.items=nr}return tr}),vr("5-".concat(Ae.key+1)),me(Object(D.a)(Ae))),!$t){var It,jt=Ae.find(function(tr){return tr.question_type===5});if(!jt){Ae.push({name:Sr.find(function(tr){return tr.id===5}).name,question_type:5,count:0,score:0,items:[Jt]}),me(Object(D.a)(Ae)),vr("".concat(5,"-",1));return}(It=document.getElementById("".concat(5,"-",jt.count-1)))===null||It===void 0||It.scrollIntoView({block:"center",inline:"nearest"}),jt.items.push(Jt),me(Object(D.a)(Ae)),vr("".concat(5,"-",jt.count))}}})),t.a.createElement(_e.a,{visible:ur,onCancel:function(){return Wn(!1)},onOk:Ft}),t.a.createElement(ue.a,{visible:Tr,onCancel:function(){return Or(!1)},onOk:or,data:($e=Dt.editData)===null||$e===void 0||((dt=$e.exercise)===null||dt===void 0)?void 0:dt.sort_by_qustion_type})),t.a.createElement(Oe,{questionType:Sr,onAdd:Vt,onImport:ot,onSort:function(){return Or(!0)}}))},he=Ze.default=Object(f.a)(function(ye){var ae=ye.exercise,Se=ye.newExercisePaper,$e=ye.user;return{exercise:ae,user:$e,newExercisePaper:Se}})(le)},bT9E:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return $});var ee=K("VTBJ");function $(k,Q){var B=Object(ee.a)({},k);return Array.isArray(Q)&&Q.forEach(function(I){delete B[I]}),B}},biw7:function(Rt,Ze,K){"use strict";var ee=K("cDcd"),$=K.n(ee),k=ee.createContext(null);Ze.a=k},c5Ni:function(Rt,Ze,K){},dejd:function(Rt,Ze,K){},dmUQ:function(Rt,Ze,K){"use strict";var ee=K("Ff2n"),$=K("rePB"),k=K("1OyB"),Q=K("vuIU"),B=K("Ji7U"),I=K("md7G"),z=K("foSv"),G=K("cDcd"),L=K.n(G),D=K("TSYQ"),m=K.n(D),g=K("4IlW");function h(u,d){var y=Object.keys(u);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(u);d&&(v=v.filter(function(E){return Object.getOwnPropertyDescriptor(u,E).enumerable})),y.push.apply(y,v)}return y}function o(u){for(var d=1;d<arguments.length;d++){var y=arguments[d]!=null?arguments[d]:{};d%2?h(Object(y),!0).forEach(function(v){Object($.a)(u,v,y[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(y)):h(Object(y)).forEach(function(v){Object.defineProperty(u,v,Object.getOwnPropertyDescriptor(y,v))})}return u}function l(u){var d=a();return function(){var v=Object(z.a)(u),E;if(d){var M=Object(z.a)(this).constructor;E=Reflect.construct(v,arguments,M)}else E=v.apply(this,arguments);return Object(I.a)(this,E)}}function a(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(u){return!1}}function r(){}function t(u){u.preventDefault()}var c=function(d){return d.replace(/[^\w.-]+/g,"")},f=200,S=600,C=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,T=function(d){return d!=null},O=function(d,y){return y===d||typeof y=="number"&&typeof d=="number"&&isNaN(y)&&isNaN(d)},R=function(u){Object(B.a)(y,u);var d=l(y);function y(v){var E;Object(k.a)(this,y),E=d.call(this,v),E.onKeyDown=function(j){var H=E.props,P=H.onKeyDown,x=H.onPressEnter;if(j.keyCode===g.a.UP){var U=E.getRatio(j);E.up(j,U,null),E.stop()}else if(j.keyCode===g.a.DOWN){var V=E.getRatio(j);E.down(j,V,null),E.stop()}else j.keyCode===g.a.ENTER&&x&&x(j);if(E.recordCursorPosition(),E.lastKeyCode=j.keyCode,P){for(var q=arguments.length,ie=new Array(q>1?q-1:0),se=1;se<q;se++)ie[se-1]=arguments[se];P.apply(void 0,[j].concat(ie))}},E.onKeyUp=function(j){var H=E.props.onKeyUp;if(E.stop(),E.recordCursorPosition(),H){for(var P=arguments.length,x=new Array(P>1?P-1:0),U=1;U<P;U++)x[U-1]=arguments[U];H.apply(void 0,[j].concat(x))}},E.onChange=function(j){var H=E.props.onChange;E.state.focused&&(E.inputting=!0),E.rawInput=E.props.parser(E.getValueFromEvent(j)),E.setState({inputValue:E.rawInput}),H(E.toNumber(E.rawInput))},E.onMouseUp=function(){var j=E.props.onMouseUp;E.recordCursorPosition(),j&&j.apply(void 0,arguments)},E.onFocus=function(){var j;E.setState({focused:!0}),(j=E.props).onFocus.apply(j,arguments)},E.onBlur=function(){var j=E.props.onBlur;E.inputting=!1,E.setState({focused:!1});var H=E.getCurrentValidValue(E.state.inputValue),P=E.setValue(H,r);if(j){var x=E.input.value,U=E.getInputDisplayValue({focus:!1,value:P});E.input.value=U&&Number(U),j.apply(void 0,arguments),E.input.value=x}},E.getRatio=function(j){var H=1;return j.metaKey||j.ctrlKey?H=.1:j.shiftKey&&(H=10),H},E.getFullNum=function(j){return isNaN(j)?j:/e/i.test(String(j))?Number(j).toFixed(18).replace(/\.?0+$/,""):j},E.getPrecision=function(j){if(T(E.props.precision))return E.props.precision;var H=String(j);if(H.indexOf("e-")>=0)return parseInt(H.slice(H.indexOf("e-")+2),10);var P=0;return H.indexOf(".")>=0&&(P=H.length-H.indexOf(".")-1),P},E.getInputDisplayValue=function(j){var H=j||E.state,P=H.focused,x=H.inputValue,U=H.value,V;P?V=x:V=E.toPrecisionAsStep(U),V==null&&(V="");var q=E.formatWrapper(V);return T(E.props.decimalSeparator)&&(q=q.toString().replace(".",E.props.decimalSeparator)),q},E.recordCursorPosition=function(){try{E.cursorStart=E.input.selectionStart,E.cursorEnd=E.input.selectionEnd,E.currentValue=E.input.value,E.cursorBefore=E.input.value.substring(0,E.cursorStart),E.cursorAfter=E.input.value.substring(E.cursorEnd)}catch(j){}},E.restoreByAfter=function(j){if(j===void 0)return!1;var H=E.input.value,P=H.lastIndexOf(j);if(P===-1)return!1;var x=E.cursorBefore.length;return E.lastKeyCode===g.a.DELETE&&E.cursorBefore.charAt(x-1)===j[0]?(E.fixCaret(x,x),!0):P+j.length===H.length?(E.fixCaret(P,P),!0):!1},E.partRestoreByAfter=function(j){return j===void 0?!1:Array.prototype.some.call(j,function(H,P){var x=j.substring(P);return E.restoreByAfter(x)})},E.isNotCompleteNumber=function(j){return isNaN(j)||j===""||j===null||j&&j.toString().indexOf(".")===j.toString().length-1},E.stop=function(){E.autoStepTimer&&clearTimeout(E.autoStepTimer)},E.down=function(j,H,P){E.pressingUpOrDown=!0,E.step("down",j,H,P)},E.up=function(j,H,P){E.pressingUpOrDown=!0,E.step("up",j,H,P)},E.saveInput=function(j){E.input=j};var M=v.value;M===void 0&&(M=v.defaultValue),E.state={focused:v.autoFocus};var N=E.getValidValue(E.toNumber(M));return E.state=o(o({},E.state),{},{inputValue:E.toPrecisionAsStep(N),value:N}),E}return Object(Q.a)(y,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(E){var M=this.props,N=M.value,j=M.onChange,H=M.max,P=M.min,x=this.state.focused;if(E){if(!O(E.value,N)||!O(E.max,H)||!O(E.min,P)){var U=x?N:this.getValidValue(N),V;this.pressingUpOrDown?V=U:this.inputting?V=this.rawInput:V=this.toPrecisionAsStep(U),this.setState({value:U,inputValue:V})}var q="value"in this.props?N:this.state.value;"max"in this.props&&E.max!==H&&typeof q=="number"&&q>H&&j&&j(H),"min"in this.props&&E.min!==P&&typeof q=="number"&&q<P&&j&&j(P)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var ie=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?ie=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(ie=this.cursorStart):ie=this.input.value.length,this.fixCaret(ie,ie)}else if(this.currentValue===this.input.value)switch(this.lastKeyCode){case g.a.BACKSPACE:this.fixCaret(this.cursorStart-1,this.cursorStart-1);break;case g.a.DELETE:this.fixCaret(this.cursorStart+1,this.cursorStart+1);break;default:}}}catch(se){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(E){var M=E;return M===""?M="":this.isNotCompleteNumber(parseFloat(M))?M=this.state.value:M=this.getValidValue(M),this.toNumber(M)}},{key:"getValueFromEvent",value:function(E){var M=E.target.value.trim().replace(/。/g,".");return T(this.props.decimalSeparator)&&(M=M.replace(this.props.decimalSeparator,".")),M}},{key:"getValidValue",value:function(E){var M=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,j=parseFloat(E);return isNaN(j)?E:(j<M&&(j=M),j>N&&(j=N),j)}},{key:"setValue",value:function(E,M){var N=this.props.precision,j=this.isNotCompleteNumber(parseFloat(E))?null:parseFloat(E),H=this.state.value,P=H===void 0?null:H,x=this.state.inputValue,U=x===void 0?null:x,V=typeof j=="number"?j.toFixed(N):"".concat(j),q=j!==P||V!=="".concat(U);return"value"in this.props?(U=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:U},M)):this.setState({value:j,inputValue:this.toPrecisionAsStep(E)},M),q&&this.props.onChange(j),j}},{key:"getMaxPrecision",value:function(E){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.props,j=N.precision,H=N.step;if(T(j))return j;var P=this.getPrecision(M),x=this.getPrecision(H),U=this.getPrecision(E);return E?Math.max(U,P+x):P+x}},{key:"getPrecisionFactor",value:function(E){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,N=this.getMaxPrecision(E,M);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(E){return this.props.formatter?this.props.formatter(E):E}},{key:"toPrecisionAsStep",value:function(E){if(this.isNotCompleteNumber(E)||E==="")return E;var M=Math.abs(this.getMaxPrecision(E));return isNaN(M)?E.toString():Number(E).toFixed(M)}},{key:"toNumber",value:function(E){var M=this.props.precision,N=this.state.focused,j=E&&E.length>16&&N;return this.isNotCompleteNumber(E)||j?E:T(M)?Math.round(E*Math.pow(10,M))/Math.pow(10,M):Number(E)}},{key:"upStep",value:function(E,M){var N=this.props.step,j=this.getPrecisionFactor(E,M),H=Math.abs(this.getMaxPrecision(E,M)),P=((j*E+j*N*M)/j).toFixed(H);return this.toNumber(P)}},{key:"downStep",value:function(E,M){var N=this.props.step,j=this.getPrecisionFactor(E,M),H=Math.abs(this.getMaxPrecision(E,M)),P=((j*E-j*N*M)/j).toFixed(H);return this.toNumber(P)}},{key:"step",value:function(E,M){var N=this,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,H=arguments.length>3?arguments[3]:void 0;this.stop(),M&&(M.persist(),M.preventDefault());var P=this.props;if(P.disabled)return;var x=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(x))return;var U=this["".concat(E,"Step")](x,j),V=U>P.max||U<P.min;if(U>P.max?U=P.max:U<P.min&&(U=P.min),this.setValue(U,null),this.setState({focused:!0},function(){N.pressingUpOrDown=!1}),V)return;this.autoStepTimer=setTimeout(function(){N[E](M,j,!0)},H?f:S)}},{key:"fixCaret",value:function(E,M){if(E===void 0||M===void 0||!this.input||!this.input.value)return;try{var N=this.input.selectionStart,j=this.input.selectionEnd;(E!==N||M!==j)&&this.input.setSelectionRange(E,M)}catch(H){}}},{key:"render",value:function(){var E,M=this.props,N=M.prefixCls,j=M.disabled,H=M.readOnly,P=M.useTouch,x=M.autoComplete,U=M.upHandler,V=M.downHandler,q=M.className,ie=M.max,se=M.min,ve=M.style,Te=M.title,fe=M.onMouseEnter,_e=M.onMouseLeave,ue=M.onMouseOver,xe=M.onMouseOut,Y=M.required,oe=M.onClick,ce=M.tabIndex,Re=M.type,Ge=M.placeholder,Ne=M.id,Je=M.inputMode,rt=M.pattern,_t=M.step,ft=M.maxLength,ut=M.autoFocus,qe=M.name,Ct=M.onPaste,kt=M.onInput,Kt=Object(ee.a)(M,["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"]),zt=this.state,ln=zt.value,un=zt.focused,We=m()(N,(E={},Object($.a)(E,q,!!q),Object($.a)(E,"".concat(N,"-disabled"),j),Object($.a)(E,"".concat(N,"-focused"),un),E)),je={};Object.keys(Kt).forEach(function(ae){(ae.substr(0,5)==="data-"||ae.substr(0,5)==="aria-"||ae==="role")&&(je[ae]=Kt[ae])});var ht=!H&&!j,ct=this.getInputDisplayValue(null),He=(ln||ln===0)&&(isNaN(ln)||Number(ln)>=ie),lt=(ln||ln===0)&&(isNaN(ln)||Number(ln)<=se),Pe=He||j||H,Oe=lt||j||H,Ce=m()("".concat(N,"-handler"),"".concat(N,"-handler-up"),Object($.a)({},"".concat(N,"-handler-up-disabled"),Pe)),le=m()("".concat(N,"-handler"),"".concat(N,"-handler-down"),Object($.a)({},"".concat(N,"-handler-down-disabled"),Oe)),he=P?{onTouchStart:Pe?r:this.up,onTouchEnd:this.stop}:{onMouseDown:Pe?r:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},ye=P?{onTouchStart:Oe?r:this.down,onTouchEnd:this.stop}:{onMouseDown:Oe?r:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return L.a.createElement("div",{className:We,style:ve,title:Te,onMouseEnter:fe,onMouseLeave:_e,onMouseOver:ue,onMouseOut:xe,onFocus:function(){return null},onBlur:function(){return null}},L.a.createElement("div",{className:"".concat(N,"-handler-wrap")},L.a.createElement("span",Object.assign({unselectable:"on"},he,{role:"button","aria-label":"Increase Value","aria-disabled":Pe,className:Ce}),U||L.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-up-inner"),onClick:t})),L.a.createElement("span",Object.assign({unselectable:"on"},ye,{role:"button","aria-label":"Decrease Value","aria-disabled":Oe,className:le}),V||L.a.createElement("span",{unselectable:"on",className:"".concat(N,"-handler-down-inner"),onClick:t}))),L.a.createElement("div",{className:"".concat(N,"-input-wrap")},L.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":se,"aria-valuemax":ie,"aria-valuenow":ln,required:Y,type:Re,placeholder:Ge,onPaste:Ct,onClick:oe,onMouseUp:this.onMouseUp,className:"".concat(N,"-input"),tabIndex:ce,autoComplete:x,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:ht?this.onKeyDown:r,onKeyUp:ht?this.onKeyUp:r,autoFocus:ut,maxLength:ft,readOnly:H,disabled:j,max:ie,min:se,step:_t,name:qe,title:Te,id:Ne,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(ct),pattern:rt,inputMode:Je,onInput:kt},je))))}}]),y}(L.a.Component);R.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:C,min:-C,step:1,style:{},onChange:r,onKeyDown:r,onPressEnter:r,onFocus:r,onBlur:r,parser:c,required:!1,autoComplete:"off"};var b=R,_=Ze.a=b},fcSX:function(Rt,Ze,K){"use strict";var ee=K("Ff2n"),$=K("1OyB"),k=K("vuIU"),Q=K("Ji7U"),B=K("md7G"),I=K("foSv"),z=K("1W/9"),G=K("cDcd"),L=K("rePB"),D=K("JX7q"),m=K("TSYQ"),g=K.n(m),h=K("qx4F"),o=K("4IlW");function l(j){return Array.isArray(j)?j:[j]}var a={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},r=Object.keys(a).filter(function(j){if(typeof document=="undefined")return!1;var H=document.getElementsByTagName("html")[0];return j in(H?H.style:{})})[0],t=a[r];function c(j,H,P,x){j.addEventListener?j.addEventListener(H,P,x):j.attachEvent&&j.attachEvent("on".concat(H),P)}function f(j,H,P,x){j.removeEventListener?j.removeEventListener(H,P,x):j.attachEvent&&j.detachEvent("on".concat(H),P)}function S(j,H){var P=typeof j=="function"?j(H):j;return Array.isArray(P)?P.length===2?P:[P[0],P[1]]:[P]}var C=function(H){return!isNaN(parseFloat(H))&&isFinite(H)},T=!(typeof window!="undefined"&&window.document&&window.document.createElement),O=function j(H,P,x,U){if(!P||P===document||P instanceof Document)return!1;if(P===H.parentNode)return!0;var V=Math.max(Math.abs(x),Math.abs(U))===Math.abs(U),q=Math.max(Math.abs(x),Math.abs(U))===Math.abs(x),ie=P.scrollHeight-P.clientHeight,se=P.scrollWidth-P.clientWidth,ve=document.defaultView.getComputedStyle(P),Te=ve.overflowY==="auto"||ve.overflowY==="scroll",fe=ve.overflowX==="auto"||ve.overflowX==="scroll",_e=ie&&Te,ue=se&&fe;return V&&(!_e||_e&&(P.scrollTop>=ie&&U<0||P.scrollTop<=0&&U>0))||q&&(!ue||ue&&(P.scrollLeft>=se&&x<0||P.scrollLeft<=0&&x>0))?j(H,P.parentNode,x,U):!1};function R(j){var H=b();return function(){var x=Object(I.a)(j),U;if(H){var V=Object(I.a)(this).constructor;U=Reflect.construct(x,arguments,V)}else U=x.apply(this,arguments);return Object(B.a)(this,U)}}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(j){return!1}}var _={},u=function(j){Object(Q.a)(P,j);var H=R(P);function P(x){var U;return Object($.a)(this,P),U=H.call(this,x),U.domFocus=function(){U.dom&&U.dom.focus()},U.removeStartHandler=function(V){if(V.touches.length>1)return;U.startPos={x:V.touches[0].clientX,y:V.touches[0].clientY}},U.removeMoveHandler=function(V){if(V.changedTouches.length>1)return;var q=V.currentTarget,ie=V.changedTouches[0].clientX-U.startPos.x,se=V.changedTouches[0].clientY-U.startPos.y;(q===U.maskDom||q===U.handlerDom||q===U.contentDom&&O(q,V.target,ie,se))&&V.cancelable&&V.preventDefault()},U.transitionEnd=function(V){var q=V.target;f(q,t,U.transitionEnd),q.style.transition=""},U.onKeyDown=function(V){if(V.keyCode===o.a.ESC){var q=U.props.onClose;V.stopPropagation(),q&&q(V)}},U.onWrapperTransitionEnd=function(V){var q=U.props,ie=q.open,se=q.afterVisibleChange;V.target===U.contentWrapper&&V.propertyName.match(/transform$/)&&(U.dom.style.transition="",!ie&&U.getCurrentDrawerSome()&&(document.body.style.overflowX="",U.maskDom&&(U.maskDom.style.left="",U.maskDom.style.width="")),se&&se(!!ie))},U.openLevelTransition=function(){var V=U.props,q=V.open,ie=V.width,se=V.height,ve=U.getHorizontalBoolAndPlacementName(),Te=ve.isHorizontal,fe=ve.placementName,_e=U.contentDom?U.contentDom.getBoundingClientRect()[Te?"width":"height"]:0,ue=(Te?ie:se)||_e;U.setLevelAndScrolling(q,fe,ue)},U.setLevelTransform=function(V,q,ie,se){var ve=U.props,Te=ve.placement,fe=ve.levelMove,_e=ve.duration,ue=ve.ease,xe=ve.showMask;U.levelDom.forEach(function(Y){Y.style.transition="transform ".concat(_e," ").concat(ue),c(Y,t,U.transitionEnd);var oe=V?ie:0;if(fe){var ce=S(fe,{target:Y,open:V});oe=V?ce[0]:ce[1]||0}var Re=typeof oe=="number"?"".concat(oe,"px"):oe,Ge=Te==="left"||Te==="top"?Re:"-".concat(Re);Ge=xe&&Te==="right"&&se?"calc(".concat(Ge," + ").concat(se,"px)"):Ge,Y.style.transform=oe?"".concat(q,"(").concat(Ge,")"):""})},U.setLevelAndScrolling=function(V,q,ie){var se=U.props.onChange;if(!T){var ve=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(h.a)(!0):0;U.setLevelTransform(V,q,ie,ve),U.toggleScrollingToDrawerAndBody(ve)}se&&se(V)},U.toggleScrollingToDrawerAndBody=function(V){var q=U.props,ie=q.getOpenCount,se=q.getContainer,ve=q.showMask,Te=q.open,fe=se&&se(),_e=ie&&ie();if(fe&&fe.parentNode===document.body&&ve){var ue=["touchstart"],xe=[document.body,U.maskDom,U.handlerDom,U.contentDom];Te&&document.body.style.overflow!=="hidden"?(V&&U.addScrollingEffect(V),_e===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",xe.forEach(function(Y,oe){if(!Y)return;c(Y,ue[oe]||"touchmove",oe?U.removeMoveHandler:U.removeStartHandler,U.passive)})):U.getCurrentDrawerSome()&&(_e||(document.body.style.overflow=""),document.body.style.touchAction="",V&&U.remScrollingEffect(V),xe.forEach(function(Y,oe){if(!Y)return;f(Y,ue[oe]||"touchmove",oe?U.removeMoveHandler:U.removeStartHandler,U.passive)}))}},U.addScrollingEffect=function(V){var q=U.props,ie=q.placement,se=q.duration,ve=q.ease,Te=q.getOpenCount,fe=q.switchScrollingEffect,_e=Te&&Te();_e===1&&fe();var ue="width ".concat(se," ").concat(ve),xe="transform ".concat(se," ").concat(ve);U.dom.style.transition="none";switch(ie){case"right":U.dom.style.transform="translateX(-".concat(V,"px)");break;case"top":case"bottom":U.dom.style.width="calc(100% - ".concat(V,"px)"),U.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(U.timeout),U.timeout=setTimeout(function(){U.dom&&(U.dom.style.transition="".concat(xe,",").concat(ue),U.dom.style.width="",U.dom.style.transform="")})},U.remScrollingEffect=function(V){var q=U.props,ie=q.placement,se=q.duration,ve=q.ease,Te=q.getOpenCount,fe=q.switchScrollingEffect,_e=Te&&Te();_e||fe(!0),r&&(document.body.style.overflowX="hidden"),U.dom.style.transition="none";var ue,xe="width ".concat(se," ").concat(ve),Y="transform ".concat(se," ").concat(ve);switch(ie){case"left":{U.dom.style.width="100%",xe="width 0s ".concat(ve," ").concat(se);break}case"right":{U.dom.style.transform="translateX(".concat(V,"px)"),U.dom.style.width="100%",xe="width 0s ".concat(ve," ").concat(se),U.maskDom&&(U.maskDom.style.left="-".concat(V,"px"),U.maskDom.style.width="calc(100% + ".concat(V,"px)"));break}case"top":case"bottom":{U.dom.style.width="calc(100% + ".concat(V,"px)"),U.dom.style.height="100%",U.dom.style.transform="translateZ(0)",ue="height 0s ".concat(ve," ").concat(se);break}default:break}clearTimeout(U.timeout),U.timeout=setTimeout(function(){U.dom&&(U.dom.style.transition="".concat(Y,",").concat(ue?"".concat(ue,","):"").concat(xe),U.dom.style.transform="",U.dom.style.width="",U.dom.style.height="")})},U.getCurrentDrawerSome=function(){return!Object.keys(_).some(function(V){return _[V]})},U.getLevelDom=function(V){var q=V.level,ie=V.getContainer;if(T)return;var se=ie&&ie(),ve=se?se.parentNode:null;if(U.levelDom=[],q==="all"){var Te=ve?Array.prototype.slice.call(ve.children):[];Te.forEach(function(fe){fe.nodeName!=="SCRIPT"&&fe.nodeName!=="STYLE"&&fe.nodeName!=="LINK"&&fe!==se&&U.levelDom.push(fe)})}else q&&l(q).forEach(function(fe){document.querySelectorAll(fe).forEach(function(_e){U.levelDom.push(_e)})})},U.getHorizontalBoolAndPlacementName=function(){var V=U.props.placement,q=V==="left"||V==="right",ie="translate".concat(q?"X":"Y");return{isHorizontal:q,placementName:ie}},U.state={_self:Object(D.a)(U)},U}return Object(k.a)(P,[{key:"componentDidMount",value:function(){var U=this;if(!T){var V=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return V=!0,null}}))}catch(Te){}this.passive=V?{passive:!1}:!1}var q=this.props,ie=q.open,se=q.getContainer,ve=se&&se();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),ie&&(ve&&ve.parentNode===document.body&&(_[this.drawerId]=ie),this.openLevelTransition(),this.forceUpdate(function(){U.domFocus()}))}},{key:"componentDidUpdate",value:function(U){var V=this.props,q=V.open,ie=V.getContainer,se=ie&&ie();q!==U.open&&(q&&this.domFocus(),se&&se.parentNode===document.body&&(_[this.drawerId]=!!q),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var U=this.props,V=U.getOpenCount,q=U.open,ie=U.switchScrollingEffect,se=typeof V=="function"&&V();delete _[this.drawerId],q&&(this.setLevelTransform(!1),document.body.style.touchAction=""),se||(document.body.style.overflow="",ie(!0))}},{key:"render",value:function(){var U,V=this,q=this.props,ie=q.className,se=q.children,ve=q.style,Te=q.width,fe=q.height,_e=q.defaultOpen,ue=q.open,xe=q.prefixCls,Y=q.placement,oe=q.level,ce=q.levelMove,Re=q.ease,Ge=q.duration,Ne=q.getContainer,Je=q.handler,rt=q.onChange,_t=q.afterVisibleChange,ft=q.showMask,ut=q.maskClosable,qe=q.maskStyle,Ct=q.onClose,kt=q.onHandleClick,Kt=q.keyboard,zt=q.getOpenCount,ln=q.switchScrollingEffect,un=Object(ee.a)(q,["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"]),We=this.dom?ue:!1,je=g()(xe,(U={},Object(L.a)(U,"".concat(xe,"-").concat(Y),!0),Object(L.a)(U,"".concat(xe,"-open"),We),Object(L.a)(U,ie||"",!!ie),Object(L.a)(U,"no-mask",!ft),U)),ht=this.getHorizontalBoolAndPlacementName(),ct=ht.placementName,He=Y==="left"||Y==="top"?"-100%":"100%",lt=We?"":"".concat(ct,"(").concat(He,")"),Pe=Je&&G.cloneElement(Je,{onClick:function(Ce){Je.props.onClick&&Je.props.onClick(),kt&&kt(Ce)},ref:function(Ce){V.handlerDom=Ce}});return G.createElement("div",Object.assign({},un,{tabIndex:-1,className:je,style:ve,ref:function(Ce){V.dom=Ce},onKeyDown:We&&Kt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),ft&&G.createElement("div",{className:"".concat(xe,"-mask"),onClick:ut?Ct:void 0,style:qe,ref:function(Ce){V.maskDom=Ce}}),G.createElement("div",{className:"".concat(xe,"-content-wrapper"),style:{transform:lt,msTransform:lt,width:C(Te)?"".concat(Te,"px"):Te,height:C(fe)?"".concat(fe,"px"):fe},ref:function(Ce){V.contentWrapper=Ce}},G.createElement("div",{className:"".concat(xe,"-content"),ref:function(Ce){V.contentDom=Ce},onTouchStart:We&&ft?this.removeStartHandler:void 0,onTouchMove:We&&ft?this.removeMoveHandler:void 0},se),Pe))}}],[{key:"getDerivedStateFromProps",value:function(U,V){var q=V.prevProps,ie=V._self,se={prevProps:U};if(q!==void 0){var ve=U.placement,Te=U.level;ve!==q.placement&&(ie.contentDom=null),Te!==q.level&&ie.getLevelDom(U)}return se}}]),P}(G.Component);u.defaultProps={switchScrollingEffect:function(){}};var d=u;function y(j){var H=v();return function(){var x=Object(I.a)(j),U;if(H){var V=Object(I.a)(this).constructor;U=Reflect.construct(x,arguments,V)}else U=x.apply(this,arguments);return Object(B.a)(this,U)}}function v(){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(j){return!1}}var E=function(j){Object(Q.a)(P,j);var H=y(P);function P(x){var U;Object($.a)(this,P),U=H.call(this,x),U.onHandleClick=function(q){var ie=U.props,se=ie.onHandleClick,ve=ie.open;if(se&&se(q),typeof ve=="undefined"){var Te=U.state.open;U.setState({open:!Te})}},U.onClose=function(q){var ie=U.props,se=ie.onClose,ve=ie.open;se&&se(q),typeof ve=="undefined"&&U.setState({open:!1})};var V=typeof x.open!="undefined"?x.open:!!x.defaultOpen;return U.state={open:V},"onMaskClick"in x&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),U}return Object(k.a)(P,[{key:"render",value:function(){var U=this,V=this.props,q=V.defaultOpen,ie=V.getContainer,se=V.wrapperClassName,ve=V.forceRender,Te=V.handler,fe=Object(ee.a)(V,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),_e=this.state.open;if(!ie)return G.createElement("div",{className:se,ref:function(Y){U.dom=Y}},G.createElement(d,Object.assign({},fe,{open:_e,handler:Te,getContainer:function(){return U.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var ue=!!Te||ve;return G.createElement(z.a,{visible:_e,forceRender:ue,getContainer:ie,wrapperClassName:se},function(xe){var Y=xe.visible,oe=xe.afterClose,ce=Object(ee.a)(xe,["visible","afterClose"]);return G.createElement(d,Object.assign({},fe,ce,{open:Y!==void 0?Y:_e,afterVisibleChange:oe!==void 0?oe:fe.afterVisibleChange,handler:Te,onClose:U.onClose,onHandleClick:U.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(U,V){var q=V.prevProps,ie={prevProps:U};return typeof q!="undefined"&&U.open!==q.open&&(ie.open=U.open),ie}}]),P}(G.Component);E.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:G.createElement("div",{className:"drawer-handle"},G.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var M=E,N=Ze.a=M},fyJ8:function(Rt,Ze,K){"use strict";var ee=K("rePB"),$=K("VTBJ"),k=K("Ff2n"),Q=K("U8pU"),B=K("cDcd"),I=K.n(B),z=K("TSYQ"),G=K.n(z),L=K("c+Xe"),D=K("sR1s");function m(a){return a&&Object(Q.a)(a)==="object"&&!Array.isArray(a)&&!B.isValidElement(a)}function g(a){return typeof a=="string"?!0:Object(L.c)(a)}function h(a,r){var t,c=a.prefixCls,f=a.className,S=a.record,C=a.index,T=a.dataIndex,O=a.render,R=a.children,b=a.component,_=b===void 0?"td":b,u=a.colSpan,d=a.rowSpan,y=a.fixLeft,v=a.fixRight,E=a.firstFixLeft,M=a.lastFixLeft,N=a.firstFixRight,j=a.lastFixRight,H=a.appendNode,P=a.additionalProps,x=P===void 0?{}:P,U=a.ellipsis,V=a.align,q=a.rowType,ie=a.isSticky,se="".concat(c,"-cell"),ve,Te;if(R)Te=R;else{var fe=Object(D.b)(S,T);if(Te=fe,O){var _e=O(fe,S,C);m(_e)?(Te=_e.children,ve=_e.props):Te=_e}}Object(Q.a)(Te)==="object"&&!Array.isArray(Te)&&!B.isValidElement(Te)&&(Te=null),U&&(M||N)&&(Te=B.createElement("span",{className:"".concat(se,"-content")},Te));var ue=ve||{},xe=ue.colSpan,Y=ue.rowSpan,oe=ue.style,ce=ue.className,Re=Object(k.a)(ue,["colSpan","rowSpan","style","className"]),Ge=xe!==void 0?xe:u,Ne=Y!==void 0?Y:d;if(Ge===0||Ne===0)return null;var Je={},rt=typeof y=="number",_t=typeof v=="number";rt&&(Je.position="sticky",Je.left=y),_t&&(Je.position="sticky",Je.right=v);var ft={};V&&(ft.textAlign=V);var ut,qe=U===!0?{showTitle:!0}:U;qe&&(qe.showTitle||q==="header")&&(typeof Te=="string"||typeof Te=="number"?ut=Te.toString():B.isValidElement(Te)&&typeof Te.props.children=="string"&&(ut=Te.props.children));var Ct=Object($.a)(Object($.a)(Object($.a)({title:ut},Re),x),{},{colSpan:Ge&&Ge!==1?Ge:null,rowSpan:Ne&&Ne!==1?Ne:null,className:G()(se,f,(t={},Object(ee.a)(t,"".concat(se,"-fix-left"),rt),Object(ee.a)(t,"".concat(se,"-fix-left-first"),E),Object(ee.a)(t,"".concat(se,"-fix-left-last"),M),Object(ee.a)(t,"".concat(se,"-fix-right"),_t),Object(ee.a)(t,"".concat(se,"-fix-right-first"),N),Object(ee.a)(t,"".concat(se,"-fix-right-last"),j),Object(ee.a)(t,"".concat(se,"-ellipsis"),U),Object(ee.a)(t,"".concat(se,"-with-append"),H),Object(ee.a)(t,"".concat(se,"-fix-sticky"),(rt||_t)&&ie),t),x.className,ce),style:Object($.a)(Object($.a)(Object($.a)(Object($.a)({},x.style),ft),Je),oe),ref:g(_)?r:null});return B.createElement(_,Object.assign({},Ct),H,Te)}var o=B.forwardRef(h);o.displayName="Cell";var l=B.memo(o,function(a,r){return r.shouldCellUpdate?!r.shouldCellUpdate(r.record,a.record):!1});Ze.a=l},h78n:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return E});var ee=K("cDcd"),$=K.n(ee),k=K("TSYQ"),Q=K.n(k),B={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},I=function(j){var H=j.map(function(){return Object(ee.useRef)()}),P=Object(ee.useRef)();return Object(ee.useEffect)(function(){var x=Date.now(),U=!1;Object.keys(H).forEach(function(V){var q=H[V].current;if(!q)return;U=!0;var ie=q.style;ie.transitionDuration=".3s, .3s, .3s, .06s",P.current&&x-P.current<100&&(ie.transitionDuration="0s, 0s")}),U&&(P.current=Date.now())}),[H]};function z(){return z=Object.assign||function(N){for(var j=1;j<arguments.length;j++){var H=arguments[j];for(var P in H)Object.prototype.hasOwnProperty.call(H,P)&&(N[P]=H[P])}return N},z.apply(this,arguments)}function G(N,j){return h(N)||g(N,j)||D(N,j)||L()}function L(){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,j){if(!N)return;if(typeof N=="string")return m(N,j);var H=Object.prototype.toString.call(N).slice(8,-1);if(H==="Object"&&N.constructor&&(H=N.constructor.name),H==="Map"||H==="Set")return Array.from(N);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return m(N,j)}function m(N,j){(j==null||j>N.length)&&(j=N.length);for(var H=0,P=new Array(j);H<j;H++)P[H]=N[H];return P}function g(N,j){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(N)))return;var H=[],P=!0,x=!1,U=void 0;try{for(var V=N[Symbol.iterator](),q;!(P=(q=V.next()).done)&&!(H.push(q.value),j&&H.length===j);P=!0);}catch(ie){x=!0,U=ie}finally{try{!P&&V.return!=null&&V.return()}finally{if(x)throw U}}return H}function h(N){if(Array.isArray(N))return N}function o(N,j){if(N==null)return{};var H=l(N,j),P,x;if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(N);for(x=0;x<U.length;x++){if(P=U[x],j.indexOf(P)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(N,P))continue;H[P]=N[P]}}return H}function l(N,j){if(N==null)return{};var H={},P=Object.keys(N),x,U;for(U=0;U<P.length;U++){if(x=P[U],j.indexOf(x)>=0)continue;H[x]=N[x]}return H}var a=function(j){var H=j.className,P=j.percent,x=j.prefixCls,U=j.strokeColor,V=j.strokeLinecap,q=j.strokeWidth,ie=j.style,se=j.trailColor,ve=j.trailWidth,Te=j.transition,fe=o(j,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete fe.gapPosition;var _e=Array.isArray(P)?P:[P],ue=Array.isArray(U)?U:[U],xe=I(_e),Y=G(xe,1),oe=Y[0],ce=q/2,Re=100-q/2,Ge="M ".concat(V==="round"?ce:0,",").concat(ce,`
L `).concat(V==="round"?Re:100,",").concat(ce),Ne="0 0 100 ".concat(q),Je=0;return $.a.createElement("svg",z({className:Q()("".concat(x,"-line"),H),viewBox:Ne,preserveAspectRatio:"none",style:ie},fe),$.a.createElement("path",{className:"".concat(x,"-line-trail"),d:Ge,strokeLinecap:V,stroke:se,strokeWidth:ve||q,fillOpacity:"0"}),_e.map(function(rt,_t){var ft={strokeDasharray:"".concat(rt,"px, 100px"),strokeDashoffset:"-".concat(Je,"px"),transition:Te||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},ut=ue[_t]||ue[ue.length-1];return Je+=rt,$.a.createElement("path",{key:_t,className:"".concat(x,"-line-path"),d:Ge,strokeLinecap:V,stroke:ut,strokeWidth:q,fillOpacity:"0",ref:oe[_t],style:ft})}))};a.defaultProps=B;var r=a;function t(){return t=Object.assign||function(N){for(var j=1;j<arguments.length;j++){var H=arguments[j];for(var P in H)Object.prototype.hasOwnProperty.call(H,P)&&(N[P]=H[P])}return N},t.apply(this,arguments)}function c(N,j){return O(N)||T(N,j)||S(N,j)||f()}function f(){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 S(N,j){if(!N)return;if(typeof N=="string")return C(N,j);var H=Object.prototype.toString.call(N).slice(8,-1);if(H==="Object"&&N.constructor&&(H=N.constructor.name),H==="Map"||H==="Set")return Array.from(N);if(H==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(H))return C(N,j)}function C(N,j){(j==null||j>N.length)&&(j=N.length);for(var H=0,P=new Array(j);H<j;H++)P[H]=N[H];return P}function T(N,j){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(N)))return;var H=[],P=!0,x=!1,U=void 0;try{for(var V=N[Symbol.iterator](),q;!(P=(q=V.next()).done)&&!(H.push(q.value),j&&H.length===j);P=!0);}catch(ie){x=!0,U=ie}finally{try{!P&&V.return!=null&&V.return()}finally{if(x)throw U}}return H}function O(N){if(Array.isArray(N))return N}function R(N,j){if(N==null)return{};var H=b(N,j),P,x;if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(N);for(x=0;x<U.length;x++){if(P=U[x],j.indexOf(P)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(N,P))continue;H[P]=N[P]}}return H}function b(N,j){if(N==null)return{};var H={},P=Object.keys(N),x,U;for(U=0;U<P.length;U++){if(x=P[U],j.indexOf(x)>=0)continue;H[x]=N[x]}return H}var _=0;function u(N){return+N.replace("%","")}function d(N){return Array.isArray(N)?N:[N]}function y(N,j,H,P){var x=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,U=arguments.length>5?arguments[5]:void 0,V=50-P/2,q=0,ie=-V,se=0,ve=-2*V;switch(U){case"left":q=-V,ie=0,se=2*V,ve=0;break;case"right":q=V,ie=0,se=-2*V,ve=0;break;case"bottom":ie=V,ve=2*V;break;default:}var Te="M 50,50 m ".concat(q,",").concat(ie,`
a `).concat(V,",").concat(V," 0 1 1 ").concat(se,",").concat(-ve,`
a `).concat(V,",").concat(V," 0 1 1 ").concat(-se,",").concat(ve),fe=Math.PI*2*V,_e={stroke:H,strokeDasharray:"".concat(j/100*(fe-x),"px ").concat(fe,"px"),strokeDashoffset:"-".concat(x/2+N/100*(fe-x),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Te,pathStyle:_e}}var v=function(j){var H=j.prefixCls,P=j.strokeWidth,x=j.trailWidth,U=j.gapDegree,V=j.gapPosition,q=j.trailColor,ie=j.strokeLinecap,se=j.style,ve=j.className,Te=j.strokeColor,fe=j.percent,_e=R(j,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),ue=Object(ee.useMemo)(function(){return _+=1,_},[]),xe=y(0,100,q,P,U,V),Y=xe.pathString,oe=xe.pathStyle,ce=d(fe),Re=d(Te),Ge=Re.find(function(ft){return Object.prototype.toString.call(ft)==="[object Object]"}),Ne=I(ce),Je=c(Ne,1),rt=Je[0],_t=function(){var ut=0;return ce.map(function(qe,Ct){var kt=Re[Ct]||Re[Re.length-1],Kt=Object.prototype.toString.call(kt)==="[object Object]"?"url(#".concat(H,"-gradient-").concat(ue,")"):"",zt=y(ut,qe,kt,P,U,V);return ut+=qe,$.a.createElement("path",{key:Ct,className:"".concat(H,"-circle-path"),d:zt.pathString,stroke:Kt,strokeLinecap:ie,strokeWidth:P,opacity:qe===0?0:1,fillOpacity:"0",style:zt.pathStyle,ref:rt[Ct]})})};return $.a.createElement("svg",t({className:Q()("".concat(H,"-circle"),ve),viewBox:"0 0 100 100",style:se},_e),Ge&&$.a.createElement("defs",null,$.a.createElement("linearGradient",{id:"".concat(H,"-gradient-").concat(ue),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(Ge).sort(function(ft,ut){return u(ft)-u(ut)}).map(function(ft,ut){return $.a.createElement("stop",{key:ut,offset:ft,stopColor:Ge[ft]})}))),$.a.createElement("path",{className:"".concat(H,"-circle-trail"),d:Y,stroke:q,strokeLinecap:ie,strokeWidth:x||P,fillOpacity:"0",style:oe}),_t().reverse())};v.defaultProps=B;var E=v,M={Line:r,Circle:E}},hQp1:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return $});var ee;(function(k){k.FirstPage="firstPage",k.PrevPage="prevPage",k.NextPage="nextPage"})(ee||(ee={}));var $;(function(k){k[k.Single=0]="Single",k[k.Multiple=1]="Multiple",k[k.Judge=2]="Judge",k[k.Fill=3]="Fill",k[k.Subjective=4]="Subjective",k[k.Shixun=5]="Shixun",k[k.Program=6]="Program",k[k.Combine=7]="Combine"})($||($={}))},hW8S:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return Q}),K.d(Ze,"c",function(){return B}),K.d(Ze,"b",function(){return I});var ee=K("VTBJ"),$=K("Ff2n"),k=K("Kwbf"),Q="RC_TABLE_INTERNAL_COL_DEFINE";function B(z){var G=z.expandable,L=Object($.a)(z,["expandable"]);return"expandable"in z?Object(ee.a)(Object(ee.a)({},L),G):L}function I(z){return Object.keys(z).reduce(function(G,L){return(L.substr(0,5)==="data-"||L.substr(0,5)==="aria-")&&(G[L]=z[L]),G},{})}},i58Z:function(Rt,Ze,K){Rt.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},ie49:function(Rt,Ze,K){Rt.exports={brief:"brief___29L5W",contentTitle:"contentTitle___2wPLj",content:"content___2MAv3",tips:"tips___3qmPX",antdTable:"antdTable___o4ScH",tableCell:"tableCell___24I9Y",antdModal:"antdModal___1nRWw"}},kCvp:function(Rt,Ze,K){Rt.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(Rt,Ze,K){},kqOp:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return D});var ee=K("0Owb"),$=K("fWQN"),k=K("mtLc"),Q=K("yKVA"),B=K("879j"),I=K("cDcd"),z=K.n(I),G=K("Ot1p"),L="\u2581",D=function(m){Object(Q.a)(h,m);var g=Object(B.a)(h);function h(){var o;Object($.a)(this,h);for(var l=arguments.length,a=new Array(l),r=0;r<l;r++)a[r]=arguments[r];return o=g.call.apply(g,[this].concat(a)),o.getChCountBeforeCursor=function(t,c){for(var f=c.line,S=0,C=0;C<f;C++)S+=t.getLine(C).split(L).length-1;var T=t.getLine(f).substring(0,c.ch);return S+=T.split(L).length-1,S},o.onCMBeforeChange=function(t,c){var f=t.getRange(c.from,c.to),S=0;if(c.text.forEach(function(R){S+=R.split(L).length-1}),f&&f.indexOf(L)!=-1){var C=f.split(L).length-1,T=o.getChCountBeforeCursor(t,c.from);console.log("\u5220\u9664".concat(C,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(T,"\u4E2A\uFF0C\u65B0\u589E").concat(S,"\u4E2A")),o.props.deleteEmptyDisabled?c.cancel():o.props.onPlaceholderChange&&o.props.onPlaceholderChange(T,C,S)}else if(S){var O=o.getChCountBeforeCursor(t,c.from);console.log("\u65B0\u589E".concat(S,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(O,"\u4E2A")),o.props.onPlaceholderChange&&o.props.onPlaceholderChange(O,0,S)}},o}return Object(k.a)(h,[{key:"render",value:function(){return z.a.createElement(G.a,Object(ee.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),h}(I.Component)},lZu9:function(Rt,Ze,K){(function(ee){ee(K("VrN/"),K("1eCo"),K("8EBN"))})(function(ee){"use strict";ee.defineMode("markdown",function($,k){var Q=ee.getMode($,"text/html"),B=Q.name=="null";function I(P){if(ee.findModeByName){var x=ee.findModeByName(P);x&&(P=x.mime||x.mimes[0])}var U=ee.getMode($,P);return U.name=="null"?null:U}k.highlightFormatting===void 0&&(k.highlightFormatting=!1),k.maxBlockquoteDepth===void 0&&(k.maxBlockquoteDepth=0),k.taskLists===void 0&&(k.taskLists=!1),k.strikethrough===void 0&&(k.strikethrough=!1),k.emoji===void 0&&(k.emoji=!1),k.fencedCodeBlockHighlighting===void 0&&(k.fencedCodeBlockHighlighting=!0),k.fencedCodeBlockDefaultMode===void 0&&(k.fencedCodeBlockDefaultMode="text/plain"),k.xml===void 0&&(k.xml=!0),k.tokenTypeOverrides===void 0&&(k.tokenTypeOverrides={});var z={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 G in z)z.hasOwnProperty(G)&&k.tokenTypeOverrides[G]&&(z[G]=k.tokenTypeOverrides[G]);var L=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,m=/^\[(x| )\](?=\s)/i,g=k.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,h=/^ {0,3}(?:\={1,}|-{2,})\s*$/,o=/^[^#!\[\]*_\\<>` "'(~:]+/,l=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,a=/^\s*\[[^\]]+?\]:.*$/,r=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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(P,x,U){return x.f=x.inline=U,U(P,x)}function f(P,x,U){return x.f=x.block=U,U(P,x)}function S(P){return!P||!/\S/.test(P.string)}function C(P){if(P.linkTitle=!1,P.linkHref=!1,P.linkText=!1,P.em=!1,P.strong=!1,P.strikethrough=!1,P.quote=0,P.indentedCode=!1,P.f==O){var x=B;if(!x){var U=ee.innerMode(Q,P.htmlState);x=U.mode.name=="xml"&&U.state.tagStart===null&&!U.state.context&&U.state.tokenize.isInText}x&&(P.f=u,P.block=T,P.htmlState=null)}return P.trailingSpace=0,P.trailingSpaceNewLine=!1,P.prevLine=P.thisLine,P.thisLine={stream:null},null}function T(P,x){var U=P.column()===x.indentation,V=S(x.prevLine.stream),q=x.indentedCode,ie=x.prevLine.hr,se=x.list!==!1,ve=(x.listStack[x.listStack.length-1]||0)+3;x.indentedCode=!1;var Te=x.indentation;if(x.indentationDiff===null&&(x.indentationDiff=x.indentation,se)){for(x.list=null;Te<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=Te-x.listStack[x.listStack.length-1])}var fe=!V&&!ie&&!x.prevLine.header&&(!se||!q)&&!x.prevLine.fencedCodeEnd,_e=(x.list===!1||ie||V)&&x.indentation<=ve&&P.match(L),ue=null;if(x.indentationDiff>=4&&(q||x.prevLine.fencedCodeEnd||x.prevLine.header||V))return P.skipToEnd(),x.indentedCode=!0,z.code;if(P.eatSpace())return null;if(U&&x.indentation<=ve&&(ue=P.match(g))&&ue[1].length<=6)return x.quote=0,x.header=ue[1].length,x.thisLine.header=!0,k.highlightFormatting&&(x.formatting="header"),x.f=x.inline,b(x);if(x.indentation<=ve&&P.eat(">"))return x.quote=U?1:x.quote+1,k.highlightFormatting&&(x.formatting="quote"),P.eatSpace(),b(x);if(!_e&&!x.setext&&U&&x.indentation<=ve&&(ue=P.match(D))){var xe=ue[1]?"ol":"ul";return x.indentation=Te+P.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,k.taskLists&&P.match(m,!1)&&(x.taskList=!0),x.f=x.inline,k.highlightFormatting&&(x.formatting=["list","list-"+xe]),b(x)}else{if(U&&x.indentation<=ve&&(ue=P.match(l,!0)))return x.quote=0,x.fencedEndRE=new RegExp(ue[1]+"+ *$"),x.localMode=k.fencedCodeBlockHighlighting&&I(ue[2]||k.fencedCodeBlockDefaultMode),x.localMode&&(x.localState=ee.startState(x.localMode)),x.f=x.block=R,k.highlightFormatting&&(x.formatting="code-block"),x.code=-1,b(x);if(x.setext||(!fe||!se)&&!x.quote&&x.list===!1&&!x.code&&!_e&&!a.test(P.string)&&(ue=P.lookAhead(1))&&(ue=ue.match(h)))return x.setext?(x.header=x.setext,x.setext=0,P.skipToEnd(),k.highlightFormatting&&(x.formatting="header")):(x.header=ue[0].charAt(0)=="="?1:2,x.setext=x.header),x.thisLine.header=!0,x.f=x.inline,b(x);if(_e)return P.skipToEnd(),x.hr=!0,x.thisLine.hr=!0,z.hr;if(P.peek()==="[")return c(P,x,M)}return c(P,x,x.inline)}function O(P,x){var U=Q.token(P,x.htmlState);if(!B){var V=ee.innerMode(Q,x.htmlState);(V.mode.name=="xml"&&V.state.tagStart===null&&!V.state.context&&V.state.tokenize.isInText||x.md_inside&&P.current().indexOf(">")>-1)&&(x.f=u,x.block=T,x.htmlState=null)}return U}function R(P,x){var U=x.listStack[x.listStack.length-1]||0,V=x.indentation<U,q=U+3;if(x.fencedEndRE&&x.indentation<=q&&(V||P.match(x.fencedEndRE))){k.highlightFormatting&&(x.formatting="code-block");var ie;return V||(ie=b(x)),x.localMode=x.localState=null,x.block=T,x.f=u,x.fencedEndRE=null,x.code=0,x.thisLine.fencedCodeEnd=!0,V?f(P,x,x.block):ie}else return x.localMode?x.localMode.token(P,x.localState):(P.skipToEnd(),z.code)}function b(P){var x=[];if(P.formatting){x.push(z.formatting),typeof P.formatting=="string"&&(P.formatting=[P.formatting]);for(var U=0;U<P.formatting.length;U++)x.push(z.formatting+"-"+P.formatting[U]),P.formatting[U]==="header"&&x.push(z.formatting+"-"+P.formatting[U]+"-"+P.header),P.formatting[U]==="quote"&&(!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=P.quote?x.push(z.formatting+"-"+P.formatting[U]+"-"+P.quote):x.push("error"))}if(P.taskOpen)return x.push("meta"),x.length?x.join(" "):null;if(P.taskClosed)return x.push("property"),x.length?x.join(" "):null;if(P.linkHref?x.push(z.linkHref,"url"):(P.strong&&x.push(z.strong),P.em&&x.push(z.em),P.strikethrough&&x.push(z.strikethrough),P.emoji&&x.push(z.emoji),P.linkText&&x.push(z.linkText),P.code&&x.push(z.code),P.image&&x.push(z.image),P.imageAltText&&x.push(z.imageAltText,"link"),P.imageMarker&&x.push(z.imageMarker)),P.header&&x.push(z.header,z.header+"-"+P.header),P.quote&&(x.push(z.quote),!k.maxBlockquoteDepth||k.maxBlockquoteDepth>=P.quote?x.push(z.quote+"-"+P.quote):x.push(z.quote+"-"+k.maxBlockquoteDepth)),P.list!==!1){var V=(P.listStack.length-1)%3;V?V===1?x.push(z.list2):x.push(z.list3):x.push(z.list1)}return P.trailingSpaceNewLine?x.push("trailing-space-new-line"):P.trailingSpace&&x.push("trailing-space-"+(P.trailingSpace%2?"a":"b")),x.length?x.join(" "):null}function _(P,x){return P.match(o,!0)?b(x):void 0}function u(P,x){var U=x.text(P,x);if(typeof U!="undefined")return U;if(x.list)return x.list=null,b(x);if(x.taskList){var V=P.match(m,!0)[1]===" ";return V?x.taskOpen=!0:x.taskClosed=!0,k.highlightFormatting&&(x.formatting="task"),x.taskList=!1,b(x)}if(x.taskOpen=!1,x.taskClosed=!1,x.header&&P.match(/^#+$/,!0))return k.highlightFormatting&&(x.formatting="header"),b(x);var q=P.next();if(x.linkTitle){x.linkTitle=!1;var ie=q;q==="("&&(ie=")"),ie=(ie+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var se="^\\s*(?:[^"+ie+"\\\\]+|\\\\\\\\|\\\\.)"+ie;if(P.match(new RegExp(se),!0))return z.linkHref}if(q==="`"){var ve=x.formatting;k.highlightFormatting&&(x.formatting="code"),P.eatWhile("`");var Te=P.current().length;if(x.code==0&&(!x.quote||Te==1))return x.code=Te,b(x);if(Te==x.code){var fe=b(x);return x.code=0,fe}else return x.formatting=ve,b(x)}else if(x.code)return b(x);if(q==="\\"&&(P.next(),k.highlightFormatting)){var _e=b(x),ue=z.formatting+"-escape";return _e?_e+" "+ue:ue}if(q==="!"&&P.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return x.imageMarker=!0,x.image=!0,k.highlightFormatting&&(x.formatting="image"),b(x);if(q==="["&&x.imageMarker&&P.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return x.imageMarker=!1,x.imageAltText=!0,k.highlightFormatting&&(x.formatting="image"),b(x);if(q==="]"&&x.imageAltText){k.highlightFormatting&&(x.formatting="image");var _e=b(x);return x.imageAltText=!1,x.image=!1,x.inline=x.f=y,_e}if(q==="["&&!x.image)return x.linkText&&P.match(/^.*?\]/)||(x.linkText=!0,k.highlightFormatting&&(x.formatting="link")),b(x);if(q==="]"&&x.linkText){k.highlightFormatting&&(x.formatting="link");var _e=b(x);return x.linkText=!1,x.inline=x.f=P.match(/\(.*?\)| ?\[.*?\]/,!1)?y:u,_e}if(q==="<"&&P.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=d,k.highlightFormatting&&(x.formatting="link");var _e=b(x);return _e?_e+=" ":_e="",_e+z.linkInline}if(q==="<"&&P.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){x.f=x.inline=d,k.highlightFormatting&&(x.formatting="link");var _e=b(x);return _e?_e+=" ":_e="",_e+z.linkEmail}if(k.xml&&q==="<"&&P.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var xe=P.string.indexOf(">",P.pos);if(xe!=-1){var Y=P.string.substring(P.start,xe);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Y)&&(x.md_inside=!0)}return P.backUp(1),x.htmlState=ee.startState(Q),f(P,x,O)}if(k.xml&&q==="<"&&P.match(/^\/\w*?>/))return x.md_inside=!1,"tag";if(q==="*"||q==="_"){for(var oe=1,ce=P.pos==1?" ":P.string.charAt(P.pos-2);oe<3&&P.eat(q);)oe++;var Re=P.peek()||" ",Ge=!/\s/.test(Re)&&(!r.test(Re)||/\s/.test(ce)||r.test(ce)),Ne=!/\s/.test(ce)&&(!r.test(ce)||/\s/.test(Re)||r.test(Re)),Je=null,rt=null;if(oe%2&&(!x.em&&Ge&&(q==="*"||!Ne||r.test(ce))?Je=!0:x.em==q&&Ne&&(q==="*"||!Ge||r.test(Re))&&(Je=!1)),oe>1&&(!x.strong&&Ge&&(q==="*"||!Ne||r.test(ce))?rt=!0:x.strong==q&&Ne&&(q==="*"||!Ge||r.test(Re))&&(rt=!1)),rt!=null||Je!=null){k.highlightFormatting&&(x.formatting=Je==null?"strong":rt==null?"em":"strong em"),Je===!0&&(x.em=q),rt===!0&&(x.strong=q);var fe=b(x);return Je===!1&&(x.em=!1),rt===!1&&(x.strong=!1),fe}}else if(q===" "&&(P.eat("*")||P.eat("_"))){if(P.peek()===" ")return b(x);P.backUp(1)}if(k.strikethrough){if(q==="~"&&P.eatWhile(q)){if(x.strikethrough){k.highlightFormatting&&(x.formatting="strikethrough");var fe=b(x);return x.strikethrough=!1,fe}else if(P.match(/^[^\s]/,!1))return x.strikethrough=!0,k.highlightFormatting&&(x.formatting="strikethrough"),b(x)}else if(q===" "&&P.match(/^~~/,!0)){if(P.peek()===" ")return b(x);P.backUp(2)}}if(k.emoji&&q===":"&&P.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){x.emoji=!0,k.highlightFormatting&&(x.formatting="emoji");var _t=b(x);return x.emoji=!1,_t}return q===" "&&(P.match(/^ +$/,!1)?x.trailingSpace++:x.trailingSpace&&(x.trailingSpaceNewLine=!0)),b(x)}function d(P,x){var U=P.next();if(U===">"){x.f=x.inline=u,k.highlightFormatting&&(x.formatting="link");var V=b(x);return V?V+=" ":V="",V+z.linkInline}return P.match(/^[^>]+/,!0),z.linkInline}function y(P,x){if(P.eatSpace())return null;var U=P.next();return U==="("||U==="["?(x.f=x.inline=E(U==="("?")":"]"),k.highlightFormatting&&(x.formatting="link-string"),x.linkHref=!0,b(x)):"error"}var v={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function E(P){return function(x,U){var V=x.next();if(V===P){U.f=U.inline=u,k.highlightFormatting&&(U.formatting="link-string");var q=b(U);return U.linkHref=!1,q}return x.match(v[P]),U.linkHref=!0,b(U)}}function M(P,x){return P.match(/^([^\]\\]|\\.)*\]:/,!1)?(x.f=N,P.next(),k.highlightFormatting&&(x.formatting="link"),x.linkText=!0,b(x)):c(P,x,u)}function N(P,x){if(P.match(/^\]:/,!0)){x.f=x.inline=j,k.highlightFormatting&&(x.formatting="link");var U=b(x);return x.linkText=!1,U}return P.match(/^([^\]\\]|\\.)+/,!0),z.linkText}function j(P,x){return P.eatSpace()?null:(P.match(/^[^\s]+/,!0),P.peek()===void 0?x.linkTitle=!0:P.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),x.f=x.inline=u,z.linkHref+" url")}var H={startState:function(){return{f:T,prevLine:{stream:null},thisLine:{stream:null},block:T,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(P){return{f:P.f,prevLine:P.prevLine,thisLine:P.thisLine,block:P.block,htmlState:P.htmlState&&ee.copyState(Q,P.htmlState),indentation:P.indentation,localMode:P.localMode,localState:P.localMode?ee.copyState(P.localMode,P.localState):null,inline:P.inline,text:P.text,formatting:!1,linkText:P.linkText,linkTitle:P.linkTitle,linkHref:P.linkHref,code:P.code,em:P.em,strong:P.strong,strikethrough:P.strikethrough,emoji:P.emoji,header:P.header,setext:P.setext,hr:P.hr,taskList:P.taskList,list:P.list,listStack:P.listStack.slice(0),quote:P.quote,indentedCode:P.indentedCode,trailingSpace:P.trailingSpace,trailingSpaceNewLine:P.trailingSpaceNewLine,md_inside:P.md_inside,fencedEndRE:P.fencedEndRE}},token:function(P,x){if(x.formatting=!1,P!=x.thisLine.stream){if(x.header=0,x.hr=!1,P.match(/^\s*$/,!0))return C(x),null;if(x.prevLine=x.thisLine,x.thisLine={stream:P},x.taskList=!1,x.trailingSpace=0,x.trailingSpaceNewLine=!1,!x.localState&&(x.f=x.block,x.f!=O)){var U=P.match(/^\s*/,!0)[0].replace(/\t/g,t).length;if(x.indentation=U,x.indentationDiff=null,U>0)return null}}return x.f(P,x)},innerMode:function(P){return P.block==O?{state:P.htmlState,mode:Q}:P.localState?{state:P.localState,mode:P.localMode}:{state:P,mode:H}},indent:function(P,x,U){return P.block==O&&Q.indent?Q.indent(P.htmlState,x,U):P.localState&&P.localMode.indent?P.localMode.indent(P.localState,x,U):ee.Pass},blankLine:C,getType:b,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return H},"xml"),ee.defineMIME("text/markdown","markdown"),ee.defineMIME("text/x-markdown","markdown")})},loLm:function(Rt,Ze,K){Rt.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"}},mOS8:function(Rt,Ze,K){Rt.exports=K.p+"static/403Qrcode.6c17b6f4.png"},n6Qo:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return G});var ee=K("cDcd"),$=K("biw7"),k=K("fyJ8");function Q(L){var D=L.className,m=L.index,g=L.children,h=L.colSpan,o=L.rowSpan,l=ee.useContext($.a),a=l.prefixCls,r=l.fixedInfoList,t=r[m];return ee.createElement(k.a,Object.assign({className:D,index:m,component:"td",prefixCls:a,record:null,dataIndex:null,render:function(){return{children:g,props:{colSpan:h,rowSpan:o}}}},t))}function B(L){return ee.createElement("tr",Object.assign({},L))}function I(L){var D=L.children,m=ee.useContext($.a),g=m.prefixCls;return ee.createElement("tfoot",{className:"".concat(g,"-summary")},D)}var z=Ze.b=I,G={Cell:Q,Row:B}},ngQI:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return Ul}),K.d(Ze,"b",function(){return El}),K.d(Ze,"c",function(){return bl});var ee=K("cDcd"),$=K.n(ee),k=K("dI71"),Q=K("wx14"),B=K("ANjH"),I=K("/MKj");function z(w,A){if(w.length!==A.length)return!1;for(var W=0;W<w.length;W++)if(w[W]!==A[W])return!1;return!0}function G(w,A){var W=Object(ee.useState)(function(){return{inputs:A,result:w()}})[0],J=Object(ee.useRef)(!0),ne=Object(ee.useRef)(W),re=J.current||Boolean(A&&ne.current.inputs&&z(A,ne.current.inputs)),Ee=re?ne.current:{inputs:A,result:w()};return Object(ee.useEffect)(function(){J.current=!1,ne.current=Ee},[Ee]),Ee.result}function L(w,A){return G(function(){return w},A)}var D=G,m=L,g=K("9R94"),h=function(A){var W=A.top,J=A.right,ne=A.bottom,re=A.left,Ee=J-re,be=ne-W,Ie={top:W,right:J,bottom:ne,left:re,width:Ee,height:be,x:re,y:W,center:{x:(J+re)/2,y:(ne+W)/2}};return Ie},o=function(A,W){return{top:A.top-W.top,left:A.left-W.left,bottom:A.bottom+W.bottom,right:A.right+W.right}},l=function(A,W){return{top:A.top+W.top,left:A.left+W.left,bottom:A.bottom-W.bottom,right:A.right-W.right}},a=function(A,W){return{top:A.top+W.y,left:A.left+W.x,bottom:A.bottom+W.y,right:A.right+W.x}},r={top:0,right:0,bottom:0,left:0},t=function(A){var W=A.borderBox,J=A.margin,ne=J===void 0?r:J,re=A.border,Ee=re===void 0?r:re,be=A.padding,Ie=be===void 0?r:be,Xe=h(o(W,ne)),Qe=h(l(W,Ee)),Ue=h(l(Qe,Ie));return{marginBox:Xe,borderBox:h(W),paddingBox:Qe,contentBox:Ue,margin:ne,border:Ee,padding:Ie}},c=function(A){var W=A.slice(0,-2),J=A.slice(-2);if(J!=="px")return 0;var ne=Number(W);return isNaN(ne)&&Object(g.a)(!1),ne},f=function(){return{x:window.pageXOffset,y:window.pageYOffset}},S=function(A,W){var J=A.borderBox,ne=A.border,re=A.margin,Ee=A.padding,be=a(J,W);return t({borderBox:be,border:ne,margin:re,padding:Ee})},C=function(A,W){return W===void 0&&(W=f()),S(A,W)},T=function(A,W){var J={top:c(W.marginTop),right:c(W.marginRight),bottom:c(W.marginBottom),left:c(W.marginLeft)},ne={top:c(W.paddingTop),right:c(W.paddingRight),bottom:c(W.paddingBottom),left:c(W.paddingLeft)},re={top:c(W.borderTopWidth),right:c(W.borderRightWidth),bottom:c(W.borderBottomWidth),left:c(W.borderLeftWidth)};return t({borderBox:A,margin:J,padding:ne,border:re})},O=function(A){var W=A.getBoundingClientRect(),J=window.getComputedStyle(A);return T(W,J)},R=Number.isNaN||function(A){return typeof A=="number"&&A!==A};function b(w,A){return w===A?!0:!!(R(w)&&R(A))}function _(w,A){if(w.length!==A.length)return!1;for(var W=0;W<w.length;W++)if(!b(w[W],A[W]))return!1;return!0}function u(w,A){A===void 0&&(A=_);var W,J=[],ne,re=!1;function Ee(){for(var be=[],Ie=0;Ie<arguments.length;Ie++)be[Ie]=arguments[Ie];return re&&W===this&&A(be,J)||(ne=w.apply(this,be),re=!0,W=this,J=be),ne}return Ee}var d=u,y=function(A){var W=[],J=null,ne=function(){for(var Ee=arguments.length,be=new Array(Ee),Ie=0;Ie<Ee;Ie++)be[Ie]=arguments[Ie];if(W=be,J)return;J=requestAnimationFrame(function(){J=null,A.apply(void 0,W)})};return ne.cancel=function(){if(!J)return;cancelAnimationFrame(J),J=null},ne},v=y,E=K("faye"),M=K.n(E),N=!0,j=/[ \t]{2,}/g,H=/^[ \t]*/gm,P=function(A){return A.replace(j," ").replace(H,"").trim()},x=function(A){return P(`
%creact-beautiful-dnd
%c`+P(A)+`
%c\u{1F477}\u200D This is a development only message. It will be removed in production builds.
`)},U=function(A){return[x(A),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},V="__react-beautiful-dnd-disable-dev-warnings";function q(w,A){var W;if(N)return;if(typeof window!="undefined"&&window[V])return;(W=console)[w].apply(W,U(A))}var ie=q.bind(null,"warn"),se=q.bind(null,"error");function ve(){}function Te(w,A){return Object(Q.a)({},w,{},A)}function fe(w,A,W){var J=A.map(function(ne){var re=Te(W,ne.options);return w.addEventListener(ne.eventName,ne.fn,re),function(){w.removeEventListener(ne.eventName,ne.fn,re)}});return function(){J.forEach(function(re){re()})}}var _e=!0,ue="Invariant failed";function xe(w){this.message=w}xe.prototype.toString=function(){return this.message};function Y(w,A){if(w)return;throw _e?new xe(ue):new xe(ue+": "+(A||""))}var oe=function(w){Object(k.a)(A,w);function A(){for(var J,ne=arguments.length,re=new Array(ne),Ee=0;Ee<ne;Ee++)re[Ee]=arguments[Ee];return J=w.call.apply(w,[this].concat(re))||this,J.callbacks=null,J.unbind=ve,J.onWindowError=function(be){var Ie=J.getCallbacks();Ie.isDragging()&&Ie.tryAbort();var Xe=be.error;Xe instanceof xe&&be.preventDefault()},J.getCallbacks=function(){if(!J.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return J.callbacks},J.setCallbacks=function(be){J.callbacks=be},J}var W=A.prototype;return W.componentDidMount=function(){this.unbind=fe(window,[{eventName:"error",fn:this.onWindowError}])},W.componentWillUnmount=function(){this.unbind()},W.componentDidCatch=function(ne){if(ne instanceof xe){this.setState({});return}throw ne},W.render=function(){return this.props.children(this.setCallbacks)},A}($.a.Component),ce=`
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
`,Re=function(A){return A+1},Ge=function(A){return`
You have lifted an item in position `+Re(A.source.index)+`
`},Ne=function(A,W){var J=A.droppableId===W.droppableId,ne=Re(A.index),re=Re(W.index);return J?`
You have moved the item from position `+ne+`
to position `+re+`
`:`
You have moved the item from position `+ne+`
in list `+A.droppableId+`
to list `+W.droppableId+`
in position `+re+`
`},Je=function(A,W,J){var ne=W.droppableId===J.droppableId;return ne?`
The item `+A+`
has been combined with `+J.draggableId:`
The item `+A+`
in list `+W.droppableId+`
has been combined with `+J.draggableId+`
in list `+J.droppableId+`
`},rt=function(A){var W=A.destination;if(W)return Ne(A.source,W);var J=A.combine;return J?Je(A.draggableId,A.source,J):"You are over an area that cannot be dropped on"},_t=function(A){return`
The item has returned to its starting position
of `+Re(A.index)+`
`},ft=function(A){if(A.reason==="CANCEL")return`
Movement cancelled.
`+_t(A.source)+`
`;var W=A.destination,J=A.combine;return W?`
You have dropped the item.
`+Ne(A.source,W)+`
`:J?`
You have dropped the item.
`+Je(A.draggableId,A.source,J)+`
`:`
The item has been dropped while not over a drop area.
`+_t(A.source)+`
`},ut={dragHandleUsageInstructions:ce,onDragStart:Ge,onDragUpdate:rt,onDragEnd:ft},qe={x:0,y:0},Ct=function(A,W){return{x:A.x+W.x,y:A.y+W.y}},kt=function(A,W){return{x:A.x-W.x,y:A.y-W.y}},Kt=function(A,W){return A.x===W.x&&A.y===W.y},zt=function(A){return{x:A.x!==0?-A.x:0,y:A.y!==0?-A.y:0}},ln=function(A,W,J){var ne;return J===void 0&&(J=0),ne={},ne[A]=W,ne[A==="x"?"y":"x"]=J,ne},un=function(A,W){return Math.sqrt(Math.pow(W.x-A.x,2)+Math.pow(W.y-A.y,2))},We=function(A,W){return Math.min.apply(Math,W.map(function(J){return un(A,J)}))},je=function(A){return function(W){return{x:A(W.x),y:A(W.y)}}},ht=function(w,A){var W=h({top:Math.max(A.top,w.top),right:Math.min(A.right,w.right),bottom:Math.min(A.bottom,w.bottom),left:Math.max(A.left,w.left)});return W.width<=0||W.height<=0?null:W},ct=function(A,W){return{top:A.top+W.y,left:A.left+W.x,bottom:A.bottom+W.y,right:A.right+W.x}},He=function(A){return[{x:A.left,y:A.top},{x:A.right,y:A.top},{x:A.left,y:A.bottom},{x:A.right,y:A.bottom}]},lt={top:0,right:0,bottom:0,left:0},Pe=function(A,W){return W?ct(A,W.scroll.diff.displacement):A},Oe=function(A,W,J){if(J&&J.increasedBy){var ne;return Object(Q.a)({},A,(ne={},ne[W.end]=A[W.end]+J.increasedBy[W.line],ne))}return A},Ce=function(A,W){return W&&W.shouldClipSubject?ht(W.pageMarginBox,A):h(A)},le=function(w){var A=w.page,W=w.withPlaceholder,J=w.axis,ne=w.frame,re=Pe(A.marginBox,ne),Ee=Oe(re,J,W),be=Ce(Ee,ne);return{page:A,withPlaceholder:W,active:be}},he=function(w,A){w.frame||Y(!1);var W=w.frame,J=kt(A,W.scroll.initial),ne=zt(J),re=Object(Q.a)({},W,{scroll:{initial:W.scroll.initial,current:A,diff:{value:J,displacement:ne},max:W.scroll.max}}),Ee=le({page:w.subject.page,withPlaceholder:w.subject.withPlaceholder,axis:w.axis,frame:re}),be=Object(Q.a)({},w,{frame:re,subject:Ee});return be};function ye(w){return Number.isInteger?Number.isInteger(w):typeof w=="number"&&isFinite(w)&&Math.floor(w)===w}function ae(w){return Object.values?Object.values(w):Object.keys(w).map(function(A){return w[A]})}function Se(w,A){if(w.findIndex)return w.findIndex(A);for(var W=0;W<w.length;W++)if(A(w[W]))return W;return-1}function $e(w,A){if(w.find)return w.find(A);var W=Se(w,A);return W!==-1?w[W]:void 0}function dt(w){return Array.prototype.slice.call(w)}var St=d(function(w){return w.reduce(function(A,W){return A[W.descriptor.id]=W,A},{})}),Dt=d(function(w){return w.reduce(function(A,W){return A[W.descriptor.id]=W,A},{})}),Mt=d(function(w){return ae(w)}),hr=d(function(w){return ae(w)}),on=d(function(w,A){var W=hr(A).filter(function(J){return w===J.descriptor.droppableId}).sort(function(J,ne){return J.descriptor.index-ne.descriptor.index});return W});function fn(w){return w.at&&w.at.type==="REORDER"?w.at.destination:null}function nn(w){return w.at&&w.at.type==="COMBINE"?w.at.combine:null}var kn=d(function(w,A){return A.filter(function(W){return W.descriptor.id!==w.descriptor.id})}),dr=function(w){var A=w.isMovingForward,W=w.draggable,J=w.destination,ne=w.insideDestination,re=w.previousImpact;if(!J.isCombineEnabled)return null;var Ee=fn(re);if(!Ee)return null;function be(gn){var Tn={type:"COMBINE",combine:{draggableId:gn,droppableId:J.descriptor.id}};return Object(Q.a)({},re,{at:Tn})}var Ie=re.displaced.all,Xe=Ie.length?Ie[0]:null;if(A)return Xe?be(Xe):null;var Qe=kn(W,ne);if(!Xe){if(!Qe.length)return null;var Ue=Qe[Qe.length-1];return be(Ue.descriptor.id)}var Me=Se(Qe,function(gn){return gn.descriptor.id===Xe});Me!==-1||Y(!1);var Ke=Me-1;if(Ke<0)return null;var gt=Qe[Ke];return be(gt.descriptor.id)},pr=function(w,A){return w.descriptor.droppableId===A.descriptor.id},Yn={point:qe,value:0},Tr={invisible:{},visible:{},all:[]},Or={displaced:Tr,displacedBy:Yn,at:null},Wt=function(w,A){return function(W){return w<=W&&W<=A}},Ln=function(w){var A=Wt(w.top,w.bottom),W=Wt(w.left,w.right);return function(J){var ne=A(J.top)&&A(J.bottom)&&W(J.left)&&W(J.right);if(ne)return!0;var re=A(J.top)||A(J.bottom),Ee=W(J.left)||W(J.right),be=re&&Ee;if(be)return!0;var Ie=J.top<w.top&&J.bottom>w.bottom,Xe=J.left<w.left&&J.right>w.right,Qe=Ie&&Xe;if(Qe)return!0;var Ue=Ie&&Ee||Xe&&re;return Ue}},mr=function(w){var A=Wt(w.top,w.bottom),W=Wt(w.left,w.right);return function(J){var ne=A(J.top)&&A(J.bottom)&&W(J.left)&&W(J.right);return ne}},vr={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},Rr={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},Sr=function(w){return function(A){var W=Wt(A.top,A.bottom),J=Wt(A.left,A.right);return function(ne){return w===vr?W(ne.top)&&W(ne.bottom):J(ne.left)&&J(ne.right)}}},Wr=function(A,W){var J=W.frame?W.frame.scroll.diff.displacement:qe;return ct(A,J)},Ar=function(A,W,J){return W.subject.active?J(W.subject.active)(A):!1},nt=function(A,W,J){return J(W)(A)},ke=function(A){var W=A.target,J=A.destination,ne=A.viewport,re=A.withDroppableDisplacement,Ee=A.isVisibleThroughFrameFn,be=re?Wr(W,J):W;return Ar(be,J,Ee)&&nt(be,ne,Ee)},xt=function(A){return ke(Object(Q.a)({},A,{isVisibleThroughFrameFn:Ln}))},Ae=function(A){return ke(Object(Q.a)({},A,{isVisibleThroughFrameFn:mr}))},me=function(A){return ke(Object(Q.a)({},A,{isVisibleThroughFrameFn:Sr(A.destination.axis)}))},pe=function(A,W,J){if(typeof J=="boolean")return J;if(!W)return!0;var ne=W.invisible,re=W.visible;if(ne[A])return!1;var Ee=re[A];return Ee?Ee.shouldAnimate:!0};function ir(w,A){var W=w.page.marginBox,J={top:A.point.y,right:0,bottom:0,left:A.point.x};return h(o(W,J))}function Vt(w){var A=w.afterDragging,W=w.destination,J=w.displacedBy,ne=w.viewport,re=w.forceShouldAnimate,Ee=w.last;return A.reduce(function(Ie,Xe){var Qe=ir(Xe,J),Ue=Xe.descriptor.id;Ie.all.push(Ue);var Me=xt({target:Qe,destination:W,viewport:ne,withDroppableDisplacement:!0});if(!Me)return Ie.invisible[Xe.descriptor.id]=!0,Ie;var Ke=pe(Ue,Ee,re),gt={draggableId:Ue,shouldAnimate:Ke};return Ie.visible[Ue]=gt,Ie},{all:[],visible:{},invisible:{}})}function we(w,A){if(!w.length)return 0;var W=w[w.length-1].descriptor.index;return A.inHomeList?W:W+1}function at(w){var A=w.insideDestination,W=w.inHomeList,J=w.displacedBy,ne=w.destination,re=we(A,{inHomeList:W});return{displaced:Tr,displacedBy:J,at:{type:"REORDER",destination:{droppableId:ne.descriptor.id,index:re}}}}function ge(w){var A=w.draggable,W=w.insideDestination,J=w.destination,ne=w.viewport,re=w.displacedBy,Ee=w.last,be=w.index,Ie=w.forceShouldAnimate,Xe=pr(A,J);if(be==null)return at({insideDestination:W,inHomeList:Xe,displacedBy:re,destination:J});var Qe=$e(W,function(gn){return gn.descriptor.index===be});if(!Qe)return at({insideDestination:W,inHomeList:Xe,displacedBy:re,destination:J});var Ue=kn(A,W),Me=W.indexOf(Qe),Ke=Ue.slice(Me),gt=Vt({afterDragging:Ke,destination:J,displacedBy:re,last:Ee,viewport:ne.frame,forceShouldAnimate:Ie});return{displaced:gt,displacedBy:re,at:{type:"REORDER",destination:{droppableId:J.descriptor.id,index:be}}}}function en(w,A){return Boolean(A.effected[w])}var sr=function(w){var A=w.isMovingForward,W=w.destination,J=w.draggables,ne=w.combine,re=w.afterCritical;if(!W.isCombineEnabled)return null;var Ee=ne.draggableId,be=J[Ee],Ie=be.descriptor.index,Xe=en(Ee,re);return Xe?A?Ie:Ie-1:A?Ie+1:Ie},ur=function(w){var A=w.isMovingForward,W=w.isInHomeList,J=w.insideDestination,ne=w.location;if(!J.length)return null;var re=ne.index,Ee=A?re+1:re-1,be=J[0].descriptor.index,Ie=J[J.length-1].descriptor.index,Xe=W?Ie:Ie+1;return Ee<be||Ee>Xe?null:Ee},Wn=function(w){var A=w.isMovingForward,W=w.isInHomeList,J=w.draggable,ne=w.draggables,re=w.destination,Ee=w.insideDestination,be=w.previousImpact,Ie=w.viewport,Xe=w.afterCritical,Qe=be.at;if(Qe||Y(!1),Qe.type==="REORDER"){var Ue=ur({isMovingForward:A,isInHomeList:W,location:Qe.destination,insideDestination:Ee});return Ue==null?null:ge({draggable:J,insideDestination:Ee,destination:re,viewport:Ie,last:be.displaced,displacedBy:be.displacedBy,index:Ue})}var Me=sr({isMovingForward:A,destination:re,displaced:be.displaced,draggables:ne,combine:Qe.combine,afterCritical:Xe});return Me==null?null:ge({draggable:J,insideDestination:Ee,destination:re,viewport:Ie,last:be.displaced,displacedBy:be.displacedBy,index:Me})},Ft=function(w){var A=w.displaced,W=w.afterCritical,J=w.combineWith,ne=w.displacedBy,re=Boolean(A.visible[J]||A.invisible[J]);return en(J,W)?re?qe:zt(ne.point):re?ne.point:qe},or=function(w){var A=w.afterCritical,W=w.impact,J=w.draggables,ne=nn(W);ne||Y(!1);var re=ne.draggableId,Ee=J[re].page.borderBox.center,be=Ft({displaced:W.displaced,afterCritical:A,combineWith:re,displacedBy:W.displacedBy});return Ct(Ee,be)},ot=function(A,W){return W.margin[A.start]+W.borderBox[A.size]/2},Mn=function(A,W){return W.margin[A.end]+W.borderBox[A.size]/2},bn=function(A,W,J){return W[A.crossAxisStart]+J.margin[A.crossAxisStart]+J.borderBox[A.crossAxisSize]/2},sn=function(A){var W=A.axis,J=A.moveRelativeTo,ne=A.isMoving;return ln(W.line,J.marginBox[W.end]+ot(W,ne),bn(W,J.marginBox,ne))},$t=function(A){var W=A.axis,J=A.moveRelativeTo,ne=A.isMoving;return ln(W.line,J.marginBox[W.start]-Mn(W,ne),bn(W,J.marginBox,ne))},Dn=function(A){var W=A.axis,J=A.moveInto,ne=A.isMoving;return ln(W.line,J.contentBox[W.start]+ot(W,ne),bn(W,J.contentBox,ne))},hn=function(w){var A=w.impact,W=w.draggable,J=w.draggables,ne=w.droppable,re=w.afterCritical,Ee=on(ne.descriptor.id,J),be=W.page,Ie=ne.axis;if(!Ee.length)return Dn({axis:Ie,moveInto:ne.page,isMoving:be});var Xe=A.displaced,Qe=A.displacedBy,Ue=Xe.all[0];if(Ue){var Me=J[Ue];if(en(Ue,re))return $t({axis:Ie,moveRelativeTo:Me.page,isMoving:be});var Ke=S(Me.page,Qe.point);return $t({axis:Ie,moveRelativeTo:Ke,isMoving:be})}var gt=Ee[Ee.length-1];if(gt.descriptor.id===W.descriptor.id)return be.borderBox.center;if(en(gt.descriptor.id,re)){var gn=S(gt.page,zt(re.displacedBy.point));return sn({axis:Ie,moveRelativeTo:gn,isMoving:be})}return sn({axis:Ie,moveRelativeTo:gt.page,isMoving:be})},Jt=function(w,A){var W=w.frame;return W?Ct(A,W.scroll.diff.displacement):A},It=function(A){var W=A.impact,J=A.draggable,ne=A.droppable,re=A.draggables,Ee=A.afterCritical,be=J.page.borderBox.center,Ie=W.at;return ne&&Ie?Ie.type==="REORDER"?hn({impact:W,draggable:J,draggables:re,droppable:ne,afterCritical:Ee}):or({impact:W,draggables:re,afterCritical:Ee}):be},jt=function(w){var A=It(w),W=w.droppable,J=W?Jt(W,A):A;return J},tr=function(w,A){var W=kt(A,w.scroll.initial),J=zt(W),ne=h({top:A.y,bottom:A.y+w.frame.height,left:A.x,right:A.x+w.frame.width}),re={frame:ne,scroll:{initial:w.scroll.initial,max:w.scroll.max,current:A,diff:{value:W,displacement:J}}};return re};function nr(w,A){return w.map(function(W){return A[W]})}function Un(w,A){for(var W=0;W<A.length;W++){var J=A[W].visible[w];if(J)return J}return null}var yn=function(w){var A=w.impact,W=w.viewport,J=w.destination,ne=w.draggables,re=w.maxScrollChange,Ee=tr(W,Ct(W.scroll.current,re)),be=J.frame?he(J,Ct(J.frame.scroll.current,re)):J,Ie=A.displaced,Xe=Vt({afterDragging:nr(Ie.all,ne),destination:J,displacedBy:A.displacedBy,viewport:Ee.frame,last:Ie,forceShouldAnimate:!1}),Qe=Vt({afterDragging:nr(Ie.all,ne),destination:be,displacedBy:A.displacedBy,viewport:W.frame,last:Ie,forceShouldAnimate:!1}),Ue={},Me={},Ke=[Ie,Xe,Qe];Ie.all.forEach(function(gn){var Tn=Un(gn,Ke);if(Tn){Me[gn]=Tn;return}Ue[gn]=!0});var gt=Object(Q.a)({},A,{displaced:{all:Ie.all,invisible:Ue,visible:Me}});return gt},Nt=function(w,A){return Ct(w.scroll.diff.displacement,A)},Xt=function(w){var A=w.pageBorderBoxCenter,W=w.draggable,J=w.viewport,ne=Nt(J,A),re=kt(ne,W.page.borderBox.center);return Ct(W.client.borderBox.center,re)},Ht=function(w){var A=w.draggable,W=w.destination,J=w.newPageBorderBoxCenter,ne=w.viewport,re=w.withDroppableDisplacement,Ee=w.onlyOnMainAxis,be=Ee===void 0?!1:Ee,Ie=kt(J,A.page.borderBox.center),Xe=ct(A.page.borderBox,Ie),Qe={target:Xe,destination:W,withDroppableDisplacement:re,viewport:ne};return be?me(Qe):Ae(Qe)},Ot=function(w){var A=w.isMovingForward,W=w.draggable,J=w.destination,ne=w.draggables,re=w.previousImpact,Ee=w.viewport,be=w.previousPageBorderBoxCenter,Ie=w.previousClientSelection,Xe=w.afterCritical;if(!J.isEnabled)return null;var Qe=on(J.descriptor.id,ne),Ue=pr(W,J),Me=dr({isMovingForward:A,draggable:W,destination:J,insideDestination:Qe,previousImpact:re})||Wn({isMovingForward:A,isInHomeList:Ue,draggable:W,draggables:ne,destination:J,insideDestination:Qe,previousImpact:re,viewport:Ee,afterCritical:Xe});if(!Me)return null;var Ke=jt({impact:Me,draggable:W,droppable:J,draggables:ne,afterCritical:Xe}),gt=Ht({draggable:W,destination:J,newPageBorderBoxCenter:Ke,viewport:Ee.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(gt){var gn=Xt({pageBorderBoxCenter:Ke,draggable:W,viewport:Ee});return{clientSelection:gn,impact:Me,scrollJumpRequest:null}}var Tn=kt(Ke,be),Vn=yn({impact:Me,viewport:Ee,destination:J,draggables:ne,maxScrollChange:Tn});return{clientSelection:Ie,impact:Vn,scrollJumpRequest:Tn}},Qn=function(A){var W=A.subject.active;return W||Y(!1),W},An=function(w){var A=w.isMovingForward,W=w.pageBorderBoxCenter,J=w.source,ne=w.droppables,re=w.viewport,Ee=J.subject.active;if(!Ee)return null;var be=J.axis,Ie=Wt(Ee[be.start],Ee[be.end]),Xe=Mt(ne).filter(function(Ue){return Ue!==J}).filter(function(Ue){return Ue.isEnabled}).filter(function(Ue){return Boolean(Ue.subject.active)}).filter(function(Ue){return Ln(re.frame)(Qn(Ue))}).filter(function(Ue){var Me=Qn(Ue);return A?Ee[be.crossAxisEnd]<Me[be.crossAxisEnd]:Me[be.crossAxisStart]<Ee[be.crossAxisStart]}).filter(function(Ue){var Me=Qn(Ue),Ke=Wt(Me[be.start],Me[be.end]);return Ie(Me[be.start])||Ie(Me[be.end])||Ke(Ee[be.start])||Ke(Ee[be.end])}).sort(function(Ue,Me){var Ke=Qn(Ue)[be.crossAxisStart],gt=Qn(Me)[be.crossAxisStart];return A?Ke-gt:gt-Ke}).filter(function(Ue,Me,Ke){return Qn(Ue)[be.crossAxisStart]===Qn(Ke[0])[be.crossAxisStart]});if(!Xe.length)return null;if(Xe.length===1)return Xe[0];var Qe=Xe.filter(function(Ue){var Me=Wt(Qn(Ue)[be.start],Qn(Ue)[be.end]);return Me(W[be.line])});return Qe.length===1?Qe[0]:Qe.length>1?Qe.sort(function(Ue,Me){return Qn(Ue)[be.start]-Qn(Me)[be.start]})[0]:Xe.sort(function(Ue,Me){var Ke=We(W,He(Qn(Ue))),gt=We(W,He(Qn(Me)));return Ke!==gt?Ke-gt:Qn(Ue)[be.start]-Qn(Me)[be.start]})[0]},pn=function(A,W){var J=A.page.borderBox.center;return en(A.descriptor.id,W)?kt(J,W.displacedBy.point):J},Gn=function(A,W){var J=A.page.borderBox;return en(A.descriptor.id,W)?ct(J,zt(W.displacedBy.point)):J},dn=function(w){var A=w.pageBorderBoxCenter,W=w.viewport,J=w.destination,ne=w.insideDestination,re=w.afterCritical,Ee=ne.filter(function(be){return Ae({target:Gn(be,re),destination:J,viewport:W.frame,withDroppableDisplacement:!0})}).sort(function(be,Ie){var Xe=un(A,Jt(J,pn(be,re))),Qe=un(A,Jt(J,pn(Ie,re)));return Xe<Qe?-1:Qe<Xe?1:be.descriptor.index-Ie.descriptor.index});return Ee[0]||null},En=d(function(A,W){var J=W[A.line];return{value:J,point:ln(A.line,J)}}),qt=function(A,W,J){var ne=A.axis;if(A.descriptor.mode==="virtual")return ln(ne.line,W[ne.line]);var re=A.subject.page.contentBox[ne.size],Ee=on(A.descriptor.id,J),be=Ee.reduce(function(Qe,Ue){return Qe+Ue.client.marginBox[ne.size]},0),Ie=be+W[ne.line],Xe=Ie-re;return Xe<=0?null:ln(ne.line,Xe)},In=function(A,W){return Object(Q.a)({},A,{scroll:Object(Q.a)({},A.scroll,{max:W})})},Jn=function(A,W,J){var ne=A.frame;pr(W,A)&&Y(!1),A.subject.withPlaceholder&&Y(!1);var re=En(A.axis,W.displaceBy).point,Ee=qt(A,re,J),be={placeholderSize:re,increasedBy:Ee,oldFrameMaxScroll:A.frame?A.frame.scroll.max:null};if(!ne){var Ie=le({page:A.subject.page,withPlaceholder:be,axis:A.axis,frame:A.frame});return Object(Q.a)({},A,{subject:Ie})}var Xe=Ee?Ct(ne.scroll.max,Ee):ne.scroll.max,Qe=In(ne,Xe),Ue=le({page:A.subject.page,withPlaceholder:be,axis:A.axis,frame:Qe});return Object(Q.a)({},A,{subject:Ue,frame:Qe})},qn=function(A){var W=A.subject.withPlaceholder;W||Y(!1);var J=A.frame;if(!J){var ne=le({page:A.subject.page,axis:A.axis,frame:null,withPlaceholder:null});return Object(Q.a)({},A,{subject:ne})}var re=W.oldFrameMaxScroll;re||Y(!1);var Ee=In(J,re),be=le({page:A.subject.page,axis:A.axis,frame:Ee,withPlaceholder:null});return Object(Q.a)({},A,{subject:be,frame:Ee})},wn=function(w){var A=w.previousPageBorderBoxCenter,W=w.moveRelativeTo,J=w.insideDestination,ne=w.draggable,re=w.draggables,Ee=w.destination,be=w.viewport,Ie=w.afterCritical;if(!W){if(J.length)return null;var Xe={displaced:Tr,displacedBy:Yn,at:{type:"REORDER",destination:{droppableId:Ee.descriptor.id,index:0}}},Qe=jt({impact:Xe,draggable:ne,droppable:Ee,draggables:re,afterCritical:Ie}),Ue=pr(ne,Ee)?Ee:Jn(Ee,ne,re),Me=Ht({draggable:ne,destination:Ue,newPageBorderBoxCenter:Qe,viewport:be.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return Me?Xe:null}var Ke=Boolean(A[Ee.axis.line]<=W.page.borderBox.center[Ee.axis.line]),gt=function(){var Tn=W.descriptor.index;return W.descriptor.id===ne.descriptor.id||Ke?Tn:Tn+1}(),gn=En(Ee.axis,ne.displaceBy);return ge({draggable:ne,insideDestination:J,destination:Ee,viewport:be,displacedBy:gn,last:Tr,index:gt})},Nn=function(w){var A=w.isMovingForward,W=w.previousPageBorderBoxCenter,J=w.draggable,ne=w.isOver,re=w.draggables,Ee=w.droppables,be=w.viewport,Ie=w.afterCritical,Xe=An({isMovingForward:A,pageBorderBoxCenter:W,source:ne,droppables:Ee,viewport:be});if(!Xe)return null;var Qe=on(Xe.descriptor.id,re),Ue=dn({pageBorderBoxCenter:W,viewport:be,destination:Xe,insideDestination:Qe,afterCritical:Ie}),Me=wn({previousPageBorderBoxCenter:W,destination:Xe,draggable:J,draggables:re,moveRelativeTo:Ue,insideDestination:Qe,viewport:be,afterCritical:Ie});if(!Me)return null;var Ke=jt({impact:Me,draggable:J,droppable:Xe,draggables:re,afterCritical:Ie}),gt=Xt({pageBorderBoxCenter:Ke,draggable:J,viewport:be});return{clientSelection:gt,impact:Me,scrollJumpRequest:null}},cn=function(w){var A=w.at;return A?A.type==="REORDER"?A.destination.droppableId:A.combine.droppableId:null},rr=function(A,W){var J=cn(A);return J?W[J]:null},zn=function(w){var A=w.state,W=w.type,J=rr(A.impact,A.dimensions.droppables),ne=Boolean(J),re=A.dimensions.droppables[A.critical.droppable.id],Ee=J||re,be=Ee.axis.direction,Ie=be==="vertical"&&(W==="MOVE_UP"||W==="MOVE_DOWN")||be==="horizontal"&&(W==="MOVE_LEFT"||W==="MOVE_RIGHT");if(Ie&&!ne)return null;var Xe=W==="MOVE_DOWN"||W==="MOVE_RIGHT",Qe=A.dimensions.draggables[A.critical.draggable.id],Ue=A.current.page.borderBoxCenter,Me=A.dimensions,Ke=Me.draggables,gt=Me.droppables;return Ie?Ot({isMovingForward:Xe,previousPageBorderBoxCenter:Ue,draggable:Qe,destination:Ee,draggables:Ke,viewport:A.viewport,previousClientSelection:A.current.client.selection,previousImpact:A.impact,afterCritical:A.afterCritical}):Nn({isMovingForward:Xe,previousPageBorderBoxCenter:Ue,draggable:Qe,isOver:Ee,draggables:Ke,droppables:gt,viewport:A.viewport,afterCritical:A.afterCritical})};function fr(w){return w.phase==="DRAGGING"||w.phase==="COLLECTING"}function cr(w){var A=Wt(w.top,w.bottom),W=Wt(w.left,w.right);return function(ne){return A(ne.y)&&W(ne.x)}}function Hn(w,A){return w.left<A.right&&w.right>A.left&&w.top<A.bottom&&w.bottom>A.top}function Fn(w){var A=w.pageBorderBox,W=w.draggable,J=w.candidates,ne=W.page.borderBox.center,re=J.map(function(Ee){var be=Ee.axis,Ie=ln(Ee.axis.line,A.center[be.line],Ee.page.borderBox.center[be.crossAxisLine]);return{id:Ee.descriptor.id,distance:un(ne,Ie)}}).sort(function(Ee,be){return be.distance-Ee.distance});return re[0]?re[0].id:null}function gr(w){var A=w.pageBorderBox,W=w.draggable,J=w.droppables,ne=Mt(J).filter(function(re){if(!re.isEnabled)return!1;var Ee=re.subject.active;if(!Ee)return!1;if(!Hn(A,Ee))return!1;if(cr(Ee)(A.center))return!0;var be=re.axis,Ie=Ee.center[be.crossAxisLine],Xe=A[be.crossAxisStart],Qe=A[be.crossAxisEnd],Ue=Wt(Ee[be.crossAxisStart],Ee[be.crossAxisEnd]),Me=Ue(Xe),Ke=Ue(Qe);return!Me&&!Ke?!0:Me?Xe<Ie:Qe>Ie});return ne.length?ne.length===1?ne[0].descriptor.id:Fn({pageBorderBox:A,draggable:W,candidates:ne}):null}var Sn=function(A,W){return h(ct(A,W))},xn=function(w,A){var W=w.frame;return W?Sn(A,W.scroll.diff.value):A};function Cn(w){var A=w.displaced,W=w.id;return Boolean(A.visible[W]||A.invisible[W])}function _n(w){var A=w.draggable,W=w.closest,J=w.inHomeList;return W?J&&W.descriptor.index>A.descriptor.index?W.descriptor.index-1:W.descriptor.index:null}var Qt=function(w){var A=w.pageBorderBoxWithDroppableScroll,W=w.draggable,J=w.destination,ne=w.insideDestination,re=w.last,Ee=w.viewport,be=w.afterCritical,Ie=J.axis,Xe=En(J.axis,W.displaceBy),Qe=Xe.value,Ue=A[Ie.start],Me=A[Ie.end],Ke=kn(W,ne),gt=$e(Ke,function(Tn){var Vn=Tn.descriptor.id,er=Tn.page.borderBox.center[Ie.line],wr=en(Vn,be),Zn=Cn({displaced:re,id:Vn});return wr?Zn?Me<=er:Ue<er-Qe:Zn?Me<=er+Qe:Ue<er}),gn=_n({draggable:W,closest:gt,inHomeList:pr(W,J)});return ge({draggable:W,insideDestination:ne,destination:J,viewport:Ee,last:re,displacedBy:Xe,index:gn})},yt=4,Pt=function(w){var A=w.draggable,W=w.pageBorderBoxWithDroppableScroll,J=w.previousImpact,ne=w.destination,re=w.insideDestination,Ee=w.afterCritical;if(!ne.isCombineEnabled)return null;var be=ne.axis,Ie=En(ne.axis,A.displaceBy),Xe=Ie.value,Qe=W[be.start],Ue=W[be.end],Me=kn(A,re),Ke=$e(Me,function(gn){var Tn=gn.descriptor.id,Vn=gn.page.borderBox,er=Vn[be.size],wr=er/yt,Zn=en(Tn,Ee),Nr=Cn({displaced:J.displaced,id:Tn});return Zn?Nr?Ue>Vn[be.start]+wr&&Ue<Vn[be.end]-wr:Qe>Vn[be.start]-Xe+wr&&Qe<Vn[be.end]-Xe-wr:Nr?Ue>Vn[be.start]+Xe+wr&&Ue<Vn[be.end]+Xe-wr:Qe>Vn[be.start]+wr&&Qe<Vn[be.end]-wr});if(!Ke)return null;var gt={displacedBy:Ie,displaced:J.displaced,at:{type:"COMBINE",combine:{draggableId:Ke.descriptor.id,droppableId:ne.descriptor.id}}};return gt},Lt=function(w){var A=w.pageOffset,W=w.draggable,J=w.draggables,ne=w.droppables,re=w.previousImpact,Ee=w.viewport,be=w.afterCritical,Ie=Sn(W.page.borderBox,A),Xe=gr({pageBorderBox:Ie,draggable:W,droppables:ne});if(!Xe)return Or;var Qe=ne[Xe],Ue=on(Qe.descriptor.id,J),Me=xn(Qe,Ie);return Pt({pageBorderBoxWithDroppableScroll:Me,draggable:W,previousImpact:re,destination:Qe,insideDestination:Ue,afterCritical:be})||Qt({pageBorderBoxWithDroppableScroll:Me,draggable:W,destination:Qe,insideDestination:Ue,last:re.displaced,viewport:Ee,afterCritical:be})},wt=function(w,A){var W;return Object(Q.a)({},w,(W={},W[A.descriptor.id]=A,W))},Gt=function(A){var W=A.previousImpact,J=A.impact,ne=A.droppables,re=cn(W),Ee=cn(J);if(!re)return ne;if(re===Ee)return ne;var be=ne[re];if(!be.subject.withPlaceholder)return ne;var Ie=qn(be);return wt(ne,Ie)},rn=function(w){var A=w.draggable,W=w.draggables,J=w.droppables,ne=w.previousImpact,re=w.impact,Ee=Gt({previousImpact:ne,impact:re,droppables:J}),be=cn(re);if(!be)return Ee;var Ie=J[be];if(pr(A,Ie))return Ee;if(Ie.subject.withPlaceholder)return Ee;var Xe=Jn(Ie,A,W);return wt(Ee,Xe)},tn=function(w){var A=w.state,W=w.clientSelection,J=w.dimensions,ne=w.viewport,re=w.impact,Ee=w.scrollJumpRequest,be=ne||A.viewport,Ie=J||A.dimensions,Xe=W||A.current.client.selection,Qe=kt(Xe,A.initial.client.selection),Ue={offset:Qe,selection:Xe,borderBoxCenter:Ct(A.initial.client.borderBoxCenter,Qe)},Me={selection:Ct(Ue.selection,be.scroll.current),borderBoxCenter:Ct(Ue.borderBoxCenter,be.scroll.current),offset:Ct(Ue.offset,be.scroll.diff.value)},Ke={client:Ue,page:Me};if(A.phase==="COLLECTING")return Object(Q.a)({phase:"COLLECTING"},A,{dimensions:Ie,viewport:be,current:Ke});var gt=Ie.draggables[A.critical.draggable.id],gn=re||Lt({pageOffset:Me.offset,draggable:gt,draggables:Ie.draggables,droppables:Ie.droppables,previousImpact:A.impact,viewport:be,afterCritical:A.afterCritical}),Tn=rn({draggable:gt,impact:gn,previousImpact:A.impact,draggables:Ie.draggables,droppables:Ie.droppables}),Vn=Object(Q.a)({},A,{current:Ke,dimensions:{draggables:Ie.draggables,droppables:Tn},impact:gn,viewport:be,scrollJumpRequest:Ee||null,forceShouldAnimate:Ee?!1:null});return Vn};function st(w,A){return w.map(function(W){return A[W]})}var Ye=function(w){var A=w.impact,W=w.viewport,J=w.draggables,ne=w.destination,re=w.forceShouldAnimate,Ee=A.displaced,be=st(Ee.all,J),Ie=Vt({afterDragging:be,destination:ne,displacedBy:A.displacedBy,viewport:W.frame,forceShouldAnimate:re,last:Ee});return Object(Q.a)({},A,{displaced:Ie})},Be=function(w){var A=w.impact,W=w.draggable,J=w.droppable,ne=w.draggables,re=w.viewport,Ee=w.afterCritical,be=jt({impact:A,draggable:W,draggables:ne,droppable:J,afterCritical:Ee});return Xt({pageBorderBoxCenter:be,draggable:W,viewport:re})},ze=function(w){var A=w.state,W=w.dimensions,J=w.viewport;A.movementMode==="SNAP"||Y(!1);var ne=A.impact,re=J||A.viewport,Ee=W||A.dimensions,be=Ee.draggables,Ie=Ee.droppables,Xe=be[A.critical.draggable.id],Qe=cn(ne);Qe||Y(!1);var Ue=Ie[Qe],Me=Ye({impact:ne,viewport:re,destination:Ue,draggables:be}),Ke=Be({impact:Me,draggable:Xe,droppable:Ue,draggables:be,viewport:re,afterCritical:A.afterCritical});return tn({impact:Me,clientSelection:Ke,state:A,dimensions:Ee,viewport:re})},Le=function(w){return{index:w.index,droppableId:w.droppableId}},tt=function(w){var A=w.draggable,W=w.home,J=w.draggables,ne=w.viewport,re=En(W.axis,A.displaceBy),Ee=on(W.descriptor.id,J),be=Ee.indexOf(A);be!==-1||Y(!1);var Ie=Ee.slice(be+1),Xe=Ie.reduce(function(Ke,gt){return Ke[gt.descriptor.id]=!0,Ke},{}),Qe={inVirtualList:W.descriptor.mode==="virtual",displacedBy:re,effected:Xe},Ue=Vt({afterDragging:Ie,destination:W,displacedBy:re,last:null,viewport:ne.frame,forceShouldAnimate:!1}),Me={displaced:Ue,displacedBy:re,at:{type:"REORDER",destination:Le(A.descriptor)}};return{impact:Me,afterCritical:Qe}},Ve=function(w,A){return{draggables:w.draggables,droppables:wt(w.droppables,A)}},pt=function(A){},bt=function(A){},mt=function(w){var A=w.draggable,W=w.offset,J=w.initialWindowScroll,ne=S(A.client,W),re=C(ne,J),Ee=Object(Q.a)({},A,{placeholder:Object(Q.a)({},A.placeholder,{client:ne}),client:ne,page:re});return Ee},At=function(w){var A=w.frame;return A||Y(!1),A},vt=function(w){var A=w.additions,W=w.updatedDroppables,J=w.viewport,ne=J.scroll.diff.value;return A.map(function(re){var Ee=re.descriptor.droppableId,be=W[Ee],Ie=At(be),Xe=Ie.scroll.diff.value,Qe=Ct(ne,Xe),Ue=mt({draggable:re,offset:Qe,initialWindowScroll:J.scroll.initial});return Ue})},Et=function(w){var A=w.state,W=w.published;pt();var J=W.modified.map(function(wr){var Zn=A.dimensions.droppables[wr.droppableId],Nr=he(Zn,wr.scroll);return Nr}),ne=Object(Q.a)({},A.dimensions.droppables,{},St(J)),re=Dt(vt({additions:W.additions,updatedDroppables:ne,viewport:A.viewport})),Ee=Object(Q.a)({},A.dimensions.draggables,{},re);W.removals.forEach(function(wr){delete Ee[wr]});var be={droppables:ne,draggables:Ee},Ie=cn(A.impact),Xe=Ie?be.droppables[Ie]:null,Qe=be.draggables[A.critical.draggable.id],Ue=be.droppables[A.critical.droppable.id],Me=tt({draggable:Qe,home:Ue,draggables:Ee,viewport:A.viewport}),Ke=Me.impact,gt=Me.afterCritical,gn=Xe&&Xe.isCombineEnabled?A.impact:Ke,Tn=Lt({pageOffset:A.current.page.offset,draggable:be.draggables[A.critical.draggable.id],draggables:be.draggables,droppables:be.droppables,previousImpact:gn,viewport:A.viewport,afterCritical:gt});bt();var Vn=Object(Q.a)({phase:"DRAGGING"},A,{phase:"DRAGGING",impact:Tn,onLiftImpact:Ke,dimensions:be,afterCritical:gt,forceShouldAnimate:!1});if(A.phase==="COLLECTING")return Vn;var er=Object(Q.a)({phase:"DROP_PENDING"},Vn,{phase:"DROP_PENDING",reason:A.reason,isWaiting:!1});return er},an=function(A){return A.movementMode==="SNAP"},Yt=function(A,W,J){var ne=Ve(A.dimensions,W);return!an(A)||J?tn({state:A,dimensions:ne}):ze({state:A,dimensions:ne})};function lr(w){return w.isDragging&&w.movementMode==="SNAP"?Object(Q.a)({phase:"DRAGGING"},w,{scrollJumpRequest:null}):w}var Bn={phase:"IDLE",completed:null,shouldFlush:!1},jn=function(w,A){if(w===void 0&&(w=Bn),A.type==="FLUSH")return Object(Q.a)({},Bn,{shouldFlush:!0});if(A.type==="INITIAL_PUBLISH"){w.phase==="IDLE"||Y(!1);var W=A.payload,J=W.critical,ne=W.clientSelection,re=W.viewport,Ee=W.dimensions,be=W.movementMode,Ie=Ee.draggables[J.draggable.id],Xe=Ee.droppables[J.droppable.id],Qe={selection:ne,borderBoxCenter:Ie.client.borderBox.center,offset:qe},Ue={client:Qe,page:{selection:Ct(Qe.selection,re.scroll.initial),borderBoxCenter:Ct(Qe.selection,re.scroll.initial),offset:Ct(Qe.selection,re.scroll.diff.value)}},Me=Mt(Ee.droppables).every(function(xr){return!xr.isFixedOnPage}),Ke=tt({draggable:Ie,home:Xe,draggables:Ee.draggables,viewport:re}),gt=Ke.impact,gn=Ke.afterCritical,Tn={phase:"DRAGGING",isDragging:!0,critical:J,movementMode:be,dimensions:Ee,initial:Ue,current:Ue,isWindowScrollAllowed:Me,impact:gt,afterCritical:gn,onLiftImpact:gt,viewport:re,scrollJumpRequest:null,forceShouldAnimate:null};return Tn}if(A.type==="COLLECTION_STARTING"){if(w.phase==="COLLECTING"||w.phase==="DROP_PENDING")return w;w.phase==="DRAGGING"||Y(!1);var Vn=Object(Q.a)({phase:"COLLECTING"},w,{phase:"COLLECTING"});return Vn}if(A.type==="PUBLISH_WHILE_DRAGGING")return w.phase==="COLLECTING"||w.phase==="DROP_PENDING"||Y(!1),Et({state:w,published:A.payload});if(A.type==="MOVE"){if(w.phase==="DROP_PENDING")return w;fr(w)||Y(!1);var er=A.payload.client;return Kt(er,w.current.client.selection)?w:tn({state:w,clientSelection:er,impact:an(w)?w.impact:null})}if(A.type==="UPDATE_DROPPABLE_SCROLL"){if(w.phase==="DROP_PENDING")return lr(w);if(w.phase==="COLLECTING")return lr(w);fr(w)||Y(!1);var wr=A.payload,Zn=wr.id,Nr=wr.newScroll,Pr=w.dimensions.droppables[Zn];if(!Pr)return w;var Fr=he(Pr,Nr);return Yt(w,Fr,!1)}if(A.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(w.phase==="DROP_PENDING")return w;fr(w)||Y(!1);var $r=A.payload,e=$r.id,n=$r.isEnabled,s=w.dimensions.droppables[e];s||Y(!1),s.isEnabled!==n||Y(!1);var i=Object(Q.a)({},s,{isEnabled:n});return Yt(w,i,!0)}if(A.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(w.phase==="DROP_PENDING")return w;fr(w)||Y(!1);var p=A.payload,F=p.id,X=p.isCombineEnabled,Z=w.dimensions.droppables[F];Z||Y(!1),Z.isCombineEnabled!==X||Y(!1);var te=Object(Q.a)({},Z,{isCombineEnabled:X});return Yt(w,te,!0)}if(A.type==="MOVE_BY_WINDOW_SCROLL"){if(w.phase==="DROP_PENDING"||w.phase==="DROP_ANIMATING")return w;fr(w)||Y(!1),w.isWindowScrollAllowed||Y(!1);var de=A.payload.newScroll;if(Kt(w.viewport.scroll.current,de))return lr(w);var De=tr(w.viewport,de);return an(w)?ze({state:w,viewport:De}):tn({state:w,viewport:De})}if(A.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!fr(w))return w;var Fe=A.payload.maxScroll;if(Kt(Fe,w.viewport.scroll.max))return w;var it=Object(Q.a)({},w.viewport,{scroll:Object(Q.a)({},w.viewport.scroll,{max:Fe})});return Object(Q.a)({phase:"DRAGGING"},w,{viewport:it})}if(A.type==="MOVE_UP"||A.type==="MOVE_DOWN"||A.type==="MOVE_LEFT"||A.type==="MOVE_RIGHT"){if(w.phase==="COLLECTING"||w.phase==="DROP_PENDING")return w;w.phase==="DRAGGING"||Y(!1);var et=zn({state:w,type:A.type});return et?tn({state:w,impact:et.impact,clientSelection:et.clientSelection,scrollJumpRequest:et.scrollJumpRequest}):w}if(A.type==="DROP_PENDING"){var Tt=A.payload.reason;w.phase==="COLLECTING"||Y(!1);var Bt=Object(Q.a)({phase:"DROP_PENDING"},w,{phase:"DROP_PENDING",isWaiting:!0,reason:Tt});return Bt}if(A.type==="DROP_ANIMATE"){var Zt=A.payload,On=Zt.completed,Xn=Zt.dropDuration,Rn=Zt.newHomeClientOffset;w.phase==="DRAGGING"||w.phase==="DROP_PENDING"||Y(!1);var ar={phase:"DROP_ANIMATING",completed:On,dropDuration:Xn,newHomeClientOffset:Rn,dimensions:w.dimensions};return ar}if(A.type==="DROP_COMPLETE"){var Cr=A.payload.completed;return{phase:"IDLE",completed:Cr,shouldFlush:!1}}return w},Ut=function(A){return{type:"BEFORE_INITIAL_CAPTURE",payload:A}},mn=function(A){return{type:"LIFT",payload:A}},Pn=function(A){return{type:"INITIAL_PUBLISH",payload:A}},Kn=function(A){return{type:"PUBLISH_WHILE_DRAGGING",payload:A}},vn=function(){return{type:"COLLECTION_STARTING",payload:null}},Lr=function(A){return{type:"UPDATE_DROPPABLE_SCROLL",payload:A}},Br=function(A){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:A}},Er=function(A){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:A}},$n=function(A){return{type:"MOVE",payload:A}},br=function(A){return{type:"MOVE_BY_WINDOW_SCROLL",payload:A}},_r=function(A){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:A}},yr=function(){return{type:"MOVE_UP",payload:null}},Mr=function(){return{type:"MOVE_DOWN",payload:null}},Vr=function(){return{type:"MOVE_RIGHT",payload:null}},Ur=function(){return{type:"MOVE_LEFT",payload:null}},Ir=function(){return{type:"FLUSH",payload:null}},Ca=function(A){return{type:"DROP_ANIMATE",payload:A}},Kr=function(A){return{type:"DROP_COMPLETE",payload:A}},Oa=function(A){return{type:"DROP",payload:A}},qr=function(A){return{type:"DROP_PENDING",payload:A}},ea=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function Ea(w){if(w.length<=1)return;for(var A=w.map(function(be){return be.descriptor.index}),W={},J=1;J<A.length;J++){var ne=A[J],re=A[J-1];ne!==re+1&&(W[ne]=!0)}if(!Object.keys(W).length)return;var Ee=A.map(function(be){var Ie=Boolean(W[be]);return Ie?"[\u{1F525}"+be+"]":""+be}).join(", ")}function Ra(w,A){if(!1)var W}var Vi=function(w){return function(A){var W=A.getState,J=A.dispatch;return function(ne){return function(re){if(re.type!=="LIFT"){ne(re);return}var Ee=re.payload,be=Ee.id,Ie=Ee.clientSelection,Xe=Ee.movementMode,Qe=W();Qe.phase==="DROP_ANIMATING"&&J(Kr({completed:Qe.completed})),W().phase==="IDLE"||Y(!1),J(Ir()),J(Ut({draggableId:be,movementMode:Xe}));var Ue={shouldPublishImmediately:Xe==="SNAP"},Me={draggableId:be,scrollOptions:Ue},Ke=w.startPublishing(Me),gt=Ke.critical,gn=Ke.dimensions,Tn=Ke.viewport;Ra(gt,gn),J(Pn({critical:gt,dimensions:gn,clientSelection:Ie,movementMode:Xe,viewport:Tn}))}}}},ha=function(w){return function(){return function(A){return function(W){W.type==="INITIAL_PUBLISH"&&w.dragging(),W.type==="DROP_ANIMATE"&&w.dropping(W.payload.completed.result.reason),(W.type==="FLUSH"||W.type==="DROP_COMPLETE")&&w.resting(),A(W)}}}},Xi={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Ka={opacity:{drop:0,combining:.7},scale:{drop:.75}},Na={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ia=Na.outOfTheWay+"s "+Xi.outOfTheWay,Ja={fluid:"opacity "+ia,snap:"transform "+ia+", opacity "+ia,drop:function(A){var W=A+"s "+Xi.drop;return"transform "+W+", opacity "+W},outOfTheWay:"transform "+ia,placeholder:"height "+ia+", width "+ia+", margin "+ia},bo=function(A){return Kt(A,qe)?null:"translate("+A.x+"px, "+A.y+"px)"},yo={moveTo:bo,drop:function(A,W){var J=bo(A);return J?W?J+" scale("+Ka.scale.drop+")":J:null}},xo=Na.minDropTime,cs=Na.maxDropTime,fs=cs-xo,To=1500,wi=.6,hs=function(w){var A=w.current,W=w.destination,J=w.reason,ne=un(A,W);if(ne<=0)return xo;if(ne>=To)return cs;var re=ne/To,Ee=xo+fs*re,be=J==="CANCEL"?Ee*wi:Ee;return Number(be.toFixed(2))},ps=function(w){var A=w.impact,W=w.draggable,J=w.dimensions,ne=w.viewport,re=w.afterCritical,Ee=J.draggables,be=J.droppables,Ie=cn(A),Xe=Ie?be[Ie]:null,Qe=be[W.descriptor.droppableId],Ue=Be({impact:A,draggable:W,draggables:Ee,afterCritical:re,droppable:Xe||Qe,viewport:ne}),Me=kt(Ue,W.client.borderBox.center);return Me},wo=function(w){var A=w.draggables,W=w.reason,J=w.lastImpact,ne=w.home,re=w.viewport,Ee=w.onLiftImpact;if(!J.at||W!=="DROP"){var be=Ye({draggables:A,impact:Ee,destination:ne,viewport:re,forceShouldAnimate:!0});return{impact:be,didDropInsideDroppable:!1}}if(J.at.type==="REORDER")return{impact:J,didDropInsideDroppable:!0};var Ie=Object(Q.a)({},J,{displaced:Tr});return{impact:Ie,didDropInsideDroppable:!0}},$i=function(w){var A=w.getState,W=w.dispatch;return function(J){return function(ne){if(ne.type!=="DROP"){J(ne);return}var re=A(),Ee=ne.payload.reason;if(re.phase==="COLLECTING"){W(qr({reason:Ee}));return}if(re.phase==="IDLE")return;var be=re.phase==="DROP_PENDING"&&re.isWaiting;be&&Y(!1),re.phase==="DRAGGING"||re.phase==="DROP_PENDING"||Y(!1);var Ie=re.critical,Xe=re.dimensions,Qe=Xe.draggables[re.critical.draggable.id],Ue=wo({reason:Ee,lastImpact:re.impact,afterCritical:re.afterCritical,onLiftImpact:re.onLiftImpact,home:re.dimensions.droppables[re.critical.droppable.id],viewport:re.viewport,draggables:re.dimensions.draggables}),Me=Ue.impact,Ke=Ue.didDropInsideDroppable,gt=Ke?fn(Me):null,gn=Ke?nn(Me):null,Tn={index:Ie.draggable.index,droppableId:Ie.droppable.id},Vn={draggableId:Qe.descriptor.id,type:Qe.descriptor.type,source:Tn,reason:Ee,mode:re.movementMode,destination:gt,combine:gn},er=ps({impact:Me,draggable:Qe,dimensions:Xe,viewport:re.viewport,afterCritical:re.afterCritical}),wr={critical:re.critical,afterCritical:re.afterCritical,result:Vn,impact:Me},Zn=!Kt(re.current.client.offset,er)||Boolean(Vn.combine);if(!Zn){W(Kr({completed:wr}));return}var Nr=hs({current:re.current.client.offset,destination:er,reason:Ee}),Pr={newHomeClientOffset:er,dropDuration:Nr,completed:wr};W(Ca(Pr))}}},Co=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function Oo(w){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(W){if(W.target!==window&&W.target!==window.document)return;w()}}}function xa(w){var A=w.onWindowScroll;function W(){A(Co())}var J=v(W),ne=Oo(J),re=ve;function Ee(){return re!==ve}function be(){Ee()&&Y(!1),re=fe(window,[ne])}function Ie(){Ee()||Y(!1),J.cancel(),re(),re=ve}return{start:be,stop:Ie,isActive:Ee}}var ms=function(A){return A.type==="DROP_COMPLETE"||A.type==="DROP_ANIMATE"||A.type==="FLUSH"},Ro=function(w){var A=xa({onWindowScroll:function(J){w.dispatch(br({newScroll:J}))}});return function(W){return function(J){!A.isActive()&&J.type==="INITIAL_PUBLISH"&&A.start(),A.isActive()&&ms(J)&&A.stop(),W(J)}}},So=function(w){var A=!1,W=!1,J=setTimeout(function(){W=!0}),ne=function(Ee){if(A)return;if(W)return;A=!0,w(Ee),clearTimeout(J)};return ne.wasCalled=function(){return A},ne},vs=function(){var w=[],A=function(re){var Ee=Se(w,function(Xe){return Xe.timerId===re});Ee!==-1||Y(!1);var be=w.splice(Ee,1),Ie=be[0];Ie.callback()},W=function(re){var Ee=setTimeout(function(){return A(Ee)}),be={timerId:Ee,callback:re};w.push(be)},J=function(){if(!w.length)return;var re=[].concat(w);w.length=0,re.forEach(function(Ee){clearTimeout(Ee.timerId),Ee.callback()})};return{add:W,flush:J}},gs=function(A,W){return A==null&&W==null?!0:A==null||W==null?!1:A.droppableId===W.droppableId&&A.index===W.index},Ao=function(A,W){return A==null&&W==null?!0:A==null||W==null?!1:A.draggableId===W.draggableId&&A.droppableId===W.droppableId},yl=function(A,W){if(A===W)return!0;var J=A.draggable.id===W.draggable.id&&A.draggable.droppableId===W.draggable.droppableId&&A.draggable.type===W.draggable.type&&A.draggable.index===W.draggable.index,ne=A.droppable.id===W.droppable.id&&A.droppable.type===W.droppable.type;return J&&ne},Ci=function(A,W){pt(),W(),bt()},Yi=function(A,W){return{draggableId:A.draggable.id,type:A.droppable.type,source:{droppableId:A.droppable.id,index:A.draggable.index},mode:W}},Sa=function(A,W,J,ne){if(!A){J(ne(W));return}var re=So(J),Ee={announce:re};A(W,Ee),re.wasCalled()||J(ne(W))},qa=function(w,A){var W=vs(),J=null,ne=function(Me,Ke){J&&Y(!1),Ci("onBeforeCapture",function(){var gt=w().onBeforeCapture;if(gt){var gn={draggableId:Me,mode:Ke};gt(gn)}})},re=function(Me,Ke){J&&Y(!1),Ci("onBeforeDragStart",function(){var gt=w().onBeforeDragStart;gt&&gt(Yi(Me,Ke))})},Ee=function(Me,Ke){J&&Y(!1);var gt=Yi(Me,Ke);J={mode:Ke,lastCritical:Me,lastLocation:gt.source,lastCombine:null},W.add(function(){Ci("onDragStart",function(){return Sa(w().onDragStart,gt,A,ut.onDragStart)})})},be=function(Me,Ke){var gt=fn(Ke),gn=nn(Ke);J||Y(!1);var Tn=!yl(Me,J.lastCritical);Tn&&(J.lastCritical=Me);var Vn=!gs(J.lastLocation,gt);Vn&&(J.lastLocation=gt);var er=!Ao(J.lastCombine,gn);if(er&&(J.lastCombine=gn),!Tn&&!Vn&&!er)return;var wr=Object(Q.a)({},Yi(Me,J.mode),{combine:gn,destination:gt});W.add(function(){Ci("onDragUpdate",function(){return Sa(w().onDragUpdate,wr,A,ut.onDragUpdate)})})},Ie=function(){J||Y(!1),W.flush()},Xe=function(Me){J||Y(!1),J=null,Ci("onDragEnd",function(){return Sa(w().onDragEnd,Me,A,ut.onDragEnd)})},Qe=function(){if(!J)return;var Me=Object(Q.a)({},Yi(J.lastCritical,J.mode),{combine:null,destination:null,reason:"CANCEL"});Xe(Me)};return{beforeCapture:ne,beforeStart:re,start:Ee,update:be,flush:Ie,drop:Xe,abort:Qe}},Za=function(w,A){var W=qa(w,A);return function(J){return function(ne){return function(re){if(re.type==="BEFORE_INITIAL_CAPTURE"){W.beforeCapture(re.payload.draggableId,re.payload.movementMode);return}if(re.type==="INITIAL_PUBLISH"){var Ee=re.payload.critical;W.beforeStart(Ee,re.payload.movementMode),ne(re),W.start(Ee,re.payload.movementMode);return}if(re.type==="DROP_COMPLETE"){var be=re.payload.completed.result;W.flush(),ne(re),W.drop(be);return}if(ne(re),re.type==="FLUSH"){W.abort();return}var Ie=J.getState();Ie.phase==="DRAGGING"&&W.update(Ie.critical,Ie.impact)}}}},Do=function(w){return function(A){return function(W){if(W.type!=="DROP_ANIMATION_FINISHED"){A(W);return}var J=w.getState();J.phase==="DROP_ANIMATING"||Y(!1),w.dispatch(Kr({completed:J.completed}))}}},Po=function(w){var A=null,W=null;function J(){W&&(cancelAnimationFrame(W),W=null),A&&(A(),A=null)}return function(ne){return function(re){if((re.type==="FLUSH"||re.type==="DROP_COMPLETE"||re.type==="DROP_ANIMATION_FINISHED")&&J(),ne(re),re.type!=="DROP_ANIMATE")return;var Ee={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var Ie=w.getState();Ie.phase==="DROP_ANIMATING"&&w.dispatch(ea())}};W=requestAnimationFrame(function(){W=null,A=fe(window,[Ee])})}}},_s=function(w){return function(){return function(A){return function(W){(W.type==="DROP_COMPLETE"||W.type==="FLUSH"||W.type==="DROP_ANIMATE")&&w.stopPublishing(),A(W)}}}},Lo=function(w){var A=!1;return function(){return function(W){return function(J){if(J.type==="INITIAL_PUBLISH"){A=!0,w.tryRecordFocus(J.payload.critical.draggable.id),W(J),w.tryRestoreFocusRecorded();return}if(W(J),!A)return;if(J.type==="FLUSH"){A=!1,w.tryRestoreFocusRecorded();return}if(J.type==="DROP_COMPLETE"){A=!1;var ne=J.payload.completed.result;ne.combine&&w.tryShiftRecord(ne.draggableId,ne.combine.draggableId),w.tryRestoreFocusRecorded()}}}}},Ga=function(A){return A.type==="DROP_COMPLETE"||A.type==="DROP_ANIMATE"||A.type==="FLUSH"},za=function(w){return function(A){return function(W){return function(J){if(Ga(J)){w.stop(),W(J);return}if(J.type==="INITIAL_PUBLISH"){W(J);var ne=A.getState();ne.phase==="DRAGGING"||Y(!1),w.start(ne);return}W(J),w.scroll(A.getState())}}}},la=function(w){return function(A){return function(W){if(A(W),W.type!=="PUBLISH_WHILE_DRAGGING")return;var J=w.getState();if(J.phase!=="DROP_PENDING")return;if(J.isWaiting)return;w.dispatch(Oa({reason:J.reason}))}}},ka=B.d,Ma=function(w){var A=w.dimensionMarshal,W=w.focusMarshal,J=w.styleMarshal,ne=w.getResponders,re=w.announce,Ee=w.autoScroller;return Object(B.e)(jn,ka(Object(B.a)(ha(J),_s(A),Vi(A),$i,Do,Po,la,za(Ee),Ro,Lo(W),Za(ne,re))))},ei=function(){return{additions:{},removals:{},modified:{}}};function xl(w){var A=w.registry,W=w.callbacks,J=ei(),ne=null,re=function(){if(ne)return;W.collectionStarting(),ne=requestAnimationFrame(function(){ne=null,pt();var Qe=J,Ue=Qe.additions,Me=Qe.removals,Ke=Qe.modified,gt=Object.keys(Ue).map(function(Vn){return A.draggable.getById(Vn).getDimension(qe)}).sort(function(Vn,er){return Vn.descriptor.index-er.descriptor.index}),gn=Object.keys(Ke).map(function(Vn){var er=A.droppable.getById(Vn),wr=er.callbacks.getScrollWhileDragging();return{droppableId:Vn,scroll:wr}}),Tn={additions:gt,removals:Object.keys(Me),modified:gn};J=ei(),bt(),W.publish(Tn)})},Ee=function(Qe){var Ue=Qe.descriptor.id;J.additions[Ue]=Qe,J.modified[Qe.descriptor.droppableId]=!0,J.removals[Ue]&&delete J.removals[Ue],re()},be=function(Qe){var Ue=Qe.descriptor;J.removals[Ue.id]=!0,J.modified[Ue.droppableId]=!0,J.additions[Ue.id]&&delete J.additions[Ue.id],re()},Ie=function(){if(!ne)return;cancelAnimationFrame(ne),ne=null,J=ei()};return{add:Ee,remove:be,stop:Ie}}var Io=function(w){var A=w.scrollHeight,W=w.scrollWidth,J=w.height,ne=w.width,re=kt({x:W,y:A},{x:ne,y:J}),Ee={x:Math.max(0,re.x),y:Math.max(0,re.y)};return Ee},ti=function(){var w=document.documentElement;return w||Y(!1),w},No=function(){var w=ti(),A=Io({scrollHeight:w.scrollHeight,scrollWidth:w.scrollWidth,width:w.clientWidth,height:w.clientHeight});return A},Es=function(){var w=Co(),A=No(),W=w.y,J=w.x,ne=ti(),re=ne.clientWidth,Ee=ne.clientHeight,be=J+re,Ie=W+Ee,Xe=h({top:W,left:J,right:be,bottom:Ie}),Qe={frame:Xe,scroll:{initial:w,current:w,max:A,diff:{value:qe,displacement:qe}}};return Qe},Qi=function(w){var A=w.critical,W=w.scrollOptions,J=w.registry;pt();var ne=Es(),re=ne.scroll.current,Ee=A.droppable,be=J.droppable.getAllByType(Ee.type).map(function(Ue){return Ue.callbacks.getDimensionAndWatchScroll(re,W)}),Ie=J.draggable.getAllByType(A.draggable.type).map(function(Ue){return Ue.getDimension(re)}),Xe={draggables:Dt(Ie),droppables:St(be)};bt();var Qe={dimensions:Xe,critical:A,viewport:ne};return Qe};function bs(w,A,W){if(W.descriptor.id===A.id)return!1;if(W.descriptor.type!==A.type)return!1;var J=w.droppable.getById(W.descriptor.droppableId);return!(J.descriptor.mode!=="virtual")}var ko=function(w,A){var W=null,J=xl({callbacks:{publish:A.publishWhileDragging,collectionStarting:A.collectionStarting},registry:w}),ne=function(Ke,gt){if(w.droppable.exists(Ke)||Y(!1),!W)return;A.updateDroppableIsEnabled({id:Ke,isEnabled:gt})},re=function(Ke,gt){if(!W)return;w.droppable.exists(Ke)||Y(!1),A.updateDroppableIsCombineEnabled({id:Ke,isCombineEnabled:gt})},Ee=function(Ke,gt){if(!W)return;w.droppable.exists(Ke)||Y(!1),A.updateDroppableScroll({id:Ke,newScroll:gt})},be=function(Ke,gt){if(!W)return;w.droppable.getById(Ke).callbacks.scroll(gt)},Ie=function(){if(!W)return;J.stop();var Ke=W.critical.droppable;w.droppable.getAllByType(Ke.type).forEach(function(gt){return gt.callbacks.dragStopped()}),W.unsubscribe(),W=null},Xe=function(Ke){W||Y(!1);var gt=W.critical.draggable;Ke.type==="ADDITION"&&(bs(w,gt,Ke.value)&&J.add(Ke.value)),Ke.type==="REMOVAL"&&(bs(w,gt,Ke.value)&&J.remove(Ke.value))},Qe=function(Ke){W&&Y(!1);var gt=w.draggable.getById(Ke.draggableId),gn=w.droppable.getById(gt.descriptor.droppableId),Tn={draggable:gt.descriptor,droppable:gn.descriptor},Vn=w.subscribe(Xe);return W={critical:Tn,unsubscribe:Vn},Qi({critical:Tn,registry:w,scrollOptions:Ke.scrollOptions})},Ue={updateDroppableIsEnabled:ne,updateDroppableIsCombineEnabled:re,scrollDroppable:be,updateDroppableScroll:Ee,startPublishing:Qe,stopPublishing:Ie};return Ue},Mo=function(w,A){return w.phase==="IDLE"?!0:w.phase!=="DROP_ANIMATING"||w.completed.result.draggableId===A?!1:w.completed.result.reason==="DROP"},ys=function(w){window.scrollBy(w.x,w.y)},Uo=d(function(w){return Mt(w).filter(function(A){return A.isEnabled?!!A.frame:!1})}),ni=function(A,W){var J=$e(Uo(W),function(ne){return ne.frame||Y(!1),cr(ne.frame.pageMarginBox)(A)});return J},Ji=function(w){var A=w.center,W=w.destination,J=w.droppables;if(W){var ne=J[W];return ne.frame?ne:null}var re=ni(A,J);return re},Aa={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(A){return Math.pow(A,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},qi=function(w,A){var W=w[A.size]*Aa.startFromPercentage,J=w[A.size]*Aa.maxScrollAtPercentage,ne={startScrollingFrom:W,maxScrollValueAt:J};return ne},xs=function(w){var A=w.startOfRange,W=w.endOfRange,J=w.current,ne=W-A;if(ne===0)return 0;var re=J-A,Ee=re/ne;return Ee},Fo=1,Tl=function(w,A){if(w>A.startScrollingFrom)return 0;if(w<=A.maxScrollValueAt)return Aa.maxPixelScroll;if(w===A.startScrollingFrom)return Fo;var W=xs({startOfRange:A.maxScrollValueAt,endOfRange:A.startScrollingFrom,current:w}),J=1-W,ne=Aa.maxPixelScroll*Aa.ease(J);return Math.ceil(ne)},Zi=Aa.durationDampening.accelerateAt,eo=Aa.durationDampening.stopDampeningAt,ri=function(w,A){var W=A,J=eo,ne=Date.now(),re=ne-W;if(re>=eo)return w;if(re<Zi)return Fo;var Ee=xs({startOfRange:Zi,endOfRange:J,current:re}),be=w*Aa.ease(Ee);return Math.ceil(be)},ai=function(w){var A=w.distanceToEdge,W=w.thresholds,J=w.dragStartTime,ne=w.shouldUseTimeDampening,re=Tl(A,W);return re===0?0:ne?Math.max(ri(re,J),Fo):re},Ts=function(w){var A=w.container,W=w.distanceToEdges,J=w.dragStartTime,ne=w.axis,re=w.shouldUseTimeDampening,Ee=qi(A,ne),be=W[ne.end]<W[ne.start];return be?ai({distanceToEdge:W[ne.end],thresholds:Ee,dragStartTime:J,shouldUseTimeDampening:re}):-1*ai({distanceToEdge:W[ne.start],thresholds:Ee,dragStartTime:J,shouldUseTimeDampening:re})},to=function(w){var A=w.container,W=w.subject,J=w.proposedScroll,ne=W.height>A.height,re=W.width>A.width;return!re&&!ne?J:re&&ne?null:{x:re?0:J.x,y:ne?0:J.y}},ws=je(function(w){return w===0?0:w}),ii=function(w){var A=w.dragStartTime,W=w.container,J=w.subject,ne=w.center,re=w.shouldUseTimeDampening,Ee={top:ne.y-W.top,right:W.right-ne.x,bottom:W.bottom-ne.y,left:ne.x-W.left},be=Ts({container:W,distanceToEdges:Ee,dragStartTime:A,axis:vr,shouldUseTimeDampening:re}),Ie=Ts({container:W,distanceToEdges:Ee,dragStartTime:A,axis:Rr,shouldUseTimeDampening:re}),Xe=ws({x:Ie,y:be});if(Kt(Xe,qe))return null;var Qe=to({container:W,subject:J,proposedScroll:Xe});return Qe?Kt(Qe,qe)?null:Qe:null},Cs=je(function(w){return w===0?0:w>0?1:-1}),Da=function(){var w=function(W,J){return W<0?W:W>J?W-J:0};return function(A){var W=A.current,J=A.max,ne=A.change,re=Ct(W,ne),Ee={x:w(re.x,J.x),y:w(re.y,J.y)};return Kt(Ee,qe)?null:Ee}}(),oi=function(A){var W=A.max,J=A.current,ne=A.change,re={x:Math.max(J.x,W.x),y:Math.max(J.y,W.y)},Ee=Cs(ne),be=Da({max:re,current:J,change:Ee});return be?Ee.x!==0&&be.x===0?!0:Ee.y!==0&&be.y===0:!0},Pa=function(A,W){return oi({current:A.scroll.current,max:A.scroll.max,change:W})},Oi=function(A,W){if(!Pa(A,W))return null;var J=A.scroll.max,ne=A.scroll.current;return Da({current:ne,max:J,change:W})},Ua=function(A,W){var J=A.frame;return J?oi({current:J.scroll.current,max:J.scroll.max,change:W}):!1},Os=function(A,W){var J=A.frame;return J&&Ua(A,W)?Da({current:J.scroll.current,max:J.scroll.max,change:W}):null},Rs=function(w){var A=w.viewport,W=w.subject,J=w.center,ne=w.dragStartTime,re=w.shouldUseTimeDampening,Ee=ii({dragStartTime:ne,container:A.frame,subject:W,center:J,shouldUseTimeDampening:re});return Ee&&Pa(A,Ee)?Ee:null},Ss=function(w){var A=w.droppable,W=w.subject,J=w.center,ne=w.dragStartTime,re=w.shouldUseTimeDampening,Ee=A.frame;if(!Ee)return null;var be=ii({dragStartTime:ne,container:Ee.pageMarginBox,subject:W,center:J,shouldUseTimeDampening:re});return be&&Ua(A,be)?be:null},As=function(w){var A=w.state,W=w.dragStartTime,J=w.shouldUseTimeDampening,ne=w.scrollWindow,re=w.scrollDroppable,Ee=A.current.page.borderBoxCenter,be=A.dimensions.draggables[A.critical.draggable.id],Ie=be.page.marginBox;if(A.isWindowScrollAllowed){var Xe=A.viewport,Qe=Rs({dragStartTime:W,viewport:Xe,subject:Ie,center:Ee,shouldUseTimeDampening:J});if(Qe){ne(Qe);return}}var Ue=Ji({center:Ee,destination:cn(A.impact),droppables:A.dimensions.droppables});if(!Ue)return;var Me=Ss({dragStartTime:W,droppable:Ue,subject:Ie,center:Ee,shouldUseTimeDampening:J});Me&&re(Ue.descriptor.id,Me)},Va=function(w){var A=w.scrollWindow,W=w.scrollDroppable,J=v(A),ne=v(W),re=null,Ee=function(Qe){re||Y(!1);var Ue=re,Me=Ue.shouldUseTimeDampening,Ke=Ue.dragStartTime;As({state:Qe,scrollWindow:J,scrollDroppable:ne,dragStartTime:Ke,shouldUseTimeDampening:Me})},be=function(Qe){pt(),re&&Y(!1);var Ue=Date.now(),Me=!1,Ke=function(){Me=!0};As({state:Qe,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:Ke,scrollDroppable:Ke}),re={dragStartTime:Ue,shouldUseTimeDampening:Me},bt(),Me&&Ee(Qe)},Ie=function(){if(!re)return;J.cancel(),ne.cancel(),re=null};return{start:be,stop:Ie,scroll:Ee}},Xa=function(w){var A=w.move,W=w.scrollDroppable,J=w.scrollWindow,ne=function(Xe,Qe){var Ue=Ct(Xe.current.client.selection,Qe);A({client:Ue})},re=function(Xe,Qe){if(!Ua(Xe,Qe))return Qe;var Ue=Os(Xe,Qe);if(!Ue)return W(Xe.descriptor.id,Qe),null;var Me=kt(Qe,Ue);W(Xe.descriptor.id,Me);var Ke=kt(Qe,Me);return Ke},Ee=function(Xe,Qe,Ue){if(!Xe)return Ue;if(!Pa(Qe,Ue))return Ue;var Me=Oi(Qe,Ue);if(!Me)return J(Ue),null;var Ke=kt(Ue,Me);J(Ke);var gt=kt(Ue,Ke);return gt},be=function(Xe){var Qe=Xe.scrollJumpRequest;if(!Qe)return;var Ue=cn(Xe.impact);Ue||Y(!1);var Me=re(Xe.dimensions.droppables[Ue],Qe);if(!Me)return;var Ke=Xe.viewport,gt=Ee(Xe.isWindowScrollAllowed,Ke,Me);if(!gt)return;ne(Xe,gt)};return be},wl=function(w){var A=w.scrollDroppable,W=w.scrollWindow,J=w.move,ne=Va({scrollWindow:W,scrollDroppable:A}),re=Xa({move:J,scrollWindow:W,scrollDroppable:A}),Ee=function(Xe){if(Xe.phase!=="DRAGGING")return;if(Xe.movementMode==="FLUID"){ne.scroll(Xe);return}if(!Xe.scrollJumpRequest)return;re(Xe)},be={scroll:Ee,start:ne.start,stop:ne.stop};return be},si="data-rbd",li=function(){var w=si+"-drag-handle";return{base:w,draggableId:w+"-draggable-id",contextId:w+"-context-id"}}(),Bo=function(){var w=si+"-draggable";return{base:w,contextId:w+"-context-id",id:w+"-id"}}(),Cl=function(){var w=si+"-droppable";return{base:w,contextId:w+"-context-id",id:w+"-id"}}(),Ds={contextId:si+"-scroll-container-context-id"},ca=function(A){return function(W){return"["+W+'="'+A+'"]'}},Gr=function(A,W){return A.map(function(J){var ne=J.styles[W];return ne?J.selector+" { "+ne+" }":""}).join(" ")},oa="pointer-events: none;",Yr=function(w){var A=ca(w),W=function(){var be=`
cursor: -webkit-grab;
cursor: grab;
`;return{selector:A(li.contextId),styles:{always:`
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
touch-action: manipulation;
`,resting:be,dragging:oa,dropAnimating:be}}}(),J=function(){var be=`
transition: `+Ja.outOfTheWay+`;
`;return{selector:A(Bo.contextId),styles:{dragging:be,dropAnimating:be,userCancel:be}}}(),ne={selector:A(Cl.contextId),styles:{always:"overflow-anchor: none;"}},re={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;
`}},Ee=[J,W,ne,re];return{always:Gr(Ee,"always"),resting:Gr(Ee,"resting"),dragging:Gr(Ee,"dragging"),dropAnimating:Gr(Ee,"dropAnimating"),userCancel:Gr(Ee,"userCancel")}},ta=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?ee.useLayoutEffect:ee.useEffect,jo=function(){var A=document.querySelector("head");return A||Y(!1),A},Ri=function(A){var W=document.createElement("style");return A&&W.setAttribute("nonce",A),W.type="text/css",W};function Ol(w,A){var W=D(function(){return Yr(w)},[w]),J=Object(ee.useRef)(null),ne=Object(ee.useRef)(null),re=m(d(function(Ue){var Me=ne.current;Me||Y(!1),Me.textContent=Ue}),[]),Ee=m(function(Ue){var Me=J.current;Me||Y(!1),Me.textContent=Ue},[]);ta(function(){!J.current&&!ne.current||Y(!1);var Ue=Ri(A),Me=Ri(A);return J.current=Ue,ne.current=Me,Ue.setAttribute(si+"-always",w),Me.setAttribute(si+"-dynamic",w),jo().appendChild(Ue),jo().appendChild(Me),Ee(W.always),re(W.resting),function(){var Ke=function(gn){var Tn=gn.current;Tn||Y(!1),jo().removeChild(Tn),gn.current=null};Ke(J),Ke(ne)}},[A,Ee,re,W.always,W.resting,w]);var be=m(function(){return re(W.dragging)},[re,W.dragging]),Ie=m(function(Ue){if(Ue==="DROP"){re(W.dropAnimating);return}re(W.userCancel)},[re,W.dropAnimating,W.userCancel]),Xe=m(function(){if(!ne.current)return;re(W.resting)},[re,W.resting]),Qe=D(function(){return{dragging:be,dropping:Ie,resting:Xe}},[be,Ie,Xe]);return Qe}var Ps=function(w){return w&&w.ownerDocument?w.ownerDocument.defaultView:window};function Si(w){return w instanceof Ps(w).HTMLElement}function no(w,A){var W="["+li.contextId+'="'+w+'"]',J=dt(document.querySelectorAll(W));if(!J.length)return null;var ne=$e(J,function(re){return re.getAttribute(li.draggableId)===A});return ne&&Si(ne)?ne:null}function Ls(w){var A=Object(ee.useRef)({}),W=Object(ee.useRef)(null),J=Object(ee.useRef)(null),ne=Object(ee.useRef)(!1),re=m(function(Me,Ke){var gt={id:Me,focus:Ke};return A.current[Me]=gt,function(){var Tn=A.current,Vn=Tn[Me];Vn!==gt&&delete Tn[Me]}},[]),Ee=m(function(Me){var Ke=no(w,Me);Ke&&Ke!==document.activeElement&&Ke.focus()},[w]),be=m(function(Me,Ke){W.current===Me&&(W.current=Ke)},[]),Ie=m(function(){if(J.current)return;if(!ne.current)return;J.current=requestAnimationFrame(function(){J.current=null;var Me=W.current;Me&&Ee(Me)})},[Ee]),Xe=m(function(Me){W.current=null;var Ke=document.activeElement;if(!Ke)return;if(Ke.getAttribute(li.draggableId)!==Me)return;W.current=Me},[]);ta(function(){return ne.current=!0,function(){ne.current=!1;var Me=J.current;Me&&cancelAnimationFrame(Me)}},[]);var Qe=D(function(){return{register:re,tryRecordFocus:Xe,tryRestoreFocusRecorded:Ie,tryShiftRecord:be}},[re,Xe,Ie,be]);return Qe}function Wo(){var w={draggables:{},droppables:{}},A=[];function W(Ue){return A.push(Ue),function(){var Ke=A.indexOf(Ue);if(Ke===-1)return;A.splice(Ke,1)}}function J(Ue){A.length&&A.forEach(function(Me){return Me(Ue)})}function ne(Ue){return w.draggables[Ue]||null}function re(Ue){var Me=ne(Ue);return Me||Y(!1),Me}var Ee={register:function(Me){w.draggables[Me.descriptor.id]=Me,J({type:"ADDITION",value:Me})},update:function(Me,Ke){var gt=w.draggables[Ke.descriptor.id];if(!gt)return;if(gt.uniqueId!==Me.uniqueId)return;delete w.draggables[Ke.descriptor.id],w.draggables[Me.descriptor.id]=Me},unregister:function(Me){var Ke=Me.descriptor.id,gt=ne(Ke);if(!gt)return;if(Me.uniqueId!==gt.uniqueId)return;delete w.draggables[Ke],J({type:"REMOVAL",value:Me})},getById:re,findById:ne,exists:function(Me){return Boolean(ne(Me))},getAllByType:function(Me){return ae(w.draggables).filter(function(Ke){return Ke.descriptor.type===Me})}};function be(Ue){return w.droppables[Ue]||null}function Ie(Ue){var Me=be(Ue);return Me||Y(!1),Me}var Xe={register:function(Me){w.droppables[Me.descriptor.id]=Me},unregister:function(Me){var Ke=be(Me.descriptor.id);if(!Ke)return;if(Me.uniqueId!==Ke.uniqueId)return;delete w.droppables[Me.descriptor.id]},getById:Ie,findById:be,exists:function(Me){return Boolean(be(Me))},getAllByType:function(Me){return ae(w.droppables).filter(function(Ke){return Ke.descriptor.type===Me})}};function Qe(){w.draggables={},w.droppables={},A.length=0}return{draggable:Ee,droppable:Xe,subscribe:W,clean:Qe}}function Rl(){var w=D(Wo,[]);return Object(ee.useEffect)(function(){return function(){requestAnimationFrame(w.clean)}},[w]),w}var Ai=$.a.createContext(null),$a=function(){var w=document.body;return w||Y(!1),w},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%)"},Ns=function(A){return"rbd-announcement-"+A};function Ho(w){var A=D(function(){return Ns(w)},[w]),W=Object(ee.useRef)(null);Object(ee.useEffect)(function(){var re=document.createElement("div");return W.current=re,re.id=A,re.setAttribute("aria-live","assertive"),re.setAttribute("aria-atomic","true"),Object(Q.a)(re.style,Is),$a().appendChild(re),function(){setTimeout(function(){var Ie=$a();Ie.contains(re)&&Ie.removeChild(re),re===W.current&&(W.current=null)})}},[A]);var J=m(function(ne){var re=W.current;if(re){re.textContent=ne;return}},[]);return J}var Ko=0,Di={separator:"::"};function Sl(){Ko=0}function ui(w,A){return A===void 0&&(A=Di),D(function(){return""+w+A.separator+Ko++},[A.separator,w])}function pa(w){var A=w.contextId,W=w.uniqueId;return"rbd-hidden-text-"+A+"-"+W}function ks(w){var A=w.contextId,W=w.text,J=ui("hidden-text",{separator:"-"}),ne=D(function(){return pa({contextId:A,uniqueId:J})},[J,A]);return Object(ee.useEffect)(function(){var Ee=document.createElement("div");return Ee.id=ne,Ee.textContent=W,Ee.style.display="none",$a().appendChild(Ee),function(){var Ie=$a();Ie.contains(Ee)&&Ie.removeChild(Ee)}},[ne,W]),ne}var ro=$.a.createContext(null),Ms={react:"^16.8.5","react-dom":"^16.8.5"},ma=/(\d+)\.(\d+)\.(\d+)/,kr=function(A){var W=ma.exec(A);W!=null||Y(!1);var J=Number(W[1]),ne=Number(W[2]),re=Number(W[3]);return{major:J,minor:ne,patch:re,raw:A}},Ta=function(A,W){return W.major>A.major?!0:W.major<A.major?!1:W.minor>A.minor?!0:W.minor<A.minor?!1:W.patch>=A.patch},Fa=function(w,A){var W=kr(w),J=kr(A);if(Ta(W,J))return},Ya=`
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(w){var A=w.doctype;if(!A)return;A.name.toLowerCase()!=="html",A.publicId!==""};function Pi(w){}function di(w,A){Pi(function(){Object(ee.useEffect)(function(){try{w()}catch(W){se(`
A setup problem was encountered.
> `+W.message+`
`)}},A)})}function Al(){di(function(){Fa(Ms.react,$.a.version),Us(document)},[])}function Li(w){var A=Object(ee.useRef)(w);return Object(ee.useEffect)(function(){A.current=w}),A}function Ii(){var w=null;function A(){return Boolean(w)}function W(Ee){return Ee===w}function J(Ee){w&&Y(!1);var be={abandon:Ee};return w=be,be}function ne(){w||Y(!1),w=null}function re(){w&&(w.abandon(),ne())}return{isClaimed:A,isActive:W,claim:J,release:ne,tryAbandon:re}}var Fs=9,Go=13,wa=27,zo=32,Bs=33,Dl=34,ao=35,Vo=36,js=37,Pl=38,Ws=39,Ll=40,io,oo=(io={},io[Go]=!0,io[Fs]=!0,io),Xo=function(w){oo[w.keyCode]&&w.preventDefault()},so=function(){var w="visibilitychange";if(typeof document=="undefined")return w;var A=[w,"ms"+w,"webkit"+w,"moz"+w,"o"+w],W=$e(A,function(J){return"on"+J in document});return W||w}(),Hs=0,$o=5;function ci(w,A){return Math.abs(A.x-w.x)>=$o||Math.abs(A.y-w.y)>=$o}var lo={type:"IDLE"};function uo(w){var A=w.cancel,W=w.completed,J=w.getPhase,ne=w.setPhase;return[{eventName:"mousemove",fn:function(Ee){var be=Ee.button,Ie=Ee.clientX,Xe=Ee.clientY;if(be!==Hs)return;var Qe={x:Ie,y:Xe},Ue=J();if(Ue.type==="DRAGGING"){Ee.preventDefault(),Ue.actions.move(Qe);return}Ue.type==="PENDING"||Y(!1);var Me=Ue.point;if(!ci(Me,Qe))return;Ee.preventDefault();var Ke=Ue.actions.fluidLift(Qe);ne({type:"DRAGGING",actions:Ke})}},{eventName:"mouseup",fn:function(Ee){var be=J();if(be.type!=="DRAGGING"){A();return}Ee.preventDefault(),be.actions.drop({shouldBlockNextClick:!0}),W()}},{eventName:"mousedown",fn:function(Ee){J().type==="DRAGGING"&&Ee.preventDefault(),A()}},{eventName:"keydown",fn:function(Ee){var be=J();if(be.type==="PENDING"){A();return}if(Ee.keyCode===wa){Ee.preventDefault(),A();return}Xo(Ee)}},{eventName:"resize",fn:A},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){J().type==="PENDING"&&A()}},{eventName:"webkitmouseforcedown",fn:function(Ee){var be=J();if(be.type!=="IDLE"||Y(!1),be.actions.shouldRespectForcePress()){A();return}Ee.preventDefault()}},{eventName:so,fn:A}]}function Ks(w){var A=Object(ee.useRef)(lo),W=Object(ee.useRef)(ve),J=D(function(){return{eventName:"mousedown",fn:function(Ue){if(Ue.defaultPrevented)return;if(Ue.button!==Hs)return;if(Ue.ctrlKey||Ue.metaKey||Ue.shiftKey||Ue.altKey)return;var Me=w.findClosestDraggableId(Ue);if(!Me)return;var Ke=w.tryGetLock(Me,Ee,{sourceEvent:Ue});if(!Ke)return;Ue.preventDefault();var gt={x:Ue.clientX,y:Ue.clientY};W.current(),Xe(Ke,gt)}}},[w]),ne=D(function(){return{eventName:"webkitmouseforcewillbegin",fn:function(Ue){if(Ue.defaultPrevented)return;var Me=w.findClosestDraggableId(Ue);if(!Me)return;var Ke=w.findOptionsForDraggable(Me);if(!Ke)return;if(Ke.shouldRespectForcePress)return;if(!w.canGetLock(Me))return;Ue.preventDefault()}}},[w]),re=m(function(){var Ue={passive:!1,capture:!0};W.current=fe(window,[ne,J],Ue)},[ne,J]),Ee=m(function(){var Qe=A.current;if(Qe.type==="IDLE")return;A.current=lo,W.current(),re()},[re]),be=m(function(){var Qe=A.current;Ee(),Qe.type==="DRAGGING"&&Qe.actions.cancel({shouldBlockNextClick:!0}),Qe.type==="PENDING"&&Qe.actions.abort()},[Ee]),Ie=m(function(){var Ue={capture:!0,passive:!1},Me=uo({cancel:be,completed:Ee,getPhase:function(){return A.current},setPhase:function(gt){A.current=gt}});W.current=fe(window,Me,Ue)},[be,Ee]),Xe=m(function(Ue,Me){A.current.type==="IDLE"||Y(!1),A.current={type:"PENDING",point:Me,actions:Ue},Ie()},[Ie]);ta(function(){return re(),function(){W.current()}},[re])}var Ba;function Gs(){}var Il=(Ba={},Ba[Dl]=!0,Ba[Bs]=!0,Ba[Vo]=!0,Ba[ao]=!0,Ba);function zs(w,A){function W(){A(),w.cancel()}function J(){A(),w.drop()}return[{eventName:"keydown",fn:function(re){if(re.keyCode===wa){re.preventDefault(),W();return}if(re.keyCode===zo){re.preventDefault(),J();return}if(re.keyCode===Ll){re.preventDefault(),w.moveDown();return}if(re.keyCode===Pl){re.preventDefault(),w.moveUp();return}if(re.keyCode===Ws){re.preventDefault(),w.moveRight();return}if(re.keyCode===js){re.preventDefault(),w.moveLeft();return}if(Il[re.keyCode]){re.preventDefault();return}Xo(re)}},{eventName:"mousedown",fn:W},{eventName:"mouseup",fn:W},{eventName:"click",fn:W},{eventName:"touchstart",fn:W},{eventName:"resize",fn:W},{eventName:"wheel",fn:W,options:{passive:!0}},{eventName:so,fn:W}]}function na(w){var A=Object(ee.useRef)(Gs),W=D(function(){return{eventName:"keydown",fn:function(re){if(re.defaultPrevented)return;if(re.keyCode!==zo)return;var Ee=w.findClosestDraggableId(re);if(!Ee)return;var be=w.tryGetLock(Ee,Qe,{sourceEvent:re});if(!be)return;re.preventDefault();var Ie=!0,Xe=be.snapLift();A.current();function Qe(){Ie||Y(!1),Ie=!1,A.current(),J()}A.current=fe(window,zs(Xe,Qe),{capture:!0,passive:!1})}}},[w]),J=m(function(){var re={passive:!1,capture:!0};A.current=fe(window,[W],re)},[W]);ta(function(){return J(),function(){A.current()}},[J])}var fi={type:"IDLE"},Vs=120,Xs=.15;function $s(w){var A=w.cancel,W=w.getPhase;return[{eventName:"orientationchange",fn:A},{eventName:"resize",fn:A},{eventName:"contextmenu",fn:function(ne){ne.preventDefault()}},{eventName:"keydown",fn:function(ne){if(W().type!=="DRAGGING"){A();return}ne.keyCode===wa&&ne.preventDefault(),A()}},{eventName:so,fn:A}]}function hi(w){var A=w.cancel,W=w.completed,J=w.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(re){var Ee=J();if(Ee.type!=="DRAGGING"){A();return}Ee.hasMoved=!0;var be=re.touches[0],Ie=be.clientX,Xe=be.clientY,Qe={x:Ie,y:Xe};re.preventDefault(),Ee.actions.move(Qe)}},{eventName:"touchend",fn:function(re){var Ee=J();if(Ee.type!=="DRAGGING"){A();return}re.preventDefault(),Ee.actions.drop({shouldBlockNextClick:!0}),W()}},{eventName:"touchcancel",fn:function(re){if(J().type!=="DRAGGING"){A();return}re.preventDefault(),A()}},{eventName:"touchforcechange",fn:function(re){var Ee=J();Ee.type!=="IDLE"||Y(!1);var be=re.touches[0];if(!be)return;var Ie=be.force>=Xs;if(!Ie)return;var Xe=Ee.actions.shouldRespectForcePress();if(Ee.type==="PENDING"){Xe&&A();return}if(Xe){if(Ee.hasMoved){re.preventDefault();return}A();return}re.preventDefault()}},{eventName:so,fn:A}]}function co(w){var A=Object(ee.useRef)(fi),W=Object(ee.useRef)(ve),J=m(function(){return A.current},[]),ne=m(function(Ke){A.current=Ke},[]),re=D(function(){return{eventName:"touchstart",fn:function(Ke){if(Ke.defaultPrevented)return;var gt=w.findClosestDraggableId(Ke);if(!gt)return;var gn=w.tryGetLock(gt,be,{sourceEvent:Ke});if(!gn)return;var Tn=Ke.touches[0],Vn=Tn.clientX,er=Tn.clientY,wr={x:Vn,y:er};W.current(),Ue(gn,wr)}}},[w]),Ee=m(function(){var Ke={capture:!0,passive:!1};W.current=fe(window,[re],Ke)},[re]),be=m(function(){var Me=A.current;if(Me.type==="IDLE")return;Me.type==="PENDING"&&clearTimeout(Me.longPressTimerId),ne(fi),W.current(),Ee()},[Ee,ne]),Ie=m(function(){var Me=A.current;be(),Me.type==="DRAGGING"&&Me.actions.cancel({shouldBlockNextClick:!0}),Me.type==="PENDING"&&Me.actions.abort()},[be]),Xe=m(function(){var Ke={capture:!0,passive:!1},gt={cancel:Ie,completed:be,getPhase:J},gn=fe(window,hi(gt),Ke),Tn=fe(window,$s(gt),Ke);W.current=function(){gn(),Tn()}},[Ie,J,be]),Qe=m(function(){var Ke=J();Ke.type==="PENDING"||Y(!1);var gt=Ke.actions.fluidLift(Ke.point);ne({type:"DRAGGING",actions:gt,hasMoved:!1})},[J,ne]),Ue=m(function(Ke,gt){J().type==="IDLE"||Y(!1);var gn=setTimeout(Qe,Vs);ne({type:"PENDING",point:gt,actions:Ke,longPressTimerId:gn}),Xe()},[Xe,J,ne,Qe]);ta(function(){return Ee(),function(){W.current();var gt=J();gt.type==="PENDING"&&(clearTimeout(gt.longPressTimerId),ne(fi))}},[J,Ee,ne]),ta(function(){var Ke=fe(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return Ke},[])}function Ys(w){Pi(function(){var A=Li(w);di(function(){A.current.length===w.length||Y(!1)})})}var Qs={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function Yo(w,A){if(A==null)return!1;var W=Boolean(Qs[A.tagName.toLowerCase()]);if(W)return!0;var J=A.getAttribute("contenteditable");return J==="true"||J===""?!0:A===w?!1:Yo(w,A.parentElement)}function pi(w,A){var W=A.target;return Si(W)?Yo(w,W):!1}var Js=function(w){return h(w.getBoundingClientRect()).center};function fo(w){return w instanceof Ps(w).Element}var qs=function(){var w="matches";if(typeof document=="undefined")return w;var A=[w,"msMatchesSelector","webkitMatchesSelector"],W=$e(A,function(J){return J in Element.prototype});return W||w}();function mi(w,A){return w==null?null:w[qs](A)?w:mi(w.parentElement,A)}function Nl(w,A){return w.closest?w.closest(A):mi(w,A)}function vi(w){return"["+li.contextId+'="'+w+'"]'}function Zs(w,A){var W=A.target;if(!fo(W))return null;var J=vi(w),ne=Nl(W,J);return ne&&Si(ne)?ne:null}function el(w,A){var W=Zs(w,A);return W?W.getAttribute(li.draggableId):null}function tl(w,A){var W="["+Bo.contextId+'="'+w+'"]',J=dt(document.querySelectorAll(W)),ne=$e(J,function(re){return re.getAttribute(Bo.id)===A});return ne&&Si(ne)?ne:null}function Ni(w){w.preventDefault()}function ja(w){var A=w.expected,W=w.phase,J=w.isLockActive,ne=w.shouldWarn;return J()?!(A!==W):!1}function gi(w){var A=w.lockAPI,W=w.store,J=w.registry,ne=w.draggableId;if(A.isClaimed())return!1;var re=J.draggable.findById(ne);return re&&re.options.isEnabled?!!Mo(W.getState(),ne):!1}function ki(w){var A=w.lockAPI,W=w.contextId,J=w.store,ne=w.registry,re=w.draggableId,Ee=w.forceSensorStop,be=w.sourceEvent,Ie=gi({lockAPI:A,store:J,registry:ne,draggableId:re});if(!Ie)return null;var Xe=ne.draggable.getById(re),Qe=tl(W,Xe.descriptor.id);if(!Qe)return null;if(be&&!Xe.options.canDragInteractiveElements&&pi(Qe,be))return null;var Ue=A.claim(Ee||ve),Me="PRE_DRAG";function Ke(){return Xe.options.shouldRespectForcePress}function gt(){return A.isActive(Ue)}function gn(Pr,Fr){ja({expected:Pr,phase:Me,isLockActive:gt,shouldWarn:!0})&&J.dispatch(Fr())}var Tn=gn.bind(null,"DRAGGING");function Vn(Pr){function Fr(){A.release(),Me="COMPLETED"}Me!=="PRE_DRAG"&&(Fr(),Me==="PRE_DRAG"||Y(!1)),J.dispatch(mn(Pr.liftActionArgs)),Me="DRAGGING";function $r(e,n){if(n===void 0&&(n={shouldBlockNextClick:!1}),Pr.cleanup(),n.shouldBlockNextClick){var s=fe(window,[{eventName:"click",fn:Ni,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(s)}Fr(),J.dispatch(Oa({reason:e}))}return Object(Q.a)({isActive:function(){return ja({expected:"DRAGGING",phase:Me,isLockActive:gt,shouldWarn:!1})},shouldRespectForcePress:Ke,drop:function(n){return $r("DROP",n)},cancel:function(n){return $r("CANCEL",n)}},Pr.actions)}function er(Pr){var Fr=v(function(e){Tn(function(){return $n({client:e})})}),$r=Vn({liftActionArgs:{id:re,clientSelection:Pr,movementMode:"FLUID"},cleanup:function(){return Fr.cancel()},actions:{move:Fr}});return Object(Q.a)({},$r,{move:Fr})}function wr(){var Pr={moveUp:function(){return Tn(yr)},moveRight:function(){return Tn(Vr)},moveDown:function(){return Tn(Mr)},moveLeft:function(){return Tn(Ur)}};return Vn({liftActionArgs:{id:re,clientSelection:Js(Qe),movementMode:"SNAP"},cleanup:ve,actions:Pr})}function Zn(){var Pr=ja({expected:"PRE_DRAG",phase:Me,isLockActive:gt,shouldWarn:!0});Pr&&A.release()}var Nr={isActive:function(){return ja({expected:"PRE_DRAG",phase:Me,isLockActive:gt,shouldWarn:!1})},shouldRespectForcePress:Ke,fluidLift:er,snapLift:wr,abort:Zn};return Nr}var nl=[Ks,na,co];function kl(w){var A=w.contextId,W=w.store,J=w.registry,ne=w.customSensors,re=w.enableDefaultSensors,Ee=[].concat(re?nl:[],ne||[]),be=Object(ee.useState)(function(){return Ii()})[0],Ie=m(function(er,wr){er.isDragging&&!wr.isDragging&&be.tryAbandon()},[be]);ta(function(){var er=W.getState(),wr=W.subscribe(function(){var Zn=W.getState();Ie(er,Zn),er=Zn});return wr},[be,W,Ie]),ta(function(){return be.tryAbandon},[be.tryAbandon]);var Xe=m(function(Vn){return gi({lockAPI:be,registry:J,store:W,draggableId:Vn})},[be,J,W]),Qe=m(function(Vn,er,wr){return ki({lockAPI:be,registry:J,contextId:A,store:W,draggableId:Vn,forceSensorStop:er,sourceEvent:wr&&wr.sourceEvent?wr.sourceEvent:null})},[A,be,J,W]),Ue=m(function(Vn){return el(A,Vn)},[A]),Me=m(function(Vn){var er=J.draggable.findById(Vn);return er?er.options:null},[J.draggable]),Ke=m(function(){if(!be.isClaimed())return;be.tryAbandon(),W.getState().phase!=="IDLE"&&W.dispatch(Ir())},[be,W]),gt=m(be.isClaimed,[be]),gn=D(function(){return{canGetLock:Xe,tryGetLock:Qe,findClosestDraggableId:Ue,findOptionsForDraggable:Me,tryReleaseLock:Ke,isLockClaimed:gt}},[Xe,Qe,Ue,Me,Ke,gt]);Ys(Ee);for(var Tn=0;Tn<Ee.length;Tn++)Ee[Tn](gn)}var rl=function(A){return{onBeforeCapture:A.onBeforeCapture,onBeforeDragStart:A.onBeforeDragStart,onDragStart:A.onDragStart,onDragEnd:A.onDragEnd,onDragUpdate:A.onDragUpdate}};function ba(w){return w.current||Y(!1),w.current}function _i(w){var A=w.contextId,W=w.setCallbacks,J=w.sensors,ne=w.nonce,re=w.dragHandleUsageInstructions,Ee=Object(ee.useRef)(null);Al();var be=Li(w),Ie=m(function(){return rl(be.current)},[be]),Xe=Ho(A),Qe=ks({contextId:A,text:re}),Ue=Ol(A,ne),Me=m(function(e){ba(Ee).dispatch(e)},[]),Ke=D(function(){return Object(B.b)({publishWhileDragging:Kn,updateDroppableScroll:Lr,updateDroppableIsEnabled:Br,updateDroppableIsCombineEnabled:Er,collectionStarting:vn},Me)},[Me]),gt=Rl(),gn=D(function(){return ko(gt,Ke)},[gt,Ke]),Tn=D(function(){return wl(Object(Q.a)({scrollWindow:ys,scrollDroppable:gn.scrollDroppable},Object(B.b)({move:$n},Me)))},[gn.scrollDroppable,Me]),Vn=Ls(A),er=D(function(){return Ma({announce:Xe,autoScroller:Tn,dimensionMarshal:gn,focusMarshal:Vn,getResponders:Ie,styleMarshal:Ue})},[Xe,Tn,gn,Vn,Ie,Ue]);Ee.current=er;var wr=m(function(){var e=ba(Ee),n=e.getState();n.phase!=="IDLE"&&e.dispatch(Ir())},[]),Zn=m(function(){var e=ba(Ee).getState();return e.isDragging||e.phase==="DROP_ANIMATING"},[]),Nr=D(function(){return{isDragging:Zn,tryAbort:wr}},[Zn,wr]);W(Nr);var Pr=m(function(e){return Mo(ba(Ee).getState(),e)},[]),Fr=m(function(){return fr(ba(Ee).getState())},[]),$r=D(function(){return{marshal:gn,focus:Vn,contextId:A,canLift:Pr,isMovementAllowed:Fr,dragHandleUsageInstructionsId:Qe,registry:gt}},[A,gn,Qe,Vn,Pr,Fr,gt]);return kl({contextId:A,store:er,registry:gt,customSensors:J,enableDefaultSensors:w.enableDefaultSensors!==!1}),Object(ee.useEffect)(function(){return wr},[wr]),$.a.createElement(ro.Provider,{value:$r},$.a.createElement(I.a,{context:Ai,store:er},w.children))}var Ei=0;function Ml(){Ei=0}function al(){return D(function(){return""+Ei++},[])}function au(){Ml(),Sl()}function Ul(w){var A=al(),W=w.dragHandleUsageInstructions||ut.dragHandleUsageInstructions;return $.a.createElement(oe,null,function(J){return $.a.createElement(_i,{nonce:w.nonce,contextId:A,setCallbacks:J,dragHandleUsageInstructions:W,enableDefaultSensors:w.enableDefaultSensors,sensors:w.sensors,onBeforeCapture:w.onBeforeCapture,onBeforeDragStart:w.onBeforeDragStart,onDragStart:w.onDragStart,onDragUpdate:w.onDragUpdate,onDragEnd:w.onDragEnd},w.children)})}var Qo=function(A){return function(W){return A===W}},ua=Qo("scroll"),il=Qo("auto"),Fl=Qo("visible"),ol=function(A,W){return W(A.overflowX)||W(A.overflowY)},Bl=function(A,W){return W(A.overflowX)&&W(A.overflowY)},Jo=function(A){var W=window.getComputedStyle(A),J={overflowX:W.overflowX,overflowY:W.overflowY};return ol(J,ua)||ol(J,il)},sl=function(){return!1;var A,W;if(!Jo(A))return!1;var J,ne;if(Bl(ne,Fl))return!1},qo=function w(A){return A==null?null:A===document.body?sl()?A:null:A===document.documentElement?null:Jo(A)?A:w(A.parentElement)},iu=function(w){if(!w)return;var A=qo(w.parentElement);if(!A)return},Zo=function(w){return{x:w.scrollLeft,y:w.scrollTop}},jl=function w(A){if(!A)return!1;var W=window.getComputedStyle(A);return W.position==="fixed"?!0:w(A.parentElement)},Wa=function(w){var A=qo(w),W=jl(w);return{closestScrollable:A,isFixedOnPage:W}},Mi=function(w){var A=w.descriptor,W=w.isEnabled,J=w.isCombineEnabled,ne=w.isFixedOnPage,re=w.direction,Ee=w.client,be=w.page,Ie=w.closest,Xe=function(){if(!Ie)return null;var Ke=Ie.scrollSize,gt=Ie.client,gn=Io({scrollHeight:Ke.scrollHeight,scrollWidth:Ke.scrollWidth,height:gt.paddingBox.height,width:gt.paddingBox.width});return{pageMarginBox:Ie.page.marginBox,frameClient:gt,scrollSize:Ke,shouldClipSubject:Ie.shouldClipSubject,scroll:{initial:Ie.scroll,current:Ie.scroll,max:gn,diff:{value:qe,displacement:qe}}}}(),Qe=re==="vertical"?vr:Rr,Ue=le({page:be,withPlaceholder:null,axis:Qe,frame:Xe}),Me={descriptor:A,isCombineEnabled:J,isFixedOnPage:ne,axis:Qe,isEnabled:W,client:Ee,page:be,frame:Xe,subject:Ue};return Me},ho=function(A,W){var J=O(A);if(!W)return J;if(A!==W)return J;var ne=J.paddingBox.top-W.scrollTop,re=J.paddingBox.left-W.scrollLeft,Ee=ne+W.scrollHeight,be=re+W.scrollWidth,Ie={top:ne,right:be,bottom:Ee,left:re},Xe=o(Ie,J.border),Qe=t({borderBox:Xe,margin:J.margin,border:J.border,padding:J.padding});return Qe},Ui=function(w){var A=w.ref,W=w.descriptor,J=w.env,ne=w.windowScroll,re=w.direction,Ee=w.isDropDisabled,be=w.isCombineEnabled,Ie=w.shouldClipSubject,Xe=J.closestScrollable,Qe=ho(A,Xe),Ue=C(Qe,ne),Me=function(){if(!Xe)return null;var gt=O(Xe),gn={scrollHeight:Xe.scrollHeight,scrollWidth:Xe.scrollWidth};return{client:gt,page:C(gt,ne),scroll:Zo(Xe),scrollSize:gn,shouldClipSubject:Ie}}(),Ke=Mi({descriptor:W,isEnabled:!Ee,isCombineEnabled:be,isFixedOnPage:J.isFixedOnPage,direction:re,client:Qe,page:Ue,closest:Me});return Ke},La={passive:!1},Wl={passive:!0},ll=function(w){return w.shouldPublishImmediately?La:Wl};function Ia(w){var A=Object(ee.useContext)(w);return A||Y(!1),A}var Fi=function(A){return A&&A.env.closestScrollable||null};function ul(w){var A=Object(ee.useRef)(null),W=Ia(ro),J=ui("droppable"),ne=W.registry,re=W.marshal,Ee=Li(w),be=D(function(){return{id:w.droppableId,type:w.type,mode:w.mode}},[w.droppableId,w.mode,w.type]),Ie=Object(ee.useRef)(be),Xe=D(function(){return d(function(Zn,Nr){A.current||Y(!1);var Pr={x:Zn,y:Nr};re.updateDroppableScroll(be.id,Pr)})},[be.id,re]),Qe=m(function(){var Zn=A.current;return!Zn||!Zn.env.closestScrollable?qe:Zo(Zn.env.closestScrollable)},[]),Ue=m(function(){var Zn=Qe();Xe(Zn.x,Zn.y)},[Qe,Xe]),Me=D(function(){return v(Ue)},[Ue]),Ke=m(function(){var Zn=A.current,Nr=Fi(Zn);Zn&&Nr||Y(!1);var Pr=Zn.scrollOptions;if(Pr.shouldPublishImmediately){Ue();return}Me()},[Me,Ue]),gt=m(function(Zn,Nr){A.current&&Y(!1);var Pr=Ee.current,Fr=Pr.getDroppableRef();Fr||Y(!1);var $r=Wa(Fr),e={ref:Fr,descriptor:be,env:$r,scrollOptions:Nr};A.current=e;var n=Ui({ref:Fr,descriptor:be,env:$r,windowScroll:Zn,direction:Pr.direction,isDropDisabled:Pr.isDropDisabled,isCombineEnabled:Pr.isCombineEnabled,shouldClipSubject:!Pr.ignoreContainerClipping}),s=$r.closestScrollable;return s&&(s.setAttribute(Ds.contextId,W.contextId),s.addEventListener("scroll",Ke,ll(e.scrollOptions))),n},[W.contextId,be,Ke,Ee]),gn=m(function(){var Zn=A.current,Nr=Fi(Zn);return Zn&&Nr||Y(!1),Zo(Nr)},[]),Tn=m(function(){var Zn=A.current;Zn||Y(!1);var Nr=Fi(Zn);if(A.current=null,!Nr)return;Me.cancel(),Nr.removeAttribute(Ds.contextId),Nr.removeEventListener("scroll",Ke,ll(Zn.scrollOptions))},[Ke,Me]),Vn=m(function(Zn){var Nr=A.current;Nr||Y(!1);var Pr=Fi(Nr);Pr||Y(!1),Pr.scrollTop+=Zn.y,Pr.scrollLeft+=Zn.x},[]),er=D(function(){return{getDimensionAndWatchScroll:gt,getScrollWhileDragging:gn,dragStopped:Tn,scroll:Vn}},[Tn,gt,gn,Vn]),wr=D(function(){return{uniqueId:J,descriptor:be,callbacks:er}},[er,be,J]);ta(function(){return Ie.current=wr.descriptor,ne.droppable.register(wr),function(){A.current&&Tn(),ne.droppable.unregister(wr)}},[er,be,Tn,wr,re,ne.droppable]),ta(function(){if(!A.current)return;re.updateDroppableIsEnabled(Ie.current.id,!w.isDropDisabled)},[w.isDropDisabled,re]),ta(function(){if(!A.current)return;re.updateDroppableIsCombineEnabled(Ie.current.id,w.isCombineEnabled)},[w.isCombineEnabled,re])}function po(){}var Bi={width:0,height:0,margin:lt},bi=function(A){var W=A.isAnimatingOpenOnMount,J=A.placeholder,ne=A.animate;return W||ne==="close"?Bi:{height:J.client.borderBox.height,width:J.client.borderBox.width,margin:J.client.margin}},es=function(A){var W=A.isAnimatingOpenOnMount,J=A.placeholder,ne=A.animate,re=bi({isAnimatingOpenOnMount:W,placeholder:J,animate:ne});return{display:J.display,boxSizing:"border-box",width:re.width,height:re.height,marginTop:re.margin.top,marginRight:re.margin.right,marginBottom:re.margin.bottom,marginLeft:re.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:ne!=="none"?Ja.placeholder:null}};function ts(w){var A=Object(ee.useRef)(null),W=m(function(){if(!A.current)return;clearTimeout(A.current),A.current=null},[]),J=w.animate,ne=w.onTransitionEnd,re=w.onClose,Ee=w.contextId,be=Object(ee.useState)(w.animate==="open"),Ie=be[0],Xe=be[1];Object(ee.useEffect)(function(){return Ie?J!=="open"?(W(),Xe(!1),po):A.current?po:(A.current=setTimeout(function(){A.current=null,Xe(!1)}),W):po},[J,Ie,W]);var Qe=m(function(Me){if(Me.propertyName!=="height")return;ne(),J==="close"&&re()},[J,re,ne]),Ue=es({isAnimatingOpenOnMount:Ie,animate:w.animate,placeholder:w.placeholder});return $.a.createElement(w.placeholder.tagName,{style:Ue,"data-rbd-placeholder-context-id":Ee,onTransitionEnd:Qe,ref:w.innerRef})}var ns=$.a.memo(ts),rs=$.a.createContext(null);function yi(w){w&&Si(w)||Y(!1)}function mo(w){return typeof w=="boolean"}function as(w,A){A.forEach(function(W){return W(w)})}var dl=[function(A){var W=A.props;W.droppableId||Y(!1),typeof W.droppableId=="string"||Y(!1)},function(A){var W=A.props;mo(W.isDropDisabled)||Y(!1),mo(W.isCombineEnabled)||Y(!1),mo(W.ignoreContainerClipping)||Y(!1)},function(A){var W=A.getDroppableRef;yi(W())}],vo=[function(A){var W=A.props,J=A.getPlaceholderRef;if(!W.placeholder)return;var ne=J();if(ne)return}],Hl=[function(A){var W=A.props;W.renderClone||Y(!1)},function(A){var W=A.getPlaceholderRef;W()&&Y(!1)}];function Kl(w){di(function(){as(w,dl),w.props.mode==="standard"&&as(w,vo),w.props.mode==="virtual"&&as(w,Hl)})}var ji=function(w){Object(k.a)(A,w);function A(){for(var J,ne=arguments.length,re=new Array(ne),Ee=0;Ee<ne;Ee++)re[Ee]=arguments[Ee];return J=w.call.apply(w,[this].concat(re))||this,J.state={isVisible:Boolean(J.props.on),data:J.props.on,animate:J.props.shouldAnimate&&J.props.on?"open":"none"},J.onClose=function(){if(J.state.animate!=="close")return;J.setState({isVisible:!1})},J}A.getDerivedStateFromProps=function(ne,re){return ne.shouldAnimate?ne.on?{isVisible:!0,data:ne.on,animate:"open"}:re.isVisible?{isVisible:!0,data:re.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(ne.on),data:ne.on,animate:"none"}};var W=A.prototype;return W.render=function(){if(!this.state.isVisible)return null;var ne={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(ne)},A}($.a.PureComponent),is={dragging:5e3,dropAnimating:4500},cl=function(A,W){return W?Ja.drop(W.duration):A?Ja.snap:Ja.fluid},Gl=function(A,W){return A?W?Ka.opacity.drop:Ka.opacity.combining:null},os=function(A){return A.forceShouldAnimate!=null?A.forceShouldAnimate:A.mode==="SNAP"};function fl(w){var A=w.dimension,W=A.client,J=w.offset,ne=w.combineWith,re=w.dropping,Ee=Boolean(ne),be=os(w),Ie=Boolean(re),Xe=Ie?yo.drop(J,Ee):yo.moveTo(J),Qe={position:"fixed",top:W.marginBox.top,left:W.marginBox.left,boxSizing:"border-box",width:W.borderBox.width,height:W.borderBox.height,transition:cl(be,re),transform:Xe,opacity:Gl(Ee,Ie),zIndex:Ie?is.dropAnimating:is.dragging,pointerEvents:"none"};return Qe}function zl(w){return{transform:yo.moveTo(w.offset),transition:w.shouldAnimateDisplacement?null:"none"}}function hl(w){return w.type==="DRAGGING"?fl(w):zl(w)}function pl(w,A,W){W===void 0&&(W=qe);var J=window.getComputedStyle(A),ne=A.getBoundingClientRect(),re=T(ne,J),Ee=C(re,W),be={client:re,tagName:A.tagName.toLowerCase(),display:J.display},Ie={x:re.marginBox.width,y:re.marginBox.height},Xe={descriptor:w,placeholder:be,displaceBy:Ie,client:re,page:Ee};return Xe}function Vl(w){var A=ui("draggable"),W=w.descriptor,J=w.registry,ne=w.getDraggableRef,re=w.canDragInteractiveElements,Ee=w.shouldRespectForcePress,be=w.isEnabled,Ie=D(function(){return{canDragInteractiveElements:re,shouldRespectForcePress:Ee,isEnabled:be}},[re,be,Ee]),Xe=m(function(Ke){var gt=ne();return gt||Y(!1),pl(W,gt,Ke)},[W,ne]),Qe=D(function(){return{uniqueId:A,descriptor:W,options:Ie,getDimension:Xe}},[W,Xe,Ie,A]),Ue=Object(ee.useRef)(Qe),Me=Object(ee.useRef)(!0);ta(function(){return J.draggable.register(Ue.current),function(){return J.draggable.unregister(Ue.current)}},[J.draggable]),ta(function(){if(Me.current){Me.current=!1;return}var Ke=Ue.current;Ue.current=Qe,J.draggable.update(Qe,Ke)},[Qe,J.draggable])}function ss(w,A,W){di(function(){function J(re){return"Draggable[id: "+re+"]: "}var ne=w.draggableId;if(ne||Y(!1),typeof ne=="string"||Y(!1),ye(w.index)||Y(!1),w.mapped.type==="DRAGGING")return;yi(W()),w.isEnabled&&(no(A,ne)||Y(!1))})}function Wi(w){Pi(function(){var A=Object(ee.useRef)(w);di(function(){w===A.current||Y(!1)},[w])})}function Hi(w){w.preventDefault()}function Xl(w){var A=Object(ee.useRef)(null),W=m(function(e){A.current=e},[]),J=m(function(){return A.current},[]),ne=Ia(ro),re=ne.contextId,Ee=ne.dragHandleUsageInstructionsId,be=ne.registry,Ie=Ia(rs),Xe=Ie.type,Qe=Ie.droppableId,Ue=D(function(){return{id:w.draggableId,index:w.index,type:Xe,droppableId:Qe}},[w.draggableId,w.index,Xe,Qe]),Me=w.children,Ke=w.draggableId,gt=w.isEnabled,gn=w.shouldRespectForcePress,Tn=w.canDragInteractiveElements,Vn=w.isClone,er=w.mapped,wr=w.dropAnimationFinished;if(ss(w,re,J),Wi(Vn),!Vn){var Zn=D(function(){return{descriptor:Ue,registry:be,getDraggableRef:J,canDragInteractiveElements:Tn,shouldRespectForcePress:gn,isEnabled:gt}},[Ue,be,J,Tn,gn,gt]);Vl(Zn)}var Nr=D(function(){return gt?{tabIndex:0,role:"button","aria-describedby":Ee,"data-rbd-drag-handle-draggable-id":Ke,"data-rbd-drag-handle-context-id":re,draggable:!1,onDragStart:Hi}:null},[re,Ee,Ke,gt]),Pr=m(function(e){if(er.type!=="DRAGGING")return;if(!er.dropping)return;if(e.propertyName!=="transform")return;wr()},[wr,er]),Fr=D(function(){var e=hl(er),n=er.type==="DRAGGING"&&er.dropping?Pr:null,s={innerRef:W,draggableProps:{"data-rbd-draggable-context-id":re,"data-rbd-draggable-id":Ke,style:e,onTransitionEnd:n},dragHandleProps:Nr};return s},[re,Nr,Ke,er,Pr,W]),$r=D(function(){return{draggableId:Ue.id,type:Ue.type,source:{index:Ue.index,droppableId:Ue.droppableId}}},[Ue.droppableId,Ue.id,Ue.index,Ue.type]);return Me(Fr,er.snapshot,$r)}var ls=function(w,A){return w===A},ml=function(w){var A=w.combine,W=w.destination;return W?W.droppableId:A?A.droppableId:null},$l=function(A){return A.combine?A.combine.draggableId:null},Yl=function(A){return A.at&&A.at.type==="COMBINE"?A.at.combine.draggableId:null};function Ql(){var w=d(function(ne,re){return{x:ne,y:re}}),A=d(function(ne,re,Ee,be,Ie){return{isDragging:!0,isClone:re,isDropAnimating:Boolean(Ie),dropAnimation:Ie,mode:ne,draggingOver:Ee,combineWith:be,combineTargetFor:null}}),W=d(function(ne,re,Ee,be,Ie,Xe,Qe){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:Ie,combineWith:Xe,mode:re,offset:ne,dimension:Ee,forceShouldAnimate:Qe,snapshot:A(re,be,Ie,Xe,null)}}}),J=function(re,Ee){if(re.isDragging){if(re.critical.draggable.id!==Ee.draggableId)return null;var be=re.current.client.offset,Ie=re.dimensions.draggables[Ee.draggableId],Xe=cn(re.impact),Qe=Yl(re.impact),Ue=re.forceShouldAnimate;return W(w(be.x,be.y),re.movementMode,Ie,Ee.isClone,Xe,Qe,Ue)}if(re.phase==="DROP_ANIMATING"){var Me=re.completed;if(Me.result.draggableId!==Ee.draggableId)return null;var Ke=Ee.isClone,gt=re.dimensions.draggables[Ee.draggableId],gn=Me.result,Tn=gn.mode,Vn=ml(gn),er=$l(gn),wr=re.dropDuration,Zn={duration:wr,curve:Xi.drop,moveTo:re.newHomeClientOffset,opacity:er?Ka.opacity.drop:null,scale:er?Ka.scale.drop:null};return{mapped:{type:"DRAGGING",offset:re.newHomeClientOffset,dimension:gt,dropping:Zn,draggingOver:Vn,combineWith:er,mode:Tn,forceShouldAnimate:null,snapshot:A(Tn,Ke,Vn,er,Zn)}}}return null};return J}function us(w){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:w,combineWith:null}}var Jl={mapped:{type:"SECONDARY",offset:qe,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:us(null)}};function ql(){var w=d(function(Ee,be){return{x:Ee,y:be}}),A=d(us),W=d(function(Ee,be,Ie){return be===void 0&&(be=null),{mapped:{type:"SECONDARY",offset:Ee,combineTargetFor:be,shouldAnimateDisplacement:Ie,snapshot:A(be)}}}),J=function(be){return be?W(qe,be,!0):null},ne=function(be,Ie,Xe,Qe){var Ue=Xe.displaced.visible[be],Me=Boolean(Qe.inVirtualList&&Qe.effected[be]),Ke=nn(Xe),gt=Ke&&Ke.draggableId===be?Ie:null;if(!Ue){if(!Me)return J(gt);if(Xe.displaced.invisible[be])return null;var gn=zt(Qe.displacedBy.point),Tn=w(gn.x,gn.y);return W(Tn,gt,!0)}if(Me)return J(gt);var Vn=Xe.displacedBy.point,er=w(Vn.x,Vn.y);return W(er,gt,Ue.shouldAnimate)},re=function(be,Ie){if(be.isDragging)return be.critical.draggable.id===Ie.draggableId?null:ne(Ie.draggableId,be.critical.draggable.id,be.impact,be.afterCritical);if(be.phase==="DROP_ANIMATING"){var Xe=be.completed;return Xe.result.draggableId===Ie.draggableId?null:ne(Ie.draggableId,Xe.result.draggableId,Xe.impact,Xe.afterCritical)}return null};return re}var vl=function(){var A=Ql(),W=ql(),J=function(re,Ee){return A(re,Ee)||W(re,Ee)||Jl};return J},ds={dropAnimationFinished:ea},gl=Object(I.c)(vl,ds,null,{context:Ai,pure:!0,areStatePropsEqual:ls})(Xl);function _l(w){var A=Ia(rs),W=A.isUsingCloneFor;return W===w.draggableId&&!w.isClone?null:$.a.createElement(gl,w)}function El(w){var A=typeof w.isDragDisabled=="boolean"?!w.isDragDisabled:!0,W=Boolean(w.disableInteractiveElementBlocking),J=Boolean(w.shouldRespectForcePress);return $.a.createElement(_l,Object(Q.a)({},w,{isClone:!1,isEnabled:A,canDragInteractiveElements:W,shouldRespectForcePress:J}))}function xi(w){var A=Object(ee.useContext)(ro);A||Y(!1);var W=A.contextId,J=A.isMovementAllowed,ne=Object(ee.useRef)(null),re=Object(ee.useRef)(null),Ee=w.children,be=w.droppableId,Ie=w.type,Xe=w.mode,Qe=w.direction,Ue=w.ignoreContainerClipping,Me=w.isDropDisabled,Ke=w.isCombineEnabled,gt=w.snapshot,gn=w.useClone,Tn=w.updateViewportMaxScroll,Vn=w.getContainerForClone,er=m(function(){return ne.current},[]),wr=m(function(i){ne.current=i},[]),Zn=m(function(){return re.current},[]),Nr=m(function(i){re.current=i},[]);Kl({props:w,getDroppableRef:er,getPlaceholderRef:Zn});var Pr=m(function(){J()&&Tn({maxScroll:No()})},[J,Tn]);ul({droppableId:be,type:Ie,mode:Xe,direction:Qe,isDropDisabled:Me,isCombineEnabled:Ke,ignoreContainerClipping:Ue,getDroppableRef:er});var Fr=$.a.createElement(ji,{on:w.placeholder,shouldAnimate:w.shouldAnimatePlaceholder},function(i){var p=i.onClose,F=i.data,X=i.animate;return $.a.createElement(ns,{placeholder:F,onClose:p,innerRef:Nr,animate:X,contextId:W,onTransitionEnd:Pr})}),$r=D(function(){return{innerRef:wr,placeholder:Fr,droppableProps:{"data-rbd-droppable-id":be,"data-rbd-droppable-context-id":W}}},[W,be,Fr,wr]),e=gn?gn.dragging.draggableId:null,n=D(function(){return{droppableId:be,type:Ie,isUsingCloneFor:e}},[be,e,Ie]);function s(){if(!gn)return null;var i=gn.dragging,p=gn.render,F=$.a.createElement(_l,{draggableId:i.draggableId,index:i.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(X,Z){return p(X,Z,i)});return M.a.createPortal(F,Vn())}return $.a.createElement(rs.Provider,{value:n},Ee($r,gt),s())}var go=function(A,W){return A===W.droppable.type},Ki=function(A,W){return W.draggables[A.draggable.id]},Zl=function(){var A={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},W=Object(Q.a)({},A,{shouldAnimatePlaceholder:!1}),J=d(function(Ee){return{draggableId:Ee.id,type:Ee.type,source:{index:Ee.index,droppableId:Ee.droppableId}}}),ne=d(function(Ee,be,Ie,Xe,Qe,Ue){var Me=Qe.descriptor.id,Ke=Qe.descriptor.droppableId===Ee;if(Ke){var gt=Ue?{render:Ue,dragging:J(Qe.descriptor)}:null,gn={isDraggingOver:Ie,draggingOverWith:Ie?Me:null,draggingFromThisWith:Me,isUsingPlaceholder:!0};return{placeholder:Qe.placeholder,shouldAnimatePlaceholder:!1,snapshot:gn,useClone:gt}}if(!be)return W;if(!Xe)return A;var Tn={isDraggingOver:Ie,draggingOverWith:Me,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:Qe.placeholder,shouldAnimatePlaceholder:!0,snapshot:Tn,useClone:null}}),re=function(be,Ie){var Xe=Ie.droppableId,Qe=Ie.type,Ue=!Ie.isDropDisabled,Me=Ie.renderClone;if(be.isDragging){var Ke=be.critical;if(!go(Qe,Ke))return W;var gt=Ki(Ke,be.dimensions),gn=cn(be.impact)===Xe;return ne(Xe,Ue,gn,gn,gt,Me)}if(be.phase==="DROP_ANIMATING"){var Tn=be.completed;if(!go(Qe,Tn.critical))return W;var Vn=Ki(Tn.critical,be.dimensions);return ne(Xe,Ue,ml(Tn.result)===Xe,cn(Tn.impact)===Xe,Vn,Me)}if(be.phase==="IDLE"&&be.completed&&!be.shouldFlush){var er=be.completed;if(!go(Qe,er.critical))return W;var wr=cn(er.impact)===Xe,Zn=Boolean(er.impact.at&&er.impact.at.type==="COMBINE"),Nr=er.critical.droppable.id===Xe;return wr?Zn?A:W:Nr?A:W}return W};return re},eu={updateViewportMaxScroll:_r};function tu(){return document.body||Y(!1),document.body}var Hr={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:tu},bl=Object(I.c)(Zl,eu,null,{context:Ai,pure:!0,areStatePropsEqual:ls})(xi);bl.defaultProps=Hr},osHv:function(Rt,Ze,K){(function(ee){ee(K("VrN/"))})(function(ee){"use strict";var $=ee.Pos;function k(r,t){return r.line-t.line||r.ch-t.ch}var Q="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",B=Q+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",I=new RegExp("<(/?)(["+Q+"]["+B+"]*)","g");function z(r,t,c,f){this.line=t,this.ch=c,this.cm=r,this.text=r.getLine(t),this.min=f?Math.max(f.from,r.firstLine()):r.firstLine(),this.max=f?Math.min(f.to-1,r.lastLine()):r.lastLine()}function G(r,t){var c=r.cm.getTokenTypeAt($(r.line,t));return c&&/\btag\b/.test(c)}function L(r){return r.line>=r.max?void 0:(r.ch=0,r.text=r.cm.getLine(++r.line),!0)}function D(r){return r.line<=r.min?void 0:(r.text=r.cm.getLine(--r.line),r.ch=r.text.length,!0)}function m(r){for(;;){var t=r.text.indexOf(">",r.ch);if(t==-1){if(L(r))continue;return}if(!G(r,t+1)){r.ch=t+1;continue}var c=r.text.lastIndexOf("/",t),f=c>-1&&!/\S/.test(r.text.slice(c+1,t));return r.ch=t+1,f?"selfClose":"regular"}}function g(r){for(;;){var t=r.ch?r.text.lastIndexOf("<",r.ch-1):-1;if(t==-1){if(D(r))continue;return}if(!G(r,t+1)){r.ch=t;continue}I.lastIndex=t,r.ch=t;var c=I.exec(r.text);if(c&&c.index==t)return c}}function h(r){for(;;){I.lastIndex=r.ch;var t=I.exec(r.text);if(!t){if(L(r))continue;return}if(!G(r,t.index+1)){r.ch=t.index+1;continue}return r.ch=t.index+t[0].length,t}}function o(r){for(;;){var t=r.ch?r.text.lastIndexOf(">",r.ch-1):-1;if(t==-1){if(D(r))continue;return}if(!G(r,t+1)){r.ch=t;continue}var c=r.text.lastIndexOf("/",t),f=c>-1&&!/\S/.test(r.text.slice(c+1,t));return r.ch=t+1,f?"selfClose":"regular"}}function l(r,t){for(var c=[];;){var f=h(r),S,C=r.line,T=r.ch-(f?f[0].length:0);if(!f||!(S=m(r)))return;if(S=="selfClose")continue;if(f[1]){for(var O=c.length-1;O>=0;--O)if(c[O]==f[2]){c.length=O;break}if(O<0&&(!t||t==f[2]))return{tag:f[2],from:$(C,T),to:$(r.line,r.ch)}}else c.push(f[2])}}function a(r,t){for(var c=[];;){var f=o(r);if(!f)return;if(f=="selfClose"){g(r);continue}var S=r.line,C=r.ch,T=g(r);if(!T)return;if(T[1])c.push(T[2]);else{for(var O=c.length-1;O>=0;--O)if(c[O]==T[2]){c.length=O;break}if(O<0&&(!t||t==T[2]))return{tag:T[2],from:$(r.line,r.ch),to:$(S,C)}}}}ee.registerHelper("fold","xml",function(r,t){for(var c=new z(r,t.line,0);;){var f=h(c);if(!f||c.line!=t.line)return;var S=m(c);if(!S)return;if(!f[1]&&S!="selfClose"){var C=$(c.line,c.ch),T=l(c,f[2]);return T&&k(T.from,C)>0?{from:C,to:T.from}:null}}}),ee.findMatchingTag=function(r,t,c){var f=new z(r,t.line,t.ch,c);if(f.text.indexOf(">")==-1&&f.text.indexOf("<")==-1)return;var S=m(f),C=S&&$(f.line,f.ch),T=S&&g(f);if(!S||!T||k(f,t)>0)return;var O={from:$(f.line,f.ch),to:C,tag:T[2]};return S=="selfClose"?{open:O,close:null,at:"open"}:T[1]?{open:a(f,T[2]),close:O,at:"close"}:(f=new z(r,C.line,C.ch,c),{open:O,close:l(f,T[2]),at:"open"})},ee.findEnclosingTag=function(r,t,c,f){for(var S=new z(r,t.line,t.ch,c);;){var C=a(S,f);if(!C)break;var T=new z(r,t.line,t.ch,c),O=l(T,C.tag);if(O)return{open:C,close:O}}},ee.scanForClosingTag=function(r,t,c,f){var S=new z(r,t.line,t.ch,f?{from:0,to:f}:null);return l(S,c)}})},p5ED:function(Rt,Ze,K){"use strict";var ee=K("+L6B"),$=K("2/Rp"),k=K("5Dmo"),Q=K("3S7+"),B=K("k1fw"),I=K("tJVT"),z=K("cDcd"),G=K.n(z),L=K("vHTk"),D=K.n(L),m=K("yEEn"),g=K("ZW9T"),h=K("1vsH");Ze.a=function(o){var l=o.name,a=o.data,r=o.theme,t=o.type,c=o.filename,f=o.monacoEditor,S=o.className,C=o.style,T=o.close,O=o.onClose,R=o.hasMask,b=Object(z.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),_=Object(I.a)(b,2),u=_[0],d=_[1],y=Object(z.useState)(""),v=Object(I.a)(y,2),E=v[0],M=v[1],N,j=1024*1024,H=10*j,P=Object(z.useRef)();t==="office"&&(N=Object(h.V)(a).filesize,N>H&&(t="other")),c&&(f.filename=c),Object(z.useEffect)(function(){var V,q,ie=(V=document.cookie)===null||V===void 0||((q=V.replace(/\s/g,""))===null||q===void 0)?void 0:q.split(";");ie==null||ie.map(function(se){var ve=se.split("=");ve[0]==="_educoder_session"&&M(ve[1])})},[]);var x=function(){if(a.startsWith("http")||a.startsWith("/")){U();return}Object(h.z)(c||"educoder",a,c)},U=function(){Object(h.x)(c||l,a)};return console.log("data:",a,"fileanme:",c," name:",l),G.a.createElement("div",{style:Object(B.a)({},C||{}),className:"".concat(R&&D.a.bgBlack," ").concat(t?D.a.wrp:"hide")},T&&G.a.createElement("div",{className:D.a.close,ref:P},G.a.createElement(Q.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return P.current}},G.a.createElement("span",{onClick:U},G.a.createElement("i",{className:"icon-quxiaozhiding"}))),G.a.createElement(Q.a,{title:"\u5173\u95ED",getPopupContainer:function(){return P.current}},G.a.createElement("span",{className:"",onClick:O},G.a.createElement("i",{className:"icon-guanbi1"})))),G.a.createElement("div",{className:"".concat(D.a[S]," ").concat(S," ").concat(D.a.monaco," ").concat(t==="txt"?"show":"hide")},t==="txt"&&G.a.createElement(g.b,f)),t==="audio"&&G.a.createElement("audio",{src:"".concat(a!=null&&a.startsWith("/")||(a==null?void 0:a.indexOf("https://"))>-1?a:"data:audio/mp3;base64,").concat(a),autoPlay:!0}),t==="video"&&G.a.createElement(G.a.Fragment,null,a!=null&&a.startsWith("/")?G.a.createElement("video",{controls:!0,src:"".concat(a),autoPlay:!0}):G.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(a),autoPlay:!0})),t==="html"&&G.a.createElement("iframe",{src:a+"&disposition=inline"}),t==="pdf"&&G.a.createElement("embed",{className:D.a.embed,src:a}),t==="image"&&G.a.createElement(G.a.Fragment,null,G.a.createElement("img",{src:"".concat(a!=null&&a.startsWith("/")||(a==null?void 0:a.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(a)})),t==="other"&&G.a.createElement("div",null,G.a.createElement($.a,{type:"primary",size:"large",onClick:x},G.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(t==="download"||t==="office")&&G.a.createElement($.a,{type:"primary",size:"large",onClick:x},G.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(Rt,Ze,K){},psGv:function(Rt,Ze,K){var ee,$;(function(){var k;(function(){"use strict";var z=[,,function(m){function g(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=[]}g.prototype.clone_empty=function(){var l=new g(this.__parent);return l.set_indent(this.__indent_count,this.__alignment_count),l},g.prototype.item=function(l){return l<0?this.__items[this.__items.length+l]:this.__items[l]},g.prototype.has_match=function(l){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(l))return!0;return!1},g.prototype.set_indent=function(l,a){this.is_empty()&&(this.__indent_count=l||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},g.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)},g.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},g.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},g.prototype.is_empty=function(){return this.__items.length===0},g.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},g.prototype.push=function(l){this.__items.push(l);var a=l.lastIndexOf(`
`);a!==-1?this.__character_count=l.length-a:this.__character_count+=l.length},g.prototype.pop=function(){var l=null;return this.is_empty()||(l=this.__items.pop(),this.__character_count-=l.length),l},g.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},g.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},g.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},g.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 h(l,a){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)),a=a||"",l.indent_level>0&&(a=new Array(l.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}h.prototype.get_indent_size=function(l,a){var r=this.__base_string_length;return a=a||0,l<0&&(r=0),r+=l*this.__indent_size,r+=a,r},h.prototype.get_indent_string=function(l,a){var r=this.__base_string;return a=a||0,l<0&&(l=0,r=""),a+=l*this.__indent_size,this.__ensure_cache(a),r+=this.__cache[a],r},h.prototype.__ensure_cache=function(l){for(;l>=this.__cache.length;)this.__add_column()},h.prototype.__add_column=function(){var l=this.__cache.length,a=0,r="";this.__indent_size&&l>=this.__indent_size&&(a=Math.floor(l/this.__indent_size),l-=a*this.__indent_size,r=new Array(a+1).join(this.__indent_string)),l&&(r+=new Array(l+1).join(" ")),this.__cache.push(r)};function o(l,a){this.__indent_cache=new h(l,a),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 g(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,a){return this.__indent_cache.get_indent_string(l,a)},o.prototype.get_indent_size=function(l,a){return this.__indent_cache.get_indent_size(l,a)},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 a=this.current_line.pop();a&&(a[a.length-1]===`
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
`);return l!==`
`&&(r=r.replace(/[\n]/g,l)),r},o.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},o.prototype.set_indent=function(l,a){return l=l||0,a=a||0,this.next_line.set_indent(l,a),this.__lines.length>1?(this.current_line.set_indent(l,a),!0):(this.current_line.set_indent(),!1)},o.prototype.add_raw_token=function(l){for(var a=0;a<l.newlines;a++)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 a=this.__lines.length;l<a;)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,a){for(var r=this.__lines.length-2;r>=0;){var t=this.__lines[r];if(t.is_empty())break;if(t.item(0).indexOf(l)!==0&&t.item(-1)!==a){this.__lines.splice(r+1,0,new g(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},m.exports.Output=o},function(m){function g(h,o,l,a){this.type=h,this.text=o,this.comments_before=null,this.newlines=l||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}m.exports.Token=g},,,function(m){function g(l,a){this.raw_options=h(l,a),this.disabled=this._get_boolean("disabled"),this.eol=this._get_characters("eol","auto"),this.end_with_newline=this._get_boolean("end_with_newline"),this.indent_size=this._get_number("indent_size",4),this.indent_char=this._get_characters("indent_char"," "),this.indent_level=this._get_number("indent_level"),this.preserve_newlines=this._get_boolean("preserve_newlines",!0),this.max_preserve_newlines=this._get_number("max_preserve_newlines",32786),this.preserve_newlines||(this.max_preserve_newlines=0),this.indent_with_tabs=this._get_boolean("indent_with_tabs",this.indent_char===" "),this.indent_with_tabs&&(this.indent_char=" ",this.indent_size===1&&(this.indent_size=4)),this.wrap_line_length=this._get_number("wrap_line_length",this._get_number("max_char")),this.indent_empty_lines=this._get_boolean("indent_empty_lines"),this.templating=this._get_selection_list("templating",["auto","none","django","erb","handlebars","php","smarty"],["auto"])}g.prototype._get_array=function(l,a){var r=this.raw_options[l],t=a||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(t=r.concat()):typeof r=="string"&&(t=r.split(/[^a-zA-Z0-9_\/\-]+/)),t},g.prototype._get_boolean=function(l,a){var r=this.raw_options[l],t=r===void 0?!!a:!!r;return t},g.prototype._get_characters=function(l,a){var r=this.raw_options[l],t=a||"";return typeof r=="string"&&(t=r.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),t},g.prototype._get_number=function(l,a){var r=this.raw_options[l];a=parseInt(a,10),isNaN(a)&&(a=0);var t=parseInt(r,10);return isNaN(t)&&(t=a),t},g.prototype._get_selection=function(l,a,r){var t=this._get_selection_list(l,a,r);if(t.length!==1)throw new Error("Invalid Option Value: The option '"+l+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[l]+"'");return t[0]},g.prototype._get_selection_list=function(l,a,r){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[a[0]],!this._is_valid_selection(r,a))throw new Error("Invalid Default Value!");var t=this._get_array(l,r);if(!this._is_valid_selection(t,a))throw new Error("Invalid Option Value: The option '"+l+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[l]+"'");return t},g.prototype._is_valid_selection=function(l,a){return l.length&&a.length&&!l.some(function(r){return a.indexOf(r)===-1})};function h(l,a){var r={};l=o(l);var t;for(t in l)t!==a&&(r[t]=l[t]);if(a&&l[a])for(t in l[a])r[t]=l[a][t];return r}function o(l){var a={},r;for(r in l){var t=r.replace(/-/g,"_");a[t]=l[r]}return a}m.exports.Options=g,m.exports.normalizeOpts=o,m.exports.mergeOpts=h},,function(m){var g=RegExp.prototype.hasOwnProperty("sticky");function h(o){this.__input=o||"",this.__input_length=this.__input.length,this.__position=0}h.prototype.restart=function(){this.__position=0},h.prototype.back=function(){this.__position>0&&(this.__position-=1)},h.prototype.hasNext=function(){return this.__position<this.__input_length},h.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__input.charAt(this.__position),this.__position+=1),o},h.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},h.prototype.__match=function(o,l){o.lastIndex=l;var a=o.exec(this.__input);return a&&!(g&&o.sticky)&&(a.index!==l&&(a=null)),a},h.prototype.test=function(o,l){return l=l||0,l+=this.__position,l>=0&&l<this.__input_length?!!this.__match(o,l):!1},h.prototype.testChar=function(o,l){var a=this.peek(l);return o.lastIndex=0,a!==null&&o.test(a)},h.prototype.match=function(o){var l=this.__match(o,this.__position);return l?this.__position+=l[0].length:l=null,l},h.prototype.read=function(o,l,a){var r="",t;return o&&(t=this.match(o),t&&(r+=t[0])),l&&(t||!o)&&(r+=this.readUntil(l,a)),r},h.prototype.readUntil=function(o,l){var a="",r=this.__position;o.lastIndex=this.__position;var t=o.exec(this.__input);return t?(r=t.index,l&&(r+=t[0].length)):r=this.__input_length,a=this.__input.substring(this.__position,r),this.__position=r,a},h.prototype.readUntilAfter=function(o){return this.readUntil(o,!0)},h.prototype.get_regexp=function(o,l){var a=null,r="g";return l&&g&&(r="y"),typeof o=="string"&&o!==""?a=new RegExp(o,r):o&&(a=new RegExp(o.source,r)),a},h.prototype.get_literal_regexp=function(o){return RegExp(o.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},h.prototype.peekUntilAfter=function(o){var l=this.__position,a=this.readUntilAfter(o);return this.__position=l,a},h.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=h},function(m,g,h){var o=h(8).InputScanner,l=h(3).Token,a=h(10).TokenStream,r=h(11).WhitespacePattern,t={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},c=function(f,S){this._input=new o(f),this._options=S||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};c.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var f,S=new l(t.START,""),C=null,T=[],O=new a;S.type!==t.EOF;){for(f=this._get_next_token(S,C);this._is_comment(f);)O.add(f),f=this._get_next_token(S,C);O.isEmpty()||(f.comments_before=O,O=new a),f.parent=C,this._is_opening(f)?(T.push(C),C=f):C&&this._is_closing(f,C)&&(f.opened=C,C.closed=f,C=T.pop(),f.parent=C),f.previous=S,S.next=f,this.__tokens.add(f),S=f}return this.__tokens},c.prototype._is_first_token=function(){return this.__tokens.isEmpty()},c.prototype._reset=function(){},c.prototype._get_next_token=function(f,S){this._readWhitespace();var C=this._input.read(/.+/g);return C?this._create_token(t.RAW,C):this._create_token(t.EOF,"")},c.prototype._is_comment=function(f){return!1},c.prototype._is_opening=function(f){return!1},c.prototype._is_closing=function(f,S){return!1},c.prototype._create_token=function(f,S){var C=new l(f,S,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return C},c.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},m.exports.Tokenizer=c,m.exports.TOKEN=t},function(m){function g(h){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=h}g.prototype.restart=function(){this.__position=0},g.prototype.isEmpty=function(){return this.__tokens_length===0},g.prototype.hasNext=function(){return this.__position<this.__tokens_length},g.prototype.next=function(){var h=null;return this.hasNext()&&(h=this.__tokens[this.__position],this.__position+=1),h},g.prototype.peek=function(h){var o=null;return h=h||0,h+=this.__position,h>=0&&h<this.__tokens_length&&(o=this.__tokens[h]),o},g.prototype.add=function(h){this.__parent_token&&(h.parent=this.__parent_token),this.__tokens.push(h),this.__tokens_length+=1},m.exports.TokenStream=g},function(m,g,h){var o=h(12).Pattern;function l(a,r){o.call(this,a,r),r?this._line_regexp=this._input.get_regexp(r._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}l.prototype=new o,l.prototype.__set_whitespace_patterns=function(a,r){a+="\\t ",r+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+r+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+r+"]")},l.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var r=this.__split(this._newline_regexp,a);this.newline_count=r.length-1,this.whitespace_before_token=r[this.newline_count]}return a},l.prototype.matching=function(a,r){var t=this._create();return t.__set_whitespace_patterns(a,r),t._update(),t},l.prototype._create=function(){return new l(this._input,this)},l.prototype.__split=function(a,r){a.lastIndex=0;for(var t=0,c=[],f=a.exec(r);f;)c.push(r.substring(t,f.index)),t=f.index+f[0].length,f=a.exec(r);return t<r.length?c.push(r.substring(t,r.length)):c.push(""),c},m.exports.WhitespacePattern=l},function(m){function g(h,o){this._input=h,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)}g.prototype.read=function(){var h=this._input.read(this._starting_pattern);return(!this._starting_pattern||h)&&(h+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),h},g.prototype.read_match=function(){return this._input.match(this._match_pattern)},g.prototype.until_after=function(h){var o=this._create();return o._until_after=!0,o._until_pattern=this._input.get_regexp(h),o._update(),o},g.prototype.until=function(h){var o=this._create();return o._until_after=!1,o._until_pattern=this._input.get_regexp(h),o._update(),o},g.prototype.starting_with=function(h){var o=this._create();return o._starting_pattern=this._input.get_regexp(h,!0),o._update(),o},g.prototype.matching=function(h){var o=this._create();return o._match_pattern=this._input.get_regexp(h,!0),o._update(),o},g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){},m.exports.Pattern=g},function(m){function g(h,o){h=typeof h=="string"?h:h.source,o=typeof o=="string"?o:o.source,this.__directives_block_pattern=new RegExp(h+/ beautify( \w+[:]\w+)+ /.source+o,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(h+/\sbeautify\signore:end\s/.source+o,"g")}g.prototype.get_directives=function(h){if(!h.match(this.__directives_block_pattern))return null;var o={};this.__directive_pattern.lastIndex=0;for(var l=this.__directive_pattern.exec(h);l;)o[l[1]]=l[2],l=this.__directive_pattern.exec(h);return o},g.prototype.readIgnored=function(h){return h.readUntilAfter(this.__directives_end_ignore_pattern)},m.exports.Directives=g},function(m,g,h){var o=h(12).Pattern,l={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(r,t){o.call(this,r,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(r);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}/)}}a.prototype=new o,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(r){var t=this._create();return t._disabled[r]=!0,t._update(),t},a.prototype.read_options=function(r){var t=this._create();for(var c in l)t._disabled[c]=r.templating.indexOf(c)===-1;return t._update(),t},a.prototype.exclude=function(r){var t=this._create();return t._excluded[r]=!0,t._update(),t},a.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=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),r+=t,t=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},a.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},a.prototype._read_template=function(){var r="",t=this._input.peek();if(t==="<"){var c=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&c==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&c==="%"&&(r=r||this.__patterns.erb.read())}else t==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},m.exports.TemplatablePattern=a},,,,function(m,g,h){var o=h(19).Beautifier,l=h(20).Options;function a(r,t,c,f){var S=new o(r,t,c,f);return S.beautify()}m.exports=a,m.exports.defaultOptions=function(){return new l}},function(m,g,h){var o=h(20).Options,l=h(2).Output,a=h(21).Tokenizer,r=h(21).TOKEN,t=/\r\n|[\r\n]/,c=/\r\n|[\r\n]/g,f=function(y,v){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=y.max_preserve_newlines,this.preserve_newlines=y.preserve_newlines,this._output=new l(y,v)};f.prototype.current_line_has_match=function(y){return this._output.current_line.has_match(y)},f.prototype.set_space_before_token=function(y,v){this._output.space_before_token=y,this._output.non_breaking_space=v},f.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},f.prototype.add_raw_token=function(y){this._output.add_raw_token(y)},f.prototype.print_preserved_newlines=function(y){var v=0;y.type!==r.TEXT&&y.previous.type!==r.TEXT&&(v=y.newlines?1:0),this.preserve_newlines&&(v=y.newlines<this.max_preserve_newlines+1?y.newlines:this.max_preserve_newlines+1);for(var E=0;E<v;E++)this.print_newline(E>0);return v!==0},f.prototype.traverse_whitespace=function(y){return y.whitespace_before||y.newlines?(this.print_preserved_newlines(y)||(this._output.space_before_token=!0),!0):!1},f.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},f.prototype.print_newline=function(y){this._output.add_new_line(y)},f.prototype.print_token=function(y){y.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(y.text))},f.prototype.indent=function(){this.indent_level++},f.prototype.get_full_indent=function(y){return y=this.indent_level+(y||0),y<1?"":this._output.get_indent_string(y)};var S=function(y){for(var v=null,E=y.next;E.type!==r.EOF&&y.closed!==E;){if(E.type===r.ATTRIBUTE&&E.text==="type"){E.next&&E.next.type===r.EQUALS&&E.next.next&&E.next.next.type===r.VALUE&&(v=E.next.next.text);break}E=E.next}return v},C=function(y,v){var E=null,M=null;return v.closed?(y==="script"?E="text/javascript":y==="style"&&(E="text/css"),E=S(v)||E,E.search("text/css")>-1?M="css":E.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?M="javascript":E.search(/(text|application|dojo)\/(x-)?(html)/)>-1?M="html":E.search(/test\/null/)>-1&&(M="null"),M):null};function T(y,v){return v.indexOf(y)!==-1}function O(y,v,E){this.parent=y||null,this.tag=v?v.tag_name:"",this.indent_level=E||0,this.parser_token=v||null}function R(y){this._printer=y,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(y){var v=new O(this._current_frame,y,this._printer.indent_level);this._current_frame=v},R.prototype._try_pop_frame=function(y){var v=null;return y&&(v=y.parser_token,this._printer.indent_level=y.indent_level,this._current_frame=y.parent),v},R.prototype._get_frame=function(y,v){for(var E=this._current_frame;E&&!(y.indexOf(E.tag)!==-1);){if(v&&v.indexOf(E.tag)!==-1){E=null;break}E=E.parent}return E},R.prototype.try_pop=function(y,v){var E=this._get_frame([y],v);return this._try_pop_frame(E)},R.prototype.indent_to_tag=function(y){var v=this._get_frame(y);v&&(this._printer.indent_level=v.indent_level)};function b(y,v,E,M){this._source_text=y||"",v=v||{},this._js_beautify=E,this._css_beautify=M,this._tag_stack=null;var N=new o(v,"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 y=this._source_text,v=this._options.eol;this._options.eol==="auto"&&(v=`
`,y&&t.test(y)&&(v=y.match(t)[0])),y=y.replace(c,`
`);var E=y.match(/^[\t ]*/)[0],M={text:"",type:""},N=new _,j=new f(this._options,E),H=new a(y,this._options).tokenize();this._tag_stack=new R(j);for(var P=null,x=H.next();x.type!==r.EOF;)x.type===r.TAG_OPEN||x.type===r.COMMENT?(P=this._handle_tag_open(j,x,N,M),N=P):x.type===r.ATTRIBUTE||x.type===r.EQUALS||x.type===r.VALUE||x.type===r.TEXT&&!N.tag_complete?P=this._handle_inside_tag(j,x,N,H):x.type===r.TAG_CLOSE?P=this._handle_tag_close(j,x,N):x.type===r.TEXT?P=this._handle_text(j,x,N):j.add_raw_token(x),M=P,x=H.next();var U=j._output.get_code(v);return U},b.prototype._handle_tag_close=function(y,v,E){var M={text:v.text,type:v.type};return y.alignment_size=0,E.tag_complete=!0,y.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),E.is_unformatted?y.add_raw_token(v):(E.tag_start_char==="<"&&(y.set_space_before_token(v.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&E.has_wrapped_attrs&&y.print_newline(!1)),y.print_token(v)),E.indent_content&&!(E.is_unformatted||E.is_content_unformatted)&&(y.indent(),E.indent_content=!1),!E.is_inline_element&&!(E.is_unformatted||E.is_content_unformatted)&&y.set_wrap_point(),M},b.prototype._handle_inside_tag=function(y,v,E,M){var N=E.has_wrapped_attrs,j={text:v.text,type:v.type};if(y.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),E.is_unformatted)y.add_raw_token(v);else if(E.tag_start_char==="{"&&v.type===r.TEXT)y.print_preserved_newlines(v)?(v.newlines=0,y.add_raw_token(v)):y.print_token(v);else{if(v.type===r.ATTRIBUTE?(y.set_space_before_token(!0),E.attr_count+=1):(v.type===r.EQUALS||v.type===r.VALUE&&v.previous.type===r.EQUALS)&&y.set_space_before_token(!1),v.type===r.ATTRIBUTE&&E.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(y.traverse_whitespace(v),N=N||v.newlines!==0),this._is_wrap_attributes_force)){var H=E.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&E.attr_count===1){var P=!0,x=0,U;do{if(U=M.peek(x),U.type===r.ATTRIBUTE){P=!1;break}x+=1}while(x<4&&U.type!==r.EOF&&U.type!==r.TAG_CLOSE);H=!P}H&&(y.print_newline(!1),N=!0)}y.print_token(v),N=N||y.previous_token_wrapped(),E.has_wrapped_attrs=N}return j},b.prototype._handle_text=function(y,v,E){var M={text:v.text,type:"TK_CONTENT"};return E.custom_beautifier_name?this._print_custom_beatifier_text(y,v,E):E.is_unformatted||E.is_content_unformatted?y.add_raw_token(v):(y.traverse_whitespace(v),y.print_token(v)),M},b.prototype._print_custom_beatifier_text=function(y,v,E){var M=this;if(v.text!==""){var N=v.text,j,H=1,P="",x="";E.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?j=this._js_beautify:E.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?j=this._css_beautify:E.custom_beautifier_name==="html"&&(j=function(ve,Te){var fe=new b(ve,Te,M._js_beautify,M._css_beautify);return fe.beautify()}),this._options.indent_scripts==="keep"?H=0:this._options.indent_scripts==="separate"&&(H=-y.indent_level);var U=y.get_full_indent(H);if(N=N.replace(/\n[ \t]*$/,""),E.custom_beautifier_name!=="html"&&N[0]==="<"&&N.match(/^(<!--|<!\[CDATA\[)/)){var V=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(N);if(!V){y.add_raw_token(v);return}P=U+V[1]+`
`,N=V[4],V[5]&&(x=U+V[5]),N=N.replace(/\n[ \t]*$/,""),(V[2]||V[3].indexOf(`
`)!==-1)&&(V=V[3].match(/[ \t]+$/),V&&(v.whitespace_before=V[0]))}if(N)if(j){var q=function(){this.eol=`
`};q.prototype=this._options.raw_options;var ie=new q;N=j(U+N,ie)}else{var se=v.whitespace_before;se&&(N=N.replace(new RegExp(`
(`+se+")?","g"),`
`)),N=U+N.replace(/\n/g,`
`+U)}P&&(N?N=P+N+`
`+x:N=P+x),y.print_newline(!1),N&&(v.text=N,v.whitespace_before="",v.newlines=0,y.add_raw_token(v),y.print_newline(!0))}},b.prototype._handle_tag_open=function(y,v,E,M){var N=this._get_tag_open_token(v);return(E.is_unformatted||E.is_content_unformatted)&&!E.is_empty_element&&v.type===r.TAG_OPEN&&v.text.indexOf("</")===0?(y.add_raw_token(v),N.start_tag_token=this._tag_stack.try_pop(N.tag_name)):(y.traverse_whitespace(v),this._set_tag_position(y,v,N,E,M),N.is_inline_element||y.set_wrap_point(),y.print_token(v)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(N.alignment_size=v.text.length+1),!N.tag_complete&&!N.is_unformatted&&(y.alignment_size=N.alignment_size),N};var _=function(y,v){if(this.parent=y||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!v)this.tag_complete=!0;else{var E;this.tag_start_char=v.text[0],this.text=v.text,this.tag_start_char==="<"?(E=v.text.match(/^<([^\s>]*)/),this.tag_check=E?E[1]:""):(E=v.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=E?E[1]:"",(v.text.startsWith("{{#>")||v.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&v.next!==null?this.tag_check=v.next.text.split(" ")[0]:this.tag_check=v.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),v.type===r.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||v.closed&&v.closed.text==="/>";var M=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(M=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(M)))}};b.prototype._get_tag_open_token=function(y){var v=new _(this._tag_stack.get_parser_token(),y);return v.alignment_size=this._options.wrap_attributes_indent_size,v.is_end_tag=v.is_end_tag||T(v.tag_check,this._options.void_elements),v.is_empty_element=v.tag_complete||v.is_start_tag&&v.is_end_tag,v.is_unformatted=!v.tag_complete&&T(v.tag_check,this._options.unformatted),v.is_content_unformatted=!v.is_empty_element&&T(v.tag_check,this._options.content_unformatted),v.is_inline_element=T(v.tag_name,this._options.inline)||v.tag_name.includes("-")||v.tag_start_char==="{",v},b.prototype._set_tag_position=function(y,v,E,M,N){if(E.is_empty_element||(E.is_end_tag?E.start_tag_token=this._tag_stack.try_pop(E.tag_name):(this._do_optional_end_element(E)&&(E.is_inline_element||y.print_newline(!1)),this._tag_stack.record_tag(E),(E.tag_name==="script"||E.tag_name==="style")&&!(E.is_unformatted||E.is_content_unformatted)&&(E.custom_beautifier_name=C(E.tag_check,v)))),T(E.tag_check,this._options.extra_liners)&&(y.print_newline(!1),y._output.just_added_blankline()||y.print_newline(!0)),E.is_empty_element){if(E.tag_start_char==="{"&&E.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),E.indent_content=!0;var j=y.current_line_has_match(/{{#if/);j||y.print_newline(!1)}E.tag_name==="!--"&&N.type===r.TAG_CLOSE&&M.is_end_tag&&E.text.indexOf(`
`)===-1||(E.is_inline_element||E.is_unformatted||y.print_newline(!1),this._calcluate_parent_multiline(y,E))}else if(E.is_end_tag){var H=!1;H=E.start_tag_token&&E.start_tag_token.multiline_content,H=H||!E.is_inline_element&&!(M.is_inline_element||M.is_unformatted)&&!(N.type===r.TAG_CLOSE&&E.start_tag_token===M)&&N.type!=="TK_CONTENT",(E.is_content_unformatted||E.is_unformatted)&&(H=!1),H&&y.print_newline(!1)}else E.indent_content=!E.custom_beautifier_name,E.tag_start_char==="<"&&(E.tag_name==="html"?E.indent_content=this._options.indent_inner_html:E.tag_name==="head"?E.indent_content=this._options.indent_head_inner_html:E.tag_name==="body"&&(E.indent_content=this._options.indent_body_inner_html)),!(E.is_inline_element||E.is_unformatted)&&(N.type!=="TK_CONTENT"||E.is_content_unformatted)&&y.print_newline(!1),this._calcluate_parent_multiline(y,E)},b.prototype._calcluate_parent_multiline=function(y,v){v.parent&&y._output.just_added_newline()&&!((v.is_inline_element||v.is_unformatted)&&v.parent.is_inline_element)&&(v.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(y){var v=null;if(y.is_empty_element||!y.is_start_tag||!y.parent)return;if(y.tag_name==="body")v=v||this._tag_stack.try_pop("head");else if(y.tag_name==="li")v=v||this._tag_stack.try_pop("li",["ol","ul"]);else if(y.tag_name==="dd"||y.tag_name==="dt")v=v||this._tag_stack.try_pop("dt",["dl"]),v=v||this._tag_stack.try_pop("dd",["dl"]);else if(y.parent.tag_name==="p"&&u.indexOf(y.tag_name)!==-1){var E=y.parent.parent;(!E||d.indexOf(E.tag_name)===-1)&&(v=v||this._tag_stack.try_pop("p"))}else y.tag_name==="rp"||y.tag_name==="rt"?(v=v||this._tag_stack.try_pop("rt",["ruby","rtc"]),v=v||this._tag_stack.try_pop("rp",["ruby","rtc"])):y.tag_name==="optgroup"?v=v||this._tag_stack.try_pop("optgroup",["select"]):y.tag_name==="option"?v=v||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):y.tag_name==="colgroup"?v=v||this._tag_stack.try_pop("caption",["table"]):y.tag_name==="thead"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"])):y.tag_name==="tbody"||y.tag_name==="tfoot"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("thead",["table"]),v=v||this._tag_stack.try_pop("tbody",["table"])):y.tag_name==="tr"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(y.tag_name==="th"||y.tag_name==="td")&&(v=v||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),v=v||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return y.parent=this._tag_stack.get_parser_token(),v},m.exports.Beautifier=b},function(m,g,h){var o=h(6).Options;function l(a){o.call(this,a,"html"),this.templating.length===1&&this.templating[0]==="auto"&&(this.templating=["django","erb","handlebars","php"]),this.indent_inner_html=this._get_boolean("indent_inner_html"),this.indent_body_inner_html=this._get_boolean("indent_body_inner_html",!0),this.indent_head_inner_html=this._get_boolean("indent_head_inner_html",!0),this.indent_handlebars=this._get_boolean("indent_handlebars",!0),this.wrap_attributes=this._get_selection("wrap_attributes",["auto","force","force-aligned","force-expand-multiline","aligned-multiple","preserve","preserve-aligned"]),this.wrap_attributes_indent_size=this._get_number("wrap_attributes_indent_size",this.indent_size),this.extra_liners=this._get_array("extra_liners",["head","body","/html"]),this.inline=this._get_array("inline",["a","abbr","area","audio","b","bdi","bdo","br","button","canvas","cite","code","data","datalist","del","dfn","em","embed","i","iframe","img","input","ins","kbd","keygen","label","map","mark","math","meter","noscript","object","output","progress","q","ruby","s","samp","select","small","span","strong","sub","sup","svg","template","textarea","time","u","var","video","wbr","text","acronym","big","strike","tt"]),this.void_elements=this._get_array("void_elements",["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr","!doctype","?xml","basefont","isindex"]),this.unformatted=this._get_array("unformatted",[]),this.content_unformatted=this._get_array("content_unformatted",["pre","textarea"]),this.unformatted_content_delimiter=this._get_characters("unformatted_content_delimiter"),this.indent_scripts=this._get_selection("indent_scripts",["normal","keep","separate"])}l.prototype=new o,m.exports.Options=l},function(m,g,h){var o=h(9).Tokenizer,l=h(9).TOKEN,a=h(13).Directives,r=h(14).TemplatablePattern,t=h(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},f=new a(/<\!--/,/-->/),S=function(C,T){o.call(this,C,T),this._current_tag_name="";var O=new r(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)}};S.prototype=new o,S.prototype._is_comment=function(C){return!1},S.prototype._is_opening=function(C){return C.type===c.TAG_OPEN},S.prototype._is_closing=function(C,T){return C.type===c.TAG_CLOSE&&T&&((C.text===">"||C.text==="/>")&&T.text[0]==="<"||C.text==="}}"&&T.text[0]==="{"&&T.text[1]==="{")},S.prototype._reset=function(){this._current_tag_name=""},S.prototype._get_next_token=function(C,T){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,T),O=O||this._read_attribute(R,C,T),O=O||this._read_close(R,T),O=O||this._read_raw_content(R,C,T),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,T),O=O||this._create_token(c.UNKNOWN,this._input.next()),O)},S.prototype._read_comment_or_cdata=function(C){var T=null,O=null,R=null;if(C==="<"){var b=this._input.peek(1);b==="!"&&(O=this.__patterns.comment.read(),O?(R=f.get_directives(O),R&&R.ignore==="start"&&(O+=f.readIgnored(this._input))):O=this.__patterns.cdata.read()),O&&(T=this._create_token(c.COMMENT,O),T.directives=R)}return T},S.prototype._read_processing=function(C){var T=null,O=null,R=null;if(C==="<"){var b=this._input.peek(1);(b==="!"||b==="?")&&(O=this.__patterns.conditional_comment.read(),O=O||this.__patterns.processing.read()),O&&(T=this._create_token(c.COMMENT,O),T.directives=R)}return T},S.prototype._read_open=function(C,T){var O=null,R=null;return T||C==="<"&&(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},S.prototype._read_open_handlebars=function(C,T){var O=null,R=null;return T||this._options.indent_handlebars&&C==="{"&&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},S.prototype._read_close=function(C,T){var O=null,R=null;return T&&(T.text[0]==="<"&&(C===">"||C==="/"&&this._input.peek(1)===">")?(O=this._input.next(),C==="/"&&(O+=this._input.next()),R=this._create_token(c.TAG_CLOSE,O)):T.text[0]==="{"&&C==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),R=this._create_token(c.TAG_CLOSE,"}}"))),R},S.prototype._read_attribute=function(C,T,O){var R=null,b="";if(O&&O.text[0]==="<")if(C==="=")R=this._create_token(c.EQUALS,this._input.next());else if(C==='"'||C==="'"){var _=this._input.next();C==='"'?_+=this.__patterns.double_quote.read():_+=this.__patterns.single_quote.read(),R=this._create_token(c.VALUE,_)}else b=this.__patterns.attribute.read(),b&&(T.type===c.EQUALS?R=this._create_token(c.VALUE,b):R=this._create_token(c.ATTRIBUTE,b));return R},S.prototype._is_content_unformatted=function(C){return this._options.void_elements.indexOf(C)===-1&&(this._options.content_unformatted.indexOf(C)!==-1||this._options.unformatted.indexOf(C)!==-1)},S.prototype._read_raw_content=function(C,T,O){var R="";if(O&&O.text[0]==="{")R=this.__patterns.handlebars_raw_close.read();else if(T.type===c.TAG_CLOSE&&T.opened.text[0]==="<"&&T.text[0]!=="/"){var b=T.opened.text.substr(1).toLowerCase();if(b==="script"||b==="style"){var _=this._read_comment_or_cdata(C);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},S.prototype._read_content_word=function(C){var T="";if(this._options.unformatted_content_delimiter&&(C===this._options.unformatted_content_delimiter[0]&&(T=this.__patterns.unformatted_content_delimiter.read())),T||(T=this.__patterns.word.read()),T)return this._create_token(c.TEXT,T)},m.exports.Tokenizer=S,m.exports.TOKEN=c}],G={};function L(m){var g=G[m];if(g!==void 0)return g.exports;var h=G[m]={exports:{}};return z[m](h,h.exports,L),h.exports}var D=L(18);k=D})();var Q=k;if(!0)!(ee=[K,K("6UM0"),K("TXwP")],$=function(z){var G=K("6UM0"),L=K("TXwP");return{html_beautify:function(D,m){return Q(D,m,G.js_beautify,L.css_beautify)}}}.apply(Ze,ee),$!==void 0&&(Rt.exports=$));else var B,I})()},"rAM+":function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return $});var ee=K("Qw5x");function $(k,Q){var B;if(typeof Symbol=="undefined"||k[Symbol.iterator]==null){if(Array.isArray(k)||(B=Object(ee.a)(k))||Q&&k&&typeof k.length=="number"){B&&(k=B);var I=0,z=function(){};return{s:z,n:function(){return I>=k.length?{done:!0}:{done:!1,value:k[I++]}},e:function(g){throw g},f:z}}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 G=!0,L=!1,D;return{s:function(){B=k[Symbol.iterator]()},n:function(){var g=B.next();return G=g.done,g},e:function(g){L=!0,D=g},f:function(){try{!G&&B.return!=null&&B.return()}finally{if(L)throw D}}}}},rUJ1:function(Rt,Ze){const K=/[&<>"']/,ee=/[&<>"']/g,$=/[<>"']|&(?!#?\w+;)/,k=/[<>"']|&(?!#?\w+;)/g,Q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},B=R=>Q[R];function I(R,b){if(b){if(K.test(R))return R.replace(ee,B)}else if($.test(R))return R.replace(k,B);return R}const z=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function G(R){return R.replace(z,(b,_)=>(_=_.toLowerCase(),_==="colon"?":":_.charAt(0)==="#"?_.charAt(1)==="x"?String.fromCharCode(parseInt(_.substring(2),16)):String.fromCharCode(+_.substring(1)):""))}const L=/(^|[^\[])\^/g;function D(R,b){R=R.source||R,b=b||"";const _={replace:(u,d)=>(d=d.source||d,d=d.replace(L,"$1"),R=R.replace(u,d),_),getRegex:()=>new RegExp(R,b)};return _}const m=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function h(R,b,_){if(R){let u;try{u=decodeURIComponent(G(_)).replace(m,"").toLowerCase()}catch(d){return null}if(u.indexOf("javascript:")===0||u.indexOf("vbscript:")===0||u.indexOf("data:")===0)return null}b&&!g.test(_)&&(_=t(b,_));try{_=encodeURI(_).replace(/%25/g,"%")}catch(u){return null}return _}const o={},l=/^[^:]+:\/*[^/]*$/,a=/^([^:]+:)[\s\S]*$/,r=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(R,b){o[" "+R]||(l.test(R)?o[" "+R]=R+"/":o[" "+R]=C(R,"/",!0)),R=o[" "+R];const _=R.indexOf(":")===-1;return b.substring(0,2)==="//"?_?b:R.replace(a,"$1")+b:b.charAt(0)==="/"?_?b:R.replace(r,"$1")+b:R+b}const c={exec:function(){}};function f(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 S(R,b){const _=R.replace(/\|/g,(y,v,E)=>{let M=!1,N=v;for(;--N>=0&&E[N]==="\\";)M=!M;return M?"|":" |"}),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 C(R,b,_){const u=R.length;if(u===0)return"";let d=0;for(;d<u;){const y=R.charAt(u-d-1);if(y===b&&!_)d++;else if(y!==b&&_)d++;else break}return R.substr(0,u-d)}function T(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")}Rt.exports={escape:I,unescape:G,edit:D,cleanUrl:h,resolveUrl:t,noopTest:c,merge:f,splitCells:S,rtrim:C,findClosingBracket:T,checkSanitizeDeprecation:O}},sR1s:function(Rt,Ze,K){"use strict";K.d(Ze,"b",function(){return Q}),K.d(Ze,"a",function(){return B}),K.d(Ze,"c",function(){return I}),K.d(Ze,"d",function(){return z});var ee=K("U8pU"),$="RC_TABLE_KEY";function k(G){return G==null?[]:Array.isArray(G)?G:[G]}function Q(G,L){if(!L&&typeof L!="number")return G;for(var D=k(L),m=G,g=0;g<D.length;g+=1){if(!m)return null;var h=D[g];m=m[h]}return m}function B(G){var L=[],D={};return G.forEach(function(m){for(var g=m||{},h=g.key,o=g.dataIndex,l=h||k(o).join("-")||$;D[l];)l="".concat(l,"_next");D[l]=!0,L.push(l)}),L}function I(){var G={};function L(h,o){o&&Object.keys(o).forEach(function(l){var a=o[l];a&&Object(ee.a)(a)==="object"?(h[l]=h[l]||{},L(h[l],a)):h[l]=a})}for(var D=arguments.length,m=new Array(D),g=0;g<D;g++)m[g]=arguments[g];return m.forEach(function(h){L(G,h)}),G}function z(G){return G!=null}},sZF6:function(Rt,Ze,K){"use strict";var ee=K("2qtc"),$=K("kLXV"),k=K("DZo9"),Q=K("8z0m"),B=K("+L6B"),I=K("2/Rp"),z=K("tJVT"),G=K("cDcd"),L=K.n(G),D=K("xvlK"),m=K("m3rI"),g=K("1vsH"),h=K("Ty5D"),o=K("69hG"),l=K.n(o),a=function(t){var c=t.visible,f=t.onOk,S=t.onCancel,C=Object(G.useState)([]),T=Object(z.a)(C,2),O=T[0],R=T[1],b=Object(G.useState)(!1),_=Object(z.a)(b,2),u=_[0],d=_[1],y=Object(h.i)();Object(G.useEffect)(function(){c||(R([]),d(!1))},[c]);var v=function(){d(!0),f(O,function(){d(!1)})},E=function(){S()},M=function(){console.log(y,444);var P="".concat(m.a.API_SERVER,"/api/courses/").concat(y.coursesId,"/exercises/down_template");Object(g.x)(null,P)},N=function(P){var x={name:P.name,uid:P.uid,file:P};return R([x]),!1},j=function(){R([])};return L.a.createElement($.a,{title:"\u6279\u91CF\u5BFC\u5165\u8BD5\u9898",visible:c,onOk:v,centered:!0,wrapClassName:l.a.customModal,onCancel:E,width:"680px",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",confirmLoading:u},L.a.createElement("div",{className:l.a.content},L.a.createElement("aside",null,L.a.createElement("div",null,"\u6B65\u9AA41\uFF1A"),L.a.createElement("ul",null,L.a.createElement("li",null,"\u4E0B\u8F7D\xA0",L.a.createElement("span",{style:{color:"#0152d9",cursor:"pointer"},onClick:M},"\u8003\u8BD5\u8BD5\u9898\u6A21\u677F"),",\xA0\u6279\u91CF\u5BFC\u5165\u8BD5\u9898\u3002"),L.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"))),L.a.createElement("aside",{className:"mt30"},L.a.createElement("div",null,"\u6B65\u9AA42\uFF1A"),L.a.createElement("ul",{style:{flex:1}},L.a.createElement("li",null,"\u4E0A\u4F20\u586B\u5199\u597D\u7684\u8BD5\u9898\u8868"),c&&L.a.createElement(Q.a,{action:"".concat(m.a.API_SERVER,"/api/attachments.json"),beforeUpload:N,onRemove:j,withCredentials:!0,fileList:O,accept:".xls,.xlsx"},L.a.createElement(I.a,{className:l.a.upload,type:"primary",icon:L.a.createElement(D.a,null)},"\u9009\u62E9\u6587\u4EF6"))))))};Ze.a=a},sboe:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return k});var ee=K("cDcd"),$=K.n(ee),k=ee.createContext(null)},t23M:function(Rt,Ze,K){"use strict";var ee=K("VTBJ"),$=K("1OyB"),k=K("vuIU"),Q=K("Ji7U"),B=K("LK+K"),I=K("cDcd"),z=K.n(I),G=K("m+aA"),L=K("Zm9Q"),D=K("Kwbf"),m=K("c+Xe"),g=K("bdgK"),h="rc-observer-key",o=function(l){Object(Q.a)(r,l);var a=Object(B.a)(r);function r(){var t;return Object($.a)(this,r),t=a.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 f=t.props.onResize,S=c[0].target,C=S.getBoundingClientRect(),T=C.width,O=C.height,R=S.offsetWidth,b=S.offsetHeight,_=Math.floor(T),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),f&&Promise.resolve().then(function(){f(Object(ee.a)(Object(ee.a)({},d),{},{offsetWidth:R,offsetHeight:b}))})}},t.setChildNode=function(c){t.childNode=c},t}return Object(k.a)(r,[{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 f=Object(G.a)(this.childNode||this),S=f!==this.currentElement;S&&(this.destroyObserver(),this.currentElement=f),!this.resizeObserver&&f&&(this.resizeObserver=new g.default(this.onResize),this.resizeObserver.observe(f))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var c=this.props.children,f=Object(L.a)(c);if(f.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(f.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var S=f[0];if(I.isValidElement(S)&&Object(m.c)(S)){var C=S.ref;f[0]=I.cloneElement(S,{ref:Object(m.a)(C,this.setChildNode)})}return f.length===1?f[0]:f.map(function(T,O){return!I.isValidElement(T)||"key"in T&&T.key!==null?T:I.cloneElement(T,{key:"".concat(h,"-").concat(O)})})}}]),r}(I.Component);o.displayName="ResizeObserver",Ze.a=o},u2Z1:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return C});var ee=K("miYZ"),$=K("tsqr"),k=K("9og8"),Q=K("5NDa"),B=K("5rEg"),I=K("2qtc"),z=K("kLXV"),G=K("oBTY"),L=K("tJVT"),D=K("OaEy"),m=K("2fM7"),g=K("WmNS"),h=K.n(g),o=K("cDcd"),l=K.n(o),a=K("ErOA"),r=K("i58Z"),t=K.n(r),c=K("T1X5"),f=K.n(c),S=m.a.Option,C=function(O){var R=O.subId,b=O.value,_=O.selectvalues,u=O.disabled,d=O.knowledgeOptions,y=d===void 0?[]:d,v=O.onChange,E=v===void 0?function(){}:v,M=O.onAddKnowledgeFinish,N=M===void 0?function(){}:M,j=Object(o.useRef)(),H=Object(o.useState)([]),P=Object(L.a)(H,2),x=P[0],U=P[1];b=b||[];var V=function(se,ve){se?(U([ve.key]),E([ve.key])):(U([]),E([]))};Object(o.useEffect)(function(){(_==null?void 0:_.length)>0&&(U(Object(G.a)(_)),E(Object(G.a)(_)))},[y]),Object(o.useEffect)(function(){var ie;((ie=b)===null||ie===void 0?void 0:ie.length)>0&&E(Object(G.a)(b))},[y]);var q=function(se){se.preventDefault(),j.current="",z.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:f.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(B.a,{className:"mt5",maxLength:20,style:{marginBottom:"42px"},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0",defaultValue:j.current,onChange:function(Te){j.current=Te.target.value}})),onOk:function(){return new Promise(function(){var Te=Object(k.a)(h.a.mark(function fe(_e,ue){var xe,Y;return h.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:if(j.current){ce.next=3;break}return $.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),ce.abrupt("return",ue());case 3:if(!(j.current.length>20)){ce.next=6;break}return $.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),ce.abrupt("return",ue());case 6:return ce.next=8,Object(a.a)("/api/tag_disciplines.json",{method:"post",body:{name:j.current,sub_discipline_id:R}});case 8:return xe=ce.sent,(xe==null?void 0:xe.status)===0&&(N({id:xe.tag_discipline_id,name:j.current,type:"personal"}),Y=[],Y.push(xe.tag_discipline_id),E([].concat(Y)),U([xe.tag_discipline_id]),E([].concat(Y))),ce.abrupt("return",_e());case 11:case"end":return ce.stop()}},fe)}));return function(fe,_e){return Te.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:V,showSearch:!0,allowClear:!0,value:y==null?void 0:y.filter(function(ie){return(x==null?void 0:x.includes(ie==null?void 0:ie.id))||(x==null?void 0:x.includes((ie==null?void 0:ie.id)+""))}).map(function(ie){return ie.name})},y==null?void 0:y.map(function(ie){return l.a.createElement(S,{key:ie.id,value:ie.name},l.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},l.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},ie.name),l.a.createElement("span",null,ie.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),l.a.createElement("button",{disabled:!R,className:"".concat(t.a.addKnowledge," ").concat(R?"":t.a.disabled),onClick:q},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uK0f:function(Rt,Ze,K){(function(ee,$){Rt.exports=$()})(this,function(){"use strict";function ee($,k,Q){Q=Q||{},Q.childrenKeyName=Q.childrenKeyName||"children";var B=$||[],I=[],z=0;do{var G=B.filter(function(L){return k(L,z)})[0];if(!G)break;I.push(G),B=G[Q.childrenKeyName]||[],z+=1}while(B.length>0);return I}return ee})},ulZh:function(Rt,Ze,K){typeof window!="undefined"&&function($,k){Rt.exports=k()}(this,function(){return function(ee){var $={};function k(Q){if($[Q])return $[Q].exports;var B=$[Q]={i:Q,l:!1,exports:{}};return ee[Q].call(B.exports,B,B.exports,k),B.l=!0,B.exports}return k.m=ee,k.c=$,k.d=function(Q,B,I){k.o(Q,B)||Object.defineProperty(Q,B,{enumerable:!0,get:I})},k.r=function(Q){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(Q,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(Q,"__esModule",{value:!0})},k.t=function(Q,B){if(B&1&&(Q=k(Q)),B&8)return Q;if(B&4&&typeof Q=="object"&&Q&&Q.__esModule)return Q;var I=Object.create(null);if(k.r(I),Object.defineProperty(I,"default",{enumerable:!0,value:Q}),B&2&&typeof Q!="string")for(var z in Q)k.d(I,z,function(G){return Q[G]}.bind(null,z));return I},k.n=function(Q){var B=Q&&Q.__esModule?function(){return Q.default}:function(){return Q};return k.d(B,"a",B),B},k.o=function(Q,B){return Object.prototype.hasOwnProperty.call(Q,B)},k.p="/dist/",k(k.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(ee,$,k){"use strict";var Q=Object.prototype.hasOwnProperty,B="~";function I(){}Object.create&&(I.prototype=Object.create(null),new I().__proto__||(B=!1));function z(m,g,h){this.fn=m,this.context=g,this.once=h||!1}function G(m,g,h,o,l){if(typeof h!="function")throw new TypeError("The listener must be a function");var a=new z(h,o||m,l),r=B?B+g:g;return m._events[r]?m._events[r].fn?m._events[r]=[m._events[r],a]:m._events[r].push(a):(m._events[r]=a,m._eventsCount++),m}function L(m,g){--m._eventsCount===0?m._events=new I:delete m._events[g]}function D(){this._events=new I,this._eventsCount=0}D.prototype.eventNames=function(){var g=[],h,o;if(this._eventsCount===0)return g;for(o in h=this._events)Q.call(h,o)&&g.push(B?o.slice(1):o);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(h)):g},D.prototype.listeners=function(g){var h=B?B+g:g,o=this._events[h];if(!o)return[];if(o.fn)return[o.fn];for(var l=0,a=o.length,r=new Array(a);l<a;l++)r[l]=o[l].fn;return r},D.prototype.listenerCount=function(g){var h=B?B+g:g,o=this._events[h];return o?o.fn?1:o.length:0},D.prototype.emit=function(g,h,o,l,a,r){var t=B?B+g:g;if(!this._events[t])return!1;var c=this._events[t],f=arguments.length,S,C;if(c.fn){c.once&&this.removeListener(g,c.fn,void 0,!0);switch(f){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,h),!0;case 3:return c.fn.call(c.context,h,o),!0;case 4:return c.fn.call(c.context,h,o,l),!0;case 5:return c.fn.call(c.context,h,o,l,a),!0;case 6:return c.fn.call(c.context,h,o,l,a,r),!0}for(C=1,S=new Array(f-1);C<f;C++)S[C-1]=arguments[C];c.fn.apply(c.context,S)}else{var T=c.length,O;for(C=0;C<T;C++){c[C].once&&this.removeListener(g,c[C].fn,void 0,!0);switch(f){case 1:c[C].fn.call(c[C].context);break;case 2:c[C].fn.call(c[C].context,h);break;case 3:c[C].fn.call(c[C].context,h,o);break;case 4:c[C].fn.call(c[C].context,h,o,l);break;default:if(!S)for(O=1,S=new Array(f-1);O<f;O++)S[O-1]=arguments[O];c[C].fn.apply(c[C].context,S)}}}return!0},D.prototype.on=function(g,h,o){return G(this,g,h,o,!1)},D.prototype.once=function(g,h,o){return G(this,g,h,o,!0)},D.prototype.removeListener=function(g,h,o,l){var a=B?B+g:g;if(!this._events[a])return this;if(!h)return L(this,a),this;var r=this._events[a];if(r.fn)r.fn===h&&(!l||r.once)&&(!o||r.context===o)&&L(this,a);else{for(var t=0,c=[],f=r.length;t<f;t++)(r[t].fn!==h||l&&!r[t].once||o&&r[t].context!==o)&&c.push(r[t]);c.length?this._events[a]=c.length===1?c[0]:c:L(this,a)}return this},D.prototype.removeAllListeners=function(g){var h;return g?(h=B?B+g:g,this._events[h]&&L(this,h)):(this._events=new I,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=B,D.EventEmitter=D,ee.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(ee,$,k){(function(Q){var B=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,I=/^([^\/?#]*)([^]*)$/,z=/(?:\/|^)\.(?=\/)/g,G=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,L={buildAbsoluteURL:function(D,m,g){if(g=g||{},D=D.trim(),m=m.trim(),!m){if(!g.alwaysNormalize)return D;var h=L.parseURL(D);if(!h)throw new Error("Error trying to parse base URL.");return h.path=L.normalizePath(h.path),L.buildURLFromParts(h)}var o=L.parseURL(m);if(!o)throw new Error("Error trying to parse relative URL.");if(o.scheme)return g.alwaysNormalize?(o.path=L.normalizePath(o.path),L.buildURLFromParts(o)):m;var l=L.parseURL(D);if(!l)throw new Error("Error trying to parse base URL.");if(!l.netLoc&&l.path&&l.path[0]!=="/"){var a=I.exec(l.path);l.netLoc=a[1],l.path=a[2]}l.netLoc&&!l.path&&(l.path="/");var r={scheme:l.scheme,netLoc:o.netLoc,path:null,params:o.params,query:o.query,fragment:o.fragment};if(!o.netLoc&&(r.netLoc=l.netLoc,o.path[0]!=="/"))if(!o.path)r.path=l.path,o.params||(r.params=l.params,o.query||(r.query=l.query));else{var t=l.path,c=t.substring(0,t.lastIndexOf("/")+1)+o.path;r.path=L.normalizePath(c)}return r.path===null&&(r.path=g.alwaysNormalize?L.normalizePath(o.path):o.path),L.buildURLFromParts(r)},parseURL:function(D){var m=B.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(z,"");D.length!==(D=D.replace(G,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};ee.exports=L})(this)},"./node_modules/webworkify-webpack/index.js":function(ee,$,k){function Q(g){var h={};function o(a){if(h[a])return h[a].exports;var r=h[a]={i:a,l:!1,exports:{}};return g[a].call(r.exports,r,r.exports,o),r.l=!0,r.exports}o.m=g,o.c=h,o.i=function(a){return a},o.d=function(a,r,t){o.o(a,r)||Object.defineProperty(a,r,{configurable:!1,enumerable:!0,get:t})},o.r=function(a){Object.defineProperty(a,"__esModule",{value:!0})},o.n=function(a){var r=a&&a.__esModule?function(){return a.default}:function(){return a};return o.d(r,"a",r),r},o.o=function(a,r){return Object.prototype.hasOwnProperty.call(a,r)},o.p="/",o.oe=function(a){throw console.error(a),a};var l=o(o.s=ENTRY_MODULE);return l.default||l}var B="[\\.|\\-|\\+|\\w|/|@]+",I="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+B+").*?\\)";function z(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function G(g){return!isNaN(1*g)}function L(g,h,o){var l={};l[o]=[];var a=h.toString(),r=a.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!r)return l;for(var t=r[1],c=new RegExp("(\\\\n|\\W)"+z(t)+I,"g"),f;f=c.exec(a);){if(f[3]==="dll-reference")continue;l[o].push(f[3])}for(c=new RegExp("\\("+z(t)+'\\("(dll-reference\\s('+B+'))"\\)\\)'+I,"g");f=c.exec(a);)g[f[2]]||(l[o].push(f[1]),g[f[2]]=k(f[1]).m),l[f[2]]=l[f[2]]||[],l[f[2]].push(f[4]);for(var S=Object.keys(l),C=0;C<S.length;C++)for(var T=0;T<l[S[C]].length;T++)G(l[S[C]][T])&&(l[S[C]][T]=1*l[S[C]][T]);return l}function D(g){var h=Object.keys(g);return h.reduce(function(o,l){return o||g[l].length>0},!1)}function m(g,h){for(var o={main:[h]},l={main:[]},a={main:{}};D(o);)for(var r=Object.keys(o),t=0;t<r.length;t++){var c=r[t],f=o[c],S=f.pop();if(a[c]=a[c]||{},a[c][S]||!g[c][S])continue;a[c][S]=!0,l[c]=l[c]||[],l[c].push(S);for(var C=L(g,g[c][S],c),T=Object.keys(C),O=0;O<T.length;O++)o[T[O]]=o[T[O]]||[],o[T[O]]=o[T[O]].concat(C[T[O]])}return l}ee.exports=function(g,h){h=h||{};var o={main:k.m},l=h.all?{main:Object.keys(o.main)}:m(o,g),a="";Object.keys(l).filter(function(S){return S!=="main"}).forEach(function(S){for(var C=0;l[S][C];)C++;l[S].push(C),o[S][C]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",a=a+"var "+S+" = ("+Q.toString().replace("ENTRY_MODULE",JSON.stringify(C))+")({"+l[S].map(function(T){return""+JSON.stringify(T)+": "+o[S][T].toString()}).join(",")+`});
`}),a=a+"new (("+Q.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+l.main.map(function(S){return""+JSON.stringify(S)+": "+o.main[S].toString()}).join(",")+"}))(self);";var r=new window.Blob([a],{type:"text/javascript"});if(h.bare)return r;var t=window.URL||window.webkitURL||window.mozURL||window.msURL,c=t.createObjectURL(r),f=new window.Worker(c);return f.objectURL=c,f}},"./src/config.ts":function(ee,$,k){"use strict";k.r($),k.d($,"hlsDefaultConfig",function(){return O}),k.d($,"mergeConfig",function(){return b}),k.d($,"enableStreamingMode",function(){return _});var Q=k("./src/controller/abr-controller.ts"),B=k("./src/controller/audio-stream-controller.ts"),I=k("./src/controller/audio-track-controller.ts"),z=k("./src/controller/subtitle-stream-controller.ts"),G=k("./src/controller/subtitle-track-controller.ts"),L=k("./src/controller/buffer-controller.ts"),D=k("./src/controller/timeline-controller.ts"),m=k("./src/controller/cap-level-controller.ts"),g=k("./src/controller/fps-controller.ts"),h=k("./src/controller/eme-controller.ts"),o=k("./src/controller/cmcd-controller.ts"),l=k("./src/utils/xhr-loader.ts"),a=k("./src/utils/fetch-loader.ts"),r=k("./src/utils/cues.ts"),t=k("./src/utils/mediakeys-helper.ts"),c=k("./src/utils/logger.ts");function f(){return f=Object.assign||function(u){for(var d=1;d<arguments.length;d++){var y=arguments[d];for(var v in y)Object.prototype.hasOwnProperty.call(y,v)&&(u[v]=y[v])}return u},f.apply(this,arguments)}function S(u,d){var y=Object.keys(u);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(u);d&&(v=v.filter(function(E){return Object.getOwnPropertyDescriptor(u,E).enumerable})),y.push.apply(y,v)}return y}function C(u){for(var d=1;d<arguments.length;d++){var y=arguments[d]!=null?arguments[d]:{};d%2?S(Object(y),!0).forEach(function(v){T(u,v,y[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(u,Object.getOwnPropertyDescriptors(y)):S(Object(y)).forEach(function(v){Object.defineProperty(u,v,Object.getOwnPropertyDescriptor(y,v))})}return u}function T(u,d,y){return d in u?Object.defineProperty(u,d,{value:y,enumerable:!0,configurable:!0,writable:!0}):u[d]=y,u}var O=C(C({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:l.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:Q.default,bufferController:L.default,capLevelController:m.default,fpsController:g.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:z.SubtitleStreamController,subtitleTrackController:G.default,timelineController:D.TimelineController,audioStreamController:B.default,audioTrackController:I.default,emeController:h.default,cmcdController:o.default});function R(){return{cueHandler:r.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 f({},u,d)}function _(u){var d=u.loader;if(d!==a.default&&d!==l.default)c.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),u.progressive=!1;else{var y=Object(a.fetchSupported)();y&&(u.loader=a.default,u.progressive=!0,u.enableSoftwareAES=!0,c.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/polyfills/number.ts"),B=k("./src/utils/ewma-bandwidth-estimator.ts"),I=k("./src/events.ts"),z=k("./src/utils/buffer-helper.ts"),G=k("./src/errors.ts"),L=k("./src/types/loader.ts"),D=k("./src/utils/logger.ts");function m(o,l){for(var a=0;a<l.length;a++){var r=l[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,r.key,r)}}function g(o,l,a){return l&&m(o.prototype,l),a&&m(o,a),o}var h=function(){function o(a){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=a;var r=a.config;this.bwEstimator=new B.default(r.abrEwmaSlowVoD,r.abrEwmaFastVoD,r.abrEwmaDefaultEstimate),this.registerListeners()}var l=o.prototype;return l.registerListeners=function(){var r=this.hls;r.on(I.Events.FRAG_LOADING,this.onFragLoading,this),r.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(I.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.on(I.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var r=this.hls;r.off(I.Events.FRAG_LOADING,this.onFragLoading,this),r.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),r.off(I.Events.FRAG_BUFFERED,this.onFragBuffered,this),r.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),r.off(I.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(r,t){var c=t.frag;if(c.type===L.PlaylistLevelType.MAIN&&!this.timer){var f;this.fragCurrent=c,this.partCurrent=(f=t.part)!=null?f:null,this.timer=self.setInterval(this.onCheck,100)}},l.onLevelLoaded=function(r,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 r=this.fragCurrent,t=this.partCurrent,c=this.hls,f=c.autoLevelEnabled,S=c.config,C=c.media;if(!r||!C)return;var T=t?t.stats:r.stats,O=t?t.duration:r.duration;if(T.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!f||C.paused||!C.playbackRate||!C.readyState)return;var R=performance.now()-T.loading.start,b=Math.abs(C.playbackRate);if(R<=500*O/b)return;var _=c.levels,u=c.minAutoLevel,d=_[r.level],y=T.total||Math.max(T.loaded,Math.round(O*d.maxBitrate/8)),v=Math.max(1,T.bwEstimate?T.bwEstimate/8:T.loaded*1e3/R),E=(y-T.loaded)/v,M=C.currentTime,N=(z.BufferHelper.bufferInfo(C,M,S.maxBufferHole).end-M)/b;if(N>=2*O/b||E<=N)return;var j=Number.POSITIVE_INFINITY,H;for(H=r.level-1;H>u;H--){var P=_[H].maxBitrate;if(j=O*P/(8*.8*v),j<N)break}if(j>=E)return;var x=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+r.sn+(t?" part "+t.index:"")+" of level "+r.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+H+`
Current BW estimate: `+(Object(Q.isFiniteNumber)(x)?(x/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+E.toFixed(3)+` s
Estimated load time for the next fragment: `+j.toFixed(3)+` s
Time to underbuffer: `+N.toFixed(3)+" s"),c.nextLoadLevel=H,this.bwEstimator.sample(R,T.loaded),this.clearTimer(),r.loader&&(this.fragCurrent=this.partCurrent=null,r.loader.abort()),c.trigger(I.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:r,part:t,stats:T})},l.onFragLoaded=function(r,t){var c=t.frag,f=t.part;if(c.type===L.PlaylistLevelType.MAIN&&Object(Q.isFiniteNumber)(c.sn)){var S=f?f.stats:c.stats,C=f?f.duration:c.duration;if(this.clearTimer(),this.lastLoadedFragLevel=c.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var T=this.hls.levels[c.level],O=(T.loaded?T.loaded.bytes:0)+S.loaded,R=(T.loaded?T.loaded.duration:0)+C;T.loaded={bytes:O,duration:R},T.realBitrate=Math.round(8*O/R)}if(c.bitrateTest){var b={stats:S,frag:c,part:f,id:c.type};this.onFragBuffered(I.Events.FRAG_BUFFERED,b),c.bitrateTest=!1}}},l.onFragBuffered=function(r,t){var c=t.frag,f=t.part,S=f?f.stats:c.stats;if(S.aborted)return;if(c.type!==L.PlaylistLevelType.MAIN||c.sn==="initSegment")return;var C=S.parsing.end-S.loading.start;this.bwEstimator.sample(C,S.loaded),S.bwEstimate=this.bwEstimator.getEstimate(),c.bitrateTest?this.bitrateTestDelay=C/1e3:this.bitrateTestDelay=0},l.onError=function(r,t){switch(t.details){case G.ErrorDetails.FRAG_LOAD_ERROR:case G.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var r=this.fragCurrent,t=this.partCurrent,c=this.hls,f=c.maxAutoLevel,S=c.config,C=c.minAutoLevel,T=c.media,O=t?t.duration:r?r.duration:0,R=T?T.currentTime:0,b=T&&T.playbackRate!==0?Math.abs(T.playbackRate):1,_=this.bwEstimator?this.bwEstimator.getEstimate():S.abrEwmaDefaultEstimate,u=(z.BufferHelper.bufferInfo(T,R,S.maxBufferHole).end-R)/b,d=this.findBestLevel(_,C,f,u,S.abrBandWidthFactor,S.abrBandWidthUpFactor);if(d>=0)return d;D.logger.trace((u?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var y=O?Math.min(O,S.maxStarvationDelay):S.maxStarvationDelay,v=S.abrBandWidthFactor,E=S.abrBandWidthUpFactor;if(!u){var M=this.bitrateTestDelay;if(M){var N=O?Math.min(O,S.maxLoadingDelay):S.maxLoadingDelay;y=N-M,D.logger.trace("bitrate test took "+Math.round(1e3*M)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*y)+" ms"),v=E=1}}return d=this.findBestLevel(_,C,f,u+y,v,E),Math.max(d,0)},l.findBestLevel=function(r,t,c,f,S,C){for(var T,O=this.fragCurrent,R=this.partCurrent,b=this.lastLoadedFragLevel,_=this.hls.levels,u=_[b],d=!!(u!=null&&(T=u.details)!==null&&T!==void 0&&T.live),y=u==null?void 0:u.codecSet,v=R?R.duration:O?O.duration:0,E=c;E>=t;E--){var M=_[E];if(!M||y&&M.codecSet!==y)continue;var N=M.details,j=(R?N==null?void 0:N.partTarget:N==null?void 0:N.averagetargetduration)||v,H=void 0;E<=b?H=S*r:H=C*r;var P=_[E].maxBitrate,x=P*j/H;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+E+"/"+Math.round(H)+"/"+P+"/"+j+"/"+f+"/"+x),H>P&&(!x||d&&!this.bitrateTestDelay||x<f))return E}return-1},g(o,[{key:"nextAutoLevel",get:function(){var r=this._nextAutoLevel,t=this.bwEstimator;if(r!==-1&&(!t||!t.canEstimate()))return r;var c=this.getNextABRAutoLevel();return r!==-1&&(c=Math.min(r,c)),c},set:function(r){this._nextAutoLevel=r}}]),o}();$.default=h},"./src/controller/audio-stream-controller.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/polyfills/number.ts"),B=k("./src/controller/base-stream-controller.ts"),I=k("./src/events.ts"),z=k("./src/utils/buffer-helper.ts"),G=k("./src/controller/fragment-tracker.ts"),L=k("./src/types/level.ts"),D=k("./src/types/loader.ts"),m=k("./src/loader/fragment.ts"),g=k("./src/demux/chunk-cache.ts"),h=k("./src/demux/transmuxer-interface.ts"),o=k("./src/types/transmuxer.ts"),l=k("./src/controller/fragment-finders.ts"),a=k("./src/utils/discontinuities.ts"),r=k("./src/errors.ts"),t=k("./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 f(O,R){O.prototype=Object.create(R.prototype),O.prototype.constructor=O,S(O,R)}function S(O,R){return S=Object.setPrototypeOf||function(_,u){return _.__proto__=u,_},S(O,R)}var C=100,T=function(O){f(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(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(I.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.on(I.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.on(I.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.on(I.Events.ERROR,this.onError,this),u.on(I.Events.BUFFER_RESET,this.onBufferReset,this),u.on(I.Events.BUFFER_CREATED,this.onBufferCreated,this),u.on(I.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.on(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(I.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var u=this.hls;u.off(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),u.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(I.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),u.off(I.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),u.off(I.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),u.off(I.Events.ERROR,this.onError,this),u.off(I.Events.BUFFER_RESET,this.onBufferReset,this),u.off(I.Events.BUFFER_CREATED,this.onBufferCreated,this),u.off(I.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),u.off(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.off(I.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onInitPtsFound=function(u,d){var y=d.frag,v=d.id,E=d.initPTS;if(v==="main"){var M=y.cc;this.initPTS[y.cc]=E,this.log("InitPTS for cc: "+M+" found from main: "+E),this.videoTrackCC=M,this.state===B.State.WAITING_INIT_PTS&&this.tick()}},b.startLoad=function(u){if(!this.levels){this.startPosition=u,this.state=B.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(C),this.fragLoadError=0,d>0&&u===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=B.State.IDLE):(this.loadedmetadata=!1,this.state=B.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=u,this.tick()},b.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_TRACK:{var u,d=this.levels,y=this.trackId,v=d==null||((u=d[y])===null||u===void 0)?void 0:u.details;if(v){if(this.waitForCdnTuneIn(v))break;this.state=B.State.WAITING_INIT_PTS}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var E,M=performance.now(),N=this.retryDate;(!N||M>=N||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=B.State.IDLE);break}case B.State.WAITING_INIT_PTS:{var j=this.waitingData;if(j){var H=j.frag,P=j.part,x=j.cache,U=j.complete;if(this.initPTS[H.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=B.State.FRAG_LOADING;var V=x.flush(),q={frag:H,part:P,payload:V,networkDetails:null};this._handleFragmentLoadProgress(q),U&&O.prototype._handleFragmentLoadComplete.call(this,q)}else if(this.videoTrackCC!==this.waitingVideoCC)t.logger.log("Waiting fragment cc ("+H.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ie=this.getLoadPosition(),se=z.BufferHelper.bufferInfo(this.mediaBuffer,ie,this.config.maxBufferHole),ve=Object(l.fragmentWithinToleranceTest)(se.end,this.config.maxFragLookUpTolerance,H);ve<0&&(t.logger.log("Waiting fragment cc ("+H.cc+") @ "+H.start+" cancelled because another fragment at "+se.end+" is needed"),this.clearWaitingFragment())}}else this.state=B.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=B.State.IDLE)},b.onTickEnd=function(){var u=this.media;if(!u||!u.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:u,y=d.buffered;!this.loadedmetadata&&y.length&&(this.loadedmetadata=!0),this.lastCurrentTime=u.currentTime},b.doTickIdle=function(){var u,d,y=this.hls,v=this.levels,E=this.media,M=this.trackId,N=y.config;if(!v||!v[M])return;if(!E&&(this.startFragRequested||!N.startFragPrefetch))return;var j=v[M],H=j.details;if(!H||H.live&&this.levelLastLoaded!==M||this.waitForCdnTuneIn(H)){this.state=B.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,m.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(P===null)return;var x=P.len,U=this.getMaxBufferLength(),V=this.audioSwitch;if(x>=U&&!V)return;if(!V&&this._streamEnded(P,H)){y.trigger(I.Events.BUFFER_EOS,{type:"audio"}),this.state=B.State.ENDED;return}var q=H.fragments,ie=q[0].start,se=P.end;if(V){var ve=this.getLoadPosition();se=ve,H.PTSKnown&&ve<ie&&((P.end>ie||P.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),E.currentTime=ie+.05))}var Te=this.getNextFragment(se,H);if(!Te){this.bufferFlushed=!0;return}((u=Te.decryptdata)===null||u===void 0?void 0:u.keyFormat)==="identity"&&!((d=Te.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(Te,H):this.loadFragment(Te,H,se)},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 y=d.audioTracks;this.resetTransmuxer(),this.levels=y.map(function(v){return new L.Level(v)})},b.onAudioTrackSwitching=function(u,d){var y=!!d.url;this.trackId=d.id;var v=this.fragCurrent;v!=null&&v.loader&&v.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),y?this.setInterval(C):this.resetTransmuxer(),y?(this.audioSwitch=!0,this.state=B.State.IDLE):this.state=B.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 y,v=this.levels,E=d.details,M=d.id;if(!v){this.warn("Audio tracks were reset while loading level "+M);return}this.log("Track "+M+" loaded ["+E.startSN+","+E.endSN+"],duration:"+E.totalduration);var N=v[M],j=0;if(E.live||(y=N.details)!==null&&y!==void 0&&y.live){var H=this.mainDetails;if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed||!H)return;!N.details&&E.hasProgramDateTime&&H.hasProgramDateTime?(Object(a.alignMediaPlaylistByPDT)(E,H),j=E.fragments[0].start):j=this.alignPlaylists(E,N.details)}N.details=E,this.levelLastLoaded=M,!this.startFragRequested&&(this.mainDetails||!E.live)&&this.setStartPosition(N.details,j),this.state===B.State.WAITING_TRACK&&!this.waitForCdnTuneIn(E)&&(this.state=B.State.IDLE),this.tick()},b._handleFragmentLoadProgress=function(u){var d,y=u.frag,v=u.part,E=u.payload,M=this.config,N=this.trackId,j=this.levels;if(!j){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+y.sn+" of level "+y.level+" will not be buffered");return}var H=j[N];console.assert(H,"Audio track is defined on fragment load progress");var P=H.details;console.assert(P,"Audio track details are defined on fragment load progress");var x=M.defaultAudioCodec||H.audioCodec||"mp4a.40.2",U=this.transmuxer;U||(U=this.transmuxer=new h.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var V=this.initPTS[y.cc],q=(d=y.initSegment)===null||d===void 0?void 0:d.data;if(V!==void 0){var ie=!1,se=v?v.index:-1,ve=se!==-1,Te=new o.ChunkMetadata(y.level,y.sn,y.stats.chunkCount,E.byteLength,se,ve);U.push(E,q,x,"",y,v,P.totalduration,ie,Te,V)}else{t.logger.log("Unknown video PTS for cc "+y.cc+", waiting for video PTS before demuxing audio frag "+y.sn+" of ["+P.startSN+" ,"+P.endSN+"],track "+N);var fe=this.waitingData=this.waitingData||{frag:y,part:v,cache:new g.default,complete:!1},_e=fe.cache;_e.push(new Uint8Array(E)),this.waitingVideoCC=this.videoTrackCC,this.state=B.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 y=d.tracks.audio;y&&(this.mediaBuffer=y.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},b.onFragBuffered=function(u,d){var y=d.frag,v=d.part;if(y.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(y)){this.warn("Fragment "+y.sn+(v?" p: "+v.index:"")+" of level "+y.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}y.sn!=="initSegment"&&(this.fragPrevious=y,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(I.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(y,v)},b.onError=function(u,d){switch(d.details){case r.ErrorDetails.FRAG_LOAD_ERROR:case r.ErrorDetails.FRAG_LOAD_TIMEOUT:case r.ErrorDetails.KEY_LOAD_ERROR:case r.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,d);break;case r.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case r.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==B.State.ERROR&&this.state!==B.State.STOPPED&&(this.state=d.fatal?B.State.ERROR:B.State.IDLE,this.warn(d.details+" while loading frag, switching to "+this.state+" state"));break;case r.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="audio"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var y=!0,v=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);v&&v.len>.5&&(y=!this.reduceMaxBufferLength(v.len)),y&&(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 y=d.type;y===m.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},b._handleTransmuxComplete=function(u){var d,y="audio",v=this.hls,E=u.remuxResult,M=u.chunkMeta,N=this.getCurrentContext(M);if(!N){this.warn("The loading context changed while buffering fragment "+M.sn+" of level "+M.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(M.level);return}var j=N.frag,H=N.part,P=E.audio,x=E.text,U=E.id3,V=E.initSegment;if(this.fragContextChanged(j))return;if(this.state=B.State.PARSING,this.audioSwitch&&P&&this.completeAudioSwitch(),V!=null&&V.tracks&&(this._bufferInitSegment(V.tracks,j,M),v.trigger(I.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:y,tracks:V.tracks})),P){var q=P.startPTS,ie=P.endPTS,se=P.startDTS,ve=P.endDTS;H&&(H.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:q,endPTS:ie,startDTS:se,endDTS:ve}),j.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,q,ie,se,ve),this.bufferFragmentData(P,j,H,M)}if(U!=null&&(d=U.samples)!==null&&d!==void 0&&d.length){var Te=c({frag:j,id:y},U);v.trigger(I.Events.FRAG_PARSING_METADATA,Te)}if(x){var fe=c({frag:j,id:y},x);v.trigger(I.Events.FRAG_PARSING_USERDATA,fe)}},b._bufferInitSegment=function(u,d,y){if(this.state!==B.State.PARSING)return;u.video&&delete u.video;var v=u.audio;if(!v)return;v.levelCodec=v.codec,v.id="audio",this.log("Init audio buffer, container:"+v.container+", codecs[parsed]=["+v.codec+"]"),this.hls.trigger(I.Events.BUFFER_CODECS,u);var E=v.initSegment;if(E!=null&&E.byteLength){var M={type:"audio",frag:d,part:null,chunkMeta:y,parent:d.type,data:E};this.hls.trigger(I.Events.BUFFER_APPENDING,M)}this.tick()},b.loadFragment=function(u,d,y){var v=this.fragmentTracker.getState(u);this.fragCurrent=u,(this.audioSwitch||v===G.FragmentState.NOT_LOADED||v===G.FragmentState.PARTIAL)&&(u.sn==="initSegment"?this._loadInitSegment(u):d.live&&!Object(Q.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=B.State.WAITING_INIT_PTS):(this.startFragRequested=!0,O.prototype.loadFragment.call(this,u,d,y)))},b.completeAudioSwitch=function(){var u=this.hls,d=this.media,y=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(I.Events.AUDIO_TRACK_SWITCHED,{id:y})},R}(B.default);$.default=T},"./src/controller/audio-track-controller.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/events.ts"),B=k("./src/errors.ts"),I=k("./src/controller/base-playlist-controller.ts"),z=k("./src/types/loader.ts");function G(h,o){for(var l=0;l<o.length;l++){var a=o[l];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(h,a.key,a)}}function L(h,o,l){return o&&G(h.prototype,o),l&&G(h,l),h}function D(h,o){h.prototype=Object.create(o.prototype),h.prototype.constructor=h,m(h,o)}function m(h,o){return m=Object.setPrototypeOf||function(a,r){return a.__proto__=r,a},m(h,o)}var g=function(h){D(o,h);function o(a){var r;return r=h.call(this,a,"[audio-track-controller]")||this,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.trackName="",r.selectDefaultTrack=!0,r.registerListeners(),r}var l=o.prototype;return l.registerListeners=function(){var r=this.hls;r.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(Q.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.on(Q.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var r=this.hls;r.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(Q.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),r.off(Q.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,h.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(r,t){this.tracks=t.audioTracks||[]},l.onAudioTrackLoaded=function(r,t){var c=t.id,f=t.details,S=this.tracksInGroup[c];if(!S){this.warn("Invalid audio track id "+c);return}var C=S.details;S.details=t.details,this.log("audioTrack "+c+" loaded ["+f.startSN+"-"+f.endSN+"]"),c===this.trackId&&(this.retryCount=0,this.playlistLoaded(c,t,C))},l.onLevelLoading=function(r,t){this.switchLevel(t.level)},l.onLevelSwitching=function(r,t){this.switchLevel(t.level)},l.switchLevel=function(r){var t=this.hls.levels[r];if(!(t!=null&&t.audioGroupIds))return;var c=t.audioGroupIds[t.urlId];if(this.groupId!==c){this.groupId=c;var f=this.tracks.filter(function(C){return!c||C.groupId===c});this.selectDefaultTrack&&!f.some(function(C){return C.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=f;var S={audioTracks:f};this.log("Updating audio tracks, "+f.length+' track(s) found in "'+c+'" group-id'),this.hls.trigger(Q.Events.AUDIO_TRACKS_UPDATED,S),this.selectInitialTrack()}},l.onError=function(r,t){if(h.prototype.onError.call(this,r,t),t.fatal||!t.context)return;t.context.type===z.PlaylistContextType.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},l.setAudioTrack=function(r){var t=this.tracksInGroup;if(r<0||r>=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 "+r);var f=t[r],S=f.id,C=f.groupId,T=C===void 0?"":C,O=f.name,R=f.type,b=f.url;if(this.trackId=r,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(Q.Events.AUDIO_TRACK_SWITCHING,{id:S,groupId:T,name:O,type:R,url:b}),f.details&&!f.details.live)return;var _=this.switchParams(f.url,c==null?void 0:c.details);this.loadPlaylist(_)},l.selectInitialTrack=function(){var r=this.tracksInGroup;console.assert(r.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(Q.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},l.findTrackId=function(r){for(var t=this.tracksInGroup,c=0;c<t.length;c++){var f=t[c];if((!this.selectDefaultTrack||f.default)&&(!r||r===f.name))return f.id}return-1},l.loadPlaylist=function(r){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var c=t.id,f=t.groupId,S=t.url;if(r)try{S=r.addDirectives(S)}catch(C){this.warn("Could not construct new URL with HLS Delivery Directives: "+C)}this.log("loading audio-track playlist for id: "+c),this.clearTimer(),this.hls.trigger(Q.Events.AUDIO_TRACK_LOADING,{url:S,id:c,groupId:f,deliveryDirectives:r||null})}},L(o,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1,this.setAudioTrack(r)}}]),o}(I.default);$.default=g},"./src/controller/base-playlist-controller.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return L});var Q=k("./src/polyfills/number.ts"),B=k("./src/types/level.ts"),I=k("./src/controller/level-helper.ts"),z=k("./src/utils/logger.ts"),G=k("./src/errors.ts"),L=function(){function D(g,h){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=z.logger.log.bind(z.logger,h+":"),this.warn=z.logger.warn.bind(z.logger,h+":"),this.hls=g}var m=D.prototype;return m.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},m.onError=function(h,o){o.fatal&&o.type===G.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(h,o){var l=o==null?void 0:o.renditionReports;if(l)for(var a=0;a<l.length;a++){var r=l[a],t=""+r.URI;if(t===h.substr(-t.length)){var c=parseInt(r["LAST-MSN"]),f=parseInt(r["LAST-PART"]);if(o&&this.hls.config.lowLatencyMode){var S=Math.min(o.age-o.partTarget,o.targetduration);f!==void 0&&S>o.partTarget&&(f+=1)}if(Object(Q.isFiniteNumber)(c))return new B.HlsUrlParameters(c,Object(Q.isFiniteNumber)(f)?f:void 0,B.HlsSkip.No)}}},m.loadPlaylist=function(h){},m.shouldLoadTrack=function(h){return this.canLoad&&h&&!!h.url&&(!h.details||h.details.live)},m.playlistLoaded=function(h,o,l){var a=this,r=o.details,t=o.stats,c=t.loading.end?Math.max(0,self.performance.now()-t.loading.end):0;if(r.advancedDateTime=Date.now()-c,r.live||l!=null&&l.live){if(r.reloaded(l),l&&this.log("live playlist "+h+" "+(r.advanced?"REFRESHED "+r.lastPartSn+"-"+r.lastPartIndex:"MISSED")),l&&r.fragments.length>0&&Object(I.mergeDetails)(l,r),!this.canLoad||!r.live)return;var f,S=void 0,C=void 0;if(r.canBlockReload&&r.endSN&&r.advanced){var T=this.hls.config.lowLatencyMode,O=r.lastPartSn,R=r.endSN,b=r.lastPartIndex,_=b!==-1,u=O===R,d=T?0:b;_?(S=u?R+1:O,C=u?d:b+1):S=R+1;var y=r.age,v=y+r.ageHeader,E=Math.min(v-r.partTarget,r.targetduration*1.5);if(E>0){if(l&&E>l.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+l.tuneInGoal+" to: "+E+" with playlist age: "+r.age),E=0;else{var M=Math.floor(E/r.targetduration);if(S+=M,C!==void 0){var N=Math.round(E%r.targetduration/r.partTarget);C+=N}this.log("CDN Tune-in age: "+r.ageHeader+"s last advanced "+y.toFixed(2)+"s goal: "+E+" skip sn "+M+" to part "+C)}r.tuneInGoal=E}if(f=this.getDeliveryDirectives(r,o.deliveryDirectives,S,C),T||!u){this.loadPlaylist(f);return}}else f=this.getDeliveryDirectives(r,o.deliveryDirectives,S,C);var j=Object(I.computeReloadInterval)(r,t);S!==void 0&&r.canBlockReload&&(j-=r.partTarget||1),this.log("reload live playlist "+h+" in "+Math.round(j)+" ms"),this.timer=self.setTimeout(function(){return a.loadPlaylist(f)},j)}else this.clearTimer()},m.getDeliveryDirectives=function(h,o,l,a){var r=Object(B.getSkipValue)(h,l);return o!=null&&o.skip&&h.deltaUpdateFailed&&(l=o.msn,a=o.part,r=B.HlsSkip.No),new B.HlsUrlParameters(l,a,r)},m.retryLoadingOrFail=function(h){var o=this,l=this.hls.config,a=this.retryCount<l.levelLoadingMaxRetry;if(a){var r;if(this.retryCount++,h.details.indexOf("LoadTimeOut")>-1&&(r=h.context)!==null&&r!==void 0&&r.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+h.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 "'+h.details+'"')}}else this.warn('cannot recover from error "'+h.details+'"'),this.clearTimer(),h.fatal=!0;return a},D}()},"./src/controller/base-stream-controller.ts":function(ee,$,k){"use strict";k.r($),k.d($,"State",function(){return R}),k.d($,"default",function(){return b});var Q=k("./src/polyfills/number.ts"),B=k("./src/task-loop.ts"),I=k("./src/controller/fragment-tracker.ts"),z=k("./src/utils/buffer-helper.ts"),G=k("./src/utils/logger.ts"),L=k("./src/events.ts"),D=k("./src/errors.ts"),m=k("./src/types/transmuxer.ts"),g=k("./src/utils/mp4-tools.ts"),h=k("./src/utils/discontinuities.ts"),o=k("./src/controller/fragment-finders.ts"),l=k("./src/controller/level-helper.ts"),a=k("./src/loader/fragment-loader.ts"),r=k("./src/crypt/decrypter.ts"),t=k("./src/utils/time-ranges.ts"),c=k("./src/types/loader.ts");function f(_,u){for(var d=0;d<u.length;d++){var y=u[d];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(_,y.key,y)}}function S(_,u,d){return u&&f(_.prototype,u),d&&f(_,d),_}function C(_){if(_===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return _}function T(_,u){_.prototype=Object.create(u.prototype),_.prototype.constructor=_,O(_,u)}function O(_,u){return O=Object.setPrototypeOf||function(y,v){return y.__proto__=v,y},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(_){T(u,_);function u(y,v,E){var M;return M=_.call(this)||this,M.hls=void 0,M.fragPrevious=null,M.fragCurrent=null,M.fragmentTracker=void 0,M.transmuxer=null,M._state=R.STOPPED,M.media=void 0,M.mediaBuffer=void 0,M.config=void 0,M.bitrateTest=!1,M.lastCurrentTime=0,M.nextLoadPosition=0,M.startPosition=0,M.loadedmetadata=!1,M.fragLoadError=0,M.retryDate=0,M.levels=null,M.fragmentLoader=void 0,M.levelLastLoaded=null,M.startFragRequested=!1,M.decrypter=void 0,M.initPTS=[],M.onvseeking=null,M.onvended=null,M.logPrefix="",M.log=void 0,M.warn=void 0,M.logPrefix=E,M.log=G.logger.log.bind(G.logger,E+":"),M.warn=G.logger.warn.bind(G.logger,E+":"),M.hls=y,M.fragmentLoader=new a.default(y.config),M.fragmentTracker=v,M.config=y.config,M.decrypter=new r.default(y,y.config),y.on(L.Events.KEY_LOADED,M.onKeyLoaded,C(M)),M}var d=u.prototype;return d.doTick=function(){this.onTickEnd()},d.onTickEnd=function(){},d.startLoad=function(v){},d.stopLoad=function(){this.fragmentLoader.abort();var v=this.fragCurrent;v&&this.fragmentTracker.removeFragment(v),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=R.STOPPED},d._streamEnded=function(v,E){var M=this.fragCurrent,N=this.fragmentTracker;if(!E.live&&M&&M.sn===E.endSN&&!v.nextStart){var j=N.getState(M);return j===I.FragmentState.PARTIAL||j===I.FragmentState.OK}return!1},d.onMediaAttached=function(v,E){var M=this.media=this.mediaBuffer=E.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),M.addEventListener("seeking",this.onvseeking),M.addEventListener("ended",this.onvended);var N=this.config;this.levels&&N.autoStartLoad&&this.state===R.STOPPED&&this.startLoad(N.startPosition)},d.onMediaDetaching=function(){var v=this.media;v!=null&&v.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),v&&(v.removeEventListener("seeking",this.onvseeking),v.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 v=this.config,E=this.fragCurrent,M=this.media,N=this.mediaBuffer,j=this.state,H=M?M.currentTime:0,P=z.BufferHelper.bufferInfo(N||M,H,v.maxBufferHole);if(this.log("media seeking to "+(Object(Q.isFiniteNumber)(H)?H.toFixed(3):H)+", state: "+j),j===R.ENDED)this.resetLoadingState();else if(E&&!P.len){var x=v.maxFragLookUpTolerance,U=E.start-x,V=E.start+E.duration+x,q=H>V;(H<U||q)&&(q&&E.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),E.loader.abort()),this.resetLoadingState())}M&&(this.lastCurrentTime=H),!this.loadedmetadata&&!P.len&&(this.nextLoadPosition=this.startPosition=H),this.tickImmediate()},d.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},d.onKeyLoaded=function(v,E){if(this.state!==R.KEY_LOADING||E.frag!==this.fragCurrent||!this.levels)return;this.state=R.IDLE;var M=this.levels[E.frag.level].details;M&&this.loadFragment(E.frag,M,E.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),_.prototype.onHandlerDestroying.call(this)},d.onHandlerDestroyed=function(){this.state=R.STOPPED,this.hls.off(L.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,_.prototype.onHandlerDestroyed.call(this)},d.loadKey=function(v,E){this.log("Loading key for "+v.sn+" of ["+E.startSN+"-"+E.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level),this.state=R.KEY_LOADING,this.fragCurrent=v,this.hls.trigger(L.Events.KEY_LOADING,{frag:v})},d.loadFragment=function(v,E,M){this._loadFragForPlayback(v,E,M)},d._loadFragForPlayback=function(v,E,M){var N=this,j=function(P){if(N.fragContextChanged(v)){N.warn("Fragment "+v.sn+(P.part?" p: "+P.part.index:"")+" of level "+v.level+" was dropped during download."),N.fragmentTracker.removeFragment(v);return}v.stats.chunkCount++,N._handleFragmentLoadProgress(P)};this._doFragLoad(v,E,M,j).then(function(H){if(!H)return;N.fragLoadError=0;var P=N.state;if(N.fragContextChanged(v)){(P===R.FRAG_LOADING||P===R.BACKTRACKING||!N.fragCurrent&&P===R.PARSING)&&(N.fragmentTracker.removeFragment(v),N.state=R.IDLE);return}if("payload"in H&&(N.log("Loaded fragment "+v.sn+" of level "+v.level),N.hls.trigger(L.Events.FRAG_LOADED,H),N.state===R.BACKTRACKING)){N.fragmentTracker.backtrack(v,H),N.resetFragmentLoading(v);return}N._handleFragmentLoadComplete(H)}).catch(function(H){N.warn(H),N.resetFragmentLoading(v)})},d.flushMainBuffer=function(v,E,M){if(M===void 0&&(M=null),!(v-E))return;var N={startOffset:v,endOffset:E,type:M};this.fragLoadError=0,this.hls.trigger(L.Events.BUFFER_FLUSHING,N)},d._loadInitSegment=function(v){var E=this;this._doFragLoad(v).then(function(M){if(!M||E.fragContextChanged(v)||!E.levels)throw new Error("init load aborted");return M}).then(function(M){var N=E.hls,j=M.payload,H=v.decryptdata;if(j&&j.byteLength>0&&H&&H.key&&H.iv&&H.method==="AES-128"){var P=self.performance.now();return E.decrypter.webCryptoDecrypt(new Uint8Array(j),H.key.buffer,H.iv.buffer).then(function(x){var U=self.performance.now();return N.trigger(L.Events.FRAG_DECRYPTED,{frag:v,payload:x,stats:{tstart:P,tdecrypt:U}}),M.payload=x,M})}return M}).then(function(M){var N=E.fragCurrent,j=E.hls,H=E.levels;if(!H)throw new Error("init load aborted, missing levels");var P=H[v.level].details;console.assert(P,"Level details are defined when init segment is loaded");var x=v.stats;E.state=R.IDLE,E.fragLoadError=0,v.data=new Uint8Array(M.payload),x.parsing.start=x.buffering.start=self.performance.now(),x.parsing.end=x.buffering.end=self.performance.now(),M.frag===N&&j.trigger(L.Events.FRAG_BUFFERED,{stats:x,frag:N,part:null,id:v.type}),E.tick()}).catch(function(M){E.warn(M),E.resetFragmentLoading(v)})},d.fragContextChanged=function(v){var E=this.fragCurrent;return!v||!E||v.level!==E.level||v.sn!==E.sn||v.urlId!==E.urlId},d.fragBufferedComplete=function(v,E){var M=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(E?" part: "+E.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+t.default.toString(z.BufferHelper.getBuffered(M))),this.state=R.IDLE,this.tick()},d._handleFragmentLoadComplete=function(v){var E=this.transmuxer;if(!E)return;var M=v.frag,N=v.part,j=v.partsLoaded,H=!j||j.length===0||j.some(function(x){return!x}),P=new m.ChunkMetadata(M.level,M.sn,M.stats.chunkCount+1,0,N?N.index:-1,!H);E.flush(P)},d._handleFragmentLoadProgress=function(v){},d._doFragLoad=function(v,E,M,N){var j=this;if(M===void 0&&(M=null),!this.levels)throw new Error("frag load aborted, missing levels");if(M=Math.max(v.start,M||0),this.config.lowLatencyMode&&E){var H=E.partList;if(H&&N){M>v.end&&E.fragmentHint&&(v=E.fragmentHint);var P=this.getNextPart(H,v,M);if(P>-1){var x=H[P];return this.log("Loading part sn: "+v.sn+" p: "+x.index+" cc: "+v.cc+" of playlist ["+E.startSN+"-"+E.endSN+"] parts [0-"+P+"-"+(H.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(M.toFixed(3))),this.nextLoadPosition=x.start+x.duration,this.state=R.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:v,part:H[P],targetBufferTime:M}),this.doFragPartsLoad(v,H,P,N).catch(function(U){return j.handleFragLoadError(U)})}else if(!v.url||this.loadedEndOfParts(H,M))return Promise.resolve(null)}}return this.log("Loading fragment "+v.sn+" cc: "+v.cc+" "+(E?"of ["+E.startSN+"-"+E.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(M.toFixed(3))),Object(Q.isFiniteNumber)(v.sn)&&!this.bitrateTest&&(this.nextLoadPosition=v.start+v.duration),this.state=R.FRAG_LOADING,this.hls.trigger(L.Events.FRAG_LOADING,{frag:v,targetBufferTime:M}),this.fragmentLoader.load(v,N).catch(function(U){return j.handleFragLoadError(U)})},d.doFragPartsLoad=function(v,E,M,N){var j=this;return new Promise(function(H,P){var x=[],U=function V(q){var ie=E[q];j.fragmentLoader.loadPart(v,ie,N).then(function(se){x[ie.index]=se;var ve=se.part;j.hls.trigger(L.Events.FRAG_LOADED,se);var Te=E[q+1];if(Te&&Te.fragment===v)V(q+1);else return H({frag:v,part:ve,partsLoaded:x})}).catch(P)};U(M)})},d.handleFragLoadError=function(v){var E=v.data;return E&&E.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(E.frag,E.part):this.hls.trigger(L.Events.ERROR,E),null},d._handleTransmuxerFlush=function(v){var E=this.getCurrentContext(v);if(!E||this.state!==R.PARSING){this.fragCurrent||(this.state=R.IDLE);return}var M=E.frag,N=E.part,j=E.level,H=self.performance.now();M.stats.parsing.end=H,N&&(N.stats.parsing.end=H),this.updateLevelTiming(M,N,j,v.partial)},d.getCurrentContext=function(v){var E=this.levels,M=v.level,N=v.sn,j=v.part;if(!E||!E[M])return this.warn("Levels object was unset while buffering fragment "+N+" of level "+M+". The current chunk will not be buffered."),null;var H=E[M],P=j>-1?Object(l.getPartWith)(H,N,j):null,x=P?P.fragment:Object(l.getFragmentWithSN)(H,N,this.fragCurrent);return x?{frag:x,part:P,level:H}:null},d.bufferFragmentData=function(v,E,M,N){if(!v||this.state!==R.PARSING)return;var j=v.data1,H=v.data2,P=j;if(j&&H&&(P=Object(g.appendUint8Array)(j,H)),!P||!P.length)return;var x={type:v.type,frag:E,part:M,chunkMeta:N,parent:E.type,data:P};this.hls.trigger(L.Events.BUFFER_APPENDING,x),v.dropped&&v.independent&&!M&&this.flushBufferGap(E)},d.flushBufferGap=function(v){var E=this.media;if(!E)return;if(!z.BufferHelper.isBuffered(E,E.currentTime)){this.flushMainBuffer(0,v.start);return}var M=E.currentTime,N=z.BufferHelper.bufferInfo(E,M,0),j=v.duration,H=Math.min(this.config.maxFragLookUpTolerance*2,j*.25),P=Math.max(Math.min(v.start-H,N.end-H),M+H);v.start-P>H&&this.flushMainBuffer(P,v.start)},d.getFwdBufferInfo=function(v,E){var M=this.config,N=this.getLoadPosition();if(!Object(Q.isFiniteNumber)(N))return null;var j=z.BufferHelper.bufferInfo(v,N,M.maxBufferHole);if(j.len===0&&j.nextStart!==void 0){var H=this.fragmentTracker.getBufferedFrag(N,E);if(H&&j.nextStart<H.end)return z.BufferHelper.bufferInfo(v,N,Math.max(j.nextStart,M.maxBufferHole))}return j},d.getMaxBufferLength=function(v){var E=this.config,M;return v?M=Math.max(8*E.maxBufferSize/v,E.maxBufferLength):M=E.maxBufferLength,Math.min(M,E.maxMaxBufferLength)},d.reduceMaxBufferLength=function(v){var E=this.config,M=v||E.maxBufferLength;return E.maxMaxBufferLength>=M?(E.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+E.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(v,E){var M,N,j=E.fragments,H=j.length;if(!H)return null;var P=this.config,x=j[0].start,U;if(E.live){var V=P.initialLiveManifestSize;if(H<V)return this.warn("Not enough fragments to start playback (have: "+H+", need: "+V+")"),null;!E.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(U=this.getInitialLiveFragment(E,j),this.startPosition=U?this.hls.liveSyncPosition||U.start:v)}else v<=x&&(U=j[0]);if(!U){var q=P.lowLatencyMode?E.partEnd:E.fragmentEnd;U=this.getFragmentAtPosition(v,q,E)}return(M=U)!==null&&M!==void 0&&M.initSegment&&!((N=U)!==null&&N!==void 0&&N.initSegment.data)&&!this.bitrateTest&&(U=U.initSegment),U},d.getNextPart=function(v,E,M){for(var N=-1,j=!1,H=!0,P=0,x=v.length;P<x;P++){var U=v[P];if(H=H&&!U.independent,N>-1&&M<U.start)break;var V=U.loaded;!V&&(j||U.independent||H)&&U.fragment===E&&(N=P),j=V}return N},d.loadedEndOfParts=function(v,E){var M=v[v.length-1];return M&&E>M.start&&M.loaded},d.getInitialLiveFragment=function(v,E){var M=this.fragPrevious,N=null;if(M){if(v.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+M.programDateTime),N=Object(o.findFragmentByPDT)(E,M.endProgramDateTime,this.config.maxFragLookUpTolerance)),!N){var j=M.sn+1;if(j>=v.startSN&&j<=v.endSN){var H=E[j-v.startSN];M.cc===H.cc&&(N=H,this.log("Live playlist, switching playlist, load frag with next SN: "+N.sn))}N||(N=Object(o.findFragWithCC)(E,M.cc),N&&this.log("Live playlist, switching playlist, load frag with same CC: "+N.sn))}}else{var P=this.hls.liveSyncPosition;P!==null&&(N=this.getFragmentAtPosition(P,this.bitrateTest?v.fragmentEnd:v.edge,v))}return N},d.getFragmentAtPosition=function(v,E,M){var N=this.config,j=this.fragPrevious,H=M.fragments,P=M.endSN,x=M.fragmentHint,U=N.maxFragLookUpTolerance,V=!!(N.lowLatencyMode&&M.partList&&x);V&&x&&!this.bitrateTest&&(H=H.concat(x),P=x.sn);var q;if(v<E){var ie=v>E-U?0:U;q=Object(o.findFragmentByPTS)(j,H,v,ie)}else q=H[H.length-1];if(q){var se=q.sn-M.startSN,ve=j&&q.level===j.level,Te=H[se+1],fe=this.fragmentTracker.getState(q);if(fe===I.FragmentState.BACKTRACKED){q=null;for(var _e=se;H[_e]&&this.fragmentTracker.getState(H[_e])===I.FragmentState.BACKTRACKED;)j?q=H[_e--]:q=H[--_e];q||(q=Te)}else j&&q.sn===j.sn&&!V&&(ve&&(q.sn<P&&this.fragmentTracker.getState(Te)!==I.FragmentState.OK?(this.log("SN "+q.sn+" just loaded, load next one: "+Te.sn),q=Te):q=null))}return q},d.synchronizeToLiveEdge=function(v){var E=this.config,M=this.media;if(!M)return;var N=this.hls.liveSyncPosition,j=M.currentTime,H=v.fragments[0].start,P=v.edge,x=j>=H-E.maxFragLookUpTolerance&&j<=P;if(N!==null&&M.duration>N&&(j<N||!x)){var U=E.liveMaxLatencyDuration!==void 0?E.liveMaxLatencyDuration:E.liveMaxLatencyDurationCount*v.targetduration;(!x&&M.readyState<4||j<P-U)&&(this.loadedmetadata||(this.nextLoadPosition=N),M.readyState&&(this.warn("Playback: "+j.toFixed(3)+" is located too far from the end of live sliding playlist: "+P+", reset currentTime to : "+N.toFixed(3)),M.currentTime=N))}},d.alignPlaylists=function(v,E){var M=this.levels,N=this.levelLastLoaded,j=this.fragPrevious,H=N!==null?M[N]:null,P=v.fragments.length;if(!P)return this.warn("No fragments in live playlist"),0;var x=v.fragments[0].start,U=!E,V=v.alignedSliding&&Object(Q.isFiniteNumber)(x);if(U||!V&&!x){Object(h.alignStream)(j,H,v);var q=v.fragments[0].start;return this.log("Live playlist sliding: "+q.toFixed(2)+" start-sn: "+(E?E.startSN:"na")+"->"+v.startSN+" prev-sn: "+(j?j.sn:"na")+" fragments: "+P),q}return x},d.waitForCdnTuneIn=function(v){var E=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*E)},d.setStartPosition=function(v,E){var M=this.startPosition;if(M<E&&(M=-1),M===-1||this.lastCurrentTime===-1){var N=v.startTimeOffset;Object(Q.isFiniteNumber)(N)?(M=E+N,N<0&&(M+=v.totalduration),M=Math.min(Math.max(E,M),E+v.totalduration),this.log("Start time offset "+N+" found in playlist, adjust startPosition to "+M),this.startPosition=M):v.live?M=this.hls.liveSyncPosition||E:this.startPosition=M=0,this.lastCurrentTime=M}this.nextLoadPosition=M},d.getLoadPosition=function(){var v=this.media,E=0;return this.loadedmetadata&&v?E=v.currentTime:this.nextLoadPosition&&(E=this.nextLoadPosition),E},d.handleFragLoadAborted=function(v,E){this.transmuxer&&v.sn!=="initSegment"&&v.stats.aborted&&(this.warn("Fragment "+v.sn+(E?" part"+E.index:"")+" of level "+v.level+" was aborted"),this.resetFragmentLoading(v))},d.resetFragmentLoading=function(v){(!this.fragCurrent||!this.fragContextChanged(v))&&(this.state=R.IDLE)},d.onFragmentOrKeyLoadError=function(v,E){if(E.fatal)return;var M=E.frag;if(!M||M.type!==v)return;var N=this.fragCurrent;console.assert(N&&M.sn===N.sn&&M.level===N.level&&M.urlId===N.urlId,"Frag load error must match current frag to retry");var j=this.config;if(this.fragLoadError+1<=j.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(M.level))return;var H=Math.min(Math.pow(2,this.fragLoadError)*j.fragLoadingRetryDelay,j.fragLoadingMaxRetryTimeout);this.warn("Fragment "+M.sn+" of "+v+" "+M.level+" failed to load, retrying in "+H+"ms"),this.retryDate=self.performance.now()+H,this.fragLoadError++,this.state=R.FRAG_LOADING_WAITING_RETRY}else E.levelRetry?(v===c.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=R.IDLE):(G.logger.error(E.details+" reaches max retry, redispatch as fatal ..."),E.fatal=!0,this.hls.stopLoad(),this.state=R.ERROR)},d.afterBufferFlushed=function(v,E,M){if(!v)return;var N=z.BufferHelper.getBuffered(v);this.fragmentTracker.detectEvictedFragments(E,N,M),this.state===R.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=R.IDLE},d.resetLiveStartWhenNotLoaded=function(v){if(!this.loadedmetadata){this.startFragRequested=!1;var E=this.levels?this.levels[v].details:null;if(E!=null&&E.live)return this.startPosition=-1,this.setStartPosition(E,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},d.updateLevelTiming=function(v,E,M,N){var j=this,H=M.details;console.assert(!!H,"level.details must be defined");var P=Object.keys(v.elementaryStreams).reduce(function(x,U){var V=v.elementaryStreams[U];if(V){var q=V.endPTS-V.startPTS;if(q<=0)return j.warn("Could not parse fragment "+v.sn+" "+U+" duration reliably ("+q+") resetting transmuxer to fallback to playlist timing"),j.resetTransmuxer(),x||!1;var ie=N?0:Object(l.updateFragPTSDTS)(H,v,V.startPTS,V.endPTS,V.startDTS,V.endDTS);return j.hls.trigger(L.Events.LEVEL_PTS_UPDATED,{details:H,level:M,drift:ie,type:U,frag:v,start:V.startPTS,end:V.endPTS}),!0}return x},!1);P?(this.state=R.PARSED,this.hls.trigger(L.Events.FRAG_PARSED,{frag:v,part:E})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},S(u,[{key:"state",get:function(){return this._state},set:function(v){var E=this._state;E!==v&&(this._state=v,this.log(E+"->"+v))}}]),u}(B.default)},"./src/controller/buffer-controller.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return o});var Q=k("./src/polyfills/number.ts"),B=k("./src/events.ts"),I=k("./src/utils/logger.ts"),z=k("./src/errors.ts"),G=k("./src/utils/buffer-helper.ts"),L=k("./src/utils/mediasource-helper.ts"),D=k("./src/loader/fragment.ts"),m=k("./src/controller/buffer-operation-queue.ts"),g=Object(L.getMediaSource)(),h=/([ha]vc.)(?:\.[^.,]+)+/,o=function(){function l(r){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,f=t.media,S=t.mediaSource;I.logger.log("[buffer-controller]: Media source opened"),f&&(t.updateMediaElementDuration(),c.trigger(B.Events.MEDIA_ATTACHED,{media:f})),S&&S.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){I.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){I.logger.log("[buffer-controller]: Media source ended")},this.hls=r,this._initSourceBuffer(),this.registerListeners()}var a=l.prototype;return a.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},a.destroy=function(){this.unregisterListeners(),this.details=null},a.registerListeners=function(){var t=this.hls;t.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(B.Events.BUFFER_RESET,this.onBufferReset,this),t.on(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(B.Events.BUFFER_EOS,this.onBufferEos,this),t.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(B.Events.FRAG_PARSED,this.onFragParsed,this),t.on(B.Events.FRAG_CHANGED,this.onFragChanged,this)},a.unregisterListeners=function(){var t=this.hls;t.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(B.Events.BUFFER_RESET,this.onBufferReset,this),t.off(B.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(B.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(B.Events.BUFFER_EOS,this.onBufferEos,this),t.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(B.Events.FRAG_PARSED,this.onFragParsed,this),t.off(B.Events.FRAG_CHANGED,this.onFragChanged,this)},a._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new m.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},a.onManifestParsed=function(t,c){var f=2;(c.audio&&!c.video||!c.altAudio)&&(f=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=f,this.details=null,I.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},a.onMediaAttaching=function(t,c){var f=this.media=c.media;if(f&&g){var S=this.mediaSource=new g;S.addEventListener("sourceopen",this._onMediaSourceOpen),S.addEventListener("sourceended",this._onMediaSourceEnded),S.addEventListener("sourceclose",this._onMediaSourceClose),f.src=self.URL.createObjectURL(S),this._objectUrl=f.src}},a.onMediaDetaching=function(){var t=this.media,c=this.mediaSource,f=this._objectUrl;if(c){if(I.logger.log("[buffer-controller]: media source detaching"),c.readyState==="open")try{c.endOfStream()}catch(S){I.logger.warn("[buffer-controller]: onMediaDetaching: "+S.message+" while calling endOfStream")}this.onBufferReset(),c.removeEventListener("sourceopen",this._onMediaSourceOpen),c.removeEventListener("sourceended",this._onMediaSourceEnded),c.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(f&&self.URL.revokeObjectURL(f),t.src===f?(t.removeAttribute("src"),t.load()):I.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(B.Events.MEDIA_DETACHED,void 0)},a.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(c){var f=t.sourceBuffer[c];try{f&&(t.removeBufferListeners(c),t.mediaSource&&t.mediaSource.removeSourceBuffer(f),t.sourceBuffer[c]=void 0)}catch(S){I.logger.warn("[buffer-controller]: Failed to reset the "+c+" buffer",S)}}),this._initSourceBuffer()},a.onBufferCodecs=function(t,c){var f=this,S=this.getSourceBufferTypes().length;if(Object.keys(c).forEach(function(C){if(S){var T=f.tracks[C];if(T&&typeof T.buffer.changeType=="function"){var O=c[C],R=O.codec,b=O.levelCodec,_=O.container,u=(T.levelCodec||T.codec).replace(h,"$1"),d=(b||R).replace(h,"$1");if(u!==d){var y=_+";codecs="+(b||R);f.appendChangeType(C,y)}}}else f.pendingTracks[C]=c[C]}),S)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},a.appendChangeType=function(t,c){var f=this,S=this.operationQueue,C={execute:function(){var O=f.sourceBuffer[t];O&&(I.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+c),O.changeType(c)),S.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(O){I.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",O)}};S.append(C,t)},a.onBufferAppending=function(t,c){var f=this,S=this.hls,C=this.operationQueue,T=this.tracks,O=c.data,R=c.type,b=c.frag,_=c.part,u=c.chunkMeta,d=u.buffering[R],y=self.performance.now();d.start=y;var v=b.stats.buffering,E=_?_.stats.buffering:null;v.start===0&&(v.start=y),E&&E.start===0&&(E.start=y);var M=T.audio,N=R==="audio"&&u.id===1&&(M==null?void 0:M.container)==="audio/mpeg",j={execute:function(){if(d.executeStart=self.performance.now(),N){var P=f.sourceBuffer[R];if(P){var x=b.start-P.timestampOffset;Math.abs(x)>=.1&&(I.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+b.start+" (delta: "+x+") sn: "+b.sn+")"),P.timestampOffset=b.start)}}f.appendExecutor(O,R)},onStart:function(){},onComplete:function(){var P=self.performance.now();d.executeEnd=d.end=P,v.first===0&&(v.first=P),E&&E.first===0&&(E.first=P);var x=f.sourceBuffer,U={};for(var V in x)U[V]=G.BufferHelper.getBuffered(x[V]);f.appendError=0,f.hls.trigger(B.Events.BUFFER_APPENDED,{type:R,frag:b,part:_,chunkMeta:u,parent:b.type,timeRanges:U})},onError:function(P){I.logger.error("[buffer-controller]: Error encountered while trying to append to the "+R+" SourceBuffer",P);var x={type:z.ErrorTypes.MEDIA_ERROR,parent:b.type,details:z.ErrorDetails.BUFFER_APPEND_ERROR,err:P,fatal:!1};P.code===DOMException.QUOTA_EXCEEDED_ERR?x.details=z.ErrorDetails.BUFFER_FULL_ERROR:(f.appendError++,x.details=z.ErrorDetails.BUFFER_APPEND_ERROR,f.appendError>S.config.appendErrorMaxRetry&&(I.logger.error("[buffer-controller]: Failed "+S.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),x.fatal=!0)),S.trigger(B.Events.ERROR,x)}};C.append(j,R)},a.onBufferFlushing=function(t,c){var f=this,S=this.operationQueue,C=function(O){return{execute:f.removeExecutor.bind(f,O,c.startOffset,c.endOffset),onStart:function(){},onComplete:function(){f.hls.trigger(B.Events.BUFFER_FLUSHED,{type:O})},onError:function(b){I.logger.warn("[buffer-controller]: Failed to remove from "+O+" SourceBuffer",b)}}};c.type?S.append(C(c.type),c.type):this.getSourceBufferTypes().forEach(function(T){S.append(C(T),T)})},a.onFragParsed=function(t,c){var f=this,S=c.frag,C=c.part,T=[],O=C?C.elementaryStreams:S.elementaryStreams;O[D.ElementaryStreamTypes.AUDIOVIDEO]?T.push("audiovideo"):(O[D.ElementaryStreamTypes.AUDIO]&&T.push("audio"),O[D.ElementaryStreamTypes.VIDEO]&&T.push("video"));var R=function(){var _=self.performance.now();S.stats.buffering.end=_,C&&(C.stats.buffering.end=_);var u=C?C.stats:S.stats;f.hls.trigger(B.Events.FRAG_BUFFERED,{frag:S,part:C,stats:u,id:S.type})};T.length===0&&I.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+S.type+" level: "+S.level+" sn: "+S.sn),this.blockBuffers(R,T)},a.onFragChanged=function(t,c){this.flushBackBuffer()},a.onBufferEos=function(t,c){var f=this,S=this.getSourceBufferTypes().reduce(function(C,T){var O=f.sourceBuffer[T];return(!c.type||c.type===T)&&(O&&!O.ended&&(O.ended=!0,I.logger.log("[buffer-controller]: "+T+" sourceBuffer now EOS"))),C&&!!(!O||O.ended)},!0);S&&this.blockBuffers(function(){var C=f.mediaSource;if(!C||C.readyState!=="open")return;C.endOfStream()})},a.onLevelUpdated=function(t,c){var f=c.details;if(!f.fragments.length)return;this.details=f,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},a.flushBackBuffer=function(){var t=this.hls,c=this.details,f=this.media,S=this.sourceBuffer;if(!f||c===null)return;var C=this.getSourceBufferTypes();if(!C.length)return;var T=c.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(Q.isFiniteNumber)(T)||T<0)return;var O=f.currentTime,R=c.levelTargetDuration,b=Math.max(T,R),_=Math.floor(O/R)*R-b;C.forEach(function(u){var d=S[u];if(d){var y=G.BufferHelper.getBuffered(d);y.length>0&&_>y.start(0)&&(t.trigger(B.Events.BACK_BUFFER_REACHED,{bufferEnd:_}),c.live&&t.trigger(B.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:_}),t.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:_,type:u}))}})},a.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var t=this.details,c=this.hls,f=this.media,S=this.mediaSource,C=t.fragments[0].start+t.totalduration,T=f.duration,O=Object(Q.isFiniteNumber)(S.duration)?S.duration:0;t.live&&c.config.liveDurationInfinity?(I.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),S.duration=Infinity,this.updateSeekableRange(t)):(C>O&&C>T||!Object(Q.isFiniteNumber)(T))&&(I.logger.log("[buffer-controller]: Updating Media Source duration to "+C.toFixed(3)),S.duration=C)},a.updateSeekableRange=function(t){var c=this.mediaSource,f=t.fragments,S=f.length;if(S&&t.live&&c!==null&&c!==void 0&&c.setLiveSeekableRange){var C=Math.max(0,f[0].start),T=Math.max(C,C+t.totalduration);c.setLiveSeekableRange(C,T)}},a.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,c=this.operationQueue,f=this.pendingTracks,S=Object.keys(f).length;if(S&&!t||S===2){this.createSourceBuffers(f),this.pendingTracks={};var C=this.getSourceBufferTypes();if(C.length===0){this.hls.trigger(B.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}C.forEach(function(T){c.executeNext(T)})}},a.createSourceBuffers=function(t){var c=this.sourceBuffer,f=this.mediaSource;if(!f)throw Error("createSourceBuffers called when mediaSource was null");var S=0;for(var C in t)if(!c[C]){var T=t[C];if(!T)throw Error("source buffer exists for track "+C+", however track does not");var O=T.levelCodec||T.codec,R=T.container+";codecs="+O;I.logger.log("[buffer-controller]: creating sourceBuffer("+R+")");try{var b=c[C]=f.addSourceBuffer(R),_=C;this.addBufferListener(_,"updatestart",this._onSBUpdateStart),this.addBufferListener(_,"updateend",this._onSBUpdateEnd),this.addBufferListener(_,"error",this._onSBUpdateError),this.tracks[C]={buffer:b,codec:O,container:T.container,levelCodec:T.levelCodec,id:T.id},S++}catch(u){I.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+u.message),this.hls.trigger(B.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:u,mimeType:R})}}S&&this.hls.trigger(B.Events.BUFFER_CREATED,{tracks:this.tracks})},a._onSBUpdateStart=function(t){var c=this.operationQueue,f=c.current(t);f.onStart()},a._onSBUpdateEnd=function(t){var c=this.operationQueue,f=c.current(t);f.onComplete(),c.shiftAndExecuteNext(t)},a._onSBUpdateError=function(t,c){I.logger.error("[buffer-controller]: "+t+" SourceBuffer error",c),this.hls.trigger(B.Events.ERROR,{type:z.ErrorTypes.MEDIA_ERROR,details:z.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var f=this.operationQueue.current(t);f&&f.onError(c)},a.removeExecutor=function(t,c,f){var S=this.media,C=this.mediaSource,T=this.operationQueue,O=this.sourceBuffer,R=O[t];if(!S||!C||!R){I.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),T.shiftAndExecuteNext(t);return}var b=Object(Q.isFiniteNumber)(S.duration)?S.duration:Infinity,_=Object(Q.isFiniteNumber)(C.duration)?C.duration:Infinity,u=Math.max(0,c),d=Math.min(f,b,_);d>u?(I.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)):T.shiftAndExecuteNext(t)},a.appendExecutor=function(t,c){var f=this.operationQueue,S=this.sourceBuffer,C=S[c];if(!C){I.logger.warn("[buffer-controller]: Attempting to append to the "+c+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(c);return}C.ended=!1,console.assert(!C.updating,c+" sourceBuffer must not be updating"),C.appendBuffer(t)},a.blockBuffers=function(t,c){var f=this;if(c===void 0&&(c=this.getSourceBufferTypes()),!c.length){I.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var S=this.operationQueue,C=c.map(function(T){return S.appendBlocker(T)});Promise.all(C).then(function(){t(),c.forEach(function(T){var O=f.sourceBuffer[T];(!O||!O.updating)&&S.shiftAndExecuteNext(T)})})},a.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},a.addBufferListener=function(t,c,f){var S=this.sourceBuffer[t];if(!S)return;var C=f.bind(this,t);this.listeners[t].push({event:c,listener:C}),S.addEventListener(c,C)},a.removeBufferListeners=function(t){var c=this.sourceBuffer[t];if(!c)return;this.listeners[t].forEach(function(f){c.removeEventListener(f.event,f.listener)})},l}()},"./src/controller/buffer-operation-queue.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return B});var Q=k("./src/utils/logger.ts"),B=function(){function I(G){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=G}var z=I.prototype;return z.append=function(L,D){var m=this.queues[D];m.push(L),m.length===1&&this.buffers[D]&&this.executeNext(D)},z.insertAbort=function(L,D){var m=this.queues[D];m.unshift(L),this.executeNext(D)},z.appendBlocker=function(L){var D,m=new Promise(function(h){D=h}),g={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,L),m},z.executeNext=function(L){var D=this.buffers,m=this.queues,g=D[L],h=m[L];if(h.length){var o=h[0];try{o.execute()}catch(l){Q.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),o.onError(l),(!g||!g.updating)&&(h.shift(),this.executeNext(L))}}},z.shiftAndExecuteNext=function(L){this.queues[L].shift(),this.executeNext(L)},z.current=function(L){return this.queues[L][0]},I}()},"./src/controller/cap-level-controller.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/events.ts");function B(G,L){for(var D=0;D<L.length;D++){var m=L[D];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(G,m.key,m)}}function I(G,L,D){return L&&B(G.prototype,L),D&&B(G,D),G}var z=function(){function G(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 L=G.prototype;return L.setStreamController=function(m){this.streamController=m},L.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},L.registerListeners=function(){var m=this.hls;m.on(Q.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(Q.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},L.unregisterListener=function(){var m=this.hls;m.off(Q.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(Q.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},L.onFpsDropLevelCapping=function(m,g){G.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},L.onMediaAttaching=function(m,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},L.onManifestParsed=function(m,g){var h=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,h.config.capLevelToPlayerSize&&g.video&&this.startCapping()},L.onBufferCodecs=function(m,g){var h=this.hls;h.config.capLevelToPlayerSize&&g.video&&this.startCapping()},L.onMediaDetaching=function(){this.stopCapping()},L.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var m=this.hls.levels;if(m.length){var g=this.hls;g.autoLevelCapping=this.getMaxLevel(m.length-1),g.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=g.autoLevelCapping}}},L.getMaxLevel=function(m){var g=this,h=this.hls.levels;if(!h.length)return-1;var o=h.filter(function(l,a){return G.isLevelAllowed(a,g.restrictedLevels)&&a<=m});return this.clientRect=null,G.getMaxLevelByMediaSize(o,this.mediaWidth,this.mediaHeight)},L.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},L.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},L.getDimensions=function(){if(this.clientRect)return this.clientRect;var m=this.media,g={width:0,height:0};if(m){var h=m.getBoundingClientRect();g.width=h.width,g.height=h.height,!g.width&&!g.height&&(g.width=h.right-h.left||m.width||0,g.height=h.bottom-h.top||m.height||0)}return this.clientRect=g,g},G.isLevelAllowed=function(m,g){return g===void 0&&(g=[]),g.indexOf(m)===-1},G.getMaxLevelByMediaSize=function(m,g,h){if(!m||!m.length)return-1;for(var o=function(c,f){return f?c.width!==f.width||c.height!==f.height:!0},l=m.length-1,a=0;a<m.length;a+=1){var r=m[a];if((r.width>=g||r.height>=h)&&o(r,m[a+1])){l=a;break}}return l},I(G,[{key:"mediaWidth",get:function(){return this.getDimensions().width*G.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*G.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var m=1;try{m=self.devicePixelRatio}catch(g){}return m}}]),G}();$.default=z},"./src/controller/cmcd-controller.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return o});var Q=k("./src/events.ts"),B=k("./src/types/cmcd.ts"),I=k("./src/utils/buffer-helper.ts"),z=k("./src/utils/logger.ts");function G(l,a){for(var r=0;r<a.length;r++){var t=a[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(l,t.key,t)}}function L(l,a,r){return a&&G(l.prototype,a),r&&G(l,r),l}function D(l,a){var r=typeof Symbol!="undefined"&&l[Symbol.iterator]||l["@@iterator"];if(r)return(r=r.call(l)).next.bind(r);if(Array.isArray(l)||(r=m(l))||a&&l&&typeof l.length=="number"){r&&(l=r);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,a){if(!l)return;if(typeof l=="string")return g(l,a);var r=Object.prototype.toString.call(l).slice(8,-1);if(r==="Object"&&l.constructor&&(r=l.constructor.name),r==="Map"||r==="Set")return Array.from(l);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return g(l,a)}function g(l,a){(a==null||a>l.length)&&(a=l.length);for(var r=0,t=new Array(a);r<a;r++)t[r]=l[r];return t}function h(){return h=Object.assign||function(l){for(var a=1;a<arguments.length;a++){var r=arguments[a];for(var t in r)Object.prototype.hasOwnProperty.call(r,t)&&(l[t]=r[t])}return l},h.apply(this,arguments)}var o=function(){function l(r){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(S){try{t.apply(S,{ot:B.CMCDObjectType.MANIFEST,su:!t.initialized})}catch(C){z.logger.warn("Could not generate manifest CMCD data.",C)}},this.applyFragmentData=function(S){try{var C=S.frag,T=t.hls.levels[C.level],O=t.getObjectType(C),R={d:C.duration*1e3,ot:O};(O===B.CMCDObjectType.VIDEO||O===B.CMCDObjectType.AUDIO||O==B.CMCDObjectType.MUXED)&&(R.br=T.bitrate/1e3,R.tb=t.getTopBandwidth(O),R.bl=t.getBufferLength(O)),t.apply(S,R)}catch(b){z.logger.warn("Could not generate segment CMCD data.",b)}},this.hls=r;var c=this.config=r.config,f=c.cmcd;f!=null&&(c.pLoader=this.createPlaylistLoader(),c.fLoader=this.createFragmentLoader(),this.sid=f.sessionId||l.uuid(),this.cid=f.contentId,this.useHeaders=f.useHeaders===!0,this.registerListeners())}var a=l.prototype;return a.registerListeners=function(){var t=this.hls;t.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(Q.Events.BUFFER_CREATED,this.onBufferCreated,this)},a.unregisterListeners=function(){var t=this.hls;t.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(Q.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},a.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},a.onMediaAttached=function(t,c){this.media=c.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},a.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},a.onBufferCreated=function(t,c){var f,S;this.audioBuffer=(f=c.tracks.audio)===null||f===void 0?void 0:f.buffer,this.videoBuffer=(S=c.tracks.video)===null||S===void 0?void 0:S.buffer},a.createData=function(){var t;return{v:B.CMCDVersion,sf:B.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}},a.apply=function(t,c){c===void 0&&(c={}),h(c,this.createData());var f=c.ot===B.CMCDObjectType.INIT||c.ot===B.CMCDObjectType.VIDEO||c.ot===B.CMCDObjectType.MUXED;if(this.starved&&f&&(c.bs=!0,c.su=!0,this.starved=!1),c.su==null&&(c.su=this.buffering),this.useHeaders){var S=l.toHeaders(c);if(!Object.keys(S).length)return;t.headers||(t.headers={}),h(t.headers,S)}else{var C=l.toQuery(c);if(!C)return;t.url=l.appendQueryToUri(t.url,C)}},a.getObjectType=function(t){var c=t.type;return c==="subtitle"?B.CMCDObjectType.TIMED_TEXT:t.sn==="initSegment"?B.CMCDObjectType.INIT:c==="audio"?B.CMCDObjectType.AUDIO:c==="main"?this.hls.audioTracks.length?B.CMCDObjectType.VIDEO:B.CMCDObjectType.MUXED:void 0},a.getTopBandwidth=function(t){for(var c=0,f=t===B.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,S=D(f),C;!(C=S()).done;){var T=C.value;T.bitrate>c&&(c=T.bitrate)}return c>0?c:NaN},a.getBufferLength=function(t){var c=this.hls.media,f=t===B.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!f||!c)return NaN;var S=I.BufferHelper.bufferInfo(f,c.currentTime,this.config.maxBufferHole);return S.len*1e3},a.createPlaylistLoader=function(){var t=this.config.pLoader,c=this.applyPlaylistData,f=t||this.config.loader;return function(){function S(T){this.loader=void 0,this.loader=new f(T)}var C=S.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(O,R,b){c(O),this.loader.load(O,R,b)},L(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},a.createFragmentLoader=function(){var t=this.config.fLoader,c=this.applyFragmentData,f=t||this.config.loader;return function(){function S(T){this.loader=void 0,this.loader=new f(T)}var C=S.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(O,R,b){c(O),this.loader.load(O,R,b)},L(S,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),S}()},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=[],f=function(N){return!Number.isNaN(N)&&N!=null&&N!==""&&N!==!1},S=function(N){return Math.round(N)},C=function(N){return S(N/100)*100},T=function(N){return encodeURIComponent(N)},O={br:S,d:S,bl:C,dl:C,mtp:C,nor:T,rtp:C,tb:S},R=Object.keys(t||{}).sort(),b=D(R),_;!(_=b()).done;){var u=_.value,d=t[u];if(!f(d))continue;if(u==="v"&&d===1)continue;if(u=="pr"&&d===1)continue;var y=O[u];y&&(d=y(d));var v=typeof d,E=void 0;u==="ot"||u==="sf"||u==="st"?E=u+"="+d:v==="boolean"?E=u:v==="number"?E=u+"="+d:E=u+"="+JSON.stringify(d),c.push(E)}return c.join(",")},l.toHeaders=function(t){for(var c=Object.keys(t),f={},S=["Object","Request","Session","Status"],C=[{},{},{},{}],T={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],_=T[b]!=null?T[b]:1;C[_][b]=t[b]}for(var u=0;u<C.length;u++){var d=l.serialize(C[u]);d&&(f["CMCD-"+S[u]]=d)}return f},l.toQuery=function(t){return"CMCD="+encodeURIComponent(l.serialize(t))},l.appendQueryToUri=function(t,c){if(!c)return t;var f=t.includes("?")?"&":"?";return""+t+f+c},l}()},"./src/controller/eme-controller.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/events.ts"),B=k("./src/errors.ts"),I=k("./src/utils/logger.ts"),z=k("./src/utils/mediakeys-helper.ts");function G(o,l){for(var a=0;a<l.length;a++){var r=l[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,r.key,r)}}function L(o,l,a){return l&&G(o.prototype,l),a&&G(o,a),o}var D=3,m=function(l,a,r){var t={audioCapabilities:[],videoCapabilities:[]};return l.forEach(function(c){t.audioCapabilities.push({contentType:'audio/mp4; codecs="'+c+'"',robustness:r.audioRobustness||""})}),a.forEach(function(c){t.videoCapabilities.push({contentType:'video/mp4; codecs="'+c+'"',robustness:r.videoRobustness||""})}),[t]},g=function(l,a,r,t){switch(l){case z.KeySystems.WIDEVINE:return m(a,r,t);default:throw new Error("Unknown key-system: "+l)}},h=function(){function o(a){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=a,this._config=a.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var l=o.prototype;return l.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},l._registerListeners=function(){this.hls.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l._unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(Q.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this)},l.getLicenseServerUrl=function(r){switch(r){case z.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+r+'"')},l._attemptKeySystemAccess=function(r,t,c){var f=this,S=g(r,t,c,this._drmSystemOptions);I.logger.log("Requesting encrypted media key-system access");var C=this.requestMediaKeySystemAccess(r,S);this.mediaKeysPromise=C.then(function(T){return f._onMediaKeySystemAccessObtained(r,T)}),C.catch(function(T){I.logger.error('Failed to obtain key-system "'+r+'" access:',T)})},l._onMediaKeySystemAccessObtained=function(r,t){var c=this;I.logger.log('Access for key-system "'+r+'" obtained');var f={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:r};this._mediaKeysList.push(f);var S=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(C){return f.mediaKeys=C,I.logger.log('Media-keys created for key-system "'+r+'"'),c._onMediaKeysCreated(),C});return S.catch(function(C){I.logger.error("Failed to create media-keys:",C)}),S},l._onMediaKeysCreated=function(){var r=this;this._mediaKeysList.forEach(function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),r._onNewMediaKeySession(t.mediaKeysSession))})},l._onNewMediaKeySession=function(r){var t=this;I.logger.log("New key-system session "+r.sessionId),r.addEventListener("message",function(c){t._onKeySessionMessage(r,c.message)},!1)},l._onKeySessionMessage=function(r,t){I.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(c){I.logger.log("Received license data (length: "+(c&&c.byteLength)+"), updating key-session"),r.update(c)})},l.onMediaEncrypted=function(r){var t=this;if(I.logger.log('Media is encrypted using "'+r.initDataType+'" init data type'),!this.mediaKeysPromise){I.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var c=function(S){if(!t._media)return;t._attemptSetMediaKeys(S),t._generateRequestWithPreferredKeySession(r.initDataType,r.initData)};this.mediaKeysPromise.then(c).catch(c)},l._attemptSetMediaKeys=function(r){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){I.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}I.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},l._generateRequestWithPreferredKeySession=function(r,t){var c=this,f=this._mediaKeysList[0];if(!f){I.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(f.mediaKeysSessionInitialized){I.logger.warn("Key-Session already initialized but requested again");return}var S=f.mediaKeysSession;if(!S){I.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){I.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}I.logger.log('Generating key-session request for "'+r+'" init data type'),f.mediaKeysSessionInitialized=!0,S.generateRequest(r,t).then(function(){I.logger.debug("Key-session generation succeeded")}).catch(function(C){I.logger.error("Error generating key-session request:",C),c.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},l._createLicenseXhr=function(r,t,c){var f=new XMLHttpRequest;f.responseType="arraybuffer",f.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,f,r,t,c);var S=this._licenseXhrSetup;if(S)try{S.call(this.hls,f,r),S=void 0}catch(C){I.logger.error(C)}try{f.readyState||f.open("POST",r,!0),S&&S.call(this.hls,f,r)}catch(C){throw new Error("issue setting up KeySystem license XHR "+C)}return f},l._onLicenseRequestReadyStageChange=function(r,t,c,f){switch(r.readyState){case 4:if(r.status===200){this._requestLicenseFailureCount=0,I.logger.log("License request succeeded");var S=r.response,C=this._licenseResponseCallback;if(C)try{S=C.call(this.hls,r,t)}catch(O){I.logger.error(O)}f(S)}else{if(I.logger.error("License Request XHR failed ("+t+"). Status: "+r.status+" ("+r.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var T=D-this._requestLicenseFailureCount+1;I.logger.warn("Retrying license request, "+T+" attempts left"),this._requestLicense(c,f)}break}},l._generateLicenseRequestChallenge=function(r,t){switch(r.mediaKeySystemDomain){case z.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+r.mediaKeySystemDomain)},l._requestLicense=function(r,t){I.logger.log("Requesting content license for key-system");var c=this._mediaKeysList[0];if(!c){I.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var f=this.getLicenseServerUrl(c.mediaKeySystemDomain),S=this._createLicenseXhr(f,r,t);I.logger.log("Sending license request to URL: "+f);var C=this._generateLicenseRequestChallenge(c,r);S.send(C)}catch(T){I.logger.error("Failure requesting DRM license: "+T),this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.KEY_SYSTEM_ERROR,details:B.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},l.onMediaAttached=function(r,t){if(!this._emeEnabled)return;var c=t.media;this._media=c,c.addEventListener("encrypted",this._onMediaEncrypted)},l.onMediaDetached=function(){var r=this._media,t=this._mediaKeysList;if(!r)return;r.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 r.setMediaKeys(null)}).catch(function(){})},l.onManifestParsed=function(r,t){if(!this._emeEnabled)return;var c=t.levels.map(function(S){return S.audioCodec}).filter(function(S){return!!S}),f=t.levels.map(function(S){return S.videoCodec}).filter(function(S){return!!S});this._attemptKeySystemAccess(z.KeySystems.WIDEVINE,c,f)},L(o,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),o}();$.default=h},"./src/controller/fps-controller.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/events.ts"),B=k("./src/utils/logger.ts"),I=function(){function z(L){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=L,this.registerListeners()}var G=z.prototype;return G.setStreamController=function(D){this.streamController=D},G.registerListeners=function(){this.hls.on(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},G.unregisterListeners=function(){this.hls.off(Q.Events.MEDIA_ATTACHING,this.onMediaAttaching)},G.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},G.onMediaAttaching=function(D,m){var g=this.hls.config;if(g.capLevelOnFPSDrop){var h=m.media instanceof self.HTMLVideoElement?m.media:null;this.media=h,h&&typeof h.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),g.fpsDroppedMonitoringPeriod)}},G.checkFPS=function(D,m,g){var h=performance.now();if(m){if(this.lastTime){var o=h-this.lastTime,l=g-this.lastDroppedFrames,a=m-this.lastDecodedFrames,r=1e3*l/o,t=this.hls;if(t.trigger(Q.Events.FPS_DROP,{currentDropped:l,currentDecoded:a,totalDroppedFrames:g}),r>0&&l>t.config.fpsDroppedMonitoringThreshold*a){var c=t.currentLevel;B.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(Q.Events.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:t.currentLevel}),t.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=h,this.lastDroppedFrames=g,this.lastDecodedFrames=m}},G.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=I},"./src/controller/fragment-finders.ts":function(ee,$,k){"use strict";k.r($),k.d($,"findFragmentByPDT",function(){return I}),k.d($,"findFragmentByPTS",function(){return z}),k.d($,"fragmentWithinToleranceTest",function(){return G}),k.d($,"pdtWithinToleranceTest",function(){return L}),k.d($,"findFragWithCC",function(){return D});var Q=k("./src/polyfills/number.ts"),B=k("./src/utils/binary-search.ts");function I(m,g,h){if(g===null||!Array.isArray(m)||!m.length||!Object(Q.isFiniteNumber)(g))return null;var o=m[0].programDateTime;if(g<(o||0))return null;var l=m[m.length-1].endProgramDateTime;if(g>=(l||0))return null;h=h||0;for(var a=0;a<m.length;++a){var r=m[a];if(L(g,h,r))return r}return null}function z(m,g,h,o){h===void 0&&(h=0),o===void 0&&(o=0);var l=null;if(m?l=g[m.sn-g[0].sn+1]||null:h===0&&g[0].start===0&&(l=g[0]),l&&G(h,o,l)===0)return l;var a=B.default.search(g,G.bind(null,h,o));return a||l}function G(m,g,h){m===void 0&&(m=0),g===void 0&&(g=0);var o=Math.min(g,h.duration+(h.deltaPTS?h.deltaPTS:0));return h.start+h.duration-o<=m?1:h.start-o>m&&h.start?-1:0}function L(m,g,h){var o=Math.min(g,h.duration+(h.deltaPTS?h.deltaPTS:0))*1e3,l=h.endProgramDateTime||0;return l-o>m}function D(m,g){return B.default.search(m,function(h){return h.cc<g?1:h.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(ee,$,k){"use strict";k.r($),k.d($,"FragmentState",function(){return I}),k.d($,"FragmentTracker",function(){return z});var Q=k("./src/events.ts"),B=k("./src/types/loader.ts"),I;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(I||(I={}));var z=function(){function D(g){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=g,this._registerListeners()}var m=D.prototype;return m._registerListeners=function(){var h=this.hls;h.on(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.on(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.on(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},m._unregisterListeners=function(){var h=this.hls;h.off(Q.Events.BUFFER_APPENDED,this.onBufferAppended,this),h.off(Q.Events.FRAG_BUFFERED,this.onFragBuffered,this),h.off(Q.Events.FRAG_LOADED,this.onFragLoaded,this)},m.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},m.getAppendedFrag=function(h,o){if(o===B.PlaylistLevelType.MAIN){var l=this.activeFragment,a=this.activeParts;if(!l)return null;if(a)for(var r=a.length;r--;){var t=a[r],c=t?t.end:l.appendedPTS;if(t.start<=h&&c!==void 0&&h<=c)return r>9&&(this.activeParts=a.slice(r-9)),t}else if(l.start<=h&&l.appendedPTS!==void 0&&h<=l.appendedPTS)return l}return this.getBufferedFrag(h,o)},m.getBufferedFrag=function(h,o){for(var l=this.fragments,a=Object.keys(l),r=a.length;r--;){var t=l[a[r]];if((t==null?void 0:t.body.type)===o&&t.buffered){var c=t.body;if(c.start<=h&&h<=c.end)return c}}return null},m.detectEvictedFragments=function(h,o,l){var a=this;Object.keys(this.fragments).forEach(function(r){var t=a.fragments[r];if(!t)return;if(!t.buffered){t.body.type===l&&a.removeFragment(t.body);return}var c=t.range[h];if(!c)return;c.time.some(function(f){var S=!a.isTimeBuffered(f.startPTS,f.endPTS,o);return S&&a.removeFragment(t.body),S})})},m.detectPartialFragments=function(h){var o=this,l=this.timeRanges,a=h.frag,r=h.part;if(!l||a.sn==="initSegment")return;var t=L(a),c=this.fragments[t];if(!c)return;Object.keys(l).forEach(function(f){var S=a.elementaryStreams[f];if(!S)return;var C=l[f],T=r!==null||S.partial===!0;c.range[f]=o.getBufferedTimes(a,r,T,C)}),c.backtrack=c.loaded=null,Object.keys(c.range).length?c.buffered=!0:this.removeFragment(c.body)},m.fragBuffered=function(h){var o=L(h),l=this.fragments[o];l&&(l.backtrack=l.loaded=null,l.buffered=!0)},m.getBufferedTimes=function(h,o,l,a){for(var r={time:[],partial:l},t=o?o.start:h.start,c=o?o.end:h.end,f=h.minEndPTS||c,S=h.maxStartPTS||t,C=0;C<a.length;C++){var T=a.start(C)-this.bufferPadding,O=a.end(C)+this.bufferPadding;if(S>=T&&f<=O){r.time.push({startPTS:Math.max(t,a.start(C)),endPTS:Math.min(c,a.end(C))});break}else if(t<O&&c>T)r.partial=!0,r.time.push({startPTS:Math.max(t,a.start(C)),endPTS:Math.min(c,a.end(C))});else if(c<=T)break}return r},m.getPartialFragment=function(h){var o=null,l,a,r,t=0,c=this.bufferPadding,f=this.fragments;return Object.keys(f).forEach(function(S){var C=f[S];if(!C)return;G(C)&&(a=C.body.start-c,r=C.body.end+c,h>=a&&h<=r&&(l=Math.min(h-a,r-h),t<=l&&(o=C.body,t=l)))}),o},m.getState=function(h){var o=L(h),l=this.fragments[o];return l?l.buffered?G(l)?I.PARTIAL:I.OK:l.backtrack?I.BACKTRACKED:I.APPENDING:I.NOT_LOADED},m.backtrack=function(h,o){var l=L(h),a=this.fragments[l];if(!a||a.backtrack)return null;var r=a.backtrack=o||a.loaded;return a.loaded=null,r},m.getBacktrackData=function(h){var o=L(h),l=this.fragments[o];if(l){var a,r=l.backtrack;if(r!=null&&(a=r.payload)!==null&&a!==void 0&&a.byteLength)return r;this.removeFragment(h)}return null},m.isTimeBuffered=function(h,o,l){for(var a,r,t=0;t<l.length;t++){if(a=l.start(t)-this.bufferPadding,r=l.end(t)+this.bufferPadding,h>=a&&o<=r)return!0;if(o<=a)return!1}return!1},m.onFragLoaded=function(h,o){var l=o.frag,a=o.part;if(l.sn==="initSegment"||l.bitrateTest||a)return;var r=L(l);this.fragments[r]={body:l,loaded:o,backtrack:null,buffered:!1,range:Object.create(null)}},m.onBufferAppended=function(h,o){var l=this,a=o.frag,r=o.part,t=o.timeRanges;if(a.type===B.PlaylistLevelType.MAIN)if(this.activeFragment=a,r){var c=this.activeParts;c||(this.activeParts=c=[]),c.push(r)}else this.activeParts=null;this.timeRanges=t,Object.keys(t).forEach(function(f){var S=t[f];if(l.detectEvictedFragments(f,S),!r)for(var C=0;C<S.length;C++)a.appendedPTS=Math.max(S.end(C),a.appendedPTS||0)})},m.onFragBuffered=function(h,o){this.detectPartialFragments(o)},m.hasFragment=function(h){var o=L(h);return!!this.fragments[o]},m.removeFragmentsInRange=function(h,o,l){var a=this;Object.keys(this.fragments).forEach(function(r){var t=a.fragments[r];if(!t)return;if(t.buffered){var c=t.body;c.type===l&&c.start<o&&c.end>h&&a.removeFragment(c)}})},m.removeFragment=function(h){var o=L(h);h.stats.loaded=0,h.clearElementaryStreamInfo(),delete this.fragments[o]},m.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function G(D){var m,g;return D.buffered&&(((m=D.range.video)===null||m===void 0?void 0:m.partial)||((g=D.range.audio)===null||g===void 0?void 0:g.partial))}function L(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(ee,$,k){"use strict";k.r($),k.d($,"STALL_MINIMUM_DURATION_MS",function(){return G}),k.d($,"MAX_START_GAP_JUMP",function(){return L}),k.d($,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),k.d($,"SKIP_BUFFER_RANGE_START",function(){return m}),k.d($,"default",function(){return g});var Q=k("./src/utils/buffer-helper.ts"),B=k("./src/errors.ts"),I=k("./src/events.ts"),z=k("./src/utils/logger.ts"),G=250,L=2,D=.1,m=.05,g=function(){function h(l,a,r,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=a,this.fragmentTracker=r,this.hls=t}var o=h.prototype;return o.destroy=function(){this.hls=this.fragmentTracker=this.media=null},o.poll=function(a){var r=this.config,t=this.media,c=this.stalled,f=t.currentTime,S=t.seeking,C=this.seeking&&!S,T=!this.seeking&&S;if(this.seeking=S,f!==a){if(this.moved=!0,c!==null){if(this.stallReported){var O=self.performance.now()-c;z.logger.warn("playback not stuck anymore @"+f+", after "+Math.round(O)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((T||C)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!Q.BufferHelper.getBuffered(t).length)return;var R=Q.BufferHelper.bufferInfo(t,f,0),b=R.len>0,_=R.nextStart||0;if(!b&&!_)return;if(S){var u=R.len>L,d=!_||_-f>L&&!this.fragmentTracker.getPartialFragment(f);if(u||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var y,v=Math.max(_,R.start||0)-f,E=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,M=E==null||((y=E.details)===null||y===void 0)?void 0:y.live,N=M?E.details.targetduration*2:L;if(v>0&&v<=N){this._trySkipBufferHole(null);return}}var j=self.performance.now();if(c===null){this.stalled=j;return}var H=j-c;!S&&H>=G&&this._reportStall(R.len);var P=Q.BufferHelper.bufferInfo(t,f,r.maxBufferHole);this._tryFixBufferStall(P,H)},o._tryFixBufferStall=function(a,r){var t=this.config,c=this.fragmentTracker,f=this.media,S=f.currentTime,C=c.getPartialFragment(S);if(C){var T=this._trySkipBufferHole(C);if(T)return}a.len>t.maxBufferHole&&r>t.highBufferWatchdogPeriod*1e3&&(z.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},o._reportStall=function(a){var r=this.hls,t=this.media,c=this.stallReported;c||(this.stallReported=!0,z.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+a+")"),r.trigger(I.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:a}))},o._trySkipBufferHole=function(a){for(var r=this.config,t=this.hls,c=this.media,f=c.currentTime,S=0,C=Q.BufferHelper.getBuffered(c),T=0;T<C.length;T++){var O=C.start(T);if(f+r.maxBufferHole>=S&&f<O){var R=Math.max(O+m,c.currentTime+D);return z.logger.warn("skipping hole, adjusting currentTime from "+f+" to "+R),this.moved=!0,this.stalled=null,c.currentTime=R,a&&t.trigger(I.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+f+" to "+R,frag:a}),R}S=C.end(T)}return 0},o._tryNudgeBuffer=function(){var a=this.config,r=this.hls,t=this.media,c=t.currentTime,f=(this.nudgeRetry||0)+1;if(this.nudgeRetry=f,f<a.nudgeMaxRetry){var S=c+f*a.nudgeOffset;z.logger.warn("Nudging 'currentTime' from "+c+" to "+S),t.currentTime=S,r.trigger(I.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else z.logger.error("Playhead still not moving while enough data buffered @"+c+" after "+a.nudgeMaxRetry+" nudges"),r.trigger(I.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},h}()},"./src/controller/id3-track-controller.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/events.ts"),B=k("./src/utils/texttrack-utils.ts"),I=k("./src/demux/id3.ts"),z=.25,G=function(){function L(m){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=m,this._registerListeners()}var D=L.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var g=this.hls;g.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(Q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var g=this.hls;g.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(Q.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(g,h){this.media=h.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(B.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(g){if(!this.media)return;for(var h=0;h<g.length;h++){var o=g[h];if(o.kind==="metadata"&&o.label==="id3")return Object(B.sendAddTrackEvent)(o,this.media),o}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(g,h){if(!this.media)return;var o=h.frag,l=h.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var a=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,r=0;r<l.length;r++){var t=I.getID3Frames(l[r].data);if(t){var c=l[r].pts,f=r<l.length-1?l[r+1].pts:o.end,S=f-c;S<=0&&(f=c+z);for(var C=0;C<t.length;C++){var T=t[C];if(!I.isTimeStampFrame(T)){var O=new a(c,f,"");O.value=T,this.id3Track.addCue(O)}}}}},D.onBufferFlushing=function(g,h){var o=h.startOffset,l=h.endOffset,a=h.type;if(!a||a==="audio"){var r=this.id3Track;r&&Object(B.removeCuesInRange)(r,o,l)}},L}();$.default=G},"./src/controller/latency-controller.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return L});var Q=k("./src/errors.ts"),B=k("./src/events.ts"),I=k("./src/utils/logger.ts");function z(D,m){for(var g=0;g<m.length;g++){var h=m[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function G(D,m,g){return m&&z(D.prototype,m),g&&z(D,g),D}var L=function(){function D(g){var h=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return h.timeupdate()},this.hls=g,this.config=g.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(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(B.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(B.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){this.hls.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(B.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(B.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(B.Events.ERROR,this.onError)},m.onMediaAttached=function(h,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(h,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(h,o){if(o.details!==Q.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,I.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},m.timeupdate=function(){var h=this.media,o=this.levelDetails;if(!h||!o)return;this.currentTime=h.currentTime;var l=this.computeLatency();if(l===null)return;this._latency=l;var a=this.config,r=a.lowLatencyMode,t=a.maxLiveSyncPlaybackRate;if(!r||t===1)return;var c=this.targetLatency;if(c===null)return;var f=l-c,S=Math.min(this.maxLatency,c+o.targetduration),C=f<S;if(o.live&&C&&f>.05&&this.forwardBufferLength>1){var T=Math.min(2,Math.max(1,t)),O=Math.round(2/(1+Math.exp(-.75*f-this.edgeStalled))*20)/20;h.playbackRate=Math.min(T,Math.max(1,O))}else h.playbackRate!==1&&h.playbackRate!==0&&(h.playbackRate=1)},m.estimateLiveEdge=function(){var h=this.levelDetails;return h===null?null:h.edge+h.age},m.computeLatency=function(){var h=this.estimateLiveEdge();return h===null?null:h-this.currentTime},G(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var h=this.config,o=this.levelDetails;return h.liveMaxLatencyDuration!==void 0?h.liveMaxLatencyDuration:o?h.liveMaxLatencyDurationCount*o.targetduration:0}},{key:"targetLatency",get:function(){var h=this.levelDetails;if(h===null)return null;var o=h.holdBack,l=h.partHoldBack,a=h.targetduration,r=this.config,t=r.liveSyncDuration,c=r.liveSyncDurationCount,f=r.lowLatencyMode,S=this.hls.userConfig,C=f&&l||o;(S.liveSyncDuration||S.liveSyncDurationCount||C===0)&&(C=t!==void 0?t:c*a);var T=a,O=1;return C+Math.min(this.stallCount*O,T)}},{key:"liveSyncPosition",get:function(){var h=this.estimateLiveEdge(),o=this.targetLatency,l=this.levelDetails;if(h===null||o===null||l===null)return null;var a=l.edge,r=h-o-this.edgeStalled,t=a-l.totalduration,c=a-(this.config.lowLatencyMode&&l.partTarget||l.targetduration);return Math.min(Math.max(t,r),c)}},{key:"drift",get:function(){var h=this.levelDetails;return h===null?1:h.drift}},{key:"edgeStalled",get:function(){var h=this.levelDetails;if(h===null)return 0;var o=(this.config.lowLatencyMode&&h.partTarget||h.targetduration)*3;return Math.max(h.age-o,0)}},{key:"forwardBufferLength",get:function(){var h=this.media,o=this.levelDetails;if(!h||!o)return 0;var l=h.buffered.length;return l?h.buffered.end(l-1):o.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return r});var Q=k("./src/types/level.ts"),B=k("./src/events.ts"),I=k("./src/errors.ts"),z=k("./src/utils/codecs.ts"),G=k("./src/controller/level-helper.ts"),L=k("./src/controller/base-playlist-controller.ts"),D=k("./src/types/loader.ts");function m(){return m=Object.assign||function(t){for(var c=1;c<arguments.length;c++){var f=arguments[c];for(var S in f)Object.prototype.hasOwnProperty.call(f,S)&&(t[S]=f[S])}return t},m.apply(this,arguments)}function g(t,c){for(var f=0;f<c.length;f++){var S=c[f];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(t,S.key,S)}}function h(t,c,f){return c&&g(t.prototype,c),f&&g(t,f),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(S,C){return S.__proto__=C,S},l(t,c)}var a=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),r=function(t){o(c,t);function c(S){var C;return C=t.call(this,S,"[level-controller]")||this,C._levels=[],C._firstLevel=-1,C._startLevel=void 0,C.currentLevelIndex=-1,C.manualLevelIndex=-1,C.onParsedComplete=void 0,C._registerListeners(),C}var f=c.prototype;return f._registerListeners=function(){var C=this.hls;C.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),C.on(B.Events.ERROR,this.onError,this)},f._unregisterListeners=function(){var C=this.hls;C.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),C.off(B.Events.ERROR,this.onError,this)},f.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},f.startLoad=function(){var C=this._levels;C.forEach(function(T){T.loadError=0}),t.prototype.startLoad.call(this)},f.onManifestLoaded=function(C,T){var O=[],R=[],b=[],_,u={},d,y=!1,v=!1,E=!1;if(T.levels.forEach(function(H){var P=H.attrs;y=y||!!(H.width&&H.height),v=v||!!H.videoCodec,E=E||!!H.audioCodec,a&&H.audioCodec&&H.audioCodec.indexOf("mp4a.40.34")!==-1&&(H.audioCodec=void 0);var x=H.bitrate+"-"+H.attrs.RESOLUTION+"-"+H.attrs.CODECS;d=u[x],d?d.url.push(H.url):(d=new Q.Level(H),u[x]=d,O.push(d)),P&&(P.AUDIO&&Object(G.addGroupId)(d,"audio",P.AUDIO),P.SUBTITLES&&Object(G.addGroupId)(d,"text",P.SUBTITLES))}),(y||v)&&E&&(O=O.filter(function(H){var P=H.videoCodec,x=H.width,U=H.height;return!!P||!!(x&&U)})),O=O.filter(function(H){var P=H.audioCodec,x=H.videoCodec;return(!P||Object(z.isCodecSupportedInMp4)(P,"audio"))&&(!x||Object(z.isCodecSupportedInMp4)(x,"video"))}),T.audioTracks&&(R=T.audioTracks.filter(function(H){return!H.audioCodec||Object(z.isCodecSupportedInMp4)(H.audioCodec,"audio")}),Object(G.assignTrackIdsByGroup)(R)),T.subtitles&&(b=T.subtitles,Object(G.assignTrackIdsByGroup)(b)),O.length>0){_=O[0].bitrate,O.sort(function(H,P){return H.bitrate-P.bitrate}),this._levels=O;for(var M=0;M<O.length;M++)if(O[M].bitrate===_){this._firstLevel=M,this.log("manifest loaded, "+O.length+" level(s) found, first bitrate: "+_);break}var N=E&&!v,j={levels:O,audioTracks:R,subtitleTracks:b,firstLevel:this._firstLevel,stats:T.stats,audio:E,video:v,altAudio:!N&&R.some(function(H){return!!H.url})};this.hls.trigger(B.Events.MANIFEST_PARSED,j),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(B.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:T.url,reason:"no level with compatible codecs found in manifest"})},f.onError=function(C,T){if(t.prototype.onError.call(this,C,T),T.fatal)return;var O=T.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(T.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:if(T.frag){var d=this._levels[T.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(u=T.frag.level)):u=T.frag.level}break;case I.ErrorDetails.LEVEL_LOAD_ERROR:case I.ErrorDetails.LEVEL_LOAD_TIMEOUT:O&&(O.deliveryDirectives&&(_=!1),u=O.level),b=!0;break;case I.ErrorDetails.REMUX_ALLOC_ERROR:u=T.level,b=!0;break}u!==void 0&&this.recoverLevel(T,u,b,_)},f.recoverLevel=function(C,T,O,R){var b=C.details,_=this._levels[T];if(_.loadError++,O){var u=this.retryLoadingOrFail(C);if(u)C.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(R){var d=_.url.length;if(d>1&&_.loadError<d)C.levelRetry=!0,this.redundantFailover(T);else if(this.manualLevelIndex===-1){var y=T===0?this._levels.length-1:T-1;this.currentLevelIndex!==y&&this._levels[y].loadError===0&&(this.warn(b+": switch to "+y),C.levelRetry=!0,this.hls.nextAutoLevel=y)}}},f.redundantFailover=function(C){var T=this._levels[C],O=T.url.length;if(O>1){var R=(T.urlId+1)%O;this.warn("Switching to redundant URL-id "+R),this._levels.forEach(function(b){b.urlId=R}),this.level=C}},f.onFragLoaded=function(C,T){var O=T.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)}},f.onLevelLoaded=function(C,T){var O,R=T.level,b=T.details,_=this._levels[R];if(!_){var u;this.warn("Invalid level index "+R),(u=T.deliveryDirectives)!==null&&u!==void 0&&u.skip&&(b.deltaUpdateFailed=!0);return}R===this.currentLevelIndex?(_.fragmentError===0&&(_.loadError=0,this.retryCount=0),this.playlistLoaded(R,T,_.details)):(O=T.deliveryDirectives)!==null&&O!==void 0&&O.skip&&(b.deltaUpdateFailed=!0)},f.onAudioTrackSwitched=function(C,T){var O=this.hls.levels[this.currentLevelIndex];if(!O)return;if(O.audioGroupIds){for(var R=-1,b=this.hls.audioTracks[T.id].groupId,_=0;_<O.audioGroupIds.length;_++)if(O.audioGroupIds[_]===b){R=_;break}R!==O.urlId&&(O.urlId=R,this.startLoad())}},f.loadPlaylist=function(C){var T=this.currentLevelIndex,O=this._levels[T];if(this.canLoad&&O&&O.url.length>0){var R=O.urlId,b=O.url[R];if(C)try{b=C.addDirectives(b)}catch(_){this.warn("Could not construct new URL with HLS Delivery Directives: "+_)}this.log("Attempt loading level index "+T+(C?" at sn "+C.msn+" part "+C.part:"")+" with URL-id "+R+" "+b),this.clearTimer(),this.hls.trigger(B.Events.LEVEL_LOADING,{url:b,level:T,id:R,deliveryDirectives:C||null})}},f.removeLevel=function(C,T){var O=function(_,u){return u!==T},R=this._levels.filter(function(b,_){return _!==C?!0:b.url.length>1&&T!==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(B.Events.LEVELS_UPDATED,{levels:R})},h(c,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(C){var T,O=this._levels;if(O.length===0)return;if(this.currentLevelIndex===C&&(T=O[C])!==null&&T!==void 0&&T.details)return;if(C<0||C>=O.length){var R=C<0;if(this.hls.trigger(B.Events.ERROR,{type:I.ErrorTypes.OTHER_ERROR,details:I.ErrorDetails.LEVEL_SWITCH_ERROR,level:C,fatal:R,reason:"invalid level idx"}),R)return;C=Math.min(C,O.length-1)}this.clearTimer();var b=this.currentLevelIndex,_=O[b],u=O[C];this.log("switching to level "+C+" from "+b),this.currentLevelIndex=C;var d=m({},u,{level:C,maxBitrate:u.maxBitrate,uri:u.uri,urlId:u.urlId});delete d._urlId,this.hls.trigger(B.Events.LEVEL_SWITCHING,d);var y=u.details;if(!y||y.live){var v=this.switchParams(u.uri,_==null?void 0:_.details);this.loadPlaylist(v)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(C){this.manualLevelIndex=C,this._startLevel===void 0&&(this._startLevel=C),C!==-1&&(this.level=C)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(C){this._firstLevel=C}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var C=this.hls.config.startLevel;return C!==void 0?C:this._firstLevel}else return this._startLevel},set:function(C){this._startLevel=C}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(C){this.level=C,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=C)}}]),c}(L.default)},"./src/controller/level-helper.ts":function(ee,$,k){"use strict";k.r($),k.d($,"addGroupId",function(){return I}),k.d($,"assignTrackIdsByGroup",function(){return z}),k.d($,"updatePTS",function(){return G}),k.d($,"updateFragPTSDTS",function(){return D}),k.d($,"mergeDetails",function(){return m}),k.d($,"mapPartIntersection",function(){return g}),k.d($,"mapFragmentIntersection",function(){return h}),k.d($,"adjustSliding",function(){return o}),k.d($,"addSliding",function(){return l}),k.d($,"computeReloadInterval",function(){return a}),k.d($,"getFragmentWithSN",function(){return r}),k.d($,"getPartWith",function(){return t});var Q=k("./src/polyfills/number.ts"),B=k("./src/utils/logger.ts");function I(c,f,S){switch(f){case"audio":c.audioGroupIds||(c.audioGroupIds=[]),c.audioGroupIds.push(S);break;case"text":c.textGroupIds||(c.textGroupIds=[]),c.textGroupIds.push(S);break}}function z(c){var f={};c.forEach(function(S){var C=S.groupId||"";S.id=f[C]=f[C]||0,f[C]++})}function G(c,f,S){var C=c[f],T=c[S];L(C,T)}function L(c,f){var S=f.startPTS;if(Object(Q.isFiniteNumber)(S)){var C=0,T;f.sn>c.sn?(C=S-c.start,T=c):(C=c.start-S,T=f),T.duration!==C&&(T.duration=C)}else if(f.sn>c.sn){var O=c.cc===f.cc;O&&c.minEndPTS?f.start=c.start+(c.minEndPTS-c.start):f.start=c.start+c.duration}else f.start=Math.max(c.start-f.duration,0)}function D(c,f,S,C,T,O){var R=C-S;R<=0&&(B.logger.warn("Fragment should have a positive duration",f),C=S+f.duration,O=T+f.duration);var b=S,_=C,u=f.startPTS,d=f.endPTS;if(Object(Q.isFiniteNumber)(u)){var y=Math.abs(u-S);Object(Q.isFiniteNumber)(f.deltaPTS)?f.deltaPTS=Math.max(y,f.deltaPTS):f.deltaPTS=y,b=Math.max(S,u),S=Math.min(S,u),T=Math.min(T,f.startDTS),_=Math.min(C,d),C=Math.max(C,d),O=Math.max(O,f.endDTS)}f.duration=C-S;var v=S-f.start;f.appendedPTS=C,f.start=f.startPTS=S,f.maxStartPTS=b,f.startDTS=T,f.endPTS=C,f.minEndPTS=_,f.endDTS=O;var E=f.sn;if(!c||E<c.startSN||E>c.endSN)return 0;var M,N=E-c.startSN,j=c.fragments;for(j[N]=f,M=N;M>0;M--)L(j[M],j[M-1]);for(M=N;M<j.length-1;M++)L(j[M],j[M+1]);return c.fragmentHint&&L(j[j.length-1],c.fragmentHint),c.PTSKnown=c.alignedSliding=!0,v}function m(c,f){for(var S=null,C=c.fragments,T=C.length-1;T>=0;T--){var O=C[T].initSegment;if(O){S=O;break}}c.fragmentHint&&delete c.fragmentHint.endPTS;var R=0,b;if(h(c,f,function(M,N){M.relurl&&(R=M.cc-N.cc),Object(Q.isFiniteNumber)(M.startPTS)&&Object(Q.isFiniteNumber)(M.endPTS)&&(N.start=N.startPTS=M.startPTS,N.startDTS=M.startDTS,N.appendedPTS=M.appendedPTS,N.maxStartPTS=M.maxStartPTS,N.endPTS=M.endPTS,N.endDTS=M.endDTS,N.minEndPTS=M.minEndPTS,N.duration=M.endPTS-M.startPTS,N.duration&&(b=N),f.PTSKnown=f.alignedSliding=!0),N.elementaryStreams=M.elementaryStreams,N.loader=M.loader,N.stats=M.stats,N.urlId=M.urlId,M.initSegment&&(N.initSegment=M.initSegment,S=M.initSegment)}),S){var _=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments;_.forEach(function(M){var N;(!M.initSegment||M.initSegment.relurl===((N=S)===null||N===void 0?void 0:N.relurl))&&(M.initSegment=S)})}if(f.skippedSegments&&(f.deltaUpdateFailed=f.fragments.some(function(M){return!M}),f.deltaUpdateFailed)){B.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var u=f.skippedSegments;u--;)f.fragments.shift();f.startSN=f.fragments[0].sn,f.startCC=f.fragments[0].cc}var d=f.fragments;if(R){B.logger.warn("discontinuity sliding from playlist, take drift into account");for(var y=0;y<d.length;y++)d[y].cc+=R}f.skippedSegments&&(f.startCC=f.fragments[0].cc),g(c.partList,f.partList,function(M,N){N.elementaryStreams=M.elementaryStreams,N.stats=M.stats}),b?D(f,b,b.startPTS,b.endPTS,b.startDTS,b.endDTS):o(c,f),d.length&&(f.totalduration=f.edge-d[0].start),f.driftStartTime=c.driftStartTime,f.driftStart=c.driftStart;var v=f.advancedDateTime;if(f.advanced&&v){var E=f.edge;f.driftStart||(f.driftStartTime=v,f.driftStart=E),f.driftEndTime=v,f.driftEnd=E}else f.driftEndTime=c.driftEndTime,f.driftEnd=c.driftEnd,f.advancedDateTime=c.advancedDateTime}function g(c,f,S){if(c&&f)for(var C=0,T=0,O=c.length;T<=O;T++){var R=c[T],b=f[T+C];R&&b&&R.index===b.index&&R.fragment.sn===b.fragment.sn?S(R,b):C--}}function h(c,f,S){for(var C=f.skippedSegments,T=Math.max(c.startSN,f.startSN)-f.startSN,O=(c.fragmentHint?1:0)+(C?f.endSN:Math.min(c.endSN,f.endSN))-f.startSN,R=f.startSN-c.startSN,b=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,_=c.fragmentHint?c.fragments.concat(c.fragmentHint):c.fragments,u=T;u<=O;u++){var d=_[R+u],y=b[u];C&&!y&&u<C&&(y=f.fragments[u]=d),d&&y&&S(d,y)}}function o(c,f){var S=f.startSN+f.skippedSegments-c.startSN,C=c.fragments;if(S<0||S>=C.length)return;l(f,C[S].start)}function l(c,f){if(f){for(var S=c.fragments,C=c.skippedSegments;C<S.length;C++)S[C].start+=f;c.fragmentHint&&(c.fragmentHint.start+=f)}}function a(c,f){var S=1e3*c.levelTargetDuration,C=S/2,T=c.age,O=T>0&&T<S*3,R=f.loading.end-f.loading.start,b,_=c.availabilityDelay;if(c.updated===!1)if(O){var u=333*c.misses;b=Math.max(Math.min(C,R*2),u),c.availabilityDelay=(c.availabilityDelay||0)+b}else b=C;else O?(_=Math.min(_||S/2,T),c.availabilityDelay=_,b=_+S-T):b=S-R;return Math.round(b)}function r(c,f,S){if(!c||!c.details)return null;var C=c.details,T=C.fragments[f-C.startSN];return T||(T=C.fragmentHint,T&&T.sn===f?T:f<C.startSN&&S&&S.sn===f?S:null)}function t(c,f,S){if(!c||!c.details)return null;var C=c.details.partList;if(C)for(var T=C.length;T--;){var O=C[T];if(O.index===S&&O.fragment.sn===f)return O}return null}},"./src/controller/stream-controller.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return C});var Q=k("./src/polyfills/number.ts"),B=k("./src/controller/base-stream-controller.ts"),I=k("./src/is-supported.ts"),z=k("./src/events.ts"),G=k("./src/utils/buffer-helper.ts"),L=k("./src/controller/fragment-tracker.ts"),D=k("./src/types/loader.ts"),m=k("./src/loader/fragment.ts"),g=k("./src/demux/transmuxer-interface.ts"),h=k("./src/types/transmuxer.ts"),o=k("./src/controller/gap-controller.ts"),l=k("./src/errors.ts"),a=k("./src/utils/logger.ts");function r(T,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(T,b.key,b)}}function t(T,O,R){return O&&r(T.prototype,O),R&&r(T,R),T}function c(T,O){T.prototype=Object.create(O.prototype),T.prototype.constructor=T,f(T,O)}function f(T,O){return f=Object.setPrototypeOf||function(b,_){return b.__proto__=_,b},f(T,O)}var S=100,C=function(T){c(O,T);function O(b,_){var u;return u=T.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(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(z.Events.LEVEL_LOADING,this.onLevelLoading,this),_.on(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(z.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.on(z.Events.ERROR,this.onError,this),_.on(z.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.on(z.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.on(z.Events.BUFFER_CREATED,this.onBufferCreated,this),_.on(z.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.on(z.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.on(z.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R._unregisterListeners=function(){var _=this.hls;_.off(z.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(z.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(z.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(z.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(z.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(z.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),_.off(z.Events.ERROR,this.onError,this),_.off(z.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),_.off(z.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),_.off(z.Events.BUFFER_CREATED,this.onBufferCreated,this),_.off(z.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),_.off(z.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),_.off(z.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(S),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var y=d.startLevel;y===-1&&(d.config.testBandwidth?(y=0,this.bitrateTest=!0):y=d.nextAutoLevel),this.level=d.nextLoadLevel=y,this.loadedmetadata=!1}u>0&&_===-1&&(this.log("Override startPosition with lastCurrentTime @"+u.toFixed(3)),_=u),this.state=B.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=_,this.tick()}else this._forceStartLoad=!0,this.state=B.State.STOPPED},R.stopLoad=function(){this._forceStartLoad=!1,T.prototype.stopLoad.call(this)},R.doTick=function(){switch(this.state){case B.State.IDLE:this.doTickIdle();break;case B.State.WAITING_LEVEL:{var _,u=this.levels,d=this.level,y=u==null||((_=u[d])===null||_===void 0)?void 0:_.details;if(y&&(!y.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(y))break;this.state=B.State.IDLE;break}break}case B.State.FRAG_LOADING_WAITING_RETRY:{var v,E=self.performance.now(),M=this.retryDate;(!M||E>=M||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=B.State.IDLE)}break;default:break}this.onTickEnd()},R.onTickEnd=function(){T.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},R.doTickIdle=function(){var _,u,d=this.hls,y=this.levelLastLoaded,v=this.levels,E=this.media,M=d.config,N=d.nextLoadLevel;if(y===null||!E&&(this.startFragRequested||!M.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[N])return;var j=v[N];this.level=d.nextLoadLevel=N;var H=j.details;if(!H||this.state===B.State.WAITING_LEVEL||H.live&&this.levelLastLoaded!==N){this.state=B.State.WAITING_LEVEL;return}var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:E,D.PlaylistLevelType.MAIN);if(P===null)return;var x=P.len,U=this.getMaxBufferLength(j.maxBitrate);if(x>=U)return;if(this._streamEnded(P,H)){var V={};this.altAudio&&(V.type="video"),this.hls.trigger(z.Events.BUFFER_EOS,V),this.state=B.State.ENDED;return}var q=P.end,ie=this.getNextFragment(q,H);if(this.couldBacktrack&&!this.fragPrevious&&ie&&ie.sn!=="initSegment"){var se=ie.sn-H.startSN;se>1&&(ie=H.fragments[se-1],this.fragmentTracker.removeFragment(ie))}if(ie&&this.fragmentTracker.getState(ie)===L.FragmentState.OK&&this.nextLoadPosition>q){var ve=this.audioOnly&&!this.altAudio?m.ElementaryStreamTypes.AUDIO:m.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(E,ve,D.PlaylistLevelType.MAIN),ie=this.getNextFragment(this.nextLoadPosition,H)}if(!ie)return;ie.initSegment&&!ie.initSegment.data&&!this.bitrateTest&&(ie=ie.initSegment),((_=ie.decryptdata)===null||_===void 0?void 0:_.keyFormat)==="identity"&&!((u=ie.decryptdata)!==null&&u!==void 0&&u.key)?this.loadKey(ie,H):this.loadFragment(ie,H,q)},R.loadFragment=function(_,u,d){var y,v=this.fragmentTracker.getState(_);if(this.fragCurrent=_,v===L.FragmentState.BACKTRACKED){var E=this.fragmentTracker.getBacktrackData(_);if(E){this._handleFragmentLoadProgress(E),this._handleFragmentLoadComplete(E);return}else v=L.FragmentState.NOT_LOADED}v===L.FragmentState.NOT_LOADED||v===L.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,T.prototype.loadFragment.call(this,_,u,d)):v===L.FragmentState.APPENDING?this.reduceMaxBufferLength(_.duration)&&this.fragmentTracker.removeFragment(_):((y=this.media)===null||y===void 0?void 0:y.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,y=this.getAppendedFrag(u.currentTime);if(y&&y.start>1&&this.flushMainBuffer(0,y.start-1),!u.paused&&_){var v=this.hls.nextLoadLevel,E=_[v],M=this.fragLastKbps;M&&this.fragCurrent?d=this.fragCurrent.duration*E.maxBitrate/(1e3*M)+1:d=0}else d=0;var N=this.getBufferedFrag(u.currentTime+d);if(N){var j=this.followingBufferedFrag(N);if(j){this.abortCurrentFrag();var H=j.maxStartPTS?j.maxStartPTS:j.start,P=j.duration,x=Math.max(N.end,H+Math.min(Math.max(P-this.config.maxFragLookUpTolerance,P*.5),P*.75));this.flushMainBuffer(x,Number.POSITIVE_INFINITY)}}}},R.abortCurrentFrag=function(){var _=this.fragCurrent;this.fragCurrent=null,_!=null&&_.loader&&_.loader.abort(),this.state===B.State.KEY_LOADING&&(this.state=B.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},R.flushMainBuffer=function(_,u){T.prototype.flushMainBuffer.call(this,_,u,this.altAudio?"video":null)},R.onMediaAttached=function(_,u){T.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),T.prototype.onMediaDetaching.call(this)},R.onMediaPlaying=function(){this.tick()},R.onMediaSeeked=function(){var _=this.media,u=_?_.currentTime:null;Object(Q.isFiniteNumber)(u)&&this.log("Media seeked to "+u.toFixed(3)),this.tick()},R.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(z.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,y=!1,v;u.levels.forEach(function(E){v=E.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(d=!0),v.indexOf("mp4a.40.5")!==-1&&(y=!0))}),this.audioCodecSwitch=d&&y&&!Object(I.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!==B.State.IDLE)return;var y=d[u.level];(!y.details||y.details.live&&this.levelLastLoaded!==u.level||this.waitForCdnTuneIn(y.details))&&(this.state=B.State.WAITING_LEVEL)},R.onLevelLoaded=function(_,u){var d,y=this.levels,v=u.level,E=u.details,M=E.totalduration;if(!y){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+E.startSN+","+E.endSN+"], cc ["+E.startCC+", "+E.endCC+"] duration:"+M);var N=this.fragCurrent;N&&(this.state===B.State.FRAG_LOADING||this.state===B.State.FRAG_LOADING_WAITING_RETRY)&&(N.level!==u.level&&N.loader&&(this.state=B.State.IDLE,N.loader.abort()));var j=y[v],H=0;if(E.live||(d=j.details)!==null&&d!==void 0&&d.live){if(E.fragments[0]||(E.deltaUpdateFailed=!0),E.deltaUpdateFailed)return;H=this.alignPlaylists(E,j.details)}if(j.details=E,this.levelLastLoaded=v,this.hls.trigger(z.Events.LEVEL_UPDATED,{details:E,level:v}),this.state===B.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(E))return;this.state=B.State.IDLE}this.startFragRequested?E.live&&this.synchronizeToLiveEdge(E):this.setStartPosition(E,H),this.tick()},R._handleFragmentLoadProgress=function(_){var u,d=_.frag,y=_.part,v=_.payload,E=this.levels;if(!E){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var M=E[d.level],N=M.details;if(!N){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var j=M.videoCodec,H=N.PTSKnown||!N.live,P=(u=d.initSegment)===null||u===void 0?void 0:u.data,x=this._getAudioCodec(M),U=this.transmuxer=this.transmuxer||new g.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),V=y?y.index:-1,q=V!==-1,ie=new h.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,v.byteLength,V,q),se=this.initPTS[d.cc];U.push(v,P,x,j,d,y,N.totalduration,H,ie,se)},R.onAudioTrackSwitching=function(_,u){var d=this.altAudio,y=!!u.url,v=u.id;if(!y){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var E=this.fragCurrent;E!=null&&E.loader&&(this.log("Switching to main audio track, cancel main fragment load"),E.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var M=this.hls;d&&M.trigger(z.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),M.trigger(z.Events.AUDIO_TRACK_SWITCHED,{id:v})}},R.onAudioTrackSwitched=function(_,u){var d=u.id,y=!!this.hls.audioTracks[d].url;if(y){var v=this.videoBuffer;v&&this.mediaBuffer!==v&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=v)}this.altAudio=y,this.tick()},R.onBufferCreated=function(_,u){var d=u.tracks,y,v,E=!1;for(var M in d){var N=d[M];if(N.id==="main"){if(v=M,y=N,M==="video"){var j=d[M];j&&(this.videoBuffer=j.buffer)}}else E=!0}E&&y?(this.log("Alternate track found, use "+v+".buffered to schedule main fragment loading"),this.mediaBuffer=y.buffer):this.mediaBuffer=this.media},R.onFragBuffered=function(_,u){var d=u.frag,y=u.part;if(d&&d.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(y?" p: "+y.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===B.State.PARSED&&(this.state=B.State.IDLE);return}var v=y?y.stats:d.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,y)},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!==B.State.ERROR&&(u.fatal?(this.warn(""+u.details),this.state=B.State.ERROR):!u.levelRetry&&this.state===B.State.WAITING_LEVEL&&(this.state=B.State.IDLE));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(u.parent==="main"&&(this.state===B.State.PARSING||this.state===B.State.PARSED)){var d=!0,y=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);y&&y.len>.5&&(d=!this.reduceMaxBufferLength(y.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=G.BufferHelper.getBuffered(_);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):u.poll(this.lastCurrentTime),this.lastCurrentTime=_.currentTime},R.onFragLoadEmergencyAborted=function(){this.state=B.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 y=(d===m.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(y,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){a.logger.log("could not seek to "+d+", already seeking at "+u);return}var y=G.BufferHelper.getBuffered(_),v=y.length?y.start(0):0,E=v-d;E>0&&(E<this.config.maxBufferHole||E<this.config.maxFragLookUpTolerance)&&(a.logger.log("adjusting start position by "+E+" to match buffer start"),d+=E,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 y=u.hls;if(!d||y.nextLoadLevel||u.fragContextChanged(_))return;u.fragLoadError=0,u.state=B.State.IDLE,u.startFragRequested=!1,u.bitrateTest=!1;var v=_.stats;v.parsing.start=v.parsing.end=v.buffering.start=v.buffering.end=self.performance.now(),y.trigger(z.Events.FRAG_LOADED,d)})},R._handleTransmuxComplete=function(_){var u,d="main",y=this.hls,v=_.remuxResult,E=_.chunkMeta,M=this.getCurrentContext(E);if(!M){this.warn("The loading context changed while buffering fragment "+E.sn+" of level "+E.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(E.level);return}var N=M.frag,j=M.part,H=M.level,P=v.video,x=v.text,U=v.id3,V=v.initSegment,q=this.altAudio?void 0:v.audio;if(this.fragContextChanged(N))return;if(this.state=B.State.PARSING,V){V.tracks&&(this._bufferInitSegment(H,V.tracks,N,E),y.trigger(z.Events.FRAG_PARSING_INIT_SEGMENT,{frag:N,id:d,tracks:V.tracks}));var ie=V.initPTS,se=V.timescale;Object(Q.isFiniteNumber)(ie)&&(this.initPTS[N.cc]=ie,y.trigger(z.Events.INIT_PTS_FOUND,{frag:N,id:d,initPTS:ie,timescale:se}))}if(P&&v.independent!==!1){if(H.details){var ve=P.startPTS,Te=P.endPTS,fe=P.startDTS,_e=P.endDTS;if(j)j.elementaryStreams[P.type]={startPTS:ve,endPTS:Te,startDTS:fe,endDTS:_e};else if(P.firstKeyFrame&&P.independent&&(this.couldBacktrack=!0),P.dropped&&P.independent){var ue=this.getLoadPosition()+this.config.maxBufferHole;if(ue<ve){this.backtrack(N);return}N.setElementaryStreamInfo(P.type,N.start,Te,N.start,_e,!0)}N.setElementaryStreamInfo(P.type,ve,Te,fe,_e),this.bufferFragmentData(P,N,j,E)}}else if(v.independent===!1){this.backtrack(N);return}if(q){var xe=q.startPTS,Y=q.endPTS,oe=q.startDTS,ce=q.endDTS;j&&(j.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:xe,endPTS:Y,startDTS:oe,endDTS:ce}),N.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,xe,Y,oe,ce),this.bufferFragmentData(q,N,j,E)}if(U!=null&&(u=U.samples)!==null&&u!==void 0&&u.length){var Re={frag:N,id:d,samples:U.samples};y.trigger(z.Events.FRAG_PARSING_METADATA,Re)}if(x){var Ge={frag:N,id:d,samples:x.samples};y.trigger(z.Events.FRAG_PARSING_USERDATA,Ge)}},R._bufferInitSegment=function(_,u,d,y){var v=this;if(this.state!==B.State.PARSING)return;this.audioOnly=!!u.audio&&!u.video,this.altAudio&&!this.audioOnly&&delete u.audio;var E=u.audio,M=u.video,N=u.audiovideo;if(E){var j=_.audioCodec,H=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(j&&(j.indexOf("mp4a.40.5")!==-1?j="mp4a.40.2":j="mp4a.40.5"),E.metadata.channelCount!==1&&H.indexOf("firefox")===-1&&(j="mp4a.40.5")),H.indexOf("android")!==-1&&E.container!=="audio/mpeg"&&(j="mp4a.40.2",this.log("Android: force audio codec to "+j)),_.audioCodec&&_.audioCodec!==j&&this.log('Swapping manifest audio codec "'+_.audioCodec+'" for "'+j+'"'),E.levelCodec=j,E.id="main",this.log("Init audio buffer, container:"+E.container+", codecs[selected/level/parsed]=["+(j||"")+"/"+(_.audioCodec||"")+"/"+E.codec+"]")}M&&(M.levelCodec=_.videoCodec,M.id="main",this.log("Init video buffer, container:"+M.container+", codecs[level/parsed]=["+(_.videoCodec||"")+"/"+M.codec+"]")),N&&this.log("Init audiovideo buffer, container:"+N.container+", codecs[level/parsed]=["+(_.attrs.CODECS||"")+"/"+N.codec+"]"),this.hls.trigger(z.Events.BUFFER_CODECS,u),Object.keys(u).forEach(function(P){var x=u[P],U=x.initSegment;U!=null&&U.byteLength&&v.hls.trigger(z.Events.BUFFER_APPENDING,{type:P,data:U,frag:d,part:null,chunkMeta:y,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=B.State.BACKTRACKING},R.checkFragmentChanged=function(){var _=this.media,u=null;if(_&&_.readyState>1&&_.seeking===!1){var d=_.currentTime;if(G.BufferHelper.isBuffered(_,d)?u=this.getAppendedFrag(d):G.BufferHelper.isBuffered(_,d+.1)&&(u=this.getAppendedFrag(d+.1)),u){var y=this.fragPlaying,v=u.level;(!y||u.sn!==y.sn||y.level!==v||u.urlId!==y.urlId)&&(this.hls.trigger(z.Events.FRAG_CHANGED,{frag:u}),(!y||y.level!==v)&&this.hls.trigger(z.Events.LEVEL_SWITCHED,{level:v}),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}(B.default)},"./src/controller/subtitle-stream-controller.ts":function(ee,$,k){"use strict";k.r($),k.d($,"SubtitleStreamController",function(){return c});var Q=k("./src/events.ts"),B=k("./src/utils/logger.ts"),I=k("./src/utils/buffer-helper.ts"),z=k("./src/controller/fragment-finders.ts"),G=k("./src/utils/discontinuities.ts"),L=k("./src/controller/level-helper.ts"),D=k("./src/controller/fragment-tracker.ts"),m=k("./src/controller/base-stream-controller.ts"),g=k("./src/types/loader.ts"),h=k("./src/types/level.ts");function o(f,S){for(var C=0;C<S.length;C++){var T=S[C];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(f,T.key,T)}}function l(f,S,C){return S&&o(f.prototype,S),C&&o(f,C),f}function a(f,S){f.prototype=Object.create(S.prototype),f.prototype.constructor=f,r(f,S)}function r(f,S){return r=Object.setPrototypeOf||function(T,O){return T.__proto__=O,T},r(f,S)}var t=500,c=function(f){a(S,f);function S(T,O){var R;return R=f.call(this,T,O,"[subtitle-stream-controller]")||this,R.levels=[],R.currentTrackId=-1,R.tracksBuffered=[],R.mainDetails=null,R._registerListeners(),R}var C=S.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var O=this.hls;O.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.on(Q.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.on(Q.Events.ERROR,this.onError,this),O.on(Q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.on(Q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.on(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.on(Q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.on(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C._unregisterListeners=function(){var O=this.hls;O.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),O.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),O.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),O.off(Q.Events.LEVEL_LOADED,this.onLevelLoaded,this),O.off(Q.Events.ERROR,this.onError,this),O.off(Q.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),O.off(Q.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),O.off(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),O.off(Q.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),O.off(Q.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},C.startLoad=function(){this.stopLoad(),this.state=m.State.IDLE,this.setInterval(t),this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},C.onLevelLoaded=function(O,R){this.mainDetails=R.details},C.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,y=b.start,v=0;v<u.length;v++)if(y>=u[v].start&&y<=u[v].end){d=u[v];break}var E=b.start+b.duration;d?d.end=E:(d={start:y,end:E},u.push(d)),this.fragmentTracker.fragBuffered(b)},C.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 y=d[u].details,v=y.targetduration,E=_-v;if(E<=0)return;R.endOffsetSubtitles=Math.max(0,E),this.tracksBuffered.forEach(function(M){for(var N=0;N<M.length;){if(M[N].end<=E){M.shift();continue}else if(M[N].start<E)M[N].start=E;else break;N++}}),this.fragmentTracker.removeFragmentsInRange(b,E,g.PlaylistLevelType.SUBTITLE)}},C.onError=function(O,R){var b,_=R.frag;if(!_||_.type!==g.PlaylistLevelType.SUBTITLE)return;(b=this.fragCurrent)!==null&&b!==void 0&&b.loader&&this.fragCurrent.loader.abort(),this.state=m.State.IDLE},C.onSubtitleTracksUpdated=function(O,R){var b=this,_=R.subtitleTracks;this.tracksBuffered=[],this.levels=_.map(function(u){return new h.Level(u)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(u){b.tracksBuffered[u.id]=[]}),this.mediaBuffer=null},C.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)},C.onSubtitleTrackLoaded=function(O,R){var b,_=R.details,u=R.id,d=this.currentTrackId,y=this.levels;if(!y.length)return;var v=y[d];if(u>=y.length||u!==d||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,_.live||(b=v.details)!==null&&b!==void 0&&b.live){var E=this.mainDetails;if(_.deltaUpdateFailed||!E)return;var M=E.fragments[0];if(!v.details)_.hasProgramDateTime&&E.hasProgramDateTime?Object(G.alignMediaPlaylistByPDT)(_,E):M&&Object(L.addSliding)(_,M.start);else{var N=this.alignPlaylists(_,v.details);N===0&&M&&Object(L.addSliding)(_,M.start)}}if(v.details=_,this.levelLastLoaded=u,this.tick(),_.live&&!this.fragCurrent&&this.media&&this.state===m.State.IDLE){var j=Object(z.findFragmentByPTS)(null,_.fragments,this.media.currentTime,0);j||(this.warn("Subtitle playlist not aligned with playback"),v.details=void 0)}},C._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(y){var v=performance.now();u.trigger(Q.Events.FRAG_DECRYPTED,{frag:R,payload:y,stats:{tstart:d,tdecrypt:v}})})}},C.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,y=this.media,v=I.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,y.currentTime-u,d.maxBufferHole),E=v.end,M=v.len,N=this.getMaxBufferLength()+u;if(M>N)return;console.assert(_,"Subtitle track details are defined on idle subtitle stream controller tick");var j=_.fragments,H=j.length,P=_.edge,x,U=this.fragPrevious;if(E<P){var V=d.maxFragLookUpTolerance;U&&_.hasProgramDateTime&&(x=Object(z.findFragmentByPDT)(j,U.endProgramDateTime,V)),x||(x=Object(z.findFragmentByPTS)(U,j,E,V),!x&&U&&U.start<j[0].start&&(x=j[0]))}else x=j[H-1];(O=x)!==null&&O!==void 0&&O.encrypted?(B.logger.log("Loading key for "+x.sn),this.state=m.State.KEY_LOADING,this.hls.trigger(Q.Events.KEY_LOADING,{frag:x})):x&&this.fragmentTracker.getState(x)===D.FragmentState.NOT_LOADED&&this.loadFragment(x,_,E)}},C.loadFragment=function(O,R,b){this.fragCurrent=O,f.prototype.loadFragment.call(this,O,R,b)},l(S,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),S}(m.default)},"./src/controller/subtitle-track-controller.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/events.ts"),B=k("./src/utils/texttrack-utils.ts"),I=k("./src/controller/base-playlist-controller.ts"),z=k("./src/types/loader.ts");function G(o,l){for(var a=0;a<l.length;a++){var r=l[a];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(o,r.key,r)}}function L(o,l,a){return l&&G(o.prototype,l),a&&G(o,a),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(r,t){return r.__proto__=t,r},m(o,l)}var g=function(o){D(l,o);function l(r){var t;return t=o.call(this,r,"[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 a=l.prototype;return a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,o.prototype.destroy.call(this)},a.registerListeners=function(){var t=this.hls;t.on(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(Q.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var t=this.hls;t.off(Q.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(Q.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(Q.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(Q.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(Q.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(Q.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(Q.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(Q.Events.ERROR,this.onError,this)},a.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)},a.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},a.onMediaDetaching=function(){if(!this.media)return;self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var t=h(this.media.textTracks);t.forEach(function(c){Object(B.clearCurrentCues)(c)}),this.subtitleTrack=-1,this.media=null},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},a.onManifestParsed=function(t,c){this.tracks=c.subtitleTracks},a.onSubtitleTrackLoaded=function(t,c){var f=c.id,S=c.details,C=this.trackId,T=this.tracksInGroup[C];if(!T){this.warn("Invalid subtitle track id "+f);return}var O=T.details;T.details=c.details,this.log("subtitle track "+f+" loaded ["+S.startSN+"-"+S.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,c,O))},a.onLevelLoading=function(t,c){this.switchLevel(c.level)},a.onLevelSwitching=function(t,c){this.switchLevel(c.level)},a.switchLevel=function(t){var c=this.hls.levels[t];if(!(c!=null&&c.textGroupIds))return;var f=c.textGroupIds[c.urlId];if(this.groupId!==f){var S=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,C=this.tracks.filter(function(R){return!f||R.groupId===f});this.tracksInGroup=C;var T=this.findTrackId(S==null?void 0:S.name)||this.findTrackId();this.groupId=f;var O={subtitleTracks:C};this.log("Updating subtitle tracks, "+C.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(Q.Events.SUBTITLE_TRACKS_UPDATED,O),T!==-1&&this.setSubtitleTrack(T,S)}},a.findTrackId=function(t){for(var c=this.tracksInGroup,f=0;f<c.length;f++){var S=c[f];if((!this.selectDefaultTrack||S.default)&&(!t||t===S.name))return S.id}return-1},a.onError=function(t,c){if(o.prototype.onError.call(this,t,c),c.fatal||!c.context)return;c.context.type===z.PlaylistContextType.SUBTITLE_TRACK&&c.context.id===this.trackId&&c.context.groupId===this.groupId&&this.retryLoadingOrFail(c)},a.loadPlaylist=function(t){var c=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(c)){var f=c.id,S=c.groupId,C=c.url;if(t)try{C=t.addDirectives(C)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Loading subtitle playlist for id "+f),this.hls.trigger(Q.Events.SUBTITLE_TRACK_LOADING,{url:C,id:f,groupId:S,deliveryDirectives:t||null})}},a.toggleTrackModes=function(t){var c=this,f=this.media,S=this.subtitleDisplay,C=this.trackId;if(!f)return;var T=h(f.textTracks),O=T.filter(function(_){return _.groupId===c.groupId});if(t===-1)[].slice.call(T).forEach(function(_){_.mode="disabled"});else{var R=O[C];R&&(R.mode="disabled")}var b=O[t];b&&(b.mode=S?"showing":"hidden")},a.setSubtitleTrack=function(t,c){var f,S=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(f=S[t])!==null&&f!==void 0&&f.details)||t<-1||t>=S.length)return;this.clearTimer();var C=S[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,C){var T=C.id,O=C.groupId,R=O===void 0?"":O,b=C.name,_=C.type,u=C.url;this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:T,groupId:R,name:b,type:_,url:u});var d=this.switchParams(C.url,c==null?void 0:c.details);this.loadPlaylist(d)}else this.hls.trigger(Q.Events.SUBTITLE_TRACK_SWITCH,{id:t})},a.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var t=-1,c=h(this.media.textTracks),f=0;f<c.length;f++)if(c[f].mode==="hidden")t=f;else if(c[f].mode==="showing"){t=f;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)},L(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}(I.default);function h(o){for(var l=[],a=0;a<o.length;a++){var r=o[a];r.kind==="subtitles"&&r.label&&l.push(o[a])}return l}$.default=g},"./src/controller/timeline-controller.ts":function(ee,$,k){"use strict";k.r($),k.d($,"TimelineController",function(){return h});var Q=k("./src/polyfills/number.ts"),B=k("./src/events.ts"),I=k("./src/utils/cea-608-parser.ts"),z=k("./src/utils/output-filter.ts"),G=k("./src/utils/webvtt-parser.ts"),L=k("./src/utils/texttrack-utils.ts"),D=k("./src/utils/imsc1-ttml-parser.ts"),m=k("./src/types/loader.ts"),g=k("./src/utils/logger.ts"),h=function(){function r(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=a(),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 f=new z.default(this,"textTrack1"),S=new z.default(this,"textTrack2"),C=new z.default(this,"textTrack3"),T=new z.default(this,"textTrack4");this.cea608Parser1=new I.default(1,f,S),this.cea608Parser2=new I.default(3,C,T)}c.on(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.on(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),c.on(B.Events.FRAG_LOADING,this.onFragLoading,this),c.on(B.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),c.on(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),c.on(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.on(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),c.on(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=r.prototype;return t.destroy=function(){var f=this.hls;f.off(B.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),f.off(B.Events.MANIFEST_LOADED,this.onManifestLoaded,this),f.off(B.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),f.off(B.Events.FRAG_LOADING,this.onFragLoading,this),f.off(B.Events.FRAG_LOADED,this.onFragLoaded,this),f.off(B.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),f.off(B.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),f.off(B.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),f.off(B.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),f.off(B.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(f,S,C,T,O){for(var R=!1,b=O.length;b--;){var _=O[b],u=l(_[0],_[1],S,C);if(u>=0&&(_[0]=Math.min(_[0],S),_[1]=Math.max(_[1],C),R=!0,u/(C-S)>.5))return}if(R||O.push([S,C]),this.config.renderTextTracksNatively){var d=this.captionsTracks[f];this.Cues.newCue(d,S,C,T)}else{var y=this.Cues.newCue(null,S,C,T);this.hls.trigger(B.Events.CUES_PARSED,{type:"captions",cues:y,track:f})}},t.onInitPtsFound=function(f,S){var C=this,T=S.frag,O=S.id,R=S.initPTS,b=S.timescale,_=this.unparsedVttFrags;O==="main"&&(this.initPTS[T.cc]=R,this.timescale[T.cc]=b),_.length&&(this.unparsedVttFrags=[],_.forEach(function(u){C.onFragLoaded(B.Events.FRAG_LOADED,u)}))},t.getExistingTrack=function(f){var S=this.media;if(S)for(var C=0;C<S.textTracks.length;C++){var T=S.textTracks[C];if(T[f])return T}return null},t.createCaptionsTrack=function(f){this.config.renderTextTracksNatively?this.createNativeTrack(f):this.createNonNativeTrack(f)},t.createNativeTrack=function(f){if(this.captionsTracks[f])return;var S=this.captionsProperties,C=this.captionsTracks,T=this.media,O=S[f],R=O.label,b=O.languageCode,_=this.getExistingTrack(f);if(_)C[f]=_,Object(L.clearCurrentCues)(C[f]),Object(L.sendAddTrackEvent)(C[f],T);else{var u=this.createTextTrack("captions",R,b);u&&(u[f]=!0,C[f]=u)}},t.createNonNativeTrack=function(f){if(this.nonNativeCaptionsTracks[f])return;var S=this.captionsProperties[f];if(!S)return;var C=S.label,T={_id:f,label:C,kind:"captions",default:S.media?!!S.media.default:!1,closedCaptions:S.media};this.nonNativeCaptionsTracks[f]=T,this.hls.trigger(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[T]})},t.createTextTrack=function(f,S,C){var T=this.media;return T?T.addTextTrack(f,S,C):void 0},t.onMediaAttaching=function(f,S){this.media=S.media,this._cleanTracks()},t.onMediaDetaching=function(){var f=this.captionsTracks;Object.keys(f).forEach(function(S){Object(L.clearCurrentCues)(f[S]),delete f[S]}),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=a(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},t._cleanTracks=function(){var f=this.media;if(!f)return;var S=f.textTracks;if(S)for(var C=0;C<S.length;C++)Object(L.clearCurrentCues)(S[C])},t.onSubtitleTracksUpdated=function(f,S){var C=this;this.textTracks=[];var T=S.subtitleTracks||[],O=T.some(function(u){return u.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||O&&this.config.enableIMSC1){var R=this.tracks&&T&&this.tracks.length===T.length;if(this.tracks=T||[],this.config.renderTextTracksNatively){var b=this.media?this.media.textTracks:[];this.tracks.forEach(function(u,d){var y;if(d<b.length){for(var v=null,E=0;E<b.length;E++)if(o(b[E],u)){v=b[E];break}v&&(y=v)}y?Object(L.clearCurrentCues)(y):(y=C.createTextTrack("subtitles",u.name,u.lang),y&&(y.mode="disabled")),y&&(y.groupId=u.groupId,C.textTracks.push(y))})}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(B.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:_})}}},t.onManifestLoaded=function(f,S){var C=this;this.config.enableCEA708Captions&&S.captions&&S.captions.forEach(function(T){var O=/(?:CC|SERVICE)([1-4])/.exec(T.instreamId);if(!O)return;var R="textTrack"+O[1],b=C.captionsProperties[R];if(!b)return;b.label=T.name,T.lang&&(b.languageCode=T.lang),b.media=T})},t.onFragLoading=function(f,S){var C=this.cea608Parser1,T=this.cea608Parser2,O=this.lastSn,R=this.lastPartIndex;if(!this.enabled||!(C&&T))return;if(S.frag.type===m.PlaylistLevelType.MAIN){var b,_,u=S.frag.sn,d=(b=S==null||((_=S.part)===null||_===void 0)?void 0:_.index)!=null?b:-1;u===O+1||u===O&&d===R+1||(C.reset(),T.reset()),this.lastSn=u,this.lastPartIndex=d}},t.onFragLoaded=function(f,S){var C=S.frag,T=S.payload,O=this.initPTS,R=this.unparsedVttFrags;if(C.type===m.PlaylistLevelType.SUBTITLE)if(T.byteLength){if(!Object(Q.isFiniteNumber)(O[C.cc])){R.push(S),O.length&&this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Missing initial subtitle PTS")});return}var b=C.decryptdata;if(b==null||b.key==null||b.method!=="AES-128"){var _=this.tracks[C.level],u=this.vttCCs;u[C.cc]||(u[C.cc]={start:C.start,prevCC:this.prevCC,new:!0},this.prevCC=C.cc),_&&_.textCodec===D.IMSC1_CODEC?this._parseIMSC1(C,T):this._parseVTTs(C,T,u)}}else this.hls.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:C,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(f,S){var C=this,T=this.hls;Object(D.parseIMSC1)(S,this.initPTS[f.cc],this.timescale[f.cc],function(O){C._appendCues(O,f.level),T.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(O){g.logger.log("Failed to parse IMSC1: "+O),T.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:O})})},t._parseVTTs=function(f,S,C){var T=this,O=this.hls;Object(G.parseWebVTT)(S,this.initPTS[f.cc],this.timescale[f.cc],C,f.cc,f.start,function(R){T._appendCues(R,f.level),O.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:f})},function(R){T._fallbackToIMSC1(f,S),g.logger.log("Failed to parse VTT cue: "+R),O.trigger(B.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:R})})},t._fallbackToIMSC1=function(f,S){var C=this,T=this.tracks[f.level];T.textCodec||Object(D.parseIMSC1)(S,this.initPTS[f.cc],this.timescale[f.cc],function(){T.textCodec=D.IMSC1_CODEC,C._parseIMSC1(f,S)},function(){T.textCodec="wvtt"})},t._appendCues=function(f,S){var C=this.hls;if(this.config.renderTextTracksNatively){var T=this.textTracks[S];if(T.mode==="disabled")return;f.forEach(function(b){return Object(L.addCueToTrack)(T,b)})}else{var O=this.tracks[S],R=O.default?"default":"subtitles"+S;C.trigger(B.Events.CUES_PARSED,{type:"subtitles",cues:f,track:R})}},t.onFragDecrypted=function(f,S){var C=S.frag;if(C.type===m.PlaylistLevelType.SUBTITLE){if(!Object(Q.isFiniteNumber)(this.initPTS[C.cc])){this.unparsedVttFrags.push(S);return}this.onFragLoaded(B.Events.FRAG_LOADED,S)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(f,S){var C=this.cea608Parser1,T=this.cea608Parser2;if(!this.enabled||!(C&&T))return;for(var O=0;O<S.samples.length;O++){var R=S.samples[O].bytes;if(R){var b=this.extractCea608Data(R);C.addData(S.samples[O].pts,b[0]),T.addData(S.samples[O].pts,b[1])}}},t.onBufferFlushing=function(f,S){var C=S.startOffset,T=S.endOffset,O=S.endOffsetSubtitles,R=S.type,b=this.media;if(!b||b.currentTime<T)return;if(!R||R==="video"){var _=this.captionsTracks;Object.keys(_).forEach(function(d){return Object(L.removeCuesInRange)(_[d],C,T)})}if(this.config.renderTextTracksNatively&&(C===0&&O!==void 0)){var u=this.textTracks;Object.keys(u).forEach(function(d){return Object(L.removeCuesInRange)(u[d],C,O)})}},t.extractCea608Data=function(f){for(var S=f[0]&31,C=2,T=[[],[]],O=0;O<S;O++){var R=f[C++],b=127&f[C++],_=127&f[C++],u=(4&R)!==0,d=3&R;if(b===0&&_===0)continue;u&&((d===0||d===1)&&(T[d].push(b),T[d].push(_)))}return T},r}();function o(r,t){return r&&r.label===t.name&&!(r.textTrack1||r.textTrack2)}function l(r,t,c,f){return Math.min(t,f)-Math.max(r,c)}function a(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return Q});var Q=function(){function B(z,G){this.subtle=void 0,this.aesIV=void 0,this.subtle=z,this.aesIV=G}var I=B.prototype;return I.decrypt=function(G,L){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},L,G)},B}()},"./src/crypt/aes-decryptor.ts":function(ee,$,k){"use strict";k.r($),k.d($,"removePadding",function(){return B}),k.d($,"default",function(){return I});var Q=k("./src/utils/typed-array.ts");function B(z){var G=z.byteLength,L=G&&new DataView(z.buffer).getUint8(G-1);return L?Object(Q.sliceUint8)(z,0,G-L):z}var I=function(){function z(){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 G=z.prototype;return G.uint8ArrayToUint32Array_=function(D){for(var m=new DataView(D),g=new Uint32Array(4),h=0;h<4;h++)g[h]=m.getUint32(h*4);return g},G.initTable=function(){var D=this.sBox,m=this.invSBox,g=this.subMix,h=g[0],o=g[1],l=g[2],a=g[3],r=this.invSubMix,t=r[0],c=r[1],f=r[2],S=r[3],C=new Uint32Array(256),T=0,O=0,R=0;for(R=0;R<256;R++)R<128?C[R]=R<<1:C[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[T]=b,m[b]=T;var _=C[T],u=C[_],d=C[u],y=C[b]*257^b*16843008;h[T]=y<<24|y>>>8,o[T]=y<<16|y>>>16,l[T]=y<<8|y>>>24,a[T]=y,y=d*16843009^u*65537^_*257^T*16843008,t[b]=y<<24|y>>>8,c[b]=y<<16|y>>>16,f[b]=y<<8|y>>>24,S[b]=y,T?(T=_^C[C[C[d^_]]],O^=C[C[O]]):T=O=1}},G.expandKey=function(D){for(var m=this.uint8ArrayToUint32Array_(D),g=!0,h=0;h<m.length&&g;)g=m[h]===this.key[h],h++;if(g)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,a,r,t=this.keySchedule=new Uint32Array(l),c=this.invKeySchedule=new Uint32Array(l),f=this.sBox,S=this.rcon,C=this.invSubMix,T=C[0],O=C[1],R=C[2],b=C[3],_,u;for(a=0;a<l;a++){if(a<o){_=t[a]=m[a];continue}u=_,a%o===0?(u=u<<8|u>>>24,u=f[u>>>24]<<24|f[u>>>16&255]<<16|f[u>>>8&255]<<8|f[u&255],u^=S[a/o|0]<<24):o>6&&a%o===4&&(u=f[u>>>24]<<24|f[u>>>16&255]<<16|f[u>>>8&255]<<8|f[u&255]),t[a]=_=(t[a-o]^u)>>>0}for(r=0;r<l;r++)a=l-r,r&3?u=t[a]:u=t[a-4],r<4||a<=4?c[r]=u:c[r]=T[f[u>>>24]]^O[f[u>>>16&255]]^R[f[u>>>8&255]]^b[f[u&255]],c[r]=c[r]>>>0},G.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},G.decrypt=function(D,m,g){for(var h=this.keySize+6,o=this.invKeySchedule,l=this.invSBox,a=this.invSubMix,r=a[0],t=a[1],c=a[2],f=a[3],S=this.uint8ArrayToUint32Array_(g),C=S[0],T=S[1],O=S[2],R=S[3],b=new Int32Array(D),_=new Int32Array(b.length),u,d,y,v,E,M,N,j,H,P,x,U,V,q,ie=this.networkToHostOrderSwap;m<b.length;){for(H=ie(b[m]),P=ie(b[m+1]),x=ie(b[m+2]),U=ie(b[m+3]),E=H^o[0],M=U^o[1],N=x^o[2],j=P^o[3],V=4,q=1;q<h;q++)u=r[E>>>24]^t[M>>16&255]^c[N>>8&255]^f[j&255]^o[V],d=r[M>>>24]^t[N>>16&255]^c[j>>8&255]^f[E&255]^o[V+1],y=r[N>>>24]^t[j>>16&255]^c[E>>8&255]^f[M&255]^o[V+2],v=r[j>>>24]^t[E>>16&255]^c[M>>8&255]^f[N&255]^o[V+3],E=u,M=d,N=y,j=v,V=V+4;u=l[E>>>24]<<24^l[M>>16&255]<<16^l[N>>8&255]<<8^l[j&255]^o[V],d=l[M>>>24]<<24^l[N>>16&255]<<16^l[j>>8&255]<<8^l[E&255]^o[V+1],y=l[N>>>24]<<24^l[j>>16&255]<<16^l[E>>8&255]<<8^l[M&255]^o[V+2],v=l[j>>>24]<<24^l[E>>16&255]<<16^l[M>>8&255]<<8^l[N&255]^o[V+3],_[m]=ie(u^C),_[m+1]=ie(v^T),_[m+2]=ie(y^O),_[m+3]=ie(d^R),C=H,T=P,O=x,R=U,m=m+4}return _.buffer},z}()},"./src/crypt/decrypter.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return m});var Q=k("./src/crypt/aes-crypto.ts"),B=k("./src/crypt/fast-aes-key.ts"),I=k("./src/crypt/aes-decryptor.ts"),z=k("./src/utils/logger.ts"),G=k("./src/utils/mp4-tools.ts"),L=k("./src/utils/typed-array.ts"),D=16,m=function(){function g(o,l,a){var r=a===void 0?{}:a,t=r.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 f=self.crypto;f&&(this.subtle=f.subtle||f.webkitSubtle)}catch(S){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var h=g.prototype;return h.destroy=function(){this.observer=null},h.isSync=function(){return this.config.enableSoftwareAES},h.flush=function(){var l=this.currentResult;if(!l){this.reset();return}var a=new Uint8Array(l);return this.reset(),this.removePKCS7Padding?Object(I.removePadding)(a):a},h.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},h.decrypt=function(l,a,r,t){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(l),a,r);var c=this.flush();c&&t(c.buffer)}else this.webCryptoDecrypt(new Uint8Array(l),a,r).then(t)},h.softwareDecrypt=function(l,a,r){var t=this.currentIV,c=this.currentResult,f=this.remainderData;this.logOnce("JS AES decrypt"),f&&(l=Object(G.appendUint8Array)(f,l),this.remainderData=null);var S=this.getValidChunk(l);if(!S.length)return null;t&&(r=t);var C=this.softwareDecrypter;C||(C=this.softwareDecrypter=new I.default),C.expandKey(a);var T=c;return this.currentResult=C.decrypt(S.buffer,0,r),this.currentIV=Object(L.sliceUint8)(S,-16).buffer,T||null},h.webCryptoDecrypt=function(l,a,r){var t=this,c=this.subtle;return(this.key!==a||!this.fastAesKey)&&(this.key=a,this.fastAesKey=new B.default(c,a)),this.fastAesKey.expandKey().then(function(f){if(!c)return Promise.reject(new Error("web crypto not initialized"));var S=new Q.default(c,r);return S.decrypt(l.buffer,f)}).catch(function(f){return t.onWebCryptoError(f,l,a,r)})},h.onWebCryptoError=function(l,a,r,t){return z.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",l),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(a,r,t)},h.getValidChunk=function(l){var a=l,r=l.length-l.length%D;return r!==l.length&&(a=Object(L.sliceUint8)(l,0,r),this.remainderData=Object(L.sliceUint8)(l,r)),a},h.logOnce=function(l){if(!this.logEnabled)return;z.logger.log("[decrypter.ts]: "+l),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return Q});var Q=function(){function B(z,G){this.subtle=void 0,this.key=void 0,this.subtle=z,this.key=G}var I=B.prototype;return I.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},B}()},"./src/demux/aacdemuxer.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/demux/base-audio-demuxer.ts"),B=k("./src/demux/adts.ts"),I=k("./src/utils/logger.ts"),z=k("./src/demux/id3.ts");function G(m,g){m.prototype=Object.create(g.prototype),m.prototype.constructor=m,L(m,g)}function L(m,g){return L=Object.setPrototypeOf||function(o,l){return o.__proto__=l,o},L(m,g)}var D=function(m){G(g,m);function g(o,l){var a;return a=m.call(this)||this,a.observer=void 0,a.config=void 0,a.observer=o,a.config=l,a}var h=g.prototype;return h.resetInitSegment=function(l,a,r){m.prototype.resetInitSegment.call(this,l,a,r),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:l,duration:r,inputTimeScale:9e4,dropped:0}},g.probe=function(l){if(!l)return!1;for(var a=z.getID3Data(l,0)||[],r=a.length,t=l.length;r<t;r++)if(B.probe(l,r))return I.logger.log("ADTS sync word found !"),!0;return!1},h.canParse=function(l,a){return B.canParse(l,a)},h.appendFrame=function(l,a,r){B.initTrackConfig(l,this.observer,a,r,l.manifestCodec);var t=B.appendFrame(l,a,r,this.initPTS,this.frameIndex);if(t&&t.missing===0)return t},g}(Q.default);D.minProbeByteLength=9,$.default=D},"./src/demux/adts.ts":function(ee,$,k){"use strict";k.r($),k.d($,"getAudioConfig",function(){return z}),k.d($,"isHeaderPattern",function(){return G}),k.d($,"getHeaderLength",function(){return L}),k.d($,"getFullFrameLength",function(){return D}),k.d($,"canGetFrameLength",function(){return m}),k.d($,"isHeader",function(){return g}),k.d($,"canParse",function(){return h}),k.d($,"probe",function(){return o}),k.d($,"initTrackConfig",function(){return l}),k.d($,"getFrameDuration",function(){return a}),k.d($,"parseFrameHeader",function(){return r}),k.d($,"appendFrame",function(){return t});var Q=k("./src/utils/logger.ts"),B=k("./src/errors.ts"),I=k("./src/events.ts");function z(c,f,S,C){var T,O,R,b,_=navigator.userAgent.toLowerCase(),u=C,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];T=((f[S+2]&192)>>>6)+1;var y=(f[S+2]&60)>>>2;if(y>d.length-1){c.trigger(I.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+y});return}return R=(f[S+2]&1)<<2,R|=(f[S+3]&192)>>>6,Q.logger.log("manifest codec:"+C+", ADTS type:"+T+", samplingIndex:"+y),/firefox/i.test(_)?y>=6?(T=5,b=new Array(4),O=y-3):(T=2,b=new Array(2),O=y):_.indexOf("android")!==-1?(T=2,b=new Array(2),O=y):(T=5,b=new Array(4),C&&(C.indexOf("mp4a.40.29")!==-1||C.indexOf("mp4a.40.5")!==-1)||!C&&y>=6?O=y-3:((C&&C.indexOf("mp4a.40.2")!==-1&&(y>=6&&R===1||/vivaldi/i.test(_))||!C&&R===1)&&(T=2,b=new Array(2)),O=y)),b[0]=T<<3,b[0]|=(y&14)>>1,b[1]|=(y&1)<<7,b[1]|=R<<3,T===5&&(b[1]|=(O&14)>>1,b[2]=(O&1)<<7,b[2]|=2<<2,b[3]=0),{config:b,samplerate:d[y],channelCount:R,codec:"mp4a.40."+T,manifestCodec:u}}function G(c,f){return c[f]===255&&(c[f+1]&246)===240}function L(c,f){return c[f+1]&1?7:9}function D(c,f){return(c[f+3]&3)<<11|c[f+4]<<3|(c[f+5]&224)>>>5}function m(c,f){return f+5<c.length}function g(c,f){return f+1<c.length&&G(c,f)}function h(c,f){return m(c,f)&&G(c,f)&&D(c,f)<=c.length-f}function o(c,f){if(g(c,f)){var S=L(c,f);if(f+S>=c.length)return!1;var C=D(c,f);if(C<=S)return!1;var T=f+C;return T===c.length||g(c,T)}return!1}function l(c,f,S,C,T){if(!c.samplerate){var O=z(f,S,C,T);if(!O)return;c.config=O.config,c.samplerate=O.samplerate,c.channelCount=O.channelCount,c.codec=O.codec,c.manifestCodec=O.manifestCodec,Q.logger.log("parsed codec:"+c.codec+", rate:"+O.samplerate+", channels:"+O.channelCount)}}function a(c){return 1024*9e4/c}function r(c,f,S,C,T){var O=L(c,f),R=D(c,f);if(R-=O,R>0){var b=S+C*T;return{headerLength:O,frameLength:R,stamp:b}}}function t(c,f,S,C,T){var O=a(c.samplerate),R=r(f,S,C,T,O);if(R){var b=R.frameLength,_=R.headerLength,u=R.stamp,d=_+b,y=Math.max(0,S+d-f.length),v;y?(v=new Uint8Array(d-_),v.set(f.subarray(S+_,f.length),0)):v=f.subarray(S+_,S+d);var E={unit:v,pts:u};return y||c.samples.push(E),{sample:E,length:d,missing:y}}}},"./src/demux/base-audio-demuxer.ts":function(ee,$,k){"use strict";k.r($),k.d($,"initPTSFn",function(){return D});var Q=k("./src/polyfills/number.ts"),B=k("./src/demux/id3.ts"),I=k("./src/demux/dummy-demuxed-track.ts"),z=k("./src/utils/mp4-tools.ts"),G=k("./src/utils/typed-array.ts"),L=function(){function m(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var g=m.prototype;return g.resetInitSegment=function(o,l,a){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(o,l){return!1},g.appendFrame=function(o,l,a){},g.demux=function(o,l){this.cachedData&&(o=Object(z.appendUint8Array)(this.cachedData,o),this.cachedData=null);var a=B.getID3Data(o,0),r=a?a.length:0,t,c,f=this._audioTrack,S=this._id3Track,C=a?B.getTimeStamp(a):void 0,T=o.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(C,l)),a&&a.length>0&&S.samples.push({pts:this.initPTS,dts:this.initPTS,data:a}),c=this.initPTS;r<T;){if(this.canParse(o,r)){var O=this.appendFrame(f,o,r);O?(this.frameIndex++,c=O.sample.pts,r+=O.length,t=r):r=T}else B.canParse(o,r)?(a=B.getID3Data(o,r),S.samples.push({pts:c,dts:c,data:a}),r+=a.length,t=r):r++;if(r===T&&t!==T){var R=Object(G.sliceUint8)(o,t);this.cachedData?this.cachedData=Object(z.appendUint8Array)(this.cachedData,R):this.cachedData=R}}return{audioTrack:f,avcTrack:Object(I.dummyTrack)(),id3Track:S,textTrack:Object(I.dummyTrack)()}},g.demuxSampleAes=function(o,l,a){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(o){var l=this.cachedData;return l&&(this.cachedData=null,this.demux(l,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(I.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(I.dummyTrack)()}},g.destroy=function(){},m}(),D=function(g,h){return Object(Q.isFiniteNumber)(g)?g*90:h*9e4};$.default=L},"./src/demux/chunk-cache.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return Q});var Q=function(){function I(){this.chunks=[],this.dataLength=0}var z=I.prototype;return z.push=function(L){this.chunks.push(L),this.dataLength+=L.length},z.flush=function(){var L=this.chunks,D=this.dataLength,m;if(L.length)L.length===1?m=L[0]:m=B(L,D);else return new Uint8Array(0);return this.reset(),m},z.reset=function(){this.chunks.length=0,this.dataLength=0},I}();function B(I,z){for(var G=new Uint8Array(z),L=0,D=0;D<I.length;D++){var m=I[D];G.set(m,L),L+=m.length}return G}},"./src/demux/dummy-demuxed-track.ts":function(ee,$,k){"use strict";k.r($),k.d($,"dummyTrack",function(){return Q});function Q(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/utils/logger.ts"),B=function(){function I(G){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=G,this.bytesAvailable=G.byteLength,this.word=0,this.bitsAvailable=0}var z=I.prototype;return z.loadWord=function(){var L=this.data,D=this.bytesAvailable,m=L.byteLength-D,g=new Uint8Array(4),h=Math.min(4,D);if(h===0)throw new Error("no bytes available");g.set(L.subarray(m,m+h)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=h*8,this.bytesAvailable-=h},z.skipBits=function(L){var D;this.bitsAvailable>L?(this.word<<=L,this.bitsAvailable-=L):(L-=this.bitsAvailable,D=L>>3,L-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=L,this.bitsAvailable-=L)},z.readBits=function(L){var D=Math.min(this.bitsAvailable,L),m=this.word>>>32-D;return L>32&&Q.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=L-D,D>0&&this.bitsAvailable?m<<D|this.readBits(D):m},z.skipLZ=function(){var L;for(L=0;L<this.bitsAvailable;++L)if((this.word&2147483648>>>L)!==0)return this.word<<=L,this.bitsAvailable-=L,L;return this.loadWord(),L+this.skipLZ()},z.skipUEG=function(){this.skipBits(1+this.skipLZ())},z.skipEG=function(){this.skipBits(1+this.skipLZ())},z.readUEG=function(){var L=this.skipLZ();return this.readBits(L+1)-1},z.readEG=function(){var L=this.readUEG();return 1&L?1+L>>>1:-1*(L>>>1)},z.readBoolean=function(){return this.readBits(1)===1},z.readUByte=function(){return this.readBits(8)},z.readUShort=function(){return this.readBits(16)},z.readUInt=function(){return this.readBits(32)},z.skipScalingList=function(L){for(var D=8,m=8,g,h=0;h<L;h++)m!==0&&(g=this.readEG(),m=(D+g+256)%256),D=m===0?D:m},z.readSPS=function(){var L=0,D=0,m=0,g=0,h,o,l,a=this.readUByte.bind(this),r=this.readBits.bind(this),t=this.readUEG.bind(this),c=this.readBoolean.bind(this),f=this.skipBits.bind(this),S=this.skipEG.bind(this),C=this.skipUEG.bind(this),T=this.skipScalingList.bind(this);a();var O=a();if(r(5),f(3),a(),C(),O===100||O===110||O===122||O===244||O===44||O===83||O===86||O===118||O===128){var R=t();if(R===3&&f(1),C(),C(),f(1),c())for(o=R!==3?8:12,l=0;l<o;l++)c()&&(l<6?T(16):T(64))}C();var b=t();if(b===0)t();else if(b===1)for(f(1),S(),S(),h=t(),l=0;l<h;l++)S();C(),f(1);var _=t(),u=t(),d=r(1);d===0&&f(1),f(1),c()&&(L=t(),D=t(),m=t(),g=t());var y=[1,1];if(c()&&c()){var v=a();switch(v){case 1:y=[1,1];break;case 2:y=[12,11];break;case 3:y=[10,11];break;case 4:y=[16,11];break;case 5:y=[40,33];break;case 6:y=[24,11];break;case 7:y=[20,11];break;case 8:y=[32,11];break;case 9:y=[80,33];break;case 10:y=[18,11];break;case 11:y=[15,11];break;case 12:y=[64,33];break;case 13:y=[160,99];break;case 14:y=[4,3];break;case 15:y=[3,2];break;case 16:y=[2,1];break;case 255:{y=[a()<<8|a(),a()<<8|a()];break}}}return{width:Math.ceil((_+1)*16-L*2-D*2),height:(2-d)*(u+1)*16-(d?2:4)*(m+g),pixelRatio:y}},z.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},I}();$.default=B},"./src/demux/id3.ts":function(ee,$,k){"use strict";k.r($),k.d($,"isHeader",function(){return Q}),k.d($,"isFooter",function(){return B}),k.d($,"getID3Data",function(){return I}),k.d($,"canParse",function(){return G}),k.d($,"getTimeStamp",function(){return L}),k.d($,"isTimeStampFrame",function(){return D}),k.d($,"getID3Frames",function(){return g}),k.d($,"decodeFrame",function(){return h}),k.d($,"utf8ArrayToStr",function(){return t}),k.d($,"testables",function(){return c});var Q=function(T,O){return O+10<=T.length&&(T[O]===73&&T[O+1]===68&&T[O+2]===51&&(T[O+3]<255&&T[O+4]<255&&(T[O+6]<128&&T[O+7]<128&&T[O+8]<128&&T[O+9]<128)))},B=function(T,O){return O+10<=T.length&&(T[O]===51&&T[O+1]===68&&T[O+2]===73&&(T[O+3]<255&&T[O+4]<255&&(T[O+6]<128&&T[O+7]<128&&T[O+8]<128&&T[O+9]<128)))},I=function(T,O){for(var R=O,b=0;Q(T,O);){b+=10;var _=z(T,O+6);b+=_,B(T,O+10)&&(b+=10),O+=b}return b>0?T.subarray(R,R+b):void 0},z=function(T,O){var R=0;return R=(T[O]&127)<<21,R|=(T[O+1]&127)<<14,R|=(T[O+2]&127)<<7,R|=T[O+3]&127,R},G=function(T,O){return Q(T,O)&&z(T,O+6)+10<=T.length-O},L=function(T){for(var O=g(T),R=0;R<O.length;R++){var b=O[R];if(D(b))return r(b)}return},D=function(T){return T&&T.key==="PRIV"&&T.info==="com.apple.streaming.transportStreamTimestamp"},m=function(T){var O=String.fromCharCode(T[0],T[1],T[2],T[3]),R=z(T,4),b=10;return{type:O,size:R,data:T.subarray(b,b+R)}},g=function(T){for(var O=0,R=[];Q(T,O);){var b=z(T,O+6);O+=10;for(var _=O+b;O+8<_;){var u=m(T.subarray(O)),d=h(u);d&&R.push(d),O+=u.size+10}B(T,O)&&(O+=10)}return R},h=function(T){return T.type==="PRIV"?o(T):T.type[0]==="W"?a(T):l(T)},o=function(T){if(T.size<2)return;var O=t(T.data,!0),R=new Uint8Array(T.data.subarray(O.length+1));return{key:T.type,info:O,data:R.buffer}},l=function(T){if(T.size<2)return;if(T.type==="TXXX"){var O=1,R=t(T.data.subarray(O),!0);O+=R.length+1;var b=t(T.data.subarray(O));return{key:T.type,info:R,data:b}}var _=t(T.data.subarray(1));return{key:T.type,data:_}},a=function(T){if(T.type==="WXXX"){if(T.size<2)return;var O=1,R=t(T.data.subarray(O),!0);O+=R.length+1;var b=t(T.data.subarray(O));return{key:T.type,info:R,data:b}}var _=t(T.data);return{key:T.type,data:_}},r=function(T){if(T.data.byteLength===8){var O=new Uint8Array(T.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(T,O){O===void 0&&(O=!1);var R=S();if(R){var b=R.decode(T);if(O){var _=b.indexOf("\0");return _!==-1?b.substring(0,_):b}return b.replace(/\0/g,"")}for(var u=T.length,d,y,v,E="",M=0;M<u;){if(d=T[M++],d===0&&O)return E;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:E+=String.fromCharCode(d);break;case 12:case 13:y=T[M++],E+=String.fromCharCode((d&31)<<6|y&63);break;case 14:y=T[M++],v=T[M++],E+=String.fromCharCode((d&15)<<12|(y&63)<<6|(v&63)<<0);break;default:}}return E},c={decodeTextFrame:l},f;function S(){return!f&&typeof self.TextDecoder!="undefined"&&(f=new self.TextDecoder("utf-8")),f}},"./src/demux/mp3demuxer.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/demux/base-audio-demuxer.ts"),B=k("./src/demux/id3.ts"),I=k("./src/utils/logger.ts"),z=k("./src/demux/mpegaudio.ts");function G(m,g){m.prototype=Object.create(g.prototype),m.prototype.constructor=m,L(m,g)}function L(m,g){return L=Object.setPrototypeOf||function(o,l){return o.__proto__=l,o},L(m,g)}var D=function(m){G(g,m);function g(){return m.apply(this,arguments)||this}var h=g.prototype;return h.resetInitSegment=function(l,a,r){m.prototype.resetInitSegment.call(this,l,a,r),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:l,duration:r,inputTimeScale:9e4,dropped:0}},g.probe=function(l){if(!l)return!1;for(var a=B.getID3Data(l,0)||[],r=a.length,t=l.length;r<t;r++)if(z.probe(l,r))return I.logger.log("MPEG Audio sync word found !"),!0;return!1},h.canParse=function(l,a){return z.canParse(l,a)},h.appendFrame=function(l,a,r){return this.initPTS===null?void 0:z.appendFrame(l,a,r,this.initPTS,this.frameIndex)},g}(Q.default);D.minProbeByteLength=4,$.default=D},"./src/demux/mp4demuxer.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/utils/mp4-tools.ts"),B=k("./src/demux/dummy-demuxed-track.ts"),I=function(){function z(L,D){this.remainderData=null,this.config=void 0,this.config=D}var G=z.prototype;return G.resetTimeStamp=function(){},G.resetInitSegment=function(){},G.resetContiguity=function(){},z.probe=function(D){return Object(Q.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},G.demux=function(D){var m=D,g=Object(B.dummyTrack)();if(this.config.progressive){this.remainderData&&(m=Object(Q.appendUint8Array)(this.remainderData,D));var h=Object(Q.segmentValidRange)(m);this.remainderData=h.remainder,g.samples=h.valid||new Uint8Array}else g.samples=m;return{audioTrack:Object(B.dummyTrack)(),avcTrack:g,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},G.flush=function(){var D=Object(B.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(B.dummyTrack)(),avcTrack:D,id3Track:Object(B.dummyTrack)(),textTrack:Object(B.dummyTrack)()}},G.demuxSampleAes=function(D,m,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},G.destroy=function(){},z}();I.minProbeByteLength=1024,$.default=I},"./src/demux/mpegaudio.ts":function(ee,$,k){"use strict";k.r($),k.d($,"appendFrame",function(){return L}),k.d($,"parseHeader",function(){return D}),k.d($,"isHeaderPattern",function(){return m}),k.d($,"isHeader",function(){return g}),k.d($,"canParse",function(){return h}),k.d($,"probe",function(){return o});var Q=null,B=[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],I=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],z=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],G=[0,1,1,4];function L(l,a,r,t,c){if(r+24>a.length)return;var f=D(a,r);if(f&&r+f.frameLength<=a.length){var S=f.samplesPerFrame*9e4/f.sampleRate,C=t+c*S,T={unit:a.subarray(r,r+f.frameLength),pts:C,dts:C};return l.config=[],l.channelCount=f.channelCount,l.samplerate=f.sampleRate,l.samples.push(T),{sample:T,length:f.frameLength,missing:0}}}function D(l,a){var r=l[a+1]>>3&3,t=l[a+1]>>1&3,c=l[a+2]>>4&15,f=l[a+2]>>2&3;if(r!==1&&c!==0&&c!==15&&f!==3){var S=l[a+2]>>1&1,C=l[a+3]>>6,T=r===3?3-t:t===3?3:4,O=B[T*14+c-1]*1e3,R=r===3?0:r===2?1:2,b=I[R*3+f],_=C===3?1:2,u=z[r][t],d=G[t],y=u*8*d,v=Math.floor(u*O/b+S)*d;if(Q===null){var E=navigator.userAgent||"",M=E.match(/Chrome\/(\d+)/i);Q=M?parseInt(M[1]):0}var N=!!Q&&Q<=87;return N&&t===2&&O>=224e3&&C===0&&(l[a+3]=l[a+3]|128),{sampleRate:b,channelCount:_,frameLength:v,samplesPerFrame:y}}}function m(l,a){return l[a]===255&&(l[a+1]&224)===224&&(l[a+1]&6)!==0}function g(l,a){return a+1<l.length&&m(l,a)}function h(l,a){var r=4;return m(l,a)&&r<=l.length-a}function o(l,a){if(a+1<l.length&&m(l,a)){var r=4,t=D(l,a),c=r;t!=null&&t.frameLength&&(c=t.frameLength);var f=a+c;return f===l.length||g(l,f)}return!1}},"./src/demux/sample-aes.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/crypt/decrypter.ts"),B=k("./src/demux/tsdemuxer.ts"),I=function(){function z(L,D,m){this.keyData=void 0,this.decrypter=void 0,this.keyData=m,this.decrypter=new Q.default(L,D,{removePKCS7Padding:!1})}var G=z.prototype;return G.decryptBuffer=function(D,m){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,m)},G.decryptAacSample=function(D,m,g,h){var o=D[m].unit,l=o.subarray(16,o.length-o.length%16),a=l.buffer.slice(l.byteOffset,l.byteOffset+l.length),r=this;this.decryptBuffer(a,function(t){var c=new Uint8Array(t);o.set(c,16),h||r.decryptAacSamples(D,m+1,g)})},G.decryptAacSamples=function(D,m,g){for(;;m++){if(m>=D.length){g();return}if(D[m].unit.length<32)continue;var h=this.decrypter.isSync();if(this.decryptAacSample(D,m,g,h),!h)return}},G.getAvcEncryptedData=function(D){for(var m=Math.floor((D.length-48)/160)*16+16,g=new Int8Array(m),h=0,o=32;o<=D.length-16;o+=160,h+=16)g.set(D.subarray(o,o+16),h);return g},G.getAvcDecryptedUnit=function(D,m){for(var g=new Uint8Array(m),h=0,o=32;o<=D.length-16;o+=160,h+=16)D.set(g.subarray(h,h+16),o);return D},G.decryptAvcSample=function(D,m,g,h,o,l){var a=Object(B.discardEPB)(o.data),r=this.getAvcEncryptedData(a),t=this;this.decryptBuffer(r.buffer,function(c){o.data=t.getAvcDecryptedUnit(a,c),l||t.decryptAvcSamples(D,m,g+1,h)})},G.decryptAvcSamples=function(D,m,g,h){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;m++,g=0){if(m>=D.length){h();return}for(var o=D[m].units;!(g>=o.length);g++){var l=o[g];if(l.data.length<=48||l.type!==1&&l.type!==5)continue;var a=this.decrypter.isSync();if(this.decryptAvcSample(D,m,g,h,l,a),!a)return}}},z}();$.default=I},"./src/demux/transmuxer-interface.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return o});var Q=k("./node_modules/webworkify-webpack/index.js"),B=k.n(Q),I=k("./src/events.ts"),z=k("./src/demux/transmuxer.ts"),G=k("./src/utils/logger.ts"),L=k("./src/errors.ts"),D=k("./src/utils/mediasource-helper.ts"),m=k("./node_modules/eventemitter3/index.js"),g=k.n(m),h=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},o=function(){function l(r,t,c,f){var S=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=r,this.id=t,this.onTransmuxComplete=c,this.onFlush=f;var C=r.config,T=function(u,d){d=d||{},d.frag=S.frag,d.id=S.id,r.trigger(u,d)};this.observer=new m.EventEmitter,this.observer.on(I.Events.FRAG_DECRYPTED,T),this.observer.on(I.Events.ERROR,T);var O={mp4:h.isTypeSupported("video/mp4"),mpeg:h.isTypeSupported("audio/mpeg"),mp3:h.isTypeSupported('audio/mp4; codecs="mp3"')},R=navigator.vendor;if(C.enableWorker&&typeof Worker!="undefined"){G.logger.log("demuxing in webworker");var b;try{b=this.worker=Q("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),b.addEventListener("message",this.onwmsg),b.onerror=function(_){r.trigger(I.Events.ERROR,{type:L.ErrorTypes.OTHER_ERROR,details:L.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(C)})}catch(_){G.logger.warn("Error in worker:",_),G.logger.error("Error while initializing DemuxerWorker, fallback to inline"),b&&self.URL.revokeObjectURL(b.objectURL),this.transmuxer=new z.default(this.observer,O,C,R,t),this.worker=null}}else this.transmuxer=new z.default(this.observer,O,C,R,t)}var a=l.prototype;return a.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 f=this.observer;f&&f.removeAllListeners(),this.observer=null},a.push=function(t,c,f,S,C,T,O,R,b,_){var u=this;b.transmuxing.start=self.performance.now();var d=this.transmuxer,y=this.worker,v=T?T.start:C.start,E=C.decryptdata,M=this.frag,N=!(M&&C.cc===M.cc),j=!(M&&b.level===M.level),H=M?b.sn-M.sn:-1,P=this.part?b.part-this.part.index:1,x=!j&&(H===1||H===0&&P===1),U=self.performance.now();(j||H||C.stats.parsing.start===0)&&(C.stats.parsing.start=U),T&&(P||!x)&&(T.stats.parsing.start=U);var V=new z.TransmuxState(N,x,R,j,v);if(!x||N){G.logger.log("[transmuxer-interface, "+C.type+"]: Starting new transmux session for sn: "+b.sn+" p: "+b.part+" level: "+b.level+" id: "+b.id+`
discontinuity: `+N+`
trackSwitch: `+j+`
contiguous: `+x+`
accurateTimeOffset: `+R+`
timeOffset: `+v);var q=new z.TransmuxConfig(f,S,c,O,_);this.configureTransmuxer(q)}if(this.frag=C,this.part=T,y)y.postMessage({cmd:"demux",data:t,decryptdata:E,chunkMeta:b,state:V},t instanceof ArrayBuffer?[t]:[]);else if(d){var ie=d.push(t,E,b,V);Object(z.isPromise)(ie)?ie.then(function(se){u.handleTransmuxComplete(se)}):this.handleTransmuxComplete(ie)}},a.flush=function(t){var c=this;t.transmuxing.start=self.performance.now();var f=this.transmuxer,S=this.worker;if(S)S.postMessage({cmd:"flush",chunkMeta:t});else if(f){var C=f.flush(t);Object(z.isPromise)(C)?C.then(function(T){c.handleFlushResult(T,t)}):this.handleFlushResult(C,t)}},a.handleFlushResult=function(t,c){var f=this;t.forEach(function(S){f.handleTransmuxComplete(S)}),this.onFlush(c)},a.onWorkerMessage=function(t){var c=t.data,f=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,f.trigger(c.event,c.data);break}}},a.configureTransmuxer=function(t){var c=this.worker,f=this.transmuxer;c?c.postMessage({cmd:"configure",config:t}):f&&f.configure(t)},a.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},l}()},"./src/demux/transmuxer-worker.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return L});var Q=k("./src/demux/transmuxer.ts"),B=k("./src/events.ts"),I=k("./src/utils/logger.ts"),z=k("./node_modules/eventemitter3/index.js"),G=k.n(z);function L(o){var l=new z.EventEmitter,a=function(t,c){o.postMessage({event:t,data:c})};l.on(B.Events.FRAG_DECRYPTED,a),l.on(B.Events.ERROR,a),o.addEventListener("message",function(r){var t=r.data;switch(t.cmd){case"init":{var c=JSON.parse(t.config);o.transmuxer=new Q.default(l,t.typeSupported,c,t.vendor,t.id),Object(I.enableLogs)(c.debug),a("init",null);break}case"configure":{o.transmuxer.configure(t.config);break}case"demux":{var f=o.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state);Object(Q.isPromise)(f)?f.then(function(T){D(o,T)}):D(o,f);break}case"flush":{var S=t.chunkMeta,C=o.transmuxer.flush(S);Object(Q.isPromise)(C)?C.then(function(T){g(o,T,S)}):g(o,C,S);break}default:break}})}function D(o,l){if(h(l.remuxResult))return;var a=[],r=l.remuxResult,t=r.audio,c=r.video;t&&m(a,t),c&&m(a,c),o.postMessage({event:"transmuxComplete",data:l},a)}function m(o,l){l.data1&&o.push(l.data1.buffer),l.data2&&o.push(l.data2.buffer)}function g(o,l,a){l.forEach(function(r){D(o,r)}),o.postMessage({event:"flush",data:a})}function h(o){return!o.audio&&!o.video&&!o.text&&!o.id3&&!o.initSegment}},"./src/demux/transmuxer.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return c}),k.d($,"isPromise",function(){return C}),k.d($,"TransmuxConfig",function(){return T}),k.d($,"TransmuxState",function(){return O});var Q=k("./src/events.ts"),B=k("./src/errors.ts"),I=k("./src/crypt/decrypter.ts"),z=k("./src/demux/aacdemuxer.ts"),G=k("./src/demux/mp4demuxer.ts"),L=k("./src/demux/tsdemuxer.ts"),D=k("./src/demux/mp3demuxer.ts"),m=k("./src/remux/mp4-remuxer.ts"),g=k("./src/remux/passthrough-remuxer.ts"),h=k("./src/demux/chunk-cache.ts"),o=k("./src/utils/mp4-tools.ts"),l=k("./src/utils/logger.ts"),a;try{a=self.performance.now.bind(self.performance)}catch(R){l.logger.debug("Unable to use Performance API on this environment"),a=self.Date.now}var r=[{demux:L.default,remux:m.default},{demux:G.default,remux:g.default},{demux:z.default,remux:m.default},{demux:D.default,remux:m.default}],t=1024;r.forEach(function(R){var b=R.demux;t=Math.max(t,b.minProbeByteLength)});var c=function(){function R(_,u,d,y,v){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new h.default,this.observer=_,this.typeSupported=u,this.config=d,this.vendor=y,this.id=v}var b=R.prototype;return b.configure=function(u){this.transmuxConfig=u,this.decrypter&&this.decrypter.reset()},b.push=function(u,d,y,v){var E=this,M=y.transmuxing;M.executeStart=a();var N=new Uint8Array(u),j=this.cache,H=this.config,P=this.currentTransmuxState,x=this.transmuxConfig;v&&(this.currentTransmuxState=v);var U=f(N,d);if(U&&U.method==="AES-128"){var V=this.getDecrypter();if(H.enableSoftwareAES){var q=V.softwareDecrypt(N,U.key.buffer,U.iv.buffer);if(!q)return M.executeEnd=a(),S(y);N=new Uint8Array(q)}else return this.decryptionPromise=V.webCryptoDecrypt(N,U.key.buffer,U.iv.buffer).then(function(Je){var rt=E.push(Je,null,y);return E.decryptionPromise=null,rt}),this.decryptionPromise}var ie=v||P,se=ie.contiguous,ve=ie.discontinuity,Te=ie.trackSwitch,fe=ie.accurateTimeOffset,_e=ie.timeOffset,ue=x.audioCodec,xe=x.videoCodec,Y=x.defaultInitPts,oe=x.duration,ce=x.initSegmentData;if((ve||Te)&&this.resetInitSegment(ce,ue,xe,oe),ve&&this.resetInitialTimestamp(Y),se||this.resetContiguity(),this.needsProbing(N,ve,Te)){if(j.dataLength){var Re=j.flush();N=Object(o.appendUint8Array)(Re,N)}this.configureTransmuxer(N,x)}var Ge=this.transmux(N,U,_e,fe,y),Ne=this.currentTransmuxState;return Ne.contiguous=!0,Ne.discontinuity=!1,Ne.trackSwitch=!1,M.executeEnd=a(),Ge},b.flush=function(u){var d=this,y=u.transmuxing;y.executeStart=a();var v=this.decrypter,E=this.cache,M=this.currentTransmuxState,N=this.decryptionPromise;if(N)return N.then(function(){return d.flush(u)});var j=[],H=M.timeOffset;if(v){var P=v.flush();P&&j.push(this.push(P,null,u))}var x=E.dataLength;E.reset();var U=this.demuxer,V=this.remuxer;if(!U||!V)return x>=t&&this.observer.emit(Q.Events.ERROR,Q.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),y.executeEnd=a(),[S(u)];var q=U.flush(H);return C(q)?q.then(function(ie){return d.flushRemux(j,ie,u),j}):(this.flushRemux(j,q,u),j)},b.flushRemux=function(u,d,y){var v=d.audioTrack,E=d.avcTrack,M=d.id3Track,N=d.textTrack,j=this.currentTransmuxState,H=j.accurateTimeOffset,P=j.timeOffset;l.logger.log("[transmuxer.ts]: Flushed fragment "+y.sn+(y.part>-1?" p: "+y.part:"")+" of level "+y.level);var x=this.remuxer.remux(v,E,M,N,P,H,!0,this.id);u.push({remuxResult:x,chunkMeta:y}),y.transmuxing.executeEnd=a()},b.resetInitialTimestamp=function(u){var d=this.demuxer,y=this.remuxer;if(!d||!y)return;d.resetTimeStamp(u),y.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,y,v){var E=this.demuxer,M=this.remuxer;if(!E||!M)return;E.resetInitSegment(d,y,v),M.resetInitSegment(u,d,y)},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,y,v,E){var M;return d&&d.method==="SAMPLE-AES"?M=this.transmuxSampleAes(u,d,y,v,E):M=this.transmuxUnencrypted(u,y,v,E),M},b.transmuxUnencrypted=function(u,d,y,v){var E=this.demuxer.demux(u,d,!1,!this.config.progressive),M=E.audioTrack,N=E.avcTrack,j=E.id3Track,H=E.textTrack,P=this.remuxer.remux(M,N,j,H,d,y,!1,this.id);return{remuxResult:P,chunkMeta:v}},b.transmuxSampleAes=function(u,d,y,v,E){var M=this;return this.demuxer.demuxSampleAes(u,d,y).then(function(N){var j=M.remuxer.remux(N.audioTrack,N.avcTrack,N.id3Track,N.textTrack,y,v,!1,M.id);return{remuxResult:j,chunkMeta:E}})},b.configureTransmuxer=function(u,d){for(var y=this.config,v=this.observer,E=this.typeSupported,M=this.vendor,N=d.audioCodec,j=d.defaultInitPts,H=d.duration,P=d.initSegmentData,x=d.videoCodec,U,V=0,q=r.length;V<q;V++)if(r[V].demux.probe(u)){U=r[V];break}U||(l.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),U={demux:G.default,remux:g.default});var ie=this.demuxer,se=this.remuxer,ve=U.remux,Te=U.demux;(!se||!(se instanceof ve))&&(this.remuxer=new ve(v,y,E,M)),(!ie||!(ie instanceof Te))&&(this.demuxer=new Te(v,y,E),this.probe=Te.probe),this.resetInitSegment(P,N,x,H),this.resetInitialTimestamp(j)},b.needsProbing=function(u,d,y){return!this.demuxer||!this.remuxer||d||y},b.getDecrypter=function(){var u=this.decrypter;return u||(u=this.decrypter=new I.default(this.observer,this.config)),u},R}();function f(R,b){var _=null;return R.byteLength>0&&b!=null&&b.key!=null&&b.iv!==null&&b.method!=null&&(_=b),_}var S=function(b){return{remuxResult:{},chunkMeta:b}};function C(R){return"then"in R&&R.then instanceof Function}var T=function(b,_,u,d,y){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=y},O=function(b,_,u,d,y){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=y}},"./src/demux/tsdemuxer.ts":function(ee,$,k){"use strict";k.r($),k.d($,"discardEPB",function(){return S});var Q=k("./src/demux/adts.ts"),B=k("./src/demux/mpegaudio.ts"),I=k("./src/demux/exp-golomb.ts"),z=k("./src/demux/id3.ts"),G=k("./src/demux/sample-aes.ts"),L=k("./src/events.ts"),D=k("./src/utils/mp4-tools.ts"),m=k("./src/utils/logger.ts"),g=k("./src/errors.ts"),h={video:1,audio:2,id3:3,text:4},o=function(){function C(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}C.probe=function(R){var b=C.syncOffset(R);return b<0?!1:(b&&m.logger.warn("MPEG2-TS detected but first sync word found @ offset "+b+", junk ahead ?"),!0)},C.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},C.createTrack=function(R,b){return{container:R==="video"||R==="audio"?"video/mp2t":void 0,type:R,id:h[R],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:R==="audio"?b:void 0}};var T=C.prototype;return T.resetInitSegment=function(R,b,_){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=C.createTrack("video",_),this._audioTrack=C.createTrack("audio",_),this._id3Track=C.createTrack("id3",_),this._txtTrack=C.createTrack("text",_),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=R,this.videoCodec=b,this._duration=_},T.resetTimeStamp=function(){},T.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},T.demux=function(R,b,_,u){_===void 0&&(_=!1),u===void 0&&(u=!1),_||(this.sampleAes=null);var d,y=this._avcTrack,v=this._audioTrack,E=this._id3Track,M=y.pid,N=y.pesData,j=v.pid,H=E.pid,P=v.pesData,x=E.pesData,U=!1,V=this.pmtParsed,q=this._pmtId,ie=R.length;if(this.remainderData&&(R=Object(D.appendUint8Array)(this.remainderData,R),ie=R.length,this.remainderData=null),ie<188&&!u)return this.remainderData=R,{audioTrack:v,avcTrack:y,id3Track:E,textTrack:this._txtTrack};var se=Math.max(0,C.syncOffset(R));ie-=(ie+se)%188,ie<R.byteLength&&!u&&(this.remainderData=new Uint8Array(R.buffer,ie,R.buffer.byteLength-ie));for(var ve=se;ve<ie;ve+=188)if(R[ve]===71){var Te=!!(R[ve+1]&64),fe=((R[ve+1]&31)<<8)+R[ve+2],_e=(R[ve+3]&48)>>4,ue=void 0;if(_e>1){if(ue=ve+5+R[ve+4],ue===ve+188)continue}else ue=ve+4;switch(fe){case M:Te&&(N&&(d=t(N))&&this.parseAVCPES(d,!1),N={data:[],size:0}),N&&(N.data.push(R.subarray(ue,ve+188)),N.size+=ve+188-ue);break;case j:Te&&(P&&(d=t(P))&&(v.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),P={data:[],size:0}),P&&(P.data.push(R.subarray(ue,ve+188)),P.size+=ve+188-ue);break;case H:Te&&(x&&(d=t(x))&&this.parseID3PES(d),x={data:[],size:0}),x&&(x.data.push(R.subarray(ue,ve+188)),x.size+=ve+188-ue);break;case 0:Te&&(ue+=R[ue]+1),q=this._pmtId=a(R,ue);break;case q:{Te&&(ue+=R[ue]+1);var xe=r(R,ue,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,_);M=xe.avc,M>0&&(y.pid=M),j=xe.audio,j>0&&(v.pid=j,v.isAAC=xe.isAAC),H=xe.id3,H>0&&(E.pid=H),U&&!V&&(m.logger.log("reparse from beginning"),U=!1,ve=se-188),V=this.pmtParsed=!0;break}case 17:case 8191:break;default:U=!0;break}}else this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});y.pesData=N,v.pesData=P,E.pesData=x;var Y={audioTrack:v,avcTrack:y,id3Track:E,textTrack:this._txtTrack};return u&&this.extractRemainingSamples(Y),Y},T.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},T.extractRemainingSamples=function(R){var b=R.audioTrack,_=R.avcTrack,u=R.id3Track,d=_.pesData,y=b.pesData,v=u.pesData,E;d&&(E=t(d))?(this.parseAVCPES(E,!0),_.pesData=null):_.pesData=d,y&&(E=t(y))?(b.isAAC?this.parseAACPES(E):this.parseMPEGPES(E),b.pesData=null):(y!=null&&y.size&&m.logger.log("last AAC PES packet truncated,might overlap between fragments"),b.pesData=y),v&&(E=t(v))?(this.parseID3PES(E),u.pesData=null):u.pesData=v},T.demuxSampleAes=function(R,b,_){var u=this.demux(R,_,!0,!this.config.progressive),d=this.sampleAes=new G.default(this.observer,this.config,b);return this.decrypt(u,d)},T.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)})})},T.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},T.parseAVCPES=function(R,b){var _=this,u=this._avcTrack,d=this.parseAVCNALu(R.data),y=!1,v=this.avcSample,E,M=!1;R.data=null,v&&d.length&&!u.audFound&&(c(v,u),v=this.avcSample=l(!1,R.pts,R.dts,"")),d.forEach(function(N){switch(N.type){case 1:{E=!0,v||(v=_.avcSample=l(!0,R.pts,R.dts,"")),y&&(v.debug+="NDR "),v.frame=!0;var j=N.data;if(M&&j.length>4){var H=new I.default(j).readSliceType();(H===2||H===4||H===7||H===9)&&(v.key=!0)}break}case 5:E=!0,v||(v=_.avcSample=l(!0,R.pts,R.dts,"")),y&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{E=!0,y&&v&&(v.debug+="SEI ");var P=new I.default(S(N.data));P.readUByte();for(var x=0,U=0,V=!1,q=0;!V&&P.bytesAvailable>1;){x=0;do q=P.readUByte(),x+=q;while(q===255);U=0;do q=P.readUByte(),U+=q;while(q===255);if(x===4&&P.bytesAvailable!==0){V=!0;var ie=P.readUByte();if(ie===181){var se=P.readUShort();if(se===49){var ve=P.readUInt();if(ve===1195456820){var Te=P.readUByte();if(Te===3){for(var fe=P.readUByte(),_e=P.readUByte(),ue=31&fe,xe=[fe,_e],Y=0;Y<ue;Y++)xe.push(P.readUByte()),xe.push(P.readUByte()),xe.push(P.readUByte());f(_._txtTrack.samples,{type:3,pts:R.pts,bytes:xe})}}}}}else if(x===5&&P.bytesAvailable!==0){if(V=!0,U>16){for(var oe=[],ce=0;ce<16;ce++)oe.push(P.readUByte().toString(16)),(ce===3||ce===5||ce===7||ce===9)&&oe.push("-");for(var Re=U-16,Ge=new Uint8Array(Re),Ne=0;Ne<Re;Ne++)Ge[Ne]=P.readUByte();f(_._txtTrack.samples,{pts:R.pts,payloadType:x,uuid:oe.join(""),userData:Object(z.utf8ArrayToStr)(Ge),userDataBytes:Ge})}}else if(U<P.bytesAvailable)for(var Je=0;Je<U;Je++)P.readUByte()}break}case 7:if(E=!0,M=!0,y&&v&&(v.debug+="SPS "),!u.sps){var rt=new I.default(N.data),_t=rt.readSPS();u.width=_t.width,u.height=_t.height,u.pixelRatio=_t.pixelRatio,u.sps=[N.data],u.duration=_._duration;for(var ft=N.data.subarray(1,4),ut="avc1.",qe=0;qe<3;qe++){var Ct=ft[qe].toString(16);Ct.length<2&&(Ct="0"+Ct),ut+=Ct}u.codec=ut}break;case 8:E=!0,y&&v&&(v.debug+="PPS "),u.pps||(u.pps=[N.data]);break;case 9:E=!1,u.audFound=!0,v&&c(v,u),v=_.avcSample=l(!1,R.pts,R.dts,y?"AUD ":"");break;case 12:E=!1;break;default:E=!1,v&&(v.debug+="unknown NAL "+N.type+" ");break}if(v&&E){var kt=v.units;kt.push(N)}}),b&&v&&(c(v,u),this.avcSample=null)},T.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 _},T.parseAVCNALu=function(R){var b=R.byteLength,_=this._avcTrack,u=_.naluState||0,d=u,y=[],v=0,E,M,N,j=-1,H=0;for(u===-1&&(j=0,H=R[0]&31,u=0,v=1);v<b;){if(E=R[v++],!u){u=E?0:1;continue}if(u===1){u=E?0:2;continue}if(!E)u=3;else if(E===1){if(j>=0){var P={data:R.subarray(j,v-u-1),type:H};y.push(P)}else{var x=this.getLastNalUnit();if(x&&(d&&v<=4-d&&(x.state&&(x.data=x.data.subarray(0,x.data.byteLength-d))),M=v-u-1,M>0)){var U=new Uint8Array(x.data.byteLength+M);U.set(x.data,0),U.set(R.subarray(0,M),x.data.byteLength),x.data=U,x.state=0}}v<b?(N=R[v]&31,j=v,H=N,u=0):u=-1}else u=0}if(j>=0&&u>=0){var V={data:R.subarray(j,b),type:H,state:u};y.push(V)}if(y.length===0){var q=this.getLastNalUnit();if(q){var ie=new Uint8Array(q.data.byteLength+R.byteLength);ie.set(q.data,0),ie.set(R,q.data.byteLength),q.data=ie}}return _.naluState=u,y},T.parseAACPES=function(R){var b=0,_=this._audioTrack,u=this.aacOverFlow,d=R.data;if(u){this.aacOverFlow=null;var y=u.sample.unit.byteLength,v=Math.min(u.missing,y),E=y-v;u.sample.unit.set(d.subarray(0,v),E),_.samples.push(u.sample),b=u.missing}var M,N;for(M=b,N=d.length;M<N-1&&!Q.isHeader(d,M);M++);if(M!==b){var j,H;if(M<N-1?(j="AAC PES did not start with ADTS header,offset:"+M,H=!1):(j="no ADTS header found in AAC PES",H=!0),m.logger.warn("parsing error:"+j),this.observer.emit(L.Events.ERROR,L.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:H,reason:j}),H)return}Q.initTrackConfig(_,this.observer,d,M,this.audioCodec);var P;if(R.pts!==void 0)P=R.pts;else if(u){var x=Q.getFrameDuration(_.samplerate);P=u.sample.pts+x}else{m.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var U=0;M<N;)if(Q.isHeader(d,M)){if(M+5<N){var V=Q.appendFrame(_,d,M,P,U);if(V)if(V.missing)this.aacOverFlow=V;else{M+=V.length,U++;continue}}break}else M++},T.parseMPEGPES=function(R){var b=R.data,_=b.length,u=0,d=0,y=R.pts;if(y===void 0){m.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<_;)if(B.isHeader(b,d)){var v=B.appendFrame(this._audioTrack,b,d,y,u);if(v)d+=v.length,u++;else break}else d++},T.parseID3PES=function(R){if(R.pts===void 0){m.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(R)},C}();o.minProbeByteLength=188;function l(C,T,O,R){return{key:C,frame:!1,pts:T,dts:O,units:[],debug:R,length:0}}function a(C,T){return(C[T+10]&31)<<8|C[T+11]}function r(C,T,O,R){var b={audio:-1,avc:-1,id3:-1,isAAC:!0},_=(C[T+1]&15)<<8|C[T+2],u=T+3+_-4,d=(C[T+10]&15)<<8|C[T+11];for(T+=12+d;T<u;){var y=(C[T+1]&31)<<8|C[T+2];switch(C[T]){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=y);break;case 21:b.id3===-1&&(b.id3=y);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=y);break;case 3:case 4:O?b.audio===-1&&(b.audio=y,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}T+=((C[T+3]&15)<<8|C[T+4])+5}return b}function t(C){var T=0,O,R,b,_,u,d=C.data;if(!C||C.size===0)return null;for(;d[0].length<19&&d.length>1;){var y=new Uint8Array(d[0].length+d[1].length);y.set(d[0]),y.set(d[1],d[0].length),d[0]=y,d.splice(1,1)}O=d[0];var v=(O[0]<<16)+(O[1]<<8)+O[2];if(v===1){if(R=(O[4]<<8)+O[5],R&&R>C.size-6)return null;var E=O[7];E&192&&(_=(O[9]&14)*536870912+(O[10]&255)*4194304+(O[11]&254)*16384+(O[12]&255)*128+(O[13]&254)/2,E&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 M=b+9;if(C.size<=M)return null;C.size-=M;for(var N=new Uint8Array(C.size),j=0,H=d.length;j<H;j++){O=d[j];var P=O.byteLength;if(M)if(M>P){M-=P;continue}else O=O.subarray(M),P-=M,M=0;N.set(O,T),T+=P}return R&&(R-=b+3),{data:N,pts:_,dts:u,len:R}}return null}function c(C,T){if(C.units.length&&C.frame){if(C.pts===void 0){var O=T.samples,R=O.length;if(R){var b=O[R-1];C.pts=b.pts,C.dts=b.dts}else{T.dropped++;return}}T.samples.push(C)}C.debug.length&&m.logger.log(C.pts+"/"+C.dts+":"+C.debug)}function f(C,T){var O=C.length;if(O>0){if(T.pts>=C[O-1].pts)C.push(T);else for(var R=O-1;R>=0;R--)if(T.pts<C[R].pts){C.splice(R,0,T);break}}else C.push(T)}function S(C){for(var T=C.byteLength,O=[],R=1;R<T-2;)C[R]===0&&C[R+1]===0&&C[R+2]===3?(O.push(R+2),R+=2):R++;if(O.length===0)return C;var b=T-O.length,_=new Uint8Array(b),u=0;for(R=0;R<b;u++,R++)u===O[0]&&(u++,O.shift()),_[R]=C[u];return _}$.default=o},"./src/errors.ts":function(ee,$,k){"use strict";k.r($),k.d($,"ErrorTypes",function(){return Q}),k.d($,"ErrorDetails",function(){return B});var Q;(function(I){I.NETWORK_ERROR="networkError",I.MEDIA_ERROR="mediaError",I.KEY_SYSTEM_ERROR="keySystemError",I.MUX_ERROR="muxError",I.OTHER_ERROR="otherError"})(Q||(Q={}));var B;(function(I){I.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",I.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",I.KEY_SYSTEM_NO_SESSION="keySystemNoSession",I.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",I.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",I.MANIFEST_LOAD_ERROR="manifestLoadError",I.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",I.MANIFEST_PARSING_ERROR="manifestParsingError",I.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",I.LEVEL_EMPTY_ERROR="levelEmptyError",I.LEVEL_LOAD_ERROR="levelLoadError",I.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",I.LEVEL_SWITCH_ERROR="levelSwitchError",I.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",I.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",I.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",I.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",I.FRAG_LOAD_ERROR="fragLoadError",I.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",I.FRAG_DECRYPT_ERROR="fragDecryptError",I.FRAG_PARSING_ERROR="fragParsingError",I.REMUX_ALLOC_ERROR="remuxAllocError",I.KEY_LOAD_ERROR="keyLoadError",I.KEY_LOAD_TIMEOUT="keyLoadTimeOut",I.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",I.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",I.BUFFER_APPEND_ERROR="bufferAppendError",I.BUFFER_APPENDING_ERROR="bufferAppendingError",I.BUFFER_STALLED_ERROR="bufferStalledError",I.BUFFER_FULL_ERROR="bufferFullError",I.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",I.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",I.INTERNAL_EXCEPTION="internalException",I.INTERNAL_ABORTED="aborted",I.UNKNOWN="unknown"})(B||(B={}))},"./src/events.ts":function(ee,$,k){"use strict";k.r($),k.d($,"Events",function(){return Q});var Q;(function(B){B.MEDIA_ATTACHING="hlsMediaAttaching",B.MEDIA_ATTACHED="hlsMediaAttached",B.MEDIA_DETACHING="hlsMediaDetaching",B.MEDIA_DETACHED="hlsMediaDetached",B.BUFFER_RESET="hlsBufferReset",B.BUFFER_CODECS="hlsBufferCodecs",B.BUFFER_CREATED="hlsBufferCreated",B.BUFFER_APPENDING="hlsBufferAppending",B.BUFFER_APPENDED="hlsBufferAppended",B.BUFFER_EOS="hlsBufferEos",B.BUFFER_FLUSHING="hlsBufferFlushing",B.BUFFER_FLUSHED="hlsBufferFlushed",B.MANIFEST_LOADING="hlsManifestLoading",B.MANIFEST_LOADED="hlsManifestLoaded",B.MANIFEST_PARSED="hlsManifestParsed",B.LEVEL_SWITCHING="hlsLevelSwitching",B.LEVEL_SWITCHED="hlsLevelSwitched",B.LEVEL_LOADING="hlsLevelLoading",B.LEVEL_LOADED="hlsLevelLoaded",B.LEVEL_UPDATED="hlsLevelUpdated",B.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",B.LEVELS_UPDATED="hlsLevelsUpdated",B.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",B.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",B.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",B.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",B.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",B.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",B.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",B.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",B.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",B.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",B.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",B.CUES_PARSED="hlsCuesParsed",B.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",B.INIT_PTS_FOUND="hlsInitPtsFound",B.FRAG_LOADING="hlsFragLoading",B.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",B.FRAG_LOADED="hlsFragLoaded",B.FRAG_DECRYPTED="hlsFragDecrypted",B.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",B.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",B.FRAG_PARSING_METADATA="hlsFragParsingMetadata",B.FRAG_PARSED="hlsFragParsed",B.FRAG_BUFFERED="hlsFragBuffered",B.FRAG_CHANGED="hlsFragChanged",B.FPS_DROP="hlsFpsDrop",B.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",B.ERROR="hlsError",B.DESTROYING="hlsDestroying",B.KEY_LOADING="hlsKeyLoading",B.KEY_LOADED="hlsKeyLoaded",B.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",B.BACK_BUFFER_REACHED="hlsBackBufferReached"})(Q||(Q={}))},"./src/hls.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return C});var Q=k("./node_modules/url-toolkit/src/url-toolkit.js"),B=k.n(Q),I=k("./src/loader/playlist-loader.ts"),z=k("./src/loader/key-loader.ts"),G=k("./src/controller/id3-track-controller.ts"),L=k("./src/controller/latency-controller.ts"),D=k("./src/controller/level-controller.ts"),m=k("./src/controller/fragment-tracker.ts"),g=k("./src/controller/stream-controller.ts"),h=k("./src/is-supported.ts"),o=k("./src/utils/logger.ts"),l=k("./src/config.ts"),a=k("./node_modules/eventemitter3/index.js"),r=k.n(a),t=k("./src/events.ts"),c=k("./src/errors.ts");function f(T,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(T,b.key,b)}}function S(T,O,R){return O&&f(T.prototype,O),R&&f(T,R),T}var C=function(){T.isSupported=function(){return Object(h.isSupported)()};function T(R){R===void 0&&(R={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new a.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var b=this.config=Object(l.mergeConfig)(T.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,y=b.fpsController,v=this.abrController=new _(this),E=this.bufferController=new u(this),M=this.capLevelController=new d(this),N=new y(this),j=new I.default(this),H=new z.default(this),P=new G.default(this),x=this.levelController=new D.default(this),U=new m.FragmentTracker(this),V=this.streamController=new g.default(this,U);M.setStreamController(V),N.setStreamController(V);var q=[x,V];this.networkControllers=q;var ie=[j,H,v,E,M,N,P,U];this.audioTrackController=this.createController(b.audioTrackController,null,q),this.createController(b.audioStreamController,U,q),this.subtitleTrackController=this.createController(b.subtitleTrackController,null,q),this.createController(b.subtitleStreamController,U,q),this.createController(b.timelineController,null,ie),this.emeController=this.createController(b.emeController,null,ie),this.cmcdController=this.createController(b.cmcdController,null,ie),this.latencyController=this.createController(L.default,null,ie),this.coreComponents=ie}var O=T.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=Q.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,_)},S(T,[{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 T.defaultConfig?T.defaultConfig:l.hlsDefaultConfig},set:function(b){T.defaultConfig=b}}]),T}();C.defaultConfig=void 0},"./src/is-supported.ts":function(ee,$,k){"use strict";k.r($),k.d($,"isSupported",function(){return I}),k.d($,"changeTypeSupported",function(){return z});var Q=k("./src/utils/mediasource-helper.ts");function B(){return self.SourceBuffer||self.WebKitSourceBuffer}function I(){var G=Object(Q.getMediaSource)();if(!G)return!1;var L=B(),D=G&&typeof G.isTypeSupported=="function"&&G.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),m=!L||L.prototype&&typeof L.prototype.appendBuffer=="function"&&typeof L.prototype.remove=="function";return!!D&&!!m}function z(){var G,L=B();return typeof(L==null||((G=L.prototype)===null||G===void 0)?void 0:G.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return o}),k.d($,"LoadError",function(){return a});var Q=k("./src/polyfills/number.ts"),B=k("./src/errors.ts");function I(r,t){r.prototype=Object.create(t.prototype),r.prototype.constructor=r,m(r,t)}function z(r){var t=typeof Map=="function"?new Map:void 0;return z=function(f){if(f===null||!D(f))return f;if(typeof f!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(f))return t.get(f);t.set(f,S)}function S(){return G(f,arguments,g(this).constructor)}return S.prototype=Object.create(f.prototype,{constructor:{value:S,enumerable:!1,writable:!0,configurable:!0}}),m(S,f)},z(r)}function G(r,t,c){return L()?G=Reflect.construct:G=function(S,C,T){var O=[null];O.push.apply(O,C);var R=Function.bind.apply(S,O),b=new R;return T&&m(b,T.prototype),b},G.apply(null,arguments)}function L(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(r){return!1}}function D(r){return Function.toString.call(r).indexOf("[native code]")!==-1}function m(r,t){return m=Object.setPrototypeOf||function(f,S){return f.__proto__=S,f},m(r,t)}function g(r){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(c){return c.__proto__||Object.getPrototypeOf(c)},g(r)}var h=Math.pow(2,17),o=function(){function r(c){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=c}var t=r.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(f,S){var C=this,T=f.url;if(!T)return Promise.reject(new a({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,networkDetails:null},"Fragment does not have a "+(T?"part list":"url")));this.abort();var O=this.config,R=O.fLoader,b=O.loader;return new Promise(function(_,u){C.loader&&C.loader.destroy();var d=C.loader=f.loader=R?new R(O):new b(O),y=l(f),v={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:h};f.stats=d.stats,d.load(y,v,{onSuccess:function(M,N,j,H){C.resetLoader(f,d),_({frag:f,part:null,payload:M.data,networkDetails:H})},onError:function(M,N,j){C.resetLoader(f,d),u(new a({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,response:M,networkDetails:j}))},onAbort:function(M,N,j){C.resetLoader(f,d),u(new a({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,networkDetails:j}))},onTimeout:function(M,N,j){C.resetLoader(f,d),u(new a({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,networkDetails:j}))},onProgress:function(M,N,j,H){S&&S({frag:f,part:null,payload:j,networkDetails:H})}})})},t.loadPart=function(f,S,C){var T=this;this.abort();var O=this.config,R=O.fLoader,b=O.loader;return new Promise(function(_,u){T.loader&&T.loader.destroy();var d=T.loader=f.loader=R?new R(O):new b(O),y=l(f,S),v={timeout:O.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:O.fragLoadingMaxRetryTimeout,highWaterMark:h};S.stats=d.stats,d.load(y,v,{onSuccess:function(M,N,j,H){T.resetLoader(f,d),T.updateStatsFromPart(f,S);var P={frag:f,part:S,payload:M.data,networkDetails:H};C(P),_(P)},onError:function(M,N,j){T.resetLoader(f,d),u(new a({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:f,part:S,response:M,networkDetails:j}))},onAbort:function(M,N,j){f.stats.aborted=S.stats.aborted,T.resetLoader(f,d),u(new a({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:f,part:S,networkDetails:j}))},onTimeout:function(M,N,j){T.resetLoader(f,d),u(new a({type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:f,part:S,networkDetails:j}))}})})},t.updateStatsFromPart=function(f,S){var C=f.stats,T=S.stats,O=T.total;if(C.loaded+=T.loaded,O){var R=Math.round(f.duration/S.duration),b=Math.min(Math.round(C.loaded/O),R),_=R-b,u=_*Math.round(C.loaded/b);C.total=C.loaded+u}else C.total=Math.max(C.loaded,C.total);var d=C.loading,y=T.loading;d.start?d.first+=y.first-y.start:(d.start=y.start,d.first=y.first),d.end=y.end},t.resetLoader=function(f,S){f.loader=null,this.loader===S&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),S.destroy()},r}();function l(r,t){t===void 0&&(t=null);var c=t||r,f={frag:r,part:t,responseType:"arraybuffer",url:c.url,headers:{},rangeStart:0,rangeEnd:0},S=c.byteRangeStartOffset,C=c.byteRangeEndOffset;return Object(Q.isFiniteNumber)(S)&&Object(Q.isFiniteNumber)(C)&&(f.rangeStart=S,f.rangeEnd=C),f}var a=function(r){I(t,r);function t(c){for(var f,S=arguments.length,C=new Array(S>1?S-1:0),T=1;T<S;T++)C[T-1]=arguments[T];return f=r.call.apply(r,[this].concat(C))||this,f.data=void 0,f.data=c,f}return t}(z(Error))},"./src/loader/fragment.ts":function(ee,$,k){"use strict";k.r($),k.d($,"ElementaryStreamTypes",function(){return o}),k.d($,"BaseSegment",function(){return l}),k.d($,"Fragment",function(){return a}),k.d($,"Part",function(){return r});var Q=k("./src/polyfills/number.ts"),B=k("./node_modules/url-toolkit/src/url-toolkit.js"),I=k.n(B),z=k("./src/utils/logger.ts"),G=k("./src/loader/level-key.ts"),L=k("./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(S,C){return S.__proto__=C,S},m(t,c)}function g(t,c){for(var f=0;f<c.length;f++){var S=c[f];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(t,S.key,S)}}function h(t,c,f){return c&&g(t.prototype,c),f&&g(t,f),t}var o;(function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"})(o||(o={}));var l=function(){function t(f){var S;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(S={},S[o.AUDIO]=null,S[o.VIDEO]=null,S[o.AUDIOVIDEO]=null,S),this.baseurl=f}var c=t.prototype;return c.setByteRange=function(S,C){var T=S.split("@",2),O=[];T.length===1?O[0]=C?C.byteRangeEndOffset:0:O[0]=parseInt(T[1]),O[1]=parseInt(T[0])+O[0],this._byteRange=O},h(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(B.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(S){this._url=S}}]),t}(),a=function(t){D(c,t);function c(S,C){var T;return T=t.call(this,C)||this,T._decryptdata=null,T.rawProgramDateTime=null,T.programDateTime=null,T.tagList=[],T.duration=0,T.sn=0,T.levelkey=void 0,T.type=void 0,T.loader=null,T.level=-1,T.cc=0,T.startPTS=void 0,T.endPTS=void 0,T.appendedPTS=void 0,T.startDTS=void 0,T.endDTS=void 0,T.start=0,T.deltaPTS=void 0,T.maxStartPTS=void 0,T.minEndPTS=void 0,T.stats=new L.LoadStats,T.urlId=0,T.data=void 0,T.bitrateTest=!1,T.title=null,T.initSegment=null,T.type=S,T}var f=c.prototype;return f.createInitializationVector=function(C){for(var T=new Uint8Array(16),O=12;O<16;O++)T[O]=C>>8*(15-O)&255;return T},f.setDecryptDataFromLevelKey=function(C,T){var O=C;return(C==null?void 0:C.method)==="AES-128"&&C.uri&&!C.iv&&(O=G.LevelKey.fromURI(C.uri),O.method=C.method,O.iv=this.createInitializationVector(T),O.keyFormat="identity"),O},f.setElementaryStreamInfo=function(C,T,O,R,b,_){_===void 0&&(_=!1);var u=this.elementaryStreams,d=u[C];if(!d){u[C]={startPTS:T,endPTS:O,startDTS:R,endDTS:b,partial:_};return}d.startPTS=Math.min(d.startPTS,T),d.endPTS=Math.max(d.endPTS,O),d.startDTS=Math.min(d.startDTS,R),d.endDTS=Math.max(d.endDTS,b)},f.clearElementaryStreamInfo=function(){var C=this.elementaryStreams;C[o.AUDIO]=null,C[o.VIDEO]=null,C[o.AUDIOVIDEO]=null},h(c,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var C=this.sn;typeof C!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&z.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),C=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,C)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(Q.isFiniteNumber)(this.programDateTime))return null;var C=Object(Q.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+C*1e3}},{key:"encrypted",get:function(){var C;return!!((C=this.decryptdata)!==null&&C!==void 0&&C.keyFormat&&this.decryptdata.uri)}}]),c}(l),r=function(t){D(c,t);function c(f,S,C,T,O){var R;R=t.call(this,C)||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 L.LoadStats,R.duration=f.decimalFloatingPoint("DURATION"),R.gap=f.bool("GAP"),R.independent=f.bool("INDEPENDENT"),R.relurl=f.enumeratedString("URI"),R.fragment=S,R.index=T;var b=f.enumeratedString("BYTERANGE");return b&&R.setByteRange(b,O),O&&(R.fragOffset=O.fragOffset+O.duration),R}return h(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 S=this.elementaryStreams;return!!(S.audio||S.video||S.audiovideo)}}]),c}(l)},"./src/loader/key-loader.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return z});var Q=k("./src/events.ts"),B=k("./src/errors.ts"),I=k("./src/utils/logger.ts"),z=function(){function G(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var L=G.prototype;return L._registerListeners=function(){this.hls.on(Q.Events.KEY_LOADING,this.onKeyLoading,this)},L._unregisterListeners=function(){this.hls.off(Q.Events.KEY_LOADING,this.onKeyLoading)},L.destroy=function(){this._unregisterListeners();for(var m in this.loaders){var g=this.loaders[m];g&&g.destroy()}this.loaders={}},L.onKeyLoading=function(m,g){var h=g.frag,o=h.type,l=this.loaders[o];if(!h.decryptdata){I.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var a=h.decryptdata.uri;if(a!==this.decrypturl||this.decryptkey===null){var r=this.hls.config;if(l&&(I.logger.warn("abort previous key loader for type:"+o),l.abort()),!a){I.logger.warn("key uri is falsy");return}var t=r.loader,c=h.loader=this.loaders[o]=new t(r);this.decrypturl=a,this.decryptkey=null;var f={url:a,frag:h,responseType:"arraybuffer"},S={timeout:r.fragLoadingTimeOut,maxRetry:0,retryDelay:r.fragLoadingRetryDelay,maxRetryDelay:r.fragLoadingMaxRetryTimeout,highWaterMark:0},C={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};c.load(f,S,C)}else this.decryptkey&&(h.decryptdata.key=this.decryptkey,this.hls.trigger(Q.Events.KEY_LOADED,{frag:h}))},L.loadsuccess=function(m,g,h){var o=h.frag;if(!o.decryptdata){I.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(Q.Events.KEY_LOADED,{frag:o})},L.loaderror=function(m,g){var h=g.frag,o=h.loader;o&&o.abort(),delete this.loaders[h.type],this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:h,response:m})},L.loadtimeout=function(m,g){var h=g.frag,o=h.loader;o&&o.abort(),delete this.loaders[h.type],this.hls.trigger(Q.Events.ERROR,{type:B.ErrorTypes.NETWORK_ERROR,details:B.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:h})},G}()},"./src/loader/level-details.ts":function(ee,$,k){"use strict";k.r($),k.d($,"LevelDetails",function(){return G});var Q=k("./src/polyfills/number.ts");function B(L,D){for(var m=0;m<D.length;m++){var g=D[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(L,g.key,g)}}function I(L,D,m){return D&&B(L.prototype,D),m&&B(L,m),L}var z=10,G=function(){function L(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=L.prototype;return D.reloaded=function(g){if(!g){this.advanced=!0,this.updated=!0;return}var h=this.lastPartSn-g.lastPartSn,o=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!o||!!h,this.advanced=this.endSN>g.endSN||h>0||h===0&&o>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},I(L,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(Q.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||z}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var h=this.driftEnd-this.driftStart;return h*1e3/g}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var g;return(g=this.fragments)!==null&&g!==void 0&&g.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 g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var g;return(g=this.partList)!==null&&g!==void 0&&g.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),L}()},"./src/loader/level-key.ts":function(ee,$,k){"use strict";k.r($),k.d($,"LevelKey",function(){return G});var Q=k("./node_modules/url-toolkit/src/url-toolkit.js"),B=k.n(Q);function I(L,D){for(var m=0;m<D.length;m++){var g=D[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(L,g.key,g)}}function z(L,D,m){return D&&I(L.prototype,D),m&&I(L,m),L}var G=function(){L.fromURL=function(m,g){return new L(m,g)},L.fromURI=function(m){return new L(m)};function L(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(Q.buildAbsoluteURL)(D,m,{alwaysNormalize:!0}):this._uri=D}return z(L,[{key:"uri",get:function(){return this._uri}}]),L}()},"./src/loader/load-stats.ts":function(ee,$,k){"use strict";k.r($),k.d($,"LoadStats",function(){return Q});var Q=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(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return c});var Q=k("./src/polyfills/number.ts"),B=k("./node_modules/url-toolkit/src/url-toolkit.js"),I=k.n(B),z=k("./src/loader/fragment.ts"),G=k("./src/loader/level-details.ts"),L=k("./src/loader/level-key.ts"),D=k("./src/utils/attr-list.ts"),m=k("./src/utils/logger.ts"),g=k("./src/utils/codecs.ts"),h=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,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"),a=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),r=/\.(mp4|m4s|m4v|m4a)$/i;function t(O){var R,b;return r.test((R=(b=B.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 B.buildAbsoluteURL(_,b,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(b,_){var u=[],d={},y=!1;h.lastIndex=0;for(var v;(v=h.exec(b))!=null;)if(v[1]){var E=new D.AttrList(v[1]),M={attrs:E,bitrate:E.decimalInteger("AVERAGE-BANDWIDTH")||E.decimalInteger("BANDWIDTH"),name:E.NAME,url:O.resolve(v[2],_)},N=E.decimalResolution("RESOLUTION");N&&(M.width=N.width,M.height=N.height),f((E.CODECS||"").split(/[ ,]+/).filter(function(H){return H}),M),M.videoCodec&&M.videoCodec.indexOf("avc1")!==-1&&(M.videoCodec=O.convertAVC1ToAVCOTI(M.videoCodec)),u.push(M)}else if(v[3]){var j=new D.AttrList(v[3]);j["DATA-ID"]&&(y=!0,d[j["DATA-ID"]]=j)}return{levels:u,sessionData:y?d:null}},O.parseMasterPlaylistMedia=function(b,_,u,d){d===void 0&&(d=[]);var y,v=[],E=0;for(o.lastIndex=0;(y=o.exec(b))!==null;){var M=new D.AttrList(y[1]);if(M.TYPE===u){var N={attrs:M,bitrate:0,id:E++,groupId:M["GROUP-ID"],instreamId:M["INSTREAM-ID"],name:M.NAME||M.LANGUAGE||"",type:u,default:M.bool("DEFAULT"),autoselect:M.bool("AUTOSELECT"),forced:M.bool("FORCED"),lang:M.LANGUAGE,url:M.URI?O.resolve(M.URI,_):""};if(d.length){var j=O.findGroup(d,N.groupId)||d[0];S(N,j,"audioCodec"),S(N,j,"textCodec")}v.push(N)}}return v},O.parseLevelPlaylist=function(b,_,u,d,y){var v=new G.LevelDetails(_),E=v.fragments,M=null,N=0,j=0,H=0,P=0,x=null,U=new z.Fragment(d,_),V,q,ie,se=-1,ve=!1;for(l.lastIndex=0,v.m3u8=b;(V=l.exec(b))!==null;){ve&&(ve=!1,U=new z.Fragment(d,_),U.start=H,U.sn=N,U.cc=P,U.level=u,M&&(U.initSegment=M,U.rawProgramDateTime=M.rawProgramDateTime));var Te=V[1];if(Te){U.duration=parseFloat(Te);var fe=(" "+V[2]).slice(1);U.title=fe||null,U.tagList.push(fe?["INF",Te,fe]:["INF",Te])}else if(V[3])Object(Q.isFiniteNumber)(U.duration)&&(U.start=H,ie&&(U.levelkey=ie),U.sn=N,U.level=u,U.cc=P,U.urlId=y,E.push(U),U.relurl=(" "+V[3]).slice(1),T(U,x),x=U,H+=U.duration,N++,j=0,ve=!0);else if(V[4]){var _e=(" "+V[4]).slice(1);x?U.setByteRange(_e,x):U.setByteRange(_e)}else if(V[5])U.rawProgramDateTime=(" "+V[5]).slice(1),U.tagList.push(["PROGRAM-DATE-TIME",U.rawProgramDateTime]),se===-1&&(se=E.length);else{if(V=V[0].match(a),!V){m.logger.warn("No matches on slow regex match for level playlist!");continue}for(q=1;q<V.length&&!(typeof V[q]!="undefined");q++);var ue=(" "+V[q]).slice(1),xe=(" "+V[q+1]).slice(1),Y=V[q+2]?(" "+V[q+2]).slice(1):"";switch(ue){case"PLAYLIST-TYPE":v.type=xe.toUpperCase();break;case"MEDIA-SEQUENCE":N=v.startSN=parseInt(xe);break;case"SKIP":{var oe=new D.AttrList(xe),ce=oe.decimalInteger("SKIPPED-SEGMENTS");if(Object(Q.isFiniteNumber)(ce)){v.skippedSegments=ce;for(var Re=ce;Re--;)E.unshift(null);N+=ce}var Ge=oe.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ge&&(v.recentlyRemovedDateranges=Ge.split(" "));break}case"TARGETDURATION":v.targetduration=parseFloat(xe);break;case"VERSION":v.version=parseInt(xe);break;case"EXTM3U":break;case"ENDLIST":v.live=!1;break;case"#":(xe||Y)&&U.tagList.push(Y?[xe,Y]:[xe]);break;case"DIS":P++;case"GAP":U.tagList.push([ue]);break;case"BITRATE":U.tagList.push([ue,xe]);break;case"DISCONTINUITY-SEQ":P=parseInt(xe);break;case"KEY":{var Ne,Je=new D.AttrList(xe),rt=Je.enumeratedString("METHOD"),_t=Je.URI,ft=Je.hexadecimalInteger("IV"),ut=Je.enumeratedString("KEYFORMATVERSIONS"),qe=Je.enumeratedString("KEYID"),Ct=(Ne=Je.enumeratedString("KEYFORMAT"))!=null?Ne:"identity",kt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(kt.indexOf(Ct)>-1){m.logger.warn("Keyformat "+Ct+" is not supported from the manifest");continue}else if(Ct!=="identity")continue;rt&&(ie=L.LevelKey.fromURL(_,_t),_t&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(rt)>=0&&(ie.method=rt,ie.keyFormat=Ct,qe&&(ie.keyID=qe),ut&&(ie.keyFormatVersions=ut),ie.iv=ft));break}case"START":{var Kt=new D.AttrList(xe),zt=Kt.decimalFloatingPoint("TIME-OFFSET");Object(Q.isFiniteNumber)(zt)&&(v.startTimeOffset=zt);break}case"MAP":{var ln=new D.AttrList(xe);U.relurl=ln.URI,ln.BYTERANGE&&U.setByteRange(ln.BYTERANGE),U.level=u,U.sn="initSegment",ie&&(U.levelkey=ie),U.initSegment=null,M=U,ve=!0;break}case"SERVER-CONTROL":{var un=new D.AttrList(xe);v.canBlockReload=un.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=un.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&un.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=un.optionalFloat("PART-HOLD-BACK",0),v.holdBack=un.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var We=new D.AttrList(xe);v.partTarget=We.decimalFloatingPoint("PART-TARGET");break}case"PART":{var je=v.partList;je||(je=v.partList=[]);var ht=j>0?je[je.length-1]:void 0,ct=j++,He=new z.Part(new D.AttrList(xe),U,_,ct,ht);je.push(He),U.duration+=He.duration;break}case"PRELOAD-HINT":{var lt=new D.AttrList(xe);v.preloadHint=lt;break}case"RENDITION-REPORT":{var Pe=new D.AttrList(xe);v.renditionReports=v.renditionReports||[],v.renditionReports.push(Pe);break}default:m.logger.warn("line parsed but not handled: "+V);break}}}x&&!x.relurl?(E.pop(),H-=x.duration,v.partList&&(v.fragmentHint=x)):v.partList&&(T(U,x),U.cc=P,v.fragmentHint=U);var Oe=E.length,Ce=E[0],le=E[Oe-1];if(H+=v.skippedSegments*v.targetduration,H>0&&Oe&&le){v.averagetargetduration=H/Oe;var he=le.sn;v.endSN=he!=="initSegment"?he:0,Ce&&(v.startCC=Ce.cc,Ce.initSegment||v.fragments.every(function(ye){return ye.relurl&&t(ye.relurl)})&&(m.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),U=new z.Fragment(d,_),U.relurl=le.relurl,U.level=u,U.sn="initSegment",Ce.initSegment=U,v.needSidxRanges=!0))}else v.endSN=0,v.startCC=0;return v.fragmentHint&&(H+=v.fragmentHint.duration),v.totalduration=H,v.endCC=P,se>0&&C(E,se),v},O}();function f(O,R){["video","audio","text"].forEach(function(b){var _=O.filter(function(d){return Object(g.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 S(O,R,b){var _=R[b];_&&(O[b]=_)}function C(O,R){for(var b=O[R],_=R;_--;){var u=O[_];if(!u)return;u.programDateTime=b.programDateTime-u.duration*1e3,b=u}}function T(O,R){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):R!=null&&R.programDateTime&&(O.programDateTime=R.endProgramDateTime),Object(Q.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/polyfills/number.ts"),B=k("./src/events.ts"),I=k("./src/errors.ts"),z=k("./src/utils/logger.ts"),G=k("./src/utils/mp4-tools.ts"),L=k("./src/loader/m3u8-parser.ts"),D=k("./src/types/loader.ts"),m=k("./src/utils/attr-list.ts");function g(l){var a=l.type;switch(a){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function h(l,a){var r=l.url;return(r===void 0||r.indexOf("data:")===0)&&(r=a.url),r}var o=function(){function l(r){this.hls=void 0,this.loaders=Object.create(null),this.hls=r,this.registerListeners()}var a=l.prototype;return a.registerListeners=function(){var t=this.hls;t.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},a.unregisterListeners=function(){var t=this.hls;t.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(B.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(B.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(B.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},a.createInternalLoader=function(t){var c=this.hls.config,f=c.pLoader,S=c.loader,C=f||S,T=new C(c);return t.loader=T,this.loaders[t.type]=T,T},a.getInternalLoader=function(t){return this.loaders[t.type]},a.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},a.destroyInternalLoaders=function(){for(var t in this.loaders){var c=this.loaders[t];c&&c.destroy(),this.resetInternalLoader(t)}},a.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},a.onManifestLoading=function(t,c){var f=c.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:f,deliveryDirectives:null})},a.onLevelLoading=function(t,c){var f=c.id,S=c.level,C=c.url,T=c.deliveryDirectives;this.load({id:f,groupId:null,level:S,responseType:"text",type:D.PlaylistContextType.LEVEL,url:C,deliveryDirectives:T})},a.onAudioTrackLoading=function(t,c){var f=c.id,S=c.groupId,C=c.url,T=c.deliveryDirectives;this.load({id:f,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:C,deliveryDirectives:T})},a.onSubtitleTrackLoading=function(t,c){var f=c.id,S=c.groupId,C=c.url,T=c.deliveryDirectives;this.load({id:f,groupId:S,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:C,deliveryDirectives:T})},a.load=function(t){var c,f=this.hls.config,S=this.getInternalLoader(t);if(S){var C=S.context;if(C&&C.url===t.url){z.logger.trace("[playlist-loader]: playlist request ongoing");return}z.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),S.abort()}var T,O,R,b;switch(t.type){case D.PlaylistContextType.MANIFEST:T=f.manifestLoadingMaxRetry,O=f.manifestLoadingTimeOut,R=f.manifestLoadingRetryDelay,b=f.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:T=0,O=f.levelLoadingTimeOut;break;default:T=f.levelLoadingMaxRetry,O=f.levelLoadingTimeOut,R=f.levelLoadingRetryDelay,b=f.levelLoadingMaxRetryTimeout;break}if(S=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 y={timeout:O,maxRetry:T,retryDelay:R,maxRetryDelay:b,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};S.load(t,y,v)},a.loadsuccess=function(t,c,f,S){if(S===void 0&&(S=null),f.isSidxRequest){this.handleSidxRequest(t,f),this.handlePlaylistLoaded(t,c,f,S);return}this.resetInternalLoader(f.type);var C=t.data;if(C.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,f,"no EXTM3U delimiter",S);return}c.parsing.start=performance.now(),C.indexOf("#EXTINF:")>0||C.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,c,f,S):this.handleMasterPlaylist(t,c,f,S)},a.loaderror=function(t,c,f){f===void 0&&(f=null),this.handleNetworkError(c,f,!1,t)},a.loadtimeout=function(t,c,f){f===void 0&&(f=null),this.handleNetworkError(c,f,!0)},a.handleMasterPlaylist=function(t,c,f,S){var C=this.hls,T=t.data,O=h(t,f),R=L.default.parseMasterPlaylist(T,O),b=R.levels,_=R.sessionData;if(!b.length){this.handleManifestParsingError(t,f,"no level found in manifest",S);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}}),y=L.default.parseMasterPlaylistMedia(T,O,"AUDIO",u),v=L.default.parseMasterPlaylistMedia(T,O,"SUBTITLES",d),E=L.default.parseMasterPlaylistMedia(T,O,"CLOSED-CAPTIONS");if(y.length){var M=y.some(function(N){return!N.url});!M&&b[0].audioCodec&&!b[0].attrs.AUDIO&&(z.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),y.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new m.AttrList({}),bitrate:0,url:""}))}C.trigger(B.Events.MANIFEST_LOADED,{levels:b,audioTracks:y,subtitles:v,captions:E,url:O,stats:c,networkDetails:S,sessionData:_})},a.handleTrackOrLevelPlaylist=function(t,c,f,S){var C=this.hls,T=f.id,O=f.level,R=f.type,b=h(t,f),_=Object(Q.isFiniteNumber)(T)?T:0,u=Object(Q.isFiniteNumber)(O)?O:_,d=g(f),y=L.default.parseLevelPlaylist(t.data,b,u,d,_);if(!y.fragments.length){C.trigger(B.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:b,reason:"no fragments found in level",level:typeof f.level=="number"?f.level:void 0});return}if(R===D.PlaylistContextType.MANIFEST){var v={attrs:new m.AttrList({}),bitrate:0,details:y,name:"",url:b};C.trigger(B.Events.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:b,stats:c,networkDetails:S,sessionData:null})}if(c.parsing.end=performance.now(),y.needSidxRanges){var E,M=(E=y.fragments[0].initSegment)===null||E===void 0?void 0:E.url;this.load({url:M,isSidxRequest:!0,type:R,level:O,levelDetails:y,id:T,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}f.levelDetails=y,this.handlePlaylistLoaded(t,c,f,S)},a.handleSidxRequest=function(t,c){var f=Object(G.parseSegmentIndex)(new Uint8Array(t.data));if(!f)return;var S=f.references,C=c.levelDetails;S.forEach(function(T,O){var R=T.info,b=C.fragments[O];b.byteRange.length===0&&b.setByteRange(String(1+R.end-R.start)+"@"+String(R.start)),b.initSegment&&b.initSegment.setByteRange(String(f.moovEndOffset)+"@0")})},a.handleManifestParsingError=function(t,c,f,S){this.hls.trigger(B.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:c.type===D.PlaylistContextType.MANIFEST,url:t.url,reason:f,response:t,context:c,networkDetails:S})},a.handleNetworkError=function(t,c,f,S){f===void 0&&(f=!1),z.logger.warn("[playlist-loader]: A network "+(f?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var C=I.ErrorDetails.UNKNOWN,T=!1,O=this.getInternalLoader(t);switch(t.type){case D.PlaylistContextType.MANIFEST:C=f?I.ErrorDetails.MANIFEST_LOAD_TIMEOUT:I.ErrorDetails.MANIFEST_LOAD_ERROR,T=!0;break;case D.PlaylistContextType.LEVEL:C=f?I.ErrorDetails.LEVEL_LOAD_TIMEOUT:I.ErrorDetails.LEVEL_LOAD_ERROR,T=!1;break;case D.PlaylistContextType.AUDIO_TRACK:C=f?I.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,T=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:C=f?I.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:I.ErrorDetails.SUBTITLE_LOAD_ERROR,T=!1;break}O&&this.resetInternalLoader(t.type);var R={type:I.ErrorTypes.NETWORK_ERROR,details:C,fatal:T,url:t.url,loader:O,context:t,networkDetails:c};S&&(R.response=S),this.hls.trigger(B.Events.ERROR,R)},a.handlePlaylistLoaded=function(t,c,f,S){var C=f.type,T=f.level,O=f.id,R=f.groupId,b=f.loader,_=f.levelDetails,u=f.deliveryDirectives;if(!(_!=null&&_.targetduration)){this.handleManifestParsingError(t,f,"invalid target duration",S);return}if(!b)return;_.live&&(b.getCacheAge&&(_.ageHeader=b.getCacheAge()||0),(!b.getCacheAge||isNaN(_.ageHeader))&&(_.ageHeader=0));switch(C){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(B.Events.LEVEL_LOADED,{details:_,level:T||0,id:O||0,stats:c,networkDetails:S,deliveryDirectives:u});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(B.Events.AUDIO_TRACK_LOADED,{details:_,id:O||0,groupId:R||"",stats:c,networkDetails:S,deliveryDirectives:u});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(B.Events.SUBTITLE_TRACK_LOADED,{details:_,id:O||0,groupId:R||"",stats:c,networkDetails:S,deliveryDirectives:u});break}},l}();$.default=o},"./src/polyfills/number.ts":function(ee,$,k){"use strict";k.r($),k.d($,"isFiniteNumber",function(){return Q}),k.d($,"MAX_SAFE_INTEGER",function(){return B});var Q=Number.isFinite||function(I){return typeof I=="number"&&isFinite(I)},B=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(ee,$,k){"use strict";k.r($);var Q=function(){function B(){}return B.getSilentFrame=function(z,G){switch(z){case"mp4a.40.2":if(G===1)return new Uint8Array([0,200,0,128,35,128]);if(G===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(G===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(G===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(G===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(G===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(G===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(G===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(G===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},B}();$.default=Q},"./src/remux/mp4-generator.ts":function(ee,$,k){"use strict";k.r($);var Q=Math.pow(2,32)-1,B=function(){function I(){}return I.init=function(){I.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 G;for(G in I.types)I.types.hasOwnProperty(G)&&(I.types[G]=[G.charCodeAt(0),G.charCodeAt(1),G.charCodeAt(2),G.charCodeAt(3)]);var L=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),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]);I.HDLR_TYPES={video:L,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]),g=new Uint8Array([0,0,0,0,0,0,0,0]);I.STTS=I.STSC=I.STCO=g,I.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),I.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),I.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),I.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var h=new Uint8Array([105,115,111,109]),o=new Uint8Array([97,118,99,49]),l=new Uint8Array([0,0,0,1]);I.FTYP=I.box(I.types.ftyp,h,l,h,o),I.DINF=I.box(I.types.dinf,I.box(I.types.dref,m))},I.box=function(G){for(var L=8,D=arguments.length,m=new Array(D>1?D-1:0),g=1;g<D;g++)m[g-1]=arguments[g];for(var h=m.length,o=h;h--;)L+=m[h].byteLength;var l=new Uint8Array(L);for(l[0]=L>>24&255,l[1]=L>>16&255,l[2]=L>>8&255,l[3]=L&255,l.set(G,4),h=0,L=8;h<o;h++)l.set(m[h],L),L+=m[h].byteLength;return l},I.hdlr=function(G){return I.box(I.types.hdlr,I.HDLR_TYPES[G])},I.mdat=function(G){return I.box(I.types.mdat,G)},I.mdhd=function(G,L){L*=G;var D=Math.floor(L/(Q+1)),m=Math.floor(L%(Q+1));return I.box(I.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&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]))},I.mdia=function(G){return I.box(I.types.mdia,I.mdhd(G.timescale,G.duration),I.hdlr(G.type),I.minf(G))},I.mfhd=function(G){return I.box(I.types.mfhd,new Uint8Array([0,0,0,0,G>>24,G>>16&255,G>>8&255,G&255]))},I.minf=function(G){return G.type==="audio"?I.box(I.types.minf,I.box(I.types.smhd,I.SMHD),I.DINF,I.stbl(G)):I.box(I.types.minf,I.box(I.types.vmhd,I.VMHD),I.DINF,I.stbl(G))},I.moof=function(G,L,D){return I.box(I.types.moof,I.mfhd(G),I.traf(D,L))},I.moov=function(G){for(var L=G.length,D=[];L--;)D[L]=I.trak(G[L]);return I.box.apply(null,[I.types.moov,I.mvhd(G[0].timescale,G[0].duration)].concat(D).concat(I.mvex(G)))},I.mvex=function(G){for(var L=G.length,D=[];L--;)D[L]=I.trex(G[L]);return I.box.apply(null,[I.types.mvex].concat(D))},I.mvhd=function(G,L){L*=G;var D=Math.floor(L/(Q+1)),m=Math.floor(L%(Q+1)),g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,G>>24&255,G>>16&255,G>>8&255,G&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 I.box(I.types.mvhd,g)},I.sdtp=function(G){var L=G.samples||[],D=new Uint8Array(4+L.length),m,g;for(m=0;m<L.length;m++)g=L[m].flags,D[m+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return I.box(I.types.sdtp,D)},I.stbl=function(G){return I.box(I.types.stbl,I.stsd(G),I.box(I.types.stts,I.STTS),I.box(I.types.stsc,I.STSC),I.box(I.types.stsz,I.STSZ),I.box(I.types.stco,I.STCO))},I.avc1=function(G){var L=[],D=[],m,g,h;for(m=0;m<G.sps.length;m++)g=G.sps[m],h=g.byteLength,L.push(h>>>8&255),L.push(h&255),L=L.concat(Array.prototype.slice.call(g));for(m=0;m<G.pps.length;m++)g=G.pps[m],h=g.byteLength,D.push(h>>>8&255),D.push(h&255),D=D.concat(Array.prototype.slice.call(g));var o=I.box(I.types.avcC,new Uint8Array([1,L[3],L[4],L[5],252|3,224|G.sps.length].concat(L).concat([G.pps.length]).concat(D))),l=G.width,a=G.height,r=G.pixelRatio[0],t=G.pixelRatio[1];return I.box(I.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,a>>8&255,a&255,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,100,97,105,108,121,109,111,116,105,111,110,47,104,108,115,46,106,115,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),o,I.box(I.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),I.box(I.types.pasp,new Uint8Array([r>>24,r>>16&255,r>>8&255,r&255,t>>24,t>>16&255,t>>8&255,t&255])))},I.esds=function(G){var L=G.config.length;return new Uint8Array([0,0,0,0,3,23+L,0,1,0,4,15+L,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([L]).concat(G.config).concat([6,1,2]))},I.mp4a=function(G){var L=G.samplerate;return I.box(I.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]),I.box(I.types.esds,I.esds(G)))},I.mp3=function(G){var L=G.samplerate;return I.box(I.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,G.channelCount,0,16,0,0,0,0,L>>8&255,L&255,0,0]))},I.stsd=function(G){return G.type==="audio"?!G.isAAC&&G.codec==="mp3"?I.box(I.types.stsd,I.STSD,I.mp3(G)):I.box(I.types.stsd,I.STSD,I.mp4a(G)):I.box(I.types.stsd,I.STSD,I.avc1(G))},I.tkhd=function(G){var L=G.id,D=G.duration*G.timescale,m=G.width,g=G.height,h=Math.floor(D/(Q+1)),o=Math.floor(D%(Q+1));return I.box(I.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,L>>24&255,L>>16&255,L>>8&255,L&255,0,0,0,0,h>>24,h>>16&255,h>>8&255,h&255,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,g>>8&255,g&255,0,0]))},I.traf=function(G,L){var D=I.sdtp(G),m=G.id,g=Math.floor(L/(Q+1)),h=Math.floor(L%(Q+1));return I.box(I.types.traf,I.box(I.types.tfhd,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255])),I.box(I.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,h>>24,h>>16&255,h>>8&255,h&255])),I.trun(G,D.length+16+20+8+16+8+8),D)},I.trak=function(G){return G.duration=G.duration||4294967295,I.box(I.types.trak,I.tkhd(G),I.mdia(G))},I.trex=function(G){var L=G.id;return I.box(I.types.trex,new Uint8Array([0,0,0,0,L>>24,L>>16&255,L>>8&255,L&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},I.trun=function(G,L){var D=G.samples||[],m=D.length,g=12+16*m,h=new Uint8Array(g),o,l,a,r,t,c;for(L+=8+g,h.set([0,0,15,1,m>>>24&255,m>>>16&255,m>>>8&255,m&255,L>>>24&255,L>>>16&255,L>>>8&255,L&255],0),o=0;o<m;o++)l=D[o],a=l.duration,r=l.size,t=l.flags,c=l.cts,h.set([a>>>24&255,a>>>16&255,a>>>8&255,a&255,r>>>24&255,r>>>16&255,r>>>8&255,r&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 I.box(I.types.trun,h)},I.initSegment=function(G){I.types||I.init();var L=I.moov(G),D=new Uint8Array(I.FTYP.byteLength+L.byteLength);return D.set(I.FTYP),D.set(L,I.FTYP.byteLength),D},I}();B.types=void 0,B.HDLR_TYPES=void 0,B.STTS=void 0,B.STSC=void 0,B.STCO=void 0,B.STSZ=void 0,B.VMHD=void 0,B.SMHD=void 0,B.STSD=void 0,B.FTYP=void 0,B.DINF=void 0,$.default=B},"./src/remux/mp4-remuxer.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return c}),k.d($,"normalizePts",function(){return f});var Q=k("./src/polyfills/number.ts"),B=k("./src/remux/aac-helper.ts"),I=k("./src/remux/mp4-generator.ts"),z=k("./src/events.ts"),G=k("./src/errors.ts"),L=k("./src/utils/logger.ts"),D=k("./src/types/loader.ts"),m=k("./src/utils/timescale-conversion.ts");function g(){return g=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},g.apply(this,arguments)}var h=10*1e3,o=1024,l=1152,a=null,r=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,a===null){var y=navigator.userAgent||"",v=y.match(/Chrome\/(\d+)/i);a=v?parseInt(v[1]):0}if(r===null){var E=navigator.userAgent.match(/Safari\/(\d+)/i);r=E?parseInt(E[1]):0}t=!!a&&a<75||!!r&&r<600}var R=O.prototype;return R.destroy=function(){},R.resetTimeStamp=function(_){L.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=_},R.resetNextTimestamp=function(){L.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},R.resetInitSegment=function(){L.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},R.getVideoStartPts=function(_){var u=!1,d=_.reduce(function(y,v){var E=v.pts-y;return E<-4294967296?(u=!0,f(y,v.pts)):E>0?y:v.pts},_[0].pts);return u&&L.logger.debug("PTS rollover detected"),d},R.remux=function(_,u,d,y,v,E,M,N){var j,H,P,x,U,V,q=v,ie=v,se=_.pid>-1,ve=u.pid>-1,Te=u.samples.length,fe=_.samples.length>0,_e=Te>1,ue=(!se||fe)&&(!ve||_e)||this.ISGenerated||M;if(ue){this.ISGenerated||(P=this.generateIS(_,u,v));var xe=this.isVideoContiguous,Y=-1;if(_e&&(Y=S(u.samples),!xe&&this.config.forceKeyFrameOnDiscontinuity))if(V=!0,Y>0){L.logger.warn("[mp4-remuxer]: Dropped "+Y+" out of "+Te+" video samples due to a missing keyframe");var oe=this.getVideoStartPts(u.samples);u.samples=u.samples.slice(Y),u.dropped+=Y,ie+=(u.samples[0].pts-oe)/(u.timescale||9e4)}else Y===-1&&(L.logger.warn("[mp4-remuxer]: No keyframe found out of "+Te+" video samples"),V=!1);if(this.ISGenerated){if(fe&&_e){var ce=this.getVideoStartPts(u.samples),Re=f(_.samples[0].pts,ce)-ce,Ge=Re/u.inputTimeScale;q+=Math.max(0,Ge),ie+=Math.max(0,-Ge)}if(fe){if(_.samplerate||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),P=this.generateIS(_,u,v)),H=this.remuxAudio(_,q,this.isAudioContiguous,E,ve||_e||N===D.PlaylistLevelType.AUDIO?ie:void 0),_e){var Ne=H?H.endPTS-H.startPTS:0;u.inputTimeScale||(L.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),P=this.generateIS(_,u,v)),j=this.remuxVideo(u,ie,xe,Ne)}}else _e&&(j=this.remuxVideo(u,ie,xe,0));j&&(j.firstKeyFrame=Y,j.independent=Y!==-1)}}return this.ISGenerated&&(d.samples.length&&(U=this.remuxID3(d,v)),y.samples.length&&(x=this.remuxText(y,v))),{audio:H,video:j,initSegment:P,independent:V,text:x,id3:U}},R.generateIS=function(_,u,d){var y=_.samples,v=u.samples,E=this.typeSupported,M={},N=!Object(Q.isFiniteNumber)(this._initPTS),j="audio/mp4",H,P,x;if(N&&(H=P=Infinity),_.config&&y.length&&(_.timescale=_.samplerate,_.isAAC||(E.mpeg?(j="audio/mpeg",_.codec=""):E.mp3&&(_.codec="mp3")),M.audio={id:"audio",container:j,codec:_.codec,initSegment:!_.isAAC&&E.mpeg?new Uint8Array(0):I.default.initSegment([_]),metadata:{channelCount:_.channelCount}},N&&(x=_.inputTimeScale,H=P=y[0].pts-Math.round(x*d))),u.sps&&u.pps&&v.length&&(u.timescale=u.inputTimeScale,M.video={id:"main",container:"video/mp4",codec:u.codec,initSegment:I.default.initSegment([u]),metadata:{width:u.width,height:u.height}},N)){x=u.inputTimeScale;var U=this.getVideoStartPts(v),V=Math.round(x*d);P=Math.min(P,f(v[0].dts,U)-V),H=Math.min(H,U-V)}if(Object.keys(M).length)return this.ISGenerated=!0,N&&(this._initPTS=H,this._initDTS=P),{tracks:M,initPTS:H,timescale:x}},R.remuxVideo=function(_,u,d,y){var v=_.inputTimeScale,E=_.samples,M=[],N=E.length,j=this._initPTS,H=this.nextAvcDts,P=8,x,U,V,q=Number.POSITIVE_INFINITY,ie=Number.NEGATIVE_INFINITY,se=0,ve=!1;if(!d||H===null){var Te=u*v,fe=E[0].pts-f(E[0].dts,E[0].pts);H=Te-fe}for(var _e=0;_e<N;_e++){var ue=E[_e];if(ue.pts=f(ue.pts-j,H),ue.dts=f(ue.dts-j,H),ue.dts>ue.pts){var xe=9e4*.2;se=Math.max(Math.min(se,ue.pts-ue.dts),-1*xe)}ue.dts<E[_e>0?_e-1:_e].dts&&(ve=!0)}ve&&E.sort(function(hr,on){var fn=hr.dts-on.dts,nn=hr.pts-on.pts;return fn||nn}),U=E[0].dts,V=E[E.length-1].dts;var Y=Math.round((V-U)/(N-1));if(se<0){if(se<Y*-2){L.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(m.toMsFromMpegTsClock)(-Y,!0)+" ms");for(var oe=se,ce=0;ce<N;ce++)E[ce].dts=oe=Math.max(oe,E[ce].pts-Y),E[ce].pts=Math.max(oe,E[ce].pts)}else{L.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(m.toMsFromMpegTsClock)(se,!0)+" ms to overcome this issue");for(var Re=0;Re<N;Re++)E[Re].dts=E[Re].dts+se}U=E[0].dts}if(d){var Ge=U-H,Ne=Ge>Y,Je=Ge<-1;if(Ne||Je){Ne?L.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(Ge,!0)+" ms ("+Ge+"dts) hole between fragments detected, filling it"):L.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(-Ge,!0)+" ms ("+Ge+"dts) overlapping between fragments detected"),U=H;var rt=E[0].pts-Ge;E[0].dts=U,E[0].pts=rt,L.logger.log("Video: First PTS/DTS adjusted: "+Object(m.toMsFromMpegTsClock)(rt,!0)+"/"+Object(m.toMsFromMpegTsClock)(U,!0)+", delta: "+Object(m.toMsFromMpegTsClock)(Ge,!0)+" ms")}}t&&(U=Math.max(0,U));for(var _t=0,ft=0,ut=0;ut<N;ut++){for(var qe=E[ut],Ct=qe.units,kt=Ct.length,Kt=0,zt=0;zt<kt;zt++)Kt+=Ct[zt].data.length;ft+=Kt,_t+=kt,qe.length=Kt,qe.dts=Math.max(qe.dts,U),qe.pts=Math.max(qe.pts,qe.dts,0),q=Math.min(qe.pts,q),ie=Math.max(qe.pts,ie)}V=E[N-1].dts;var ln=ft+4*_t+8,un;try{un=new Uint8Array(ln)}catch(hr){this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ln,reason:"fail allocating video mdat "+ln});return}var We=new DataView(un.buffer);We.setUint32(0,ln),un.set(I.default.types.mdat,4);for(var je=0;je<N;je++){for(var ht=E[je],ct=ht.units,He=0,lt=0,Pe=ct.length;lt<Pe;lt++){var Oe=ct[lt],Ce=Oe.data,le=Oe.data.byteLength;We.setUint32(P,le),P+=4,un.set(Ce,P),P+=le,He+=4+le}if(je<N-1)x=E[je+1].dts-ht.dts;else{var he=this.config,ye=ht.dts-E[je>0?je-1:je].dts;if(he.stretchShortVideoTrack&&this.nextAudioPts!==null){var ae=Math.floor(he.maxBufferHole*v),Se=(y?q+y*v:this.nextAudioPts)-ht.pts;Se>ae?(x=Se-ye,x<0&&(x=ye),L.logger.log("[mp4-remuxer]: It is approximately "+Se/90+" ms to the next segment; using duration "+x/90+" ms for the last video frame.")):x=ye}else x=ye}var $e=Math.round(ht.pts-ht.dts);M.push(new C(ht.key,x,He,$e))}if(M.length&&a&&a<70){var dt=M[0].flags;dt.dependsOn=2,dt.isNonSync=0}console.assert(x!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=H=V+x,this.isVideoContiguous=!0;var St=I.default.moof(_.sequenceNumber++,U,g({},_,{samples:M})),Dt="video",Mt={data1:St,data2:un,startPTS:q/v,endPTS:(ie+x)/v,startDTS:U/v,endDTS:H/v,type:Dt,hasAudio:!1,hasVideo:!0,nb:M.length,dropped:_.dropped};return _.samples=[],_.dropped=0,console.assert(un.length,"MDAT length must not be zero"),Mt},R.remuxAudio=function(_,u,d,y,v){var E=_.inputTimeScale,M=_.samplerate?_.samplerate:E,N=E/M,j=_.isAAC?o:l,H=j*N,P=this._initPTS,x=!_.isAAC&&this.typeSupported.mpeg,U=[],V=_.samples,q=x?0:8,ie=this.nextAudioPts||-1,se=u*E;if(this.isAudioContiguous=d=d||V.length&&ie>0&&(y&&Math.abs(se-ie)<9e3||Math.abs(f(V[0].pts-P,se)-ie)<20*H),V.forEach(function(Ce){Ce.pts=f(Ce.pts-P,se)}),!d||ie<0){if(V=V.filter(function(Ce){return Ce.pts>=0}),!V.length)return;v===0?ie=0:y?ie=Math.max(0,se):ie=V[0].pts}if(_.isAAC)for(var ve=v!==void 0,Te=this.config.maxAudioFramesDrift,fe=0,_e=ie;fe<V.length;fe++){var ue=V[fe],xe=ue.pts,Y=xe-_e,oe=Math.abs(1e3*Y/E);if(Y<=-Te*H&&ve)fe===0&&(L.logger.warn("Audio frame @ "+(xe/E).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*Y/E)+" ms."),this.nextAudioPts=ie=_e=xe);else if(Y>=Te*H&&oe<h&&ve){var ce=Math.round(Y/H);_e=xe-ce*H,_e<0&&(ce--,_e+=H),fe===0&&(this.nextAudioPts=ie=_e),L.logger.warn("[mp4-remuxer]: Injecting "+ce+" audio frame @ "+(_e/E).toFixed(3)+"s due to "+Math.round(1e3*Y/E)+" ms gap.");for(var Re=0;Re<ce;Re++){var Ge=Math.max(_e,0),Ne=B.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);Ne||(L.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),Ne=ue.unit.subarray()),V.splice(fe,0,{unit:Ne,pts:Ge}),_e+=H,fe++}}ue.pts=_e,_e+=H}for(var Je=null,rt=null,_t,ft=0,ut=V.length;ut--;)ft+=V[ut].unit.byteLength;for(var qe=0,Ct=V.length;qe<Ct;qe++){var kt=V[qe],Kt=kt.unit,zt=kt.pts;if(rt!==null){var ln=U[qe-1];ln.duration=Math.round((zt-rt)/N)}else if(d&&_.isAAC&&(zt=ie),Je=zt,ft>0){ft+=q;try{_t=new Uint8Array(ft)}catch(Ce){this.observer.emit(z.Events.ERROR,z.Events.ERROR,{type:G.ErrorTypes.MUX_ERROR,details:G.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:ft,reason:"fail allocating audio mdat "+ft});return}if(!x){var un=new DataView(_t.buffer);un.setUint32(0,ft),_t.set(I.default.types.mdat,4)}}else return;_t.set(Kt,q);var We=Kt.byteLength;q+=We,U.push(new C(!0,j,We,0)),rt=zt}var je=U.length;if(!je)return;var ht=U[U.length-1];this.nextAudioPts=ie=rt+N*ht.duration;var ct=x?new Uint8Array(0):I.default.moof(_.sequenceNumber++,Je/N,g({},_,{samples:U}));_.samples=[];var He=Je/E,lt=ie/E,Pe="audio",Oe={data1:ct,data2:_t,startPTS:He,endPTS:lt,startDTS:He,endDTS:lt,type:Pe,hasAudio:!0,hasVideo:!1,nb:je};return this.isAudioContiguous=!0,console.assert(_t.length,"MDAT length must not be zero"),Oe},R.remuxEmptyAudio=function(_,u,d,y){var v=_.inputTimeScale,E=_.samplerate?_.samplerate:v,M=v/E,N=this.nextAudioPts,j=(N!==null?N:y.startDTS*v)+this._initDTS,H=y.endDTS*v+this._initDTS,P=M*o,x=Math.ceil((H-j)/P),U=B.default.getSilentFrame(_.manifestCodec||_.codec,_.channelCount);if(L.logger.warn("[mp4-remuxer]: remux empty Audio"),!U){L.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var V=[],q=0;q<x;q++){var ie=j+q*P;V.push({unit:U,pts:ie,dts:ie})}return _.samples=V,this.remuxAudio(_,u,d,!1)},R.remuxID3=function(_,u){var d=_.samples.length;if(!d)return;for(var y=_.inputTimeScale,v=this._initPTS,E=this._initDTS,M=0;M<d;M++){var N=_.samples[M];N.pts=f(N.pts-v,u*y)/y,N.dts=f(N.dts-E,u*y)/y}var j=_.samples;return _.samples=[],{samples:j}},R.remuxText=function(_,u){var d=_.samples.length;if(!d)return;for(var y=_.inputTimeScale,v=this._initPTS,E=0;E<d;E++){var M=_.samples[E];M.pts=f(M.pts-v,u*y)/y}_.samples.sort(function(j,H){return j.pts-H.pts});var N=_.samples;return _.samples=[],{samples:N}},O}();function f(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 S(O){for(var R=0;R<O.length;R++)if(O[R].key)return R;return-1}var C=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 T(R)},T=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(ee,$,k){"use strict";k.r($);var Q=k("./src/polyfills/number.ts"),B=k("./src/utils/mp4-tools.ts"),I=k("./src/loader/fragment.ts"),z=k("./src/utils/logger.ts"),G=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 g=m.prototype;return g.destroy=function(){},g.resetTimeStamp=function(o){this.initPTS=o,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(o,l,a){this.audioCodec=l,this.videoCodec=a,this.generateInitSegment(o),this.emitInitSegment=!0},g.generateInitSegment=function(o){var l=this.audioCodec,a=this.videoCodec;if(!o||!o.byteLength){this.initTracks=void 0,this.initData=void 0;return}var r=this.initData=Object(B.parseInitSegment)(o);l||(l=D(r.audio,I.ElementaryStreamTypes.AUDIO)),a||(a=D(r.video,I.ElementaryStreamTypes.VIDEO));var t={};r.audio&&r.video?t.audiovideo={container:"video/mp4",codec:l+","+a,initSegment:o,id:"main"}:r.audio?t.audio={container:"audio/mp4",codec:l,initSegment:o,id:"audio"}:r.video?t.video={container:"video/mp4",codec:a,initSegment:o,id:"main"}:z.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=t},g.remux=function(o,l,a,r,t){var c=this.initPTS,f=this.lastEndDTS,S={audio:void 0,video:void 0,text:r,id3:a,initSegment:void 0};Object(Q.isFiniteNumber)(f)||(f=this.lastEndDTS=t||0);var C=l.samples;if(!C||!C.length)return S;var T={initPTS:void 0,timescale:1},O=this.initData;if((!O||!O.length)&&(this.generateInitSegment(C),O=this.initData),!O||!O.length)return z.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),S;this.emitInitSegment&&(T.tracks=this.initTracks,this.emitInitSegment=!1),Object(Q.isFiniteNumber)(c)||(this.initPTS=T.initPTS=c=L(O,C,f));var R=Object(B.getDuration)(C,O),b=f,_=R+b;Object(B.offsetStartDTS)(O,C,c),R>0?this.lastEndDTS=_:(z.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var u=!!O.audio,d=!!O.video,y="";u&&(y+="audio"),d&&(y+="video");var v={data1:C,startPTS:b,startDTS:b,endPTS:_,endDTS:_,type:y,hasAudio:u,hasVideo:d,nb:1,dropped:0};return S.audio=v.type==="audio"?v:void 0,S.video=v.type!=="audio"?v:void 0,S.text=r,S.id3=a,S.initSegment=T,S},m}(),L=function(g,h,o){return Object(B.getStartDTS)(g,h)-o};function D(m,g){var h=m==null?void 0:m.codec;return h&&h.length>4?h:h==="hvc1"?"hvc1.1.c.L120.90":h==="av01"?"av01.0.04M.08":h==="avc1"||g===I.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}$.default=G},"./src/task-loop.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return Q});var Q=function(){function B(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var I=B.prototype;return I.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},I.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},I.onHandlerDestroyed=function(){},I.hasInterval=function(){return!!this._tickInterval},I.hasNextTick=function(){return!!this._tickTimer},I.setInterval=function(G){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,G),!0)},I.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},I.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},I.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},I.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},I.doTick=function(){},B}()},"./src/types/cmcd.ts":function(ee,$,k){"use strict";k.r($),k.d($,"CMCDVersion",function(){return Q}),k.d($,"CMCDObjectType",function(){return B}),k.d($,"CMCDStreamingFormat",function(){return I}),k.d($,"CMCDStreamType",function(){return z});var Q=1,B;(function(G){G.MANIFEST="m",G.AUDIO="a",G.VIDEO="v",G.MUXED="av",G.INIT="i",G.CAPTION="c",G.TIMED_TEXT="tt",G.KEY="k",G.OTHER="o"})(B||(B={}));var I;(function(G){G.DASH="d",G.HLS="h",G.SMOOTH="s",G.OTHER="o"})(I||(I={}));var z;(function(G){G.VOD="v",G.LIVE="l"})(z||(z={}))},"./src/types/level.ts":function(ee,$,k){"use strict";k.r($),k.d($,"HlsSkip",function(){return I}),k.d($,"getSkipValue",function(){return z}),k.d($,"HlsUrlParameters",function(){return G}),k.d($,"Level",function(){return L});function Q(D,m){for(var g=0;g<m.length;g++){var h=m[g];h.enumerable=h.enumerable||!1,h.configurable=!0,"value"in h&&(h.writable=!0),Object.defineProperty(D,h.key,h)}}function B(D,m,g){return m&&Q(D.prototype,m),g&&Q(D,g),D}var I;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(I||(I={}));function z(D,m){var g=D.canSkipUntil,h=D.canSkipDateRanges,o=D.endSN,l=m!==void 0?m-o:0;return g&&l<g?h?I.v2:I.Yes:I.No}var G=function(){function D(g,h,o){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=h,this.skip=o}var m=D.prototype;return m.addDirectives=function(h){var o=new self.URL(h);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}(),L=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(g){return g}).join(",").replace(/\.[^.,]+/g,"")}return B(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(g){var h=g%this.url.length;this._urlId!==h&&(this.details=void 0,this._urlId=h)}}]),D}()},"./src/types/loader.ts":function(ee,$,k){"use strict";k.r($),k.d($,"PlaylistContextType",function(){return Q}),k.d($,"PlaylistLevelType",function(){return B});var Q;(function(I){I.MANIFEST="manifest",I.LEVEL="level",I.AUDIO_TRACK="audioTrack",I.SUBTITLE_TRACK="subtitleTrack"})(Q||(Q={}));var B;(function(I){I.MAIN="main",I.AUDIO="audio",I.SUBTITLE="subtitle"})(B||(B={}))},"./src/types/transmuxer.ts":function(ee,$,k){"use strict";k.r($),k.d($,"ChunkMetadata",function(){return Q});var Q=function(z,G,L,D,m,g){D===void 0&&(D=0),m===void 0&&(m=-1),g===void 0&&(g=!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=B(),this.buffering={audio:B(),video:B(),audiovideo:B()},this.level=z,this.sn=G,this.id=L,this.size=D,this.part=m,this.partial=g};function B(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(ee,$,k){"use strict";k.r($),k.d($,"AttrList",function(){return I});var Q=/^(\d+)x(\d+)$/,B=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,I=function(){function z(L){typeof L=="string"&&(L=z.parseAttrList(L));for(var D in L)L.hasOwnProperty(D)&&(this[D]=L[D])}var G=z.prototype;return G.decimalInteger=function(D){var m=parseInt(this[D],10);return m>Number.MAX_SAFE_INTEGER?Infinity:m},G.hexadecimalInteger=function(D){if(this[D]){var m=(this[D]||"0x").slice(2);m=(m.length&1?"0":"")+m;for(var g=new Uint8Array(m.length/2),h=0;h<m.length/2;h++)g[h]=parseInt(m.slice(h*2,h*2+2),16);return g}else return null},G.hexadecimalIntegerAsNumber=function(D){var m=parseInt(this[D],16);return m>Number.MAX_SAFE_INTEGER?Infinity:m},G.decimalFloatingPoint=function(D){return parseFloat(this[D])},G.optionalFloat=function(D,m){var g=this[D];return g?parseFloat(g):m},G.enumeratedString=function(D){return this[D]},G.bool=function(D){return this[D]==="YES"},G.decimalResolution=function(D){var m=Q.exec(this[D]);return m===null?void 0:{width:parseInt(m[1],10),height:parseInt(m[2],10)}},z.parseAttrList=function(D){var m,g={},h='"';for(B.lastIndex=0;(m=B.exec(D))!==null;){var o=m[2];o.indexOf(h)===0&&o.lastIndexOf(h)===o.length-1&&(o=o.slice(1,-1)),g[m[1]]=o}return g},z}()},"./src/utils/binary-search.ts":function(ee,$,k){"use strict";k.r($);var Q={search:function(I,z){for(var G=0,L=I.length-1,D=null,m=null;G<=L;){D=(G+L)/2|0,m=I[D];var g=z(m);if(g>0)G=D+1;else if(g<0)L=D-1;else return m}return null}};$.default=Q},"./src/utils/buffer-helper.ts":function(ee,$,k){"use strict";k.r($),k.d($,"BufferHelper",function(){return I});var Q=k("./src/utils/logger.ts"),B={length:0,start:function(){return 0},end:function(){return 0}},I=function(){function z(){}return z.isBuffered=function(L,D){try{if(L){for(var m=z.getBuffered(L),g=0;g<m.length;g++)if(D>=m.start(g)&&D<=m.end(g))return!0}}catch(h){}return!1},z.bufferInfo=function(L,D,m){try{if(L){var g=z.getBuffered(L),h=[],o;for(o=0;o<g.length;o++)h.push({start:g.start(o),end:g.end(o)});return this.bufferedInfo(h,D,m)}}catch(l){}return{len:0,start:D,end:D,nextStart:void 0}},z.bufferedInfo=function(L,D,m){D=Math.max(0,D),L.sort(function(T,O){var R=T.start-O.start;return R||O.end-T.end});var g=[];if(m)for(var h=0;h<L.length;h++){var o=g.length;if(o){var l=g[o-1].end;L[h].start-l<m?L[h].end>l&&(g[o-1].end=L[h].end):g.push(L[h])}else g.push(L[h])}else g=L;for(var a=0,r,t=D,c=D,f=0;f<g.length;f++){var S=g[f].start,C=g[f].end;if(D+m>=S&&D<C)t=S,c=C,a=c-D;else if(D+m<S){r=S;break}}return{len:a,start:t||0,end:c||0,nextStart:r}},z.getBuffered=function(L){try{return L.buffered}catch(D){return Q.logger.log("failed to get media.buffered",D),B}},z}()},"./src/utils/cea-608-parser.ts":function(ee,$,k){"use strict";k.r($),k.d($,"Row",function(){return c}),k.d($,"CaptionScreen",function(){return f});var Q=k("./src/utils/logger.ts"),B={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},I=function(_){var u=_;return B.hasOwnProperty(_)&&(u=B[_]),String.fromCharCode(u)},z=15,G=100,L={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},g={25:2,26:4,29:6,30:8,31:10,27:13,28:15},h=["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,y){this.verboseLevel>=d&&Q.logger.log(this.time+" ["+d+"] "+y)},b}(),a=function(_){for(var u=[],d=0;d<_.length;d++)u.push(_[d].toString(16));return u},r=function(){function b(u,d,y,v,E){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=y||!1,this.background=v||"black",this.flash=E||!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 y=["foreground","underline","italics","background","flash"],v=0;v<y.length;v++){var E=y[v];d.hasOwnProperty(E)&&(this[E]=d[E])}},_.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,y,v,E,M){this.uchar=void 0,this.penState=void 0,this.uchar=u||" ",this.penState=new r(d,y,v,E,M)}var _=b.prototype;return _.reset=function(){this.uchar=" ",this.penState.reset()},_.setChar=function(d,y){this.uchar=d,this.penState.copy(y)},_.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<G;d++)this.chars.push(new t);this.logger=u,this.pos=0,this.currPenState=new r}var _=b.prototype;return _.equals=function(d){for(var y=!0,v=0;v<G;v++)if(!this.chars[v].equals(d.chars[v])){y=!1;break}return y},_.copy=function(d){for(var y=0;y<G;y++)this.chars[y].copy(d.chars[y])},_.isEmpty=function(){for(var d=!0,y=0;y<G;y++)if(!this.chars[y].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>G&&(this.logger.log(o.DEBUG,"Too large cursor position "+this.pos),this.pos=G)},_.moveCursor=function(d){var y=this.pos+d;if(d>1)for(var v=this.pos+1;v<y+1;v++)this.chars[v].setPenState(this.currPenState);this.setCursor(y)},_.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},_.insertChar=function(d){d>=144&&this.backSpace();var y=I(d);if(this.pos>=G){this.logger.log(o.ERROR,"Cannot insert "+d.toString(16)+" ("+y+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(y,this.currPenState),this.moveCursor(1)},_.clearFromPos=function(d){var y;for(y=d;y<G;y++)this.chars[y].reset()},_.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},_.clearToEndOfRow=function(){this.clearFromPos(this.pos)},_.getTextString=function(){for(var d=[],y=!0,v=0;v<G;v++){var E=this.chars[v].uchar;E!==" "&&(y=!1),d.push(E)}return y?"":d.join("")},_.setPenStyles=function(d){this.currPenState.setStyles(d);var y=this.chars[this.pos];y.setPenState(this.currPenState)},b}(),f=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<z;d++)this.rows.push(new c(u));this.logger=u,this.currRow=z-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var _=b.prototype;return _.reset=function(){for(var d=0;d<z;d++)this.rows[d].clear();this.currRow=z-1},_.equals=function(d){for(var y=!0,v=0;v<z;v++)if(!this.rows[v].equals(d.rows[v])){y=!1;break}return y},_.copy=function(d){for(var y=0;y<z;y++)this.rows[y].copy(d.rows[y])},_.isEmpty=function(){for(var d=!0,y=0;y<z;y++)if(!this.rows[y].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 y=this.rows[this.currRow];y.insertChar(d)},_.setPen=function(d){var y=this.rows[this.currRow];y.setPenStyles(d)},_.moveCursor=function(d){var y=this.rows[this.currRow];y.moveCursor(d)},_.setCursor=function(d){this.logger.log(o.INFO,"setCursor: "+d);var y=this.rows[this.currRow];y.setCursor(d)},_.setPAC=function(d){this.logger.log(o.INFO,"pacData = "+JSON.stringify(d));var y=d.row-1;if(this.nrRollUpRows&&y<this.nrRollUpRows-1&&(y=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==y){for(var v=0;v<z;v++)this.rows[v].clear();var E=this.currRow+1-this.nrRollUpRows,M=this.lastOutputScreen;if(M){var N=M.rows[E].cueStartTime,j=this.logger.time;if(N&&j!==null&&N<j)for(var H=0;H<this.nrRollUpRows;H++)this.rows[y-this.nrRollUpRows+H+1].copy(M.rows[E+H])}}this.currRow=y;var P=this.rows[this.currRow];if(d.indent!==null){var x=d.indent,U=Math.max(x-1,0);P.setCursor(d.indent),d.color=P.chars[U].penState.foreground}var V={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(V)},_.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,y=this.rows.splice(d,1)[0];y.clear(),this.rows.splice(this.currRow,0,y),this.logger.log(o.INFO,"Rolling up")},_.getDisplayText=function(d){d=d||!1;for(var y=[],v="",E=-1,M=0;M<z;M++){var N=this.rows[M].getTextString();N&&(E=M+1,d?y.push("Row "+E+": '"+N+"'"):y.push(N.trim()))}return y.length>0&&(d?v="["+y.join(" | ")+"]":v=y.join(`
`)),v},_.getTextAndFormat=function(){return this.rows},b}(),S=function(){function b(u,d,y){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=u,this.outputFilter=d,this.mode=null,this.verbose=0,this.displayedMemory=new f(y),this.nonDisplayedMemory=new f(y),this.lastOutputScreen=new f(y),this.currRollUpRow=this.displayedMemory.rows[z-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=y}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[z-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 y=0;y<d.length;y++)this.writeScreen.insertChar(d[y]);var v=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(o.INFO,v+": "+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 y={flash:!1};if(y.underline=d%2===1,y.italics=d>=46,y.italics)y.foreground="white";else{var v=Math.floor(d/2)-16,E=["white","green","blue","cyan","red","yellow","magenta"];y.foreground=E[v]}this.logger.log(o.INFO,"MIDROW: "+JSON.stringify(y)),this.writeScreen.setPen(y)},_.outputDataUpdate=function(d){d===void 0&&(d=!1);var y=this.logger.time;if(y===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=y:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,y,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:y),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}(),C=function(){function b(u,d,y){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var v=new l;this.channels=[null,new S(u,d,v),new S(u+1,y,v)],this.cmdHistory=R(),this.logger=v}var _=b.prototype;return _.getHandler=function(d){return this.channels[d].getHandler()},_.setHandler=function(d,y){this.channels[d].setHandler(y)},_.addData=function(d,y){var v,E,M,N=!1;this.logger.time=d;for(var j=0;j<y.length;j+=2){if(E=y[j]&127,M=y[j+1]&127,E===0&&M===0)continue;if(this.logger.log(o.DATA,"["+a([y[j],y[j+1]])+"] -> ("+a([E,M])+")"),v=this.parseCmd(E,M),v||(v=this.parseMidrow(E,M)),v||(v=this.parsePAC(E,M)),v||(v=this.parseBackgroundAttributes(E,M)),!v&&(N=this.parseChars(E,M),N)){var H=this.currentChannel;if(H&&H>0){var P=this.channels[H];P.insertChars(N)}else this.logger.log(o.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!N&&this.logger.log(o.WARNING,"Couldn't parse cleaned data "+a([E,M])+" orig: "+a([y[j],y[j+1]]))}},_.parseCmd=function(d,y){var v=this.cmdHistory,E=(d===20||d===28||d===21||d===29)&&y>=32&&y<=47,M=(d===23||d===31)&&y>=33&&y<=35;if(!(E||M))return!1;if(O(d,y,v))return T(null,null,v),this.logger.log(o.DEBUG,"Repeated command ("+a([d,y])+") is dropped"),!0;var N=d===20||d===21||d===23?1:2,j=this.channels[N];return d===20||d===21||d===28||d===29?y===32?j.ccRCL():y===33?j.ccBS():y===34?j.ccAOF():y===35?j.ccAON():y===36?j.ccDER():y===37?j.ccRU(2):y===38?j.ccRU(3):y===39?j.ccRU(4):y===40?j.ccFON():y===41?j.ccRDC():y===42?j.ccTR():y===43?j.ccRTD():y===44?j.ccEDM():y===45?j.ccCR():y===46?j.ccENM():y===47&&j.ccEOC():j.ccTO(y-32),T(d,y,v),this.currentChannel=N,!0},_.parseMidrow=function(d,y){var v=0;if((d===17||d===25)&&y>=32&&y<=47){if(d===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(o.ERROR,"Mismatch channel in midrow parsing"),!1;var E=this.channels[v];return E?(E.ccMIDROW(y),this.logger.log(o.DEBUG,"MIDROW ("+a([d,y])+")"),!0):!1}return!1},_.parsePAC=function(d,y){var v,E=this.cmdHistory,M=(d>=17&&d<=23||d>=25&&d<=31)&&y>=64&&y<=127,N=(d===16||d===24)&&y>=64&&y<=95;if(!(M||N))return!1;if(O(d,y,E))return T(null,null,E),!0;var j=d<=23?1:2;y>=64&&y<=95?v=j===1?L[d]:m[d]:v=j===1?D[d]:g[d];var H=this.channels[j];return H?(H.setPAC(this.interpretPAC(v,y)),T(d,y,E),this.currentChannel=j,!0):!1},_.interpretPAC=function(d,y){var v,E={color:null,italics:!1,indent:null,underline:!1,row:d};return y>95?v=y-96:v=y-64,E.underline=(v&1)===1,v<=13?E.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(E.italics=!0,E.color="white"):E.indent=Math.floor((v-16)/2)*4,E},_.parseChars=function(d,y){var v,E=null,M=null;if(d>=25?(v=2,M=d-8):(v=1,M=d),M>=17&&M<=19){var N;M===17?N=y+80:M===18?N=y+112:N=y+144,this.logger.log(o.INFO,"Special char '"+I(N)+"' in channel "+v),E=[N]}else d>=32&&d<=127&&(E=y===0?[d]:[d,y]);if(E){var j=a(E);this.logger.log(o.DEBUG,"Char codes = "+j.join(",")),T(d,y,this.cmdHistory)}return E},_.parseBackgroundAttributes=function(d,y){var v=(d===16||d===24)&&y>=32&&y<=47,E=(d===23||d===31)&&y>=45&&y<=47;if(!(v||E))return!1;var M,N={};d===16||d===24?(M=Math.floor((y-32)/2),N.background=h[M],y%2===1&&(N.background=N.background+"_semi")):y===45?N.background="transparent":(N.foreground="black",y===47&&(N.underline=!0));var j=d<=23?1:2,H=this.channels[j];return H.setBkgData(N),T(d,y,this.cmdHistory),!0},_.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var y=this.channels[d];y&&y.reset()}this.cmdHistory=R()},_.cueSplitAtTime=function(d){for(var y=0;y<this.channels.length;y++){var v=this.channels[y];v&&v.cueSplitAtTime(d)}},b}();function T(b,_,u){u.a=b,u.b=_}function O(b,_,u){return u.a===b&&u.b===_}function R(){return{a:null,b:null}}$.default=C},"./src/utils/codecs.ts":function(ee,$,k){"use strict";k.r($),k.d($,"isCodecType",function(){return B}),k.d($,"isCodecSupportedInMp4",function(){return I});var Q={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 B(z,G){var L=Q[G];return!!L&&L[z.slice(0,4)]===!0}function I(z,G){return MediaSource.isTypeSupported((G||"video")+'/mp4;codecs="'+z+'"')}},"./src/utils/cues.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/utils/vttparser.ts"),B=k("./src/utils/webvtt-parser.ts"),I=k("./src/utils/texttrack-utils.ts"),z=/\s/,G={newCue:function(D,m,g,h){for(var o=[],l,a,r,t,c,f=self.VTTCue||self.TextTrackCue,S=0;S<h.rows.length;S++)if(l=h.rows[S],r=!0,t=0,c="",!l.isEmpty()){for(var C=0;C<l.chars.length;C++)z.test(l.chars[C].uchar)&&r?t++:(c+=l.chars[C].uchar,r=!1);l.cueStartTime=m,m===g&&(g+=1e-4),t>=16?t--:t++;var T=Object(Q.fixLineBreaks)(c.trim()),O=Object(B.generateCueId)(m,g,T);(!D||!D.cues||!D.cues.getCueById(O))&&(a=new f(m,g,T),a.id=O,a.line=S+1,a.align="left",a.position=10+Math.min(80,Math.floor(t*8/32)*10),o.push(a))}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(I.addCueToTrack)(D,R)})),o}};$.default=G},"./src/utils/discontinuities.ts":function(ee,$,k){"use strict";k.r($),k.d($,"findFirstFragWithCC",function(){return z}),k.d($,"shouldAlignOnDiscontinuities",function(){return G}),k.d($,"findDiscontinuousReferenceFrag",function(){return L}),k.d($,"adjustSlidingStart",function(){return m}),k.d($,"alignStream",function(){return g}),k.d($,"alignPDT",function(){return o}),k.d($,"alignFragmentByPDTDelta",function(){return l}),k.d($,"alignMediaPlaylistByPDT",function(){return a});var Q=k("./src/polyfills/number.ts"),B=k("./src/utils/logger.ts"),I=k("./src/controller/level-helper.ts");function z(r,t){for(var c=null,f=0,S=r.length;f<S;f++){var C=r[f];if(C&&C.cc===t){c=C;break}}return c}function G(r,t,c){return!!(t.details&&(c.endCC>c.startCC||r&&r.cc<c.startCC))}function L(r,t){var c=r.fragments,f=t.fragments;if(!f.length||!c.length){B.logger.log("No fragments to align");return}var S=z(c,f[0].cc);if(!S||S&&!S.startPTS){B.logger.log("No frag in previous level to align on");return}return S}function D(r,t){if(r){var c=r.start+t;r.start=r.startPTS=c,r.endPTS=c+r.duration}}function m(r,t){for(var c=t.fragments,f=0,S=c.length;f<S;f++)D(c[f],r);t.fragmentHint&&D(t.fragmentHint,r),t.alignedSliding=!0}function g(r,t,c){if(!t)return;h(r,c,t),!c.alignedSliding&&t.details&&o(c,t.details),!c.alignedSliding&&t.details&&!c.skippedSegments&&Object(I.adjustSliding)(t.details,c)}function h(r,t,c){if(G(r,c,t)){var f=L(c.details,t);f&&Object(Q.isFiniteNumber)(f.start)&&(B.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),m(f.start,t))}}function o(r,t){if(!t.fragments.length||!r.hasProgramDateTime||!t.hasProgramDateTime)return;var c=t.fragments[0].programDateTime,f=r.fragments[0].programDateTime,S=(f-c)/1e3+t.fragments[0].start;S&&Object(Q.isFiniteNumber)(S)&&(B.logger.log("Adjusting PTS using programDateTime delta "+(f-c)+"ms, sliding:"+S.toFixed(3)+" "+r.url+" "),m(S,r))}function l(r,t){var c=r.programDateTime;if(!c)return;var f=(c-t)/1e3;r.start=r.startPTS=f,r.endPTS=f+r.duration}function a(r,t){if(!t.fragments.length||!r.hasProgramDateTime||!t.hasProgramDateTime)return;var c=t.fragments[0].programDateTime,f=t.fragments[0].start,S=c-f*1e3;r.fragments.forEach(function(C){l(C,S)}),r.fragmentHint&&l(r.fragmentHint,S),r.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/utils/ewma.ts"),B=function(){function I(G,L,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 Q.default(G),this.fast_=new Q.default(L)}var z=I.prototype;return z.update=function(L,D){var m=this.slow_,g=this.fast_;this.slow_.halfLife!==L&&(this.slow_=new Q.default(L,m.getEstimate(),m.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new Q.default(D,g.getEstimate(),g.getTotalWeight()))},z.sample=function(L,D){L=Math.max(L,this.minDelayMs_);var m=8*D,g=L/1e3,h=m/g;this.fast_.sample(g,h),this.slow_.sample(g,h)},z.canEstimate=function(){var L=this.fast_;return L&&L.getTotalWeight()>=this.minWeight_},z.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},z.destroy=function(){},I}();$.default=B},"./src/utils/ewma.ts":function(ee,$,k){"use strict";k.r($);var Q=function(){function B(z,G,L){G===void 0&&(G=0),L===void 0&&(L=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=z,this.alpha_=z?Math.exp(Math.log(.5)/z):0,this.estimate_=G,this.totalWeight_=L}var I=B.prototype;return I.sample=function(G,L){var D=Math.pow(this.alpha_,G);this.estimate_=L*(1-D)+D*this.estimate_,this.totalWeight_+=G},I.getTotalWeight=function(){return this.totalWeight_},I.getEstimate=function(){if(this.alpha_){var G=1-Math.pow(this.alpha_,this.totalWeight_);if(G)return this.estimate_/G}return this.estimate_},B}();$.default=Q},"./src/utils/fetch-loader.ts":function(ee,$,k){"use strict";k.r($),k.d($,"fetchSupported",function(){return l});var Q=k("./src/polyfills/number.ts"),B=k("./src/loader/load-stats.ts"),I=k("./src/demux/chunk-cache.ts");function z(f,S){f.prototype=Object.create(S.prototype),f.prototype.constructor=f,g(f,S)}function G(f){var S=typeof Map=="function"?new Map:void 0;return G=function(T){if(T===null||!m(T))return T;if(typeof T!="function")throw new TypeError("Super expression must either be null or a function");if(typeof S!="undefined"){if(S.has(T))return S.get(T);S.set(T,O)}function O(){return L(T,arguments,h(this).constructor)}return O.prototype=Object.create(T.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),g(O,T)},G(f)}function L(f,S,C){return D()?L=Reflect.construct:L=function(O,R,b){var _=[null];_.push.apply(_,R);var u=Function.bind.apply(O,_),d=new u;return b&&g(d,b.prototype),d},L.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(f){return!1}}function m(f){return Function.toString.call(f).indexOf("[native code]")!==-1}function g(f,S){return g=Object.setPrototypeOf||function(T,O){return T.__proto__=O,T},g(f,S)}function h(f){return h=Object.setPrototypeOf?Object.getPrototypeOf:function(C){return C.__proto__||Object.getPrototypeOf(C)},h(f)}function o(){return o=Object.assign||function(f){for(var S=1;S<arguments.length;S++){var C=arguments[S];for(var T in C)Object.prototype.hasOwnProperty.call(C,T)&&(f[T]=C[T])}return f},o.apply(this,arguments)}function l(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(f){}return!1}var a=function(){function f(C){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=C.fetchSetup||t,this.controller=new self.AbortController,this.stats=new B.LoadStats}var S=f.prototype;return S.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},S.abortInternal=function(){var T=this.response;(!T||!T.ok)&&(this.stats.aborted=!0,this.controller.abort())},S.abort=function(){var T;this.abortInternal(),(T=this.callbacks)!==null&&T!==void 0&&T.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},S.load=function(T,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=r(T,this.controller.signal),d=R.onProgress,y=T.responseType==="arraybuffer",v=y?"byteLength":"length";this.context=T,this.config=O,this.callbacks=R,this.request=this.fetchSetup(T,u),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){b.abortInternal(),R.onTimeout(_,T,b.response)},O.timeout),self.fetch(this.request).then(function(E){if(b.response=b.loader=E,!E.ok){var M=E.status,N=E.statusText;throw new c(N||"fetch, bad network response",M,E)}return _.loading.first=Math.max(self.performance.now(),_.loading.start),_.total=parseInt(E.headers.get("Content-Length")||"0"),d&&Object(Q.isFiniteNumber)(O.highWaterMark)?b.loadProgressively(E,_,T,O.highWaterMark,d):y?E.arrayBuffer():E.text()}).then(function(E){var M=b.response;self.clearTimeout(b.requestTimeout),_.loading.end=Math.max(self.performance.now(),_.loading.first),_.loaded=_.total=E[v];var N={url:M.url,data:E};d&&!Object(Q.isFiniteNumber)(O.highWaterMark)&&d(_,T,E,M),R.onSuccess(N,_,T,M)}).catch(function(E){if(self.clearTimeout(b.requestTimeout),_.aborted)return;var M=E.code||0;R.onError({code:M,text:E.message},T,E.details)})},S.getCacheAge=function(){var T=null;if(this.response){var O=this.response.headers.get("age");T=O?parseFloat(O):null}return T},S.loadProgressively=function(T,O,R,b,_){b===void 0&&(b=0);var u=new I.default,d=T.body.getReader(),y=function v(){return d.read().then(function(E){if(E.done)return u.dataLength&&_(O,R,u.flush(),T),Promise.resolve(new ArrayBuffer(0));var M=E.value,N=M.length;return O.loaded+=N,N<b||u.dataLength?(u.push(M),u.dataLength>=b&&_(O,R,u.flush(),T)):_(O,R,M,T),v()}).catch(function(){return Promise.reject()})};return y()},f}();function r(f,S){var C={method:"GET",mode:"cors",credentials:"same-origin",signal:S,headers:new self.Headers(o({},f.headers))};return f.rangeEnd&&C.headers.set("Range","bytes="+f.rangeStart+"-"+String(f.rangeEnd-1)),C}function t(f,S){return new self.Request(f.url,S)}var c=function(f){z(S,f);function S(C,T,O){var R;return R=f.call(this,C)||this,R.code=void 0,R.details=void 0,R.code=T,R.details=O,R}return S}(G(Error));$.default=a},"./src/utils/imsc1-ttml-parser.ts":function(ee,$,k){"use strict";k.r($),k.d($,"IMSC1_CODEC",function(){return m}),k.d($,"parseIMSC1",function(){return l});var Q=k("./src/utils/mp4-tools.ts"),B=k("./src/utils/vttparser.ts"),I=k("./src/utils/vttcue.ts"),z=k("./src/demux/id3.ts"),G=k("./src/utils/timescale-conversion.ts"),L=k("./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",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,h=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,o={left:"start",center:"center",right:"end",start:"start",end:"end"};function l(b,_,u,d,y){var v=Object(Q.findBox)(new Uint8Array(b),["mdat"]);if(v.length===0){y(new Error("Could not parse IMSC1 mdat"));return}var E=v[0],M=Object(z.utf8ArrayToStr)(new Uint8Array(b,E.start,E.end-E.start)),N=Object(G.toTimescaleFromScale)(_,1,u);try{d(a(M,N))}catch(j){y(j)}}function a(b,_){var u=new DOMParser,d=u.parseFromString(b,"text/xml"),y=d.getElementsByTagName("tt")[0];if(!y)throw new Error("Invalid ttml");var v={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},E=Object.keys(v).reduce(function(P,x){return P[x]=y.getAttribute("ttp:"+x)||v[x],P},{}),M=y.getAttribute("xml:space")!=="preserve",N=t(r(y,"styling","style")),j=t(r(y,"layout","region")),H=r(y,"body","[begin]");return[].map.call(H,function(P){var x=c(P,M);if(!x||!P.hasAttribute("begin"))return null;var U=T(P.getAttribute("begin"),E),V=T(P.getAttribute("dur"),E),q=T(P.getAttribute("end"),E);if(U===null)throw C(P);if(q===null){if(V===null)throw C(P);q=U+V}var ie=new I.default(U-_,q-_,x);ie.id=Object(L.generateCueId)(ie.startTime,ie.endTime,ie.text);var se=j[P.getAttribute("region")],ve=N[P.getAttribute("style")];ie.position=10,ie.size=80;var Te=f(se,ve),fe=Te.textAlign;if(fe){var _e=o[fe];_e&&(ie.lineAlign=_e),ie.align=fe}return D(ie,Te),ie}).filter(function(P){return P!==null})}function r(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,y){var v;return d.nodeName==="br"&&y?u+`
`:(v=d.childNodes)!==null&&v!==void 0&&v.length?c(d,_):_?u+d.textContent.trim().replace(/\s+/g," "):u+d.textContent},"")}function f(b,_){var u="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(y,v){var E=S(_,u,v)||S(b,u,v);return E&&(y[v]=E),y},{})}function S(b,_,u){return b.hasAttributeNS(_,u)?b.getAttributeNS(_,u):null}function C(b){return new Error("Could not parse ttml timestamp "+b)}function T(b,_){if(!b)return null;var u=Object(B.parseTimeStamp)(b);return u===null&&(g.test(b)?u=O(b,_):h.test(b)&&(u=R(b,_))),u}function O(b,_){var u=g.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=h.exec(b),d=Number(u[1]),y=u[2];switch(y){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(ee,$,k){"use strict";k.r($),k.d($,"enableLogs",function(){return L}),k.d($,"logger",function(){return D});var Q=function(){},B={trace:Q,debug:Q,log:Q,warn:Q,info:Q,error:Q},I=B;function z(m){var g=self.console[m];return g?g.bind(self.console,"["+m+"] >"):Q}function G(m){for(var g=arguments.length,h=new Array(g>1?g-1:0),o=1;o<g;o++)h[o-1]=arguments[o];h.forEach(function(l){I[l]=m[l]?m[l].bind(m):z(l)})}function L(m){if(self.console&&m===!0||typeof m=="object"){G(m,"debug","log","info","warn","error");try{I.log()}catch(g){I=B}}else I=B}var D=I},"./src/utils/mediakeys-helper.ts":function(ee,$,k){"use strict";k.r($),k.d($,"KeySystems",function(){return Q}),k.d($,"requestMediaKeySystemAccess",function(){return B});var Q;(function(I){I.WIDEVINE="com.widevine.alpha",I.PLAYREADY="com.microsoft.playready"})(Q||(Q={}));var B=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(ee,$,k){"use strict";k.r($),k.d($,"getMediaSource",function(){return Q});function Q(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(ee,$,k){"use strict";k.r($),k.d($,"bin2str",function(){return G}),k.d($,"readUint16",function(){return L}),k.d($,"readUint32",function(){return D}),k.d($,"writeUint32",function(){return m}),k.d($,"findBox",function(){return g}),k.d($,"parseSegmentIndex",function(){return h}),k.d($,"parseInitSegment",function(){return o}),k.d($,"getStartDTS",function(){return l}),k.d($,"getDuration",function(){return a}),k.d($,"computeRawDurationFromSamples",function(){return r}),k.d($,"offsetStartDTS",function(){return t}),k.d($,"segmentValidRange",function(){return c}),k.d($,"appendUint8Array",function(){return f});var Q=k("./src/utils/typed-array.ts"),B=k("./src/loader/fragment.ts"),I=Math.pow(2,32)-1,z=[].push;function G(S){return String.fromCharCode.apply(null,S)}function L(S,C){"data"in S&&(C+=S.start,S=S.data);var T=S[C]<<8|S[C+1];return T<0?65536+T:T}function D(S,C){"data"in S&&(C+=S.start,S=S.data);var T=S[C]<<24|S[C+1]<<16|S[C+2]<<8|S[C+3];return T<0?4294967296+T:T}function m(S,C,T){"data"in S&&(C+=S.start,S=S.data),S[C]=T>>24,S[C+1]=T>>16&255,S[C+2]=T>>8&255,S[C+3]=T&255}function g(S,C){var T=[];if(!C.length)return T;var O,R,b;"data"in S?(O=S.data,R=S.start,b=S.end):(O=S,R=0,b=O.byteLength);for(var _=R;_<b;){var u=D(O,_),d=G(O.subarray(_+4,_+8)),y=u>1?_+u:b;if(d===C[0])if(C.length===1)T.push({data:O,start:_+8,end:y});else{var v=g({data:O,start:_+8,end:y},C.slice(1));v.length&&z.apply(T,v)}_=y}return T}function h(S){var C=g(S,["moov"]),T=C[0],O=T?T.end:null,R=g(S,["sidx"]);if(!R||!R[0])return null;var b=[],_=R[0],u=_.data[0],d=u===0?8:16,y=D(_,d);d+=4;var v=0,E=0;u===0?d+=8:d+=16,d+=2;var M=_.end+E,N=L(_,d);d+=2;for(var j=0;j<N;j++){var H=d,P=D(_,H);H+=4;var x=P&2147483647,U=(P&2147483648)>>>31;if(U===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var V=D(_,H);H+=4,b.push({referenceSize:x,subsegmentDuration:V,info:{duration:V/y,start:M,end:M+x-1}}),M+=x,H+=4,d=H}return{earliestPresentationTime:v,timescale:y,version:u,referencesCount:N,references:b,moovEndOffset:O}}function o(S){for(var C=[],T=g(S,["moov","trak"]),O=0;O<T.length;O++){var R=T[O],b=g(R,["tkhd"])[0];if(b){var _=b.data[b.start],u=_===0?12:20,d=D(b,u),y=g(R,["mdia","mdhd"])[0];if(y){_=y.data[y.start],u=_===0?12:20;var v=D(y,u),E=g(R,["mdia","hdlr"])[0];if(E){var M=G(E.data.subarray(E.start+8,E.start+12)),N={soun:B.ElementaryStreamTypes.AUDIO,vide:B.ElementaryStreamTypes.VIDEO}[M];if(N){var j=g(R,["mdia","minf","stbl","stsd"])[0],H=void 0;j&&(H=G(j.data.subarray(j.start+12,j.start+16))),C[d]={timescale:v,type:N},C[N]={timescale:v,id:d,codec:H}}}}}}var P=g(S,["moov","mvex","trex"]);return P.forEach(function(x){var U=D(x,4),V=C[U];V&&(V.default={duration:D(x,12),flags:D(x,20)})}),C}function l(S,C){return g(C,["moof","traf"]).reduce(function(T,O){var R=g(O,["tfdt"])[0],b=R.data[R.start],_=g(O,["tfhd"]).reduce(function(u,d){var y=D(d,4),v=S[y];if(v){var E=D(R,4);b===1&&(E*=Math.pow(2,32),E+=D(R,8));var M=v.timescale||9e4,N=E/M;if(isFinite(N)&&(u===null||N<u))return N}return u},null);return _!==null&&isFinite(_)&&(T===null||_<T)?_:T},null)||0}function a(S,C){for(var T=0,O=0,R=0,b=g(S,["moof","traf"]),_=0;_<b.length;_++){var u=b[_],d=g(u,["tfhd"])[0],y=D(d,4),v=C[y];if(!v)continue;var E=v.default,M=D(d,0)|(E==null?void 0:E.flags),N=E==null?void 0:E.duration;M&8&&(M&2?N=D(d,12):N=D(d,8));for(var j=v.timescale||9e4,H=g(u,["trun"]),P=0;P<H.length;P++){if(N){var x=D(H[P],4);T=N*x}else T=r(H[P]);v.type===B.ElementaryStreamTypes.VIDEO?O+=T/j:v.type===B.ElementaryStreamTypes.AUDIO&&(R+=T/j)}}if(O===0&&R===0){var U=h(S);if(U!=null&&U.references)return U.references.reduce(function(V,q){return V+q.info.duration||0},0)}return O||R}function r(S){var C=D(S,0),T=8;C&1&&(T+=4),C&4&&(T+=4);for(var O=0,R=D(S,4),b=0;b<R;b++){if(C&256){var _=D(S,T);O+=_,T+=4}C&512&&(T+=4),C&1024&&(T+=4),C&2048&&(T+=4)}return O}function t(S,C,T){g(C,["moof","traf"]).forEach(function(O){g(O,["tfhd"]).forEach(function(R){var b=D(R,4),_=S[b];if(!_)return;var u=_.timescale||9e4;g(O,["tfdt"]).forEach(function(d){var y=d.data[d.start],v=D(d,4);if(y===0)m(d,4,v-T*u);else{v*=Math.pow(2,32),v+=D(d,8),v-=T*u,v=Math.max(v,0);var E=Math.floor(v/(I+1)),M=Math.floor(v%(I+1));m(d,4,E),m(d,8,M)}})})})}function c(S){var C={valid:null,remainder:null},T=g(S,["moof"]);if(T){if(T.length<2)return C.remainder=S,C}else return C;var O=T[T.length-1];return C.valid=Object(Q.sliceUint8)(S,0,O.start-8),C.remainder=Object(Q.sliceUint8)(S,O.start-8),C}function f(S,C){var T=new Uint8Array(S.length+C.length);return T.set(S),T.set(C,S.length),T}},"./src/utils/output-filter.ts":function(ee,$,k){"use strict";k.r($),k.d($,"default",function(){return Q});var Q=function(){function B(z,G){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=z,this.trackName=G}var I=B.prototype;return I.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},I.newCue=function(G,L,D){(this.startTime===null||this.startTime>G)&&(this.startTime=G),this.endTime=L,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},I.reset=function(){this.cueRanges=[]},B}()},"./src/utils/texttrack-utils.ts":function(ee,$,k){"use strict";k.r($),k.d($,"sendAddTrackEvent",function(){return B}),k.d($,"addCueToTrack",function(){return I}),k.d($,"clearCurrentCues",function(){return z}),k.d($,"removeCuesInRange",function(){return G}),k.d($,"getCuesInRange",function(){return D});var Q=k("./src/utils/logger.ts");function B(m,g){var h;try{h=new Event("addtrack")}catch(o){h=document.createEvent("Event"),h.initEvent("addtrack",!1,!1)}h.track=m,g.dispatchEvent(h)}function I(m,g){var h=m.mode;if(h==="disabled"&&(m.mode="hidden"),m.cues&&!m.cues.getCueById(g.id))try{if(m.addCue(g),!m.cues.getCueById(g.id))throw new Error("addCue is failed for: "+g)}catch(l){Q.logger.debug("[texttrack-utils]: "+l);var o=new self.TextTrackCue(g.startTime,g.endTime,g.text);o.id=g.id,m.addCue(o)}h==="disabled"&&(m.mode=h)}function z(m){var g=m.mode;if(g==="disabled"&&(m.mode="hidden"),m.cues)for(var h=m.cues.length;h--;)m.removeCue(m.cues[h]);g==="disabled"&&(m.mode=g)}function G(m,g,h){var o=m.mode;if(o==="disabled"&&(m.mode="hidden"),m.cues&&m.cues.length>0)for(var l=D(m.cues,g,h),a=0;a<l.length;a++)m.removeCue(l[a]);o==="disabled"&&(m.mode=o)}function L(m,g){if(g<m[0].startTime)return 0;var h=m.length-1;if(g>m[h].endTime)return-1;for(var o=0,l=h;o<=l;){var a=Math.floor((l+o)/2);if(g<m[a].startTime)l=a-1;else if(g>m[a].startTime&&o<h)o=a+1;else return a}return m[o].startTime-g<g-m[l].startTime?o:l}function D(m,g,h){var o=[],l=L(m,g);if(l>-1)for(var a=l,r=m.length;a<r;a++){var t=m[a];if(t.startTime>=g&&t.endTime<=h)o.push(t);else if(t.startTime>h)return o}return o}},"./src/utils/time-ranges.ts":function(ee,$,k){"use strict";k.r($);var Q={toString:function(I){for(var z="",G=I.length,L=0;L<G;L++)z+="["+I.start(L).toFixed(3)+","+I.end(L).toFixed(3)+"]";return z}};$.default=Q},"./src/utils/timescale-conversion.ts":function(ee,$,k){"use strict";k.r($),k.d($,"toTimescaleFromBase",function(){return B}),k.d($,"toTimescaleFromScale",function(){return I}),k.d($,"toMsFromMpegTsClock",function(){return z}),k.d($,"toMpegTsClockFromTimescale",function(){return G});var Q=9e4;function B(L,D,m,g){m===void 0&&(m=1),g===void 0&&(g=!1);var h=L*D*m;return g?Math.round(h):h}function I(L,D,m,g){return m===void 0&&(m=1),g===void 0&&(g=!1),B(L,D,1/m,g)}function z(L,D){return D===void 0&&(D=!1),B(L,1e3,1/Q,D)}function G(L,D){return D===void 0&&(D=1),B(L,Q,1/D)}},"./src/utils/typed-array.ts":function(ee,$,k){"use strict";k.r($),k.d($,"sliceUint8",function(){return Q});function Q(B,I,z){return Uint8Array.prototype.slice?B.slice(I,z):new Uint8Array(Array.prototype.slice.call(B,I,z))}},"./src/utils/vttcue.ts":function(ee,$,k){"use strict";k.r($),$.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var Q=["","lr","rl"],B=["start","middle","end","left","right"];function I(m,g){if(typeof g!="string")return!1;if(!Array.isArray(m))return!1;var h=g.toLowerCase();return~m.indexOf(h)?h:!1}function z(m){return I(Q,m)}function G(m){return I(B,m)}function L(m){for(var g=arguments.length,h=new Array(g>1?g-1:0),o=1;o<g;o++)h[o-1]=arguments[o];for(var l=1;l<arguments.length;l++){var a=arguments[l];for(var r in a)m[r]=a[r]}return m}function D(m,g,h){var o=this,l={enumerable:!0};o.hasBeenReset=!1;var a="",r=!1,t=m,c=g,f=h,S=null,C="",T=!0,O="auto",R="start",b=50,_="middle",u=50,d="middle";Object.defineProperty(o,"id",L({},l,{get:function(){return a},set:function(v){a=""+v}})),Object.defineProperty(o,"pauseOnExit",L({},l,{get:function(){return r},set:function(v){r=!!v}})),Object.defineProperty(o,"startTime",L({},l,{get:function(){return t},set:function(v){if(typeof v!="number")throw new TypeError("Start time must be set to a number.");t=v,this.hasBeenReset=!0}})),Object.defineProperty(o,"endTime",L({},l,{get:function(){return c},set:function(v){if(typeof v!="number")throw new TypeError("End time must be set to a number.");c=v,this.hasBeenReset=!0}})),Object.defineProperty(o,"text",L({},l,{get:function(){return f},set:function(v){f=""+v,this.hasBeenReset=!0}})),Object.defineProperty(o,"region",L({},l,{get:function(){return S},set:function(v){S=v,this.hasBeenReset=!0}})),Object.defineProperty(o,"vertical",L({},l,{get:function(){return C},set:function(v){var E=z(v);if(E===!1)throw new SyntaxError("An invalid or illegal string was specified.");C=E,this.hasBeenReset=!0}})),Object.defineProperty(o,"snapToLines",L({},l,{get:function(){return T},set:function(v){T=!!v,this.hasBeenReset=!0}})),Object.defineProperty(o,"line",L({},l,{get:function(){return O},set:function(v){if(typeof v!="number"&&v!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");O=v,this.hasBeenReset=!0}})),Object.defineProperty(o,"lineAlign",L({},l,{get:function(){return R},set:function(v){var E=G(v);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");R=E,this.hasBeenReset=!0}})),Object.defineProperty(o,"position",L({},l,{get:function(){return b},set:function(v){if(v<0||v>100)throw new Error("Position must be between 0 and 100.");b=v,this.hasBeenReset=!0}})),Object.defineProperty(o,"positionAlign",L({},l,{get:function(){return _},set:function(v){var E=G(v);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");_=E,this.hasBeenReset=!0}})),Object.defineProperty(o,"size",L({},l,{get:function(){return u},set:function(v){if(v<0||v>100)throw new Error("Size must be between 0 and 100.");u=v,this.hasBeenReset=!0}})),Object.defineProperty(o,"align",L({},l,{get:function(){return d},set:function(v){var E=G(v);if(!E)throw new SyntaxError("An invalid or illegal string was specified.");d=E,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(ee,$,k){"use strict";k.r($),k.d($,"parseTimeStamp",function(){return I}),k.d($,"fixLineBreaks",function(){return g}),k.d($,"VTTParser",function(){return h});var Q=k("./src/utils/vttcue.ts"),B=function(){function o(){}var l=o.prototype;return l.decode=function(r,t){if(!r)return"";if(typeof r!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(r))},o}();function I(o){function l(r,t,c,f){return(r|0)*3600+(t|0)*60+(c|0)+parseFloat(f||0)}var a=o.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return a?parseFloat(a[2])>59?l(a[2],a[3],0,a[4]):l(a[1],a[2],a[3],a[4]):null}var z=function(){function o(){this.values=Object.create(null)}var l=o.prototype;return l.set=function(r,t){!this.get(r)&&t!==""&&(this.values[r]=t)},l.get=function(r,t,c){return c?this.has(r)?this.values[r]:t[c]:this.has(r)?this.values[r]:t},l.has=function(r){return r in this.values},l.alt=function(r,t,c){for(var f=0;f<c.length;++f)if(t===c[f]){this.set(r,t);break}},l.integer=function(r,t){/^-?\d+$/.test(t)&&this.set(r,parseInt(t,10))},l.percent=function(r,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var c=parseFloat(t);if(c>=0&&c<=100)return this.set(r,c),!0}return!1},o}();function G(o,l,a,r){var t=r?o.split(r):[o];for(var c in t){if(typeof t[c]!="string")continue;var f=t[c].split(a);if(f.length!==2)continue;var S=f[0],C=f[1];l(S,C)}}var L=new Q.default(0,0,""),D=L.align==="middle"?"middle":"center";function m(o,l,a){var r=o;function t(){var S=I(o);if(S===null)throw new Error("Malformed timestamp: "+r);return o=o.replace(/^[^\sa-zA-Z-]+/,""),S}function c(S,C){var T=new z;G(S,function(b,_){var u;switch(b){case"region":for(var d=a.length-1;d>=0;d--)if(a[d].id===_){T.set(b,a[d].region);break}break;case"vertical":T.alt(b,_,["rl","lr"]);break;case"line":u=_.split(","),T.integer(b,u[0]),T.percent(b,u[0])&&T.set("snapToLines",!1),T.alt(b,u[0],["auto"]),u.length===2&&T.alt("lineAlign",u[1],["start",D,"end"]);break;case"position":u=_.split(","),T.percent(b,u[0]),u.length===2&&T.alt("positionAlign",u[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":T.percent(b,_);break;case"align":T.alt(b,_,["start",D,"end","left","right"]);break}},/:/,/\s/),C.region=T.get("region",null),C.vertical=T.get("vertical","");var O=T.get("line","auto");O==="auto"&&L.line===-1&&(O=-1),C.line=O,C.lineAlign=T.get("lineAlign","start"),C.snapToLines=T.get("snapToLines",!0),C.size=T.get("size",100),C.align=T.get("align",D);var R=T.get("position","auto");R==="auto"&&L.position===50&&(R=C.align==="start"||C.align==="left"?0:C.align==="end"||C.align==="right"?100:50),C.position=R}function f(){o=o.replace(/^\s+/,"")}if(f(),l.startTime=t(),f(),o.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);o=o.substr(3),f(),l.endTime=t(),f(),c(o,l)}function g(o){return o.replace(/<br(?: \/)?>/gi,`
`)}var h=function(){function o(){this.state="INITIAL",this.buffer="",this.decoder=new B,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(r){var t=this;r&&(t.buffer+=t.decoder.decode(r,{stream:!0}));function c(){var R=t.buffer,b=0;for(R=g(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 f(R){G(R,function(b,_){},/:/)}try{var S="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;S=c();var C=S.match(/^()?WEBVTT([ \t].*)?$/);if(!C||!C[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var T=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;T?T=!1:S=c();switch(t.state){case"HEADER":/:/.test(S)?f(S):S||(t.state="ID");continue;case"NOTE":S||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(S)){t.state="NOTE";break}if(!S)continue;if(t.cue=new Q.default(0,0,""),t.state="CUE",S.indexOf("-->")===-1){t.cue.id=S;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{m(S,t.cue,t.regionList)}catch(R){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var O=S.indexOf("-->")!==-1;if(!S||O&&(T=!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+=S}continue;case"BADCUE":S||(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 r=this;try{if((r.cue||r.state==="HEADER")&&(r.buffer+=`
`,r.parse()),r.state==="INITIAL"||r.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){r.onparsingerror&&r.onparsingerror(t)}return r.onflush&&r.onflush(),this},o}()},"./src/utils/webvtt-parser.ts":function(ee,$,k){"use strict";k.r($),k.d($,"generateCueId",function(){return h}),k.d($,"parseWebVTT",function(){return l});var Q=k("./src/polyfills/number.ts"),B=k("./src/utils/vttparser.ts"),I=k("./src/demux/id3.ts"),z=k("./src/utils/timescale-conversion.ts"),G=k("./src/remux/mp4-remuxer.ts"),L=/\r\n|\n\r|\n|\r/g,D=function(r,t,c){return c===void 0&&(c=0),r.substr(c,t.length)===t},m=function(r){var t=parseInt(r.substr(-3)),c=parseInt(r.substr(-6,2)),f=parseInt(r.substr(-9,2)),S=r.length>9?parseInt(r.substr(0,r.indexOf(":"))):0;if(!Object(Q.isFiniteNumber)(t)||!Object(Q.isFiniteNumber)(c)||!Object(Q.isFiniteNumber)(f)||!Object(Q.isFiniteNumber)(S))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+r);return t+=1e3*c,t+=60*1e3*f,t+=60*60*1e3*S,t},g=function(r){for(var t=5381,c=r.length;c;)t=t*33^r.charCodeAt(--c);return(t>>>0).toString()};function h(a,r,t){return g(a.toString())+g(r.toString())+g(t)}var o=function(r,t,c){var f=r[t],S=r[f.prevCC];if(!S||!S.new&&f.new){r.ccOffset=r.presentationOffset=f.start,f.new=!1;return}for(;(C=S)!==null&&C!==void 0&&C.new;){var C;r.ccOffset+=f.start-S.start,f.new=!1,f=S,S=r[f.prevCC]}r.presentationOffset=c};function l(a,r,t,c,f,S,C,T){var O=new B.VTTParser,R=Object(I.utf8ArrayToStr)(new Uint8Array(a)).trim().replace(L,`
`).split(`
`),b=[],_=Object(z.toMpegTsClockFromTimescale)(r,t),u="00:00.000",d=0,y=0,v,E=!0,M=!1;O.oncue=function(N){var j=c[f],H=c.ccOffset,P=(d-_)/9e4;if(j!=null&&j.new&&(y!==void 0?H=c.ccOffset=j.start:o(c,f,P)),P&&(H=P-c.presentationOffset),M){var x=N.endTime-N.startTime,U=Object(G.normalizePts)((N.startTime+H-y)*9e4,S*9e4)/9e4;N.startTime=U,N.endTime=U+x}var V=N.text.trim();N.text=decodeURIComponent(encodeURIComponent(V)),N.id||(N.id=h(N.startTime,N.endTime,V)),N.endTime>0&&b.push(N)},O.onparsingerror=function(N){v=N},O.onflush=function(){if(v){T(v);return}C(b)},R.forEach(function(N){if(E)if(D(N,"X-TIMESTAMP-MAP=")){E=!1,M=!0,N.substr(16).split(",").forEach(function(j){D(j,"LOCAL:")?u=j.substr(6):D(j,"MPEGTS:")&&(d=parseInt(j.substr(7)))});try{y=m(u)/1e3}catch(j){M=!1,v=j}return}else N===""&&(E=!1);O.parse(N+`
`)}),O.flush()}},"./src/utils/xhr-loader.ts":function(ee,$,k){"use strict";k.r($);var Q=k("./src/utils/logger.ts"),B=k("./src/loader/load-stats.ts"),I=/^age:\s*[\d.]+\s*$/m,z=function(){function G(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 B.LoadStats,this.retryDelay=0}var L=G.prototype;return L.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},L.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()))},L.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},L.load=function(m,g,h){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=g,this.callbacks=h,this.retryDelay=g.retryDelay,this.loadInternal()},L.loadInternal=function(){var m=this.config,g=this.context;if(!m)return;var h=this.loader=new self.XMLHttpRequest,o=this.stats;o.loading.first=0,o.loaded=0;var l=this.xhrSetup;try{if(l)try{l(h,g.url)}catch(t){h.open("GET",g.url,!0),l(h,g.url)}h.readyState||h.open("GET",g.url,!0);var a=this.context.headers;if(a)for(var r in a)h.setRequestHeader(r,a[r])}catch(t){this.callbacks.onError({code:h.status,text:t.message},g,h);return}g.rangeEnd&&h.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),h.onreadystatechange=this.readystatechange.bind(this),h.onprogress=this.loadprogress.bind(this),h.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout),h.send()},L.readystatechange=function(){var m=this.context,g=this.loader,h=this.stats;if(!m||!g)return;var o=g.readyState,l=this.config;if(h.aborted)return;if(o>=2)if(self.clearTimeout(this.requestTimeout),h.loading.first===0&&(h.loading.first=Math.max(self.performance.now(),h.loading.start)),o===4){g.onreadystatechange=null,g.onprogress=null;var a=g.status;if(a>=200&&a<300){h.loading.end=Math.max(self.performance.now(),h.loading.first);var r,t;if(m.responseType==="arraybuffer"?(r=g.response,t=r.byteLength):(r=g.responseText,t=r.length),h.loaded=h.total=t,!this.callbacks)return;var c=this.callbacks.onProgress;if(c&&c(h,m,r,g),!this.callbacks)return;var f={url:g.responseURL,data:r};this.callbacks.onSuccess(f,h,m,g)}else h.retry>=l.maxRetry||a>=400&&a<499?(Q.logger.error(a+" while loading "+m.url),this.callbacks.onError({code:a,text:g.statusText},m,g)):(Q.logger.warn(a+" 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),h.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),l.timeout)},L.loadtimeout=function(){Q.logger.warn("timeout while loading "+this.context.url);var m=this.callbacks;m&&(this.abortInternal(),m.onTimeout(this.stats,this.context,this.loader))},L.loadprogress=function(m){var g=this.stats;g.loaded=m.loaded,m.lengthComputable&&(g.total=m.total)},L.getCacheAge=function(){var m=null;if(this.loader&&I.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");m=g?parseFloat(g):null}return m},G}();$.default=z}}).default})},vHTk:function(Rt,Ze,K){Rt.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return Kt});var ee=K("rePB"),$=K("VTBJ"),k=K("KQm4"),Q=K("U8pU"),B=K("ODXe"),I=K("cDcd"),z=K("TSYQ"),G=K.n(z),L=K("Gytx"),D=K.n(L),m=K("Kwbf"),g=K("t23M"),h=K("qx4F"),o=K("6eGT"),l=K("IBYe"),a=K("Ff2n"),r=K("c+Xe"),t=K("fyJ8"),c=K("biw7");function f(We,je,ht,ct,He){var lt=ht[We]||{},Pe=ht[je]||{},Oe,Ce;lt.fixed==="left"?Oe=ct.left[We]:Pe.fixed==="right"&&(Ce=ct.right[je]);var le=!1,he=!1,ye=!1,ae=!1,Se=ht[je+1],$e=ht[We-1];if(He==="rtl"){if(Oe!==void 0){var dt=$e&&$e.fixed==="left";ae=!dt}else if(Ce!==void 0){var St=Se&&Se.fixed==="right";ye=!St}}else if(Oe!==void 0){var Dt=Se&&Se.fixed==="left";le=!Dt}else if(Ce!==void 0){var Mt=$e&&$e.fixed==="right";he=!Mt}return{fixLeft:Oe,fixRight:Ce,lastFixLeft:le,firstFixRight:he,lastFixRight:ye,firstFixLeft:ae,isSticky:ct.isSticky}}var S=K("sR1s");function C(We){var je=We.cells,ht=We.stickyOffsets,ct=We.flattenColumns,He=We.rowComponent,lt=We.cellComponent,Pe=We.onHeaderRow,Oe=We.index,Ce=I.useContext(c.a),le=Ce.prefixCls,he=Ce.direction,ye;Pe&&(ye=Pe(je.map(function(Se){return Se.column}),Oe));var ae=Object(S.a)(je.map(function(Se){return Se.column}));return I.createElement(He,Object.assign({},ye),je.map(function(Se,$e){var dt=Se.column,St=f(Se.colStart,Se.colEnd,ct,ht,he),Dt;return dt&&dt.onHeaderCell&&(Dt=Se.column.onHeaderCell(dt)),I.createElement(t.a,Object.assign({},Se,{ellipsis:dt.ellipsis,align:dt.align,component:lt,prefixCls:le,key:ae[$e]},St,{additionalProps:Dt,rowType:"header"}))}))}C.displayName="HeaderRow";var T=C;function O(We){var je=[];function ht(Pe,Oe){var Ce=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;je[Ce]=je[Ce]||[];var le=Oe,he=Pe.filter(Boolean).map(function(ye){var ae={key:ye.key,className:ye.className||"",children:ye.title,column:ye,colStart:le},Se=1,$e=ye.children;return $e&&$e.length>0&&(Se=ht($e,le,Ce+1).reduce(function(dt,St){return dt+St},0),ae.hasSubColumns=!0),"colSpan"in ye&&(Se=ye.colSpan),"rowSpan"in ye&&(ae.rowSpan=ye.rowSpan),ae.colSpan=Se,ae.colEnd=ae.colStart+Se-1,je[Ce].push(ae),le+=Se,Se});return he}ht(We,0);for(var ct=je.length,He=function(Oe){je[Oe].forEach(function(Ce){!("rowSpan"in Ce)&&!Ce.hasSubColumns&&(Ce.rowSpan=ct-Oe)})},lt=0;lt<ct;lt+=1)He(lt);return je}function R(We){var je=We.stickyOffsets,ht=We.columns,ct=We.flattenColumns,He=We.onHeaderRow,lt=I.useContext(c.a),Pe=lt.prefixCls,Oe=lt.getComponent,Ce=I.useMemo(function(){return O(ht)},[ht]),le=Oe(["header","wrapper"],"thead"),he=Oe(["header","row"],"tr"),ye=Oe(["header","cell"],"th");return I.createElement(le,{className:"".concat(Pe,"-thead")},Ce.map(function(ae,Se){var $e=I.createElement(T,{key:Se,flattenColumns:ct,cells:ae,stickyOffsets:je,rowComponent:he,cellComponent:ye,onHeaderRow:He,index:Se});return $e}))}var b=R,_=K("hW8S");function u(We){for(var je=We.colWidths,ht=We.columns,ct=We.columCount,He=[],lt=ct||ht.length,Pe=!1,Oe=lt-1;Oe>=0;Oe-=1){var Ce=je[Oe],le=ht&&ht[Oe],he=le&&le[_.a];(Ce||he||Pe)&&(He.unshift(I.createElement("col",Object.assign({key:Oe,style:{width:Ce,minWidth:Ce}},he))),Pe=!0)}return I.createElement("colgroup",null,He)}var d=u;function y(We,je){return Object(I.useMemo)(function(){for(var ht=[],ct=0;ct<je;ct+=1){var He=We[ct];if(He!==void 0)ht[ct]=He;else return null}return ht},[We.join("_"),je])}var v=I.forwardRef(function(We,je){var ht=We.noData,ct=We.columns,He=We.flattenColumns,lt=We.colWidths,Pe=We.columCount,Oe=We.stickyOffsets,Ce=We.direction,le=We.fixHeader,he=We.offsetHeader,ye=We.stickyClassName,ae=We.onScroll,Se=Object(a.a)(We,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),$e=I.useContext(c.a),dt=$e.prefixCls,St=$e.scrollbarSize,Dt=$e.isSticky,Mt=Dt&&!le?0:St,hr=I.useRef(null),on=I.useCallback(function(Tr){Object(r.b)(je,Tr),Object(r.b)(hr,Tr)},[]);I.useEffect(function(){var Tr;function Or(Wt){var Ln=Wt.currentTarget,mr=Wt.deltaX;mr&&(ae({currentTarget:Ln,scrollLeft:Ln.scrollLeft+mr}),Wt.preventDefault())}return(Tr=hr.current)===null||Tr===void 0||Tr.addEventListener("wheel",Or),function(){var Wt;(Wt=hr.current)===null||Wt===void 0||Wt.removeEventListener("wheel",Or)}},[]);var fn=He[He.length-1],nn={fixed:fn?fn.fixed:null,onHeaderCell:function(){return{className:"".concat(dt,"-cell-scrollbar")}}},kn=Object(I.useMemo)(function(){return Mt?[].concat(Object(k.a)(ct),[nn]):ct},[Mt,ct]),dr=Object(I.useMemo)(function(){return Mt?[].concat(Object(k.a)(He),[nn]):He},[Mt,He]),pr=Object(I.useMemo)(function(){var Tr=Oe.right,Or=Oe.left;return Object($.a)(Object($.a)({},Oe),{},{left:Ce==="rtl"?[].concat(Object(k.a)(Or.map(function(Wt){return Wt+Mt})),[0]):Or,right:Ce==="rtl"?Tr:[].concat(Object(k.a)(Tr.map(function(Wt){return Wt+Mt})),[0]),isSticky:Dt})},[Mt,Oe,Dt]),Yn=y(lt,Pe);return I.createElement("div",{style:Object($.a)({overflow:"hidden"},Dt?{top:he}:{}),ref:on,className:G()("".concat(dt,"-header"),Object(ee.a)({},ye,!!ye))},I.createElement("table",{style:{tableLayout:"fixed",visibility:ht||Yn?null:"hidden"}},I.createElement(d,{colWidths:Yn?[].concat(Object(k.a)(Yn),[Mt]):[],columCount:Pe+1,columns:dr}),I.createElement(b,Object.assign({},Se,{stickyOffsets:pr,columns:kn,flattenColumns:dr}))))});v.displayName="FixedHeader";var E=v,M=I.createContext(null),N=M;function j(We){var je=We.prefixCls,ht=We.children,ct=We.component,He=We.cellComponent,lt=We.fixHeader,Pe=We.fixColumn,Oe=We.horizonScroll,Ce=We.className,le=We.expanded,he=We.componentWidth,ye=We.colSpan,ae=I.useContext(c.a),Se=ae.scrollbarSize;return I.useMemo(function(){var $e=ht;return Pe&&($e=I.createElement("div",{style:{width:he-(lt?Se:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(je,"-expanded-row-fixed")},$e)),I.createElement(ct,{className:Ce,style:{display:le?null:"none"}},I.createElement(t.a,{component:He,prefixCls:je,colSpan:ye},$e))},[ht,ct,lt,Oe,Ce,le,he,ye,Se])}var H=j;function P(We){var je=We.className,ht=We.style,ct=We.record,He=We.index,lt=We.rowKey,Pe=We.getRowKey,Oe=We.rowExpandable,Ce=We.expandedKeys,le=We.onRow,he=We.indent,ye=he===void 0?0:he,ae=We.rowComponent,Se=We.cellComponent,$e=We.childrenColumnName,dt=I.useContext(c.a),St=dt.prefixCls,Dt=dt.fixedInfoList,Mt=I.useContext(N),hr=Mt.fixHeader,on=Mt.fixColumn,fn=Mt.horizonScroll,nn=Mt.componentWidth,kn=Mt.flattenColumns,dr=Mt.expandableType,pr=Mt.expandRowByClick,Yn=Mt.onTriggerExpand,Tr=Mt.rowClassName,Or=Mt.expandedRowClassName,Wt=Mt.indentSize,Ln=Mt.expandIcon,mr=Mt.expandedRowRender,vr=Mt.expandIconColumnIndex,Rr=I.useState(!1),Sr=Object(B.a)(Rr,2),Wr=Sr[0],Ar=Sr[1],nt=Ce&&Ce.has(We.recordKey);I.useEffect(function(){nt&&Ar(!0)},[nt]);var ke=dr==="row"&&(!Oe||Oe(ct)),xt=dr==="nest",Ae=$e&&ct&&ct[$e],me=ke||xt,pe;le&&(pe=le(ct,He));var ir=function(Ft){if(pr&&me&&Yn(ct,Ft),pe&&pe.onClick){for(var or,ot=arguments.length,Mn=new Array(ot>1?ot-1:0),bn=1;bn<ot;bn++)Mn[bn-1]=arguments[bn];(or=pe).onClick.apply(or,[Ft].concat(Mn))}},Vt;typeof Tr=="string"?Vt=Tr:typeof Tr=="function"&&(Vt=Tr(ct,He,ye));var we=Object(S.a)(kn),at=I.createElement(ae,Object.assign({},pe,{"data-row-key":lt,className:G()(je,"".concat(St,"-row"),"".concat(St,"-row-level-").concat(ye),Vt,pe&&pe.className),style:Object($.a)(Object($.a)({},ht),pe?pe.style:null),onClick:ir}),kn.map(function(Wn,Ft){var or=Wn.render,ot=Wn.dataIndex,Mn=Wn.className,bn=we[Ft],sn=Dt[Ft],$t;Ft===(vr||0)&&xt&&($t=I.createElement(I.Fragment,null,I.createElement("span",{style:{paddingLeft:"".concat(Wt*ye,"px")},className:"".concat(St,"-row-indent indent-level-").concat(ye)}),Ln({prefixCls:St,expanded:nt,expandable:Ae,record:ct,onExpand:Yn})));var Dn;return Wn.onCell&&(Dn=Wn.onCell(ct,He)),I.createElement(t.a,Object.assign({className:Mn,ellipsis:Wn.ellipsis,align:Wn.align,component:Se,prefixCls:St,key:bn,record:ct,index:He,dataIndex:ot,render:or,shouldCellUpdate:Wn.shouldCellUpdate},sn,{appendNode:$t,additionalProps:Dn}))})),ge;if(ke&&(Wr||nt)){var en=mr(ct,He,ye+1,nt),sr=Or&&Or(ct,He,ye);ge=I.createElement(H,{expanded:nt,className:G()("".concat(St,"-expanded-row"),"".concat(St,"-expanded-row-level-").concat(ye+1),sr),prefixCls:St,fixHeader:hr,fixColumn:on,horizonScroll:fn,component:ae,componentWidth:nn,cellComponent:Se,colSpan:kn.length},en)}var ur;return Ae&&nt&&(ur=(ct[$e]||[]).map(function(Wn,Ft){var or=Pe(Wn,Ft);return I.createElement(P,Object.assign({},We,{key:or,rowKey:or,record:Wn,recordKey:or,index:Ft,indent:ye+1}))})),I.createElement(I.Fragment,null,at,ge,ur)}P.displayName="BodyRow";var x=P,U=I.createContext(null),V=U;function q(We){var je=We.columnKey,ht=We.onColumnResize,ct=I.useRef();return I.useEffect(function(){ct.current&&ht(je,ct.current.offsetWidth)},[]),I.createElement(g.a,{onResize:function(lt){var Pe=lt.offsetWidth;ht(je,Pe)}},I.createElement("td",{ref:ct,style:{padding:0,border:0,height:0}},I.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function ie(We){var je=We.data,ht=We.getRowKey,ct=We.measureColumnWidth,He=We.expandedKeys,lt=We.onRow,Pe=We.rowExpandable,Oe=We.emptyNode,Ce=We.childrenColumnName,le=I.useContext(V),he=le.onColumnResize,ye=I.useContext(c.a),ae=ye.prefixCls,Se=ye.getComponent,$e=I.useContext(N),dt=$e.fixHeader,St=$e.horizonScroll,Dt=$e.flattenColumns,Mt=$e.componentWidth;return I.useMemo(function(){var hr=Se(["body","wrapper"],"tbody"),on=Se(["body","row"],"tr"),fn=Se(["body","cell"],"td"),nn;je.length?nn=je.map(function(dr,pr){var Yn=ht(dr,pr);return I.createElement(x,{key:Yn,rowKey:Yn,record:dr,recordKey:Yn,index:pr,rowComponent:on,cellComponent:fn,expandedKeys:He,onRow:lt,getRowKey:ht,rowExpandable:Pe,childrenColumnName:Ce})}):nn=I.createElement(H,{expanded:!0,className:"".concat(ae,"-placeholder"),prefixCls:ae,fixHeader:dt,fixColumn:St,horizonScroll:St,component:on,componentWidth:Mt,cellComponent:fn,colSpan:Dt.length},Oe);var kn=Object(S.a)(Dt);return I.createElement(hr,{className:"".concat(ae,"-tbody")},ct&&I.createElement("tr",{"aria-hidden":"true",className:"".concat(ae,"-measure-row"),style:{height:0}},kn.map(function(dr){return I.createElement(q,{key:dr,columnKey:dr,onColumnResize:he})})),nn)},[je,ae,lt,ct,He,ht,Se,Mt,Oe,Dt])}var se=I.memo(ie);se.displayName="Body";var ve=se,Te=K("wRmb"),fe=K("xEkU"),_e=K.n(fe);function ue(We){var je=Object(I.useRef)(We),ht=Object(I.useState)({}),ct=Object(B.a)(ht,2),He=ct[1],lt=Object(I.useRef)(null),Pe=Object(I.useRef)([]);function Oe(Ce){lt.current===null&&(Pe.current=[],lt.current=_e()(function(){Pe.current.forEach(function(le){je.current=le(je.current)}),lt.current=null,He({})})),Pe.current.push(Ce)}return Object(I.useEffect)(function(){return function(){_e.a.cancel(lt.current)}},[]),[je.current,Oe]}function xe(We){var je=Object(I.useRef)(We),ht=Object(I.useRef)(null);function ct(){window.clearTimeout(ht.current)}function He(Pe){je.current=Pe,ct(),ht.current=window.setTimeout(function(){je.current=null,ht.current=null},100)}function lt(){return je.current}return Object(I.useEffect)(function(){return ct},[]),[He,lt]}function Y(We,je,ht){var ct=Object(I.useMemo)(function(){for(var He=[],lt=[],Pe=0,Oe=0,Ce=0;Ce<je;Ce+=1)if(ht==="rtl"){lt[Ce]=Oe,Oe+=We[Ce]||0;var le=je-Ce-1;He[le]=Pe,Pe+=We[le]||0}else{He[Ce]=Pe,Pe+=We[Ce]||0;var he=je-Ce-1;lt[he]=Oe,Oe+=We[he]||0}return{left:He,right:lt}},[We,je,ht]);return ct}var oe=Y;function ce(We){var je=We.className,ht=We.children;return I.createElement("div",{className:je},ht)}var Re=ce,Ge=K("n6Qo");function Ne(We){var je,ht=We.prefixCls,ct=We.record,He=We.onExpand,lt=We.expanded,Pe=We.expandable,Oe="".concat(ht,"-row-expand-icon");if(!Pe)return I.createElement("span",{className:G()(Oe,"".concat(ht,"-row-spaced"))});var Ce=function(he){He(ct,he),he.stopPropagation()};return I.createElement("span",{className:G()(Oe,(je={},Object(ee.a)(je,"".concat(ht,"-row-expanded"),lt),Object(ee.a)(je,"".concat(ht,"-row-collapsed"),!lt),je)),onClick:Ce})}function Je(We,je,ht){var ct=[];function He(lt){(lt||[]).forEach(function(Pe,Oe){ct.push(je(Pe,Oe)),He(Pe[ht])})}return He(We),ct}var rt=K("zT1h"),_t=K("y0+3"),ft=function(je,ht){var ct,He,lt=je.scrollBodyRef,Pe=je.onScroll,Oe=je.offsetScroll,Ce=I.useContext(c.a),le=Ce.prefixCls,he=((ct=lt.current)===null||ct===void 0?void 0:ct.scrollWidth)||0,ye=((He=lt.current)===null||He===void 0?void 0:He.clientWidth)||0,ae=he&&ye*(ye/he),Se=I.useRef(),$e=ue({scrollLeft:0,isHiddenScrollBar:!1}),dt=Object(B.a)($e,2),St=dt[0],Dt=dt[1],Mt=I.useRef({delta:0,x:0}),hr=I.useState(!1),on=Object(B.a)(hr,2),fn=on[0],nn=on[1],kn=function(){nn(!1)},dr=function(Wt){Wt.persist(),Mt.current.delta=Wt.pageX-St.scrollLeft,Mt.current.x=0,nn(!0),Wt.preventDefault()},pr=function(Wt){var Ln,mr=Wt||((Ln=window)===null||Ln===void 0?void 0:Ln.event),vr=mr.buttons;if(!fn||vr===0){fn&&nn(!1);return}var Rr=Mt.current.x+Wt.pageX-Mt.current.x-Mt.current.delta;Rr<=0&&(Rr=0),Rr+ae>=ye&&(Rr=ye-ae),Pe({scrollLeft:Rr/ye*(he+2)}),Mt.current.x=Wt.pageX},Yn=function(){var Wt=Object(_t.b)(lt.current).top,Ln=Wt+lt.current.offsetHeight,mr=document.documentElement.scrollTop+window.innerHeight;Ln-Object(h.a)()<=mr||Wt>=mr-Oe?Dt(function(vr){return Object($.a)(Object($.a)({},vr),{},{isHiddenScrollBar:!0})}):Dt(function(vr){return Object($.a)(Object($.a)({},vr),{},{isHiddenScrollBar:!1})})},Tr=function(Wt){Dt(function(Ln){return Object($.a)(Object($.a)({},Ln),{},{scrollLeft:Wt/he*ye||0})})};return I.useImperativeHandle(ht,function(){return{setScrollLeft:Tr}}),I.useEffect(function(){var Or=Object(rt.a)(document.body,"mouseup",kn,!1),Wt=Object(rt.a)(document.body,"mousemove",pr,!1);return Yn(),function(){Or.remove(),Wt.remove()}},[ae,fn]),I.useEffect(function(){var Or=Object(rt.a)(window,"scroll",Yn,!1),Wt=Object(rt.a)(window,"resize",Yn,!1);return function(){Or.remove(),Wt.remove()}},[]),I.useEffect(function(){St.isHiddenScrollBar||Dt(function(Or){var Wt,Ln;return Object($.a)(Object($.a)({},Or),{},{scrollLeft:lt.current.scrollLeft/((Wt=lt.current)===null||Wt===void 0?void 0:Wt.scrollWidth)*((Ln=lt.current)===null||Ln===void 0?void 0:Ln.clientWidth)})})},[St.isHiddenScrollBar]),he<=ye||!ae||St.isHiddenScrollBar?null:I.createElement("div",{style:{height:Object(h.a)(),width:ye,bottom:Oe},className:"".concat(le,"-sticky-scroll")},I.createElement("div",{onMouseDown:dr,ref:Se,className:G()("".concat(le,"-sticky-scroll-bar"),Object(ee.a)({},"".concat(le,"-sticky-scroll-bar-active"),fn)),style:{width:"".concat(ae,"px"),transform:"translate3d(".concat(St.scrollLeft,"px, 0, 0)")}}))},ut=I.forwardRef(ft);function qe(We,je){return I.useMemo(function(){var ht=!!We;return{isSticky:ht,stickyClassName:ht?"".concat(je,"-sticky-header"):"",offsetHeader:Object(Q.a)(We)==="object"&&We.offsetHeader||0,offsetScroll:Object(Q.a)(We)==="object"&&We.offsetScroll||0}},[We,je])}var Ct=[],kt={},Kt="rc-table-internal-hook",zt=I.memo(function(We){var je=We.children;return je},function(We,je){return D()(We.props,je.props)?We.pingLeft!==je.pingLeft||We.pingRight!==je.pingRight:!1});function ln(We){var je,ht=We.prefixCls,ct=We.className,He=We.rowClassName,lt=We.style,Pe=We.data,Oe=We.rowKey,Ce=We.scroll,le=We.tableLayout,he=We.direction,ye=We.title,ae=We.footer,Se=We.summary,$e=We.id,dt=We.showHeader,St=We.components,Dt=We.emptyText,Mt=We.onRow,hr=We.onHeaderRow,on=We.internalHooks,fn=We.transformColumns,nn=We.internalRefs,kn=We.sticky,dr=Pe||Ct,pr=!!dr.length,Yn=I.useState(0),Tr=Object(B.a)(Yn,2),Or=Tr[0],Wt=Tr[1];I.useEffect(function(){Wt(Object(h.a)())});var Ln=I.useMemo(function(){return Object(S.c)(St,{})},[St]),mr=I.useCallback(function(Bn,jn){return Object(S.b)(Ln,Bn)||jn},[Ln]),vr=I.useMemo(function(){return typeof Oe=="function"?Oe:function(Bn){var jn=Bn&&Bn[Oe];return jn}},[Oe]),Rr=Object(_.c)(We),Sr=Rr.expandIcon,Wr=Rr.expandedRowKeys,Ar=Rr.defaultExpandedRowKeys,nt=Rr.defaultExpandAllRows,ke=Rr.expandedRowRender,xt=Rr.onExpand,Ae=Rr.onExpandedRowsChange,me=Rr.expandRowByClick,pe=Rr.rowExpandable,ir=Rr.expandIconColumnIndex,Vt=Rr.expandedRowClassName,we=Rr.childrenColumnName,at=Rr.indentSize,ge=Sr||Ne,en=we||"children",sr=I.useMemo(function(){return ke?"row":We.expandable&&on===Kt&&We.expandable.__PARENT_RENDER_ICON__||dr.some(function(Bn){return Bn&&Object(Q.a)(Bn)==="object"&&Bn[en]})?"nest":!1},[!!ke,dr]),ur=I.useState(function(){return Ar||(nt?Je(dr,vr,en):[])}),Wn=Object(B.a)(ur,2),Ft=Wn[0],or=Wn[1],ot=I.useMemo(function(){return new Set(Wr||Ft||[])},[Wr,Ft]),Mn=I.useCallback(function(Bn){var jn=vr(Bn,dr.indexOf(Bn)),Ut,mn=ot.has(jn);mn?(ot.delete(jn),Ut=Object(k.a)(ot)):Ut=[].concat(Object(k.a)(ot),[jn]),or(Ut),xt&&xt(!mn,Bn),Ae&&Ae(Ut)},[vr,ot,dr,xt,Ae]),bn=I.useState(0),sn=Object(B.a)(bn,2),$t=sn[0],Dn=sn[1],hn=Object(Te.b)(Object($.a)(Object($.a)(Object($.a)({},We),Rr),{},{expandable:!!ke,expandedKeys:ot,getRowKey:vr,onTriggerExpand:Mn,expandIcon:ge,expandIconColumnIndex:ir,direction:he}),on===Kt?fn:null),Jt=Object(B.a)(hn,2),It=Jt[0],jt=Jt[1],tr=I.useMemo(function(){return{columns:It,flattenColumns:jt}},[It,jt]),nr=I.useRef(),Un=I.useRef(),yn=I.useRef(),Nt=I.useState(!1),Xt=Object(B.a)(Nt,2),Ht=Xt[0],Ot=Xt[1],Qn=I.useState(!1),An=Object(B.a)(Qn,2),pn=An[0],Gn=An[1],dn=ue(new Map),En=Object(B.a)(dn,2),qt=En[0],In=En[1],Jn=Object(S.a)(jt),qn=Jn.map(function(Bn){return qt.get(Bn)}),wn=I.useMemo(function(){return qn},[qn.join("_")]),Nn=oe(wn,jt.length,he),cn=Ce&&Object(S.d)(Ce.y),rr=Ce&&Object(S.d)(Ce.x),zn=rr&&jt.some(function(Bn){var jn=Bn.fixed;return jn}),fr=I.useRef(),cr=qe(kn,ht),Hn=cr.isSticky,Fn=cr.offsetHeader,gr=cr.offsetScroll,Sn=cr.stickyClassName,xn,Cn,_n;cn&&(Cn={overflowY:"scroll",maxHeight:Ce.y}),rr&&(xn={overflowX:"auto"},cn||(Cn={overflowY:"hidden"}),_n={width:Ce.x===!0?"auto":Ce.x,minWidth:"100%"});var Qt=I.useCallback(function(Bn,jn){In(function(Ut){var mn=new Map(Ut);return mn.set(Bn,jn),mn})},[]),yt=xe(null),Pt=Object(B.a)(yt,2),Lt=Pt[0],wt=Pt[1];function Gt(Bn,jn){if(!jn)return;typeof jn=="function"?jn(Bn):jn.scrollLeft!==Bn&&(jn.scrollLeft=Bn)}var rn=function(jn){var Ut=jn.currentTarget,mn=jn.scrollLeft,Pn=typeof mn=="number"?mn:Ut.scrollLeft,Kn=Ut||kt;if(!wt()||wt()===Kn){var vn;Lt(Kn),Gt(Pn,Un.current),Gt(Pn,yn.current),Gt(Pn,(vn=fr.current)===null||vn===void 0?void 0:vn.setScrollLeft)}if(Ut){var Lr=Ut.scrollWidth,Br=Ut.clientWidth;Ot(Pn>0),Gn(Pn<Lr-Br)}},tn=function(){yn.current&&rn({currentTarget:yn.current})},st=function(jn){var Ut=jn.width;tn(),Dn(nr.current?nr.current.offsetWidth:Ut)};I.useEffect(function(){return tn},[]),I.useEffect(function(){rr&&tn()},[rr]),I.useEffect(function(){on===Kt&&nn&&(nn.body.current=yn.current)});var Ye=mr(["table"],"table"),Be=I.useMemo(function(){return le||(zn?Ce.x==="max-content"?"auto":"fixed":cn||jt.some(function(Bn){var jn=Bn.ellipsis;return jn})?"fixed":"auto")},[cn,zn,jt,le]),ze,Le={colWidths:wn,columCount:jt.length,stickyOffsets:Nn,onHeaderRow:hr,fixHeader:cn},tt=I.useMemo(function(){return pr?null:typeof Dt=="function"?Dt():Dt},[pr,Dt]),Ve=I.createElement(ve,{data:dr,measureColumnWidth:cn||rr||Hn,expandedKeys:ot,rowExpandable:pe,getRowKey:vr,onRow:Mt,emptyNode:tt,childrenColumnName:en}),pt=I.createElement(d,{colWidths:jt.map(function(Bn){var jn=Bn.width;return jn}),columns:jt}),bt=Se&&I.createElement(Ge.b,null,Se(dr)),mt=mr(["body"]);if(cn||Hn){var At;typeof mt=="function"?(At=mt(dr,{scrollbarSize:Or,ref:yn,onScroll:rn}),Le.colWidths=jt.map(function(Bn,jn){var Ut=Bn.width,mn=jn===It.length-1?Ut-Or:Ut;return typeof mn=="number"&&!Number.isNaN(mn)?mn:(Object(m.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):At=I.createElement("div",{style:Object($.a)(Object($.a)({},xn),Cn),onScroll:rn,ref:yn,className:G()("".concat(ht,"-body"))},I.createElement(Ye,{style:Object($.a)(Object($.a)({},_n),{},{tableLayout:Be})},pt,Ve,bt),Hn&&I.createElement(ut,{ref:fr,offsetScroll:gr,scrollBodyRef:yn,onScroll:rn})),ze=I.createElement(I.Fragment,null,dt!==!1&&I.createElement(E,Object.assign({noData:!dr.length},Le,tr,{direction:he,offsetHeader:Fn,stickyClassName:Sn,ref:Un,onScroll:rn})),At)}else ze=I.createElement("div",{style:Object($.a)(Object($.a)({},xn),Cn),className:G()("".concat(ht,"-content")),onScroll:rn,ref:yn},I.createElement(Ye,{style:Object($.a)(Object($.a)({},_n),{},{tableLayout:Be})},pt,dt!==!1&&I.createElement(b,Object.assign({},Le,tr)),Ve,bt));var vt=Object(_.b)(We),Et=I.createElement("div",Object.assign({className:G()(ht,ct,(je={},Object(ee.a)(je,"".concat(ht,"-rtl"),he==="rtl"),Object(ee.a)(je,"".concat(ht,"-ping-left"),Ht),Object(ee.a)(je,"".concat(ht,"-ping-right"),pn),Object(ee.a)(je,"".concat(ht,"-layout-fixed"),le==="fixed"),Object(ee.a)(je,"".concat(ht,"-fixed-header"),cn),Object(ee.a)(je,"".concat(ht,"-fixed-column"),zn),Object(ee.a)(je,"".concat(ht,"-scroll-horizontal"),rr),Object(ee.a)(je,"".concat(ht,"-has-fix-left"),jt[0]&&jt[0].fixed),Object(ee.a)(je,"".concat(ht,"-has-fix-right"),jt[jt.length-1]&&jt[jt.length-1].fixed==="right"),je)),style:lt,id:$e,ref:nr},vt),I.createElement(zt,{pingLeft:Ht,pingRight:pn,props:Object($.a)(Object($.a)({},We),{},{stickyOffsets:Nn,mergedExpandedKeys:ot})},ye&&I.createElement(Re,{className:"".concat(ht,"-title")},ye(dr)),I.createElement("div",{className:"".concat(ht,"-container")},ze),ae&&I.createElement(Re,{className:"".concat(ht,"-footer")},ae(dr))));rr&&(Et=I.createElement(g.a,{onResize:st},Et));var an=I.useMemo(function(){return{prefixCls:ht,getComponent:mr,scrollbarSize:Or,direction:he,fixedInfoList:jt.map(function(Bn,jn){return f(jn,jn,jt,Nn,he)}),isSticky:Hn}},[ht,mr,Or,he,jt,Nn,he,Hn]),Yt=I.useMemo(function(){return Object($.a)(Object($.a)({},tr),{},{tableLayout:Be,rowClassName:He,expandedRowClassName:Vt,componentWidth:$t,fixHeader:cn,fixColumn:zn,horizonScroll:rr,expandIcon:ge,expandableType:sr,expandRowByClick:me,expandedRowRender:ke,onTriggerExpand:Mn,expandIconColumnIndex:ir,indentSize:at})},[tr,Be,He,Vt,$t,cn,zn,rr,ge,sr,me,ke,Mn,ir,at]),lr=I.useMemo(function(){return{onColumnResize:Qt}},[Qt]);return I.createElement(c.a.Provider,{value:an},I.createElement(N.Provider,{value:Yt},I.createElement(V.Provider,{value:lr},Et)))}ln.Column=l.a,ln.ColumnGroup=o.a,ln.Summary=Ge.a,ln.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var un=Ze.b=ln},wRmb:function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return D});var ee=K("rePB"),$=K("KQm4"),k=K("VTBJ"),Q=K("Ff2n"),B=K("cDcd"),I=K.n(B),z=K("Kwbf"),G=K("Zm9Q"),L=K("hW8S");function D(l){return Object(G.a)(l).filter(function(a){return B.isValidElement(a)}).map(function(a){var r=a.key,t=a.props,c=t.children,f=Object(Q.a)(t,["children"]),S=Object(k.a)({key:r},f);return c&&(S.children=D(c)),S})}function m(l){return l.reduce(function(a,r){var t=r.fixed,c=t===!0?"left":t,f=r.children;return f&&f.length>0?[].concat(Object($.a)(a),Object($.a)(m(f).map(function(S){return Object(k.a)({fixed:c},S)}))):[].concat(Object($.a)(a),[Object(k.a)(Object(k.a)({},r),{},{fixed:c})])},[])}function g(l){for(var a=!0,r=0;r<l.length;r+=1){var t=l[r];if(a&&t.fixed!=="left")a=!1;else if(!a&&t.fixed==="left"){Object(z.a)(!1,"Index ".concat(r-1," of `columns` missing `fixed='left'` prop."));break}}for(var c=!0,f=l.length-1;f>=0;f-=1){var S=l[f];if(c&&S.fixed!=="right")c=!1;else if(!c&&S.fixed==="right"){Object(z.a)(!1,"Index ".concat(f+1," of `columns` missing `fixed='right'` prop."));break}}}function h(l){return l.map(function(a){var r=a.fixed,t=Object(Q.a)(a,["fixed"]),c=r;return r==="left"?c="right":r==="right"&&(c="left"),Object(k.a)({fixed:c},t)})}function o(l,a){var r=l.prefixCls,t=l.columns,c=l.children,f=l.expandable,S=l.expandedKeys,C=l.getRowKey,T=l.onTriggerExpand,O=l.expandIcon,R=l.rowExpandable,b=l.expandIconColumnIndex,_=l.direction,u=l.expandRowByClick,d=B.useMemo(function(){return t||D(c)},[t,c]),y=B.useMemo(function(){if(f){var M,N=b||0,j=d[N],H=(M={},Object(ee.a)(M,L.a,{className:"".concat(r,"-expand-icon-col")}),Object(ee.a)(M,"title",""),Object(ee.a)(M,"fixed",j?j.fixed:null),Object(ee.a)(M,"className","".concat(r,"-row-expand-icon-cell")),Object(ee.a)(M,"render",function(U,V,q){var ie=C(V,q),se=S.has(ie),ve=R?R(V):!0,Te=O({prefixCls:r,expanded:se,expandable:ve,record:V,onExpand:T});return u?B.createElement("span",{onClick:function(_e){return _e.stopPropagation()}},Te):Te}),M),P=d.slice();return N>=0&&P.splice(N,0,H),P}return d},[f,d,C,S,O,_]),v=B.useMemo(function(){var M=y;return a&&(M=a(M)),M.length||(M=[{render:function(){return null}}]),M},[a,y,_]),E=B.useMemo(function(){return _==="rtl"?h(m(v)):m(v)},[v,_]);return[v,E]}Ze.b=o},"y0+3":function(Rt,Ze,K){"use strict";K.d(Ze,"a",function(){return m}),K.d(Ze,"b",function(){return h});var ee=/margin|padding|width|height|max|min|offset/,$={left:!0,top:!0},k={cssFloat:1,styleFloat:1,float:1};function Q(o){return o.nodeType===1?o.ownerDocument.defaultView.getComputedStyle(o,null):{}}function B(o,l,a){if(l=l.toLowerCase(),a==="auto"){if(l==="height")return o.offsetHeight;if(l==="width")return o.offsetWidth}return l in $||($[l]=ee.test(l)),$[l]?parseFloat(a)||0:a}function I(o,l){var a=arguments.length,r=Q(o);return l=k[l]?"cssFloat"in o.style?"cssFloat":"styleFloat":l,a===1?r:B(o,l,r[l]||o.style[l])}function z(o,l,a){var r=arguments.length;if(l=k[l]?"cssFloat"in o.style?"cssFloat":"styleFloat":l,r===3)return typeof a=="number"&&ee.test(l)&&(a="".concat(a,"px")),o.style[l]=a,a;for(var t in l)l.hasOwnProperty(t)&&z(o,t,l[t]);return Q(o)}function G(o){return o===document.body?document.documentElement.clientWidth:o.offsetWidth}function L(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 g(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function h(o){var l=o.getBoundingClientRect(),a=document.documentElement;return{left:l.left+(window.pageXOffset||a.scrollLeft)-(a.clientLeft||document.body.clientLeft||0),top:l.top+(window.pageYOffset||a.scrollTop)-(a.clientTop||document.body.clientTop||0)}}},zWo0:function(Rt,Ze,K){Rt.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"}}}]);