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

514 lines
1.6 MiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[193,5,6,7,8,20],{"+BqJ":function(It,Oe,U){It.exports={wrap:"wrap___25UhO",img:"img___2akIE",table:"table___3IRHj",totalScore:"totalScore___2JN2k",people:"people___1rT7q",glassSeal:"glassSeal___2gAyY"}},"+NIl":function(It,Oe,U){(function(te){te(U("VrN/"))})(function(te){"use strict";te.defineMode("stex",function(Q,B){"use strict";function J(a,c){a.cmdState.push(c)}function K(a){return a.cmdState.length>0?a.cmdState[a.cmdState.length-1]:null}function N(a){var c=a.cmdState.pop();c&&c.closeBracket()}function $(a){for(var c=a.cmdState,s=c.length-1;s>=0;s--){var i=c[s];if(i.name=="DEFAULT")continue;return i}return{styleIdentifier:function(){return null}}}function z(a,c,s){return function(){this.name=a,this.bracketNo=0,this.style=c,this.styles=s,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var r={};r.importmodule=z("importmodule","tag",["string","builtin"]),r.documentclass=z("documentclass","tag",["","atom"]),r.usepackage=z("usepackage","tag",["atom"]),r.begin=z("begin","tag",["atom"]),r.end=z("end","tag",["atom"]),r.label=z("label","tag",["atom"]),r.ref=z("ref","tag",["atom"]),r.eqref=z("eqref","tag",["atom"]),r.cite=z("cite","tag",["atom"]),r.bibitem=z("bibitem","tag",["atom"]),r.Bibitem=z("Bibitem","tag",["atom"]),r.RBibitem=z("RBibitem","tag",["atom"]),r.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function D(a,c){a.f=c}function m(a,c){var s;if(a.match(/^\\[a-zA-Z@]+/)){var i=a.current().slice(1);return s=r.hasOwnProperty(i)?r[i]:r.DEFAULT,s=new s,J(c,s),D(c,p),s.style}if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/\\]/))return"tag";if(a.match("\\["))return D(c,function(u,o){return g(u,o,"\\]")}),"keyword";if(a.match("\\("))return D(c,function(u,o){return g(u,o,"\\)")}),"keyword";if(a.match("$$"))return D(c,function(u,o){return g(u,o,"$$")}),"keyword";if(a.match("$"))return D(c,function(u,o){return g(u,o,"$")}),"keyword";var t=a.next();if(t=="%")return a.skipToEnd(),"comment";if(t=="}"||t=="]"){if(s=K(c),s)s.closeBracket(t),D(c,p);else return"error";return"bracket"}else return t=="{"||t=="["?(s=r.DEFAULT,s=new s,J(c,s),"bracket"):/\d/.test(t)?(a.eatWhile(/[\w.%]/),"atom"):(a.eatWhile(/[\w\-_]/),s=$(c),s.name=="begin"&&(s.argument=a.current()),s.styleIdentifier())}function g(a,c,s){if(a.eatSpace())return null;if(s&&a.match(s))return D(c,m),"keyword";if(a.match(/^\\[a-zA-Z@]+/))return"tag";if(a.match(/^[a-zA-Z]+/))return"variable-2";if(a.match(/^\\[$&%#{}_]/))return"tag";if(a.match(/^\\[,;!\/]/))return"tag";if(a.match(/^[\^_&]/))return"tag";if(a.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(a.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var i=a.next();return i=="{"||i=="}"||i=="["||i=="]"||i=="("||i==")"?"bracket":i=="%"?(a.skipToEnd(),"comment"):"error"}function p(a,c){var s=a.peek(),i;return s=="{"||s=="["?(i=K(c),i.openBracket(s),a.eat(s),D(c,m),"bracket"):/[ \t\r]/.test(s)?(a.eat(s),null):(D(c,m),N(c),m(a,c))}return{startState:function(){var a=B.inMathMode?function(c,s){return g(c,s)}:m;return{cmdState:[],f:a}},copyState:function(a){return{cmdState:a.cmdState.slice(),f:a.f}},token:function(a,c){return c.f(a,c)},blankLine:function(a){a.f=m,a.cmdState.length=0},lineComment:"%"}}),te.defineMIME("text/x-stex","stex"),te.defineMIME("text/x-latex","stex")})},"+ua5":function(It,Oe,U){},"/cxE":function(It,Oe,U){"use strict";U.d(Oe,"f",function(){return B}),U.d(Oe,"g",function(){return J}),U.d(Oe,"h",function(){return K}),U.d(Oe,"e",function(){return $}),U.d(Oe,"b",function(){return z}),U.d(Oe,"c",function(){return r}),U.d(Oe,"d",function(){return D}),U.d(Oe,"a",function(){return m});class te{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(g){setTimeout(()=>{throw g.stack?new Error(g.message+`
`+g.stack):g},0)}}emit(g){this.listeners.forEach(p=>{p(g)})}onUnexpectedError(g){this.unexpectedErrorHandler(g),this.emit(g)}onUnexpectedExternalError(g){this.unexpectedErrorHandler(g)}}const Q=new te;function B(g){$(g)||Q.onUnexpectedError(g);return}function J(g){$(g)||Q.onUnexpectedExternalError(g);return}function K(g){if(g instanceof Error){let{name:p,message:a}=g;const c=g.stacktrace||g.stack;return{$isError:!0,name:p,message:a,stack:c}}return g}const N="Canceled";function $(g){return g instanceof Error&&g.name===N&&g.message===N}function z(){const g=new Error(N);return g.name=g.message,g}function r(g){return g?new Error(`Illegal argument: ${g}`):new Error("Illegal argument")}function D(g){return g?new Error(`Illegal state: ${g}`):new Error("Illegal state")}class m extends Error{constructor(g){super("NotSupported");g&&(this.message=g)}}},"19Vz":function(It,Oe,U){(function(te){te(U("VrN/"))})(function(te){te.defineOption("placeholder","",function(z,r,D){var m=D&&D!=te.Init;if(r&&!m)z.on("blur",K),z.on("change",N),z.on("swapDoc",N),te.on(z.getInputField(),"compositionupdate",z.state.placeholderCompose=function(){J(z)}),N(z);else if(!r&&m){z.off("blur",K),z.off("change",N),z.off("swapDoc",N),te.off(z.getInputField(),"compositionupdate",z.state.placeholderCompose),Q(z);var g=z.getWrapperElement();g.className=g.className.replace(" CodeMirror-empty","")}r&&!z.hasFocus()&&K(z)});function Q(z){z.state.placeholder&&(z.state.placeholder.parentNode.removeChild(z.state.placeholder),z.state.placeholder=null)}function B(z){Q(z);var r=z.state.placeholder=document.createElement("pre");r.style.cssText="height: 0; overflow: visible",r.style.direction=z.getOption("direction"),r.className="CodeMirror-placeholder CodeMirror-line-like";var D=z.getOption("placeholder");typeof D=="string"&&(D=document.createTextNode(D)),r.appendChild(D),z.display.lineSpace.insertBefore(r,z.display.lineSpace.firstChild)}function J(z){setTimeout(function(){var r=!1,D=z.getInputField();D.nodeName=="TEXTAREA"?r=!D.value:z.lineCount()==1&&(r=!/[^\u200b]/.test(D.querySelector(".CodeMirror-line").textContent)),r?B(z):Q(z)},20)}function K(z){$(z)&&B(z)}function N(z){var r=z.getWrapperElement(),D=$(z);r.className=r.className.replace(" CodeMirror-empty","")+(D?" CodeMirror-empty":""),D?B(z):Q(z)}function $(z){return z.lineCount()===1&&z.getLine(0)===""}})},"1ZF9":function(It,Oe,U){It.exports=U.p+"static/Authorize.cc9c212f.png"},"1eCo":function(It,Oe,U){(function(te){te(U("VrN/"))})(function(te){"use strict";var Q={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},B={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};te.defineMode("xml",function(J,K){var N=J.indentUnit,$={},z=K.htmlMode?Q:B;for(var r in z)$[r]=z[r];for(var r in K)$[r]=K[r];var D,m;function g(f,C){function E(j){return C.tokenize=j,j(f,C)}var _=f.next();if(_=="<")return f.eat("!")?f.eat("[")?f.match("CDATA[")?E(c("atom","]]>")):null:f.match("--")?E(c("comment","-->")):f.match("DOCTYPE",!0,!0)?(f.eatWhile(/[\w\._\-]/),E(s(1))):null:f.eat("?")?(f.eatWhile(/[\w\._\-]/),C.tokenize=c("meta","?>"),"meta"):(D=f.eat("/")?"closeTag":"openTag",C.tokenize=p,"tag bracket");if(_=="&"){var W;return f.eat("#")?f.eat("x")?W=f.eatWhile(/[a-fA-F\d]/)&&f.eat(";"):W=f.eatWhile(/[\d]/)&&f.eat(";"):W=f.eatWhile(/[\w\.\-:]/)&&f.eat(";"),W?"atom":"error"}else return f.eatWhile(/[^&<]/),null}g.isInText=!0;function p(f,C){var E=f.next();if(E==">"||E=="/"&&f.eat(">"))return C.tokenize=g,D=E==">"?"endTag":"selfcloseTag","tag bracket";if(E=="=")return D="equals",null;if(E=="<"){C.tokenize=g,C.state=o,C.tagName=C.tagStart=null;var _=C.tokenize(f,C);return _?_+" tag error":"tag error"}else return/[\'\"]/.test(E)?(C.tokenize=a(E),C.stringStartCol=f.column(),C.tokenize(f,C)):(f.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function a(f){var C=function(E,_){for(;!E.eol();)if(E.next()==f){_.tokenize=p;break}return"string"};return C.isInAttribute=!0,C}function c(f,C){return function(E,_){for(;!E.eol();){if(E.match(C)){_.tokenize=g;break}E.next()}return f}}function s(f){return function(C,E){for(var _;(_=C.next())!=null;){if(_=="<")return E.tokenize=s(f+1),E.tokenize(C,E);if(_==">")if(f==1){E.tokenize=g;break}else return E.tokenize=s(f-1),E.tokenize(C,E)}return"meta"}}function i(f,C,E){this.prev=f.context,this.tagName=C,this.indent=f.indented,this.startOfLine=E,($.doNotIndent.hasOwnProperty(C)||f.context&&f.context.noIndent)&&(this.noIndent=!0)}function t(f){f.context&&(f.context=f.context.prev)}function u(f,C){for(var E;;){if(!f.context)return;if(E=f.context.tagName,!$.contextGrabbers.hasOwnProperty(E)||!$.contextGrabbers[E].hasOwnProperty(C))return;t(f)}}function o(f,C,E){return f=="openTag"?(E.tagStart=C.column(),R):f=="closeTag"?T:o}function R(f,C,E){return f=="word"?(E.tagName=C.current(),m="tag",I):$.allowMissingTagName&&f=="endTag"?(m="tag bracket",I(f,C,E)):(m="error",R)}function T(f,C,E){if(f=="word"){var _=C.current();return E.context&&E.context.tagName!=_&&$.implicitlyClosed.hasOwnProperty(E.context.tagName)&&t(E),E.context&&E.context.tagName==_||$.matchClosing===!1?(m="tag",S):(m="tag error",A)}else return $.allowMissingTagName&&f=="endTag"?(m="tag bracket",S(f,C,E)):(m="error",A)}function S(f,C,E){return f!="endTag"?(m="error",S):(t(E),o)}function A(f,C,E){return m="error",S(f,C,E)}function I(f,C,E){if(f=="word")return m="attribute",x;if(f=="endTag"||f=="selfcloseTag"){var _=E.tagName,W=E.tagStart;return E.tagName=E.tagStart=null,f=="selfcloseTag"||$.autoSelfClosers.hasOwnProperty(_)?u(E,_):(u(E,_),E.context=new i(E,_,W==E.indented)),o}return m="error",I}function x(f,C,E){return f=="equals"?b:($.allowMissing||(m="error"),I(f,C,E))}function b(f,C,E){return f=="string"?h:f=="word"&&$.allowUnquoted?(m="string",I):(m="error",I(f,C,E))}function h(f,C,E){return f=="string"?h:I(f,C,E)}return{startState:function(f){var C={tokenize:g,state:o,indented:f||0,tagName:null,tagStart:null,context:null};return f!=null&&(C.baseIndent=f),C},token:function(f,C){if(!C.tagName&&f.sol()&&(C.indented=f.indentation()),f.eatSpace())return null;D=null;var E=C.tokenize(f,C);return(E||D)&&E!="comment"&&(m=null,C.state=C.state(D||E,f,C),m&&(E=m=="error"?E+" error":m)),E},indent:function(f,C,E){var _=f.context;if(f.tokenize.isInAttribute)return f.tagStart==f.indented?f.stringStartCol+1:f.indented+N;if(_&&_.noIndent)return te.Pass;if(f.tokenize!=p&&f.tokenize!=g)return E?E.match(/^(\s*)/)[0].length:0;if(f.tagName)return $.multilineTagIndentPastTag!==!1?f.tagStart+f.tagName.length+2:f.tagStart+N*($.multilineTagIndentFactor||1);if($.alignCDATA&&/<!\[CDATA\[/.test(C))return 0;var W=C&&/^<(\/)?([\w_:\.-]*)/.exec(C);if(W&&W[1])for(;_;)if(_.tagName==W[2]){_=_.prev;break}else if($.implicitlyClosed.hasOwnProperty(_.tagName))_=_.prev;else break;else if(W)for(;_;){var j=$.contextGrabbers[_.tagName];if(j&&j.hasOwnProperty(W[2]))_=_.prev;else break}for(;_&&_.prev&&!_.startOfLine;)_=_.prev;return _?_.indent+N:f.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:$.htmlMode?"html":"xml",helperType:$.htmlMode?"html":"xml",skipAttribute:function(f){f.state==b&&(f.state=I)},xmlCurrentTag:function(f){return f.tagName?{name:f.tagName,close:f.type=="closeTag"}:null},xmlCurrentContext:function(f){for(var C=[],E=f.context;E;E=E.prev)E.tagName&&C.push(E.tagName);return C.reverse()}}}),te.defineMIME("text/xml","xml"),te.defineMIME("application/xml","xml"),te.mimeModes.hasOwnProperty("text/html")||te.defineMIME("text/html",{name:"xml",htmlMode:!0})})},"24hK":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return Q});class te{constructor(B){this.element=B,this.next=te.Undefined,this.prev=te.Undefined}}te.Undefined=new te(void 0);class Q{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let B=this._first;for(;B!==te.Undefined;){const J=B.next;B.prev=te.Undefined,B.next=te.Undefined,B=J}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(B){return this._insert(B,!1)}push(B){return this._insert(B,!0)}_insert(B,J){const K=new te(B);if(this._first===te.Undefined)this._first=K,this._last=K;else if(J){const $=this._last;this._last=K,K.prev=$,$.next=K}else{const $=this._first;this._first=K,K.next=$,$.prev=K}this._size+=1;let N=!1;return()=>{N||(N=!0,this._remove(K))}}shift(){if(this._first===te.Undefined)return;{const B=this._first.element;return this._remove(this._first),B}}pop(){if(this._last===te.Undefined)return;{const B=this._last.element;return this._remove(this._last),B}}_remove(B){if(B.prev!==te.Undefined&&B.next!==te.Undefined){const J=B.prev;J.next=B.next,B.next.prev=J}else B.prev===te.Undefined&&B.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):B.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):B.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let B=this._first;for(;B!==te.Undefined;)yield B.element,B=B.next}}},"2aBv":function(It,Oe,U){"use strict";var te=U("2qtc"),Q=U("kLXV"),B=U("0Owb"),J=U("14J3"),K=U("BMrR"),N=U("jCWc"),$=U("kPKH"),z=U("+L6B"),r=U("2/Rp"),D=U("oBTY"),m=U("tJVT"),g=U("q1tI"),p=U.n(g),a=U("ngQI"),c=U("Ty5D"),s=U("YIbm"),i=U.n(s),t=function(o){var R=o.visible,T=o.onOk,S=o.onCancel,A=o.data,I=Object(g.useState)([]),x=Object(m.a)(I,2),b=x[0],h=x[1],f=Object(g.useState)(!1),C=Object(m.a)(f,2),E=C[0],_=C[1],W=Object(c.i)();Object(g.useEffect)(function(){if(!R){h([]),_(!1);return}h(Object(D.a)(A)||[])},[R]);var j=function(){_(!0),T(b,function(){_(!1)})},w=function(){S()},F=function(H,Y,ie){var le=Array.from(H),he=le.splice(Y,1),xe=Object(m.a)(he,1),Le=xe[0];return le.splice(ie,0,Le),le},P=function(H,Y){if(!H.destination)return;var ie=F(Y,H.source.index,H.destination.index);h(ie)};return p.a.createElement(Q.a,{title:"\u9898\u578B\u6392\u5E8F",visible:R,centered:!0,onCancel:w,footer:p.a.createElement("div",null,p.a.createElement("span",{style:{float:"left",color:"#999",paddingTop:5}},"\u63D0\u793A:\u53EF\u5BF9\u9898\u578B\u8FDB\u884C\u4E0A\u4E0B\u62D6\u52A8\u6392\u5E8F"),p.a.createElement(r.a,{onClick:w},"\u53D6\u6D88"),p.a.createElement(r.a,{type:"primary",loading:E,onClick:j},"\u786E\u8BA4")),width:"680px"},p.a.createElement("div",{className:i.a.content},p.a.createElement(K.a,null,p.a.createElement($.a,{span:12},"\u5E8F\u53F7"),p.a.createElement($.a,{span:12},"\u9898\u578B\u540D\u79F0")),p.a.createElement(a.a,{onDragEnd:function(H){return P(H,b)}},p.a.createElement(a.c,{droppableId:"droppable"},function(v,H){return p.a.createElement("div",Object(B.a)({ref:v.innerRef},v.droppableProps,{style:{width:"100%"}}),b.map(function(Y,ie){return p.a.createElement(a.b,{key:ie,draggableId:ie.toString(),index:ie},function(le,he){return p.a.createElement("aside",Object(B.a)({ref:le.innerRef},le.draggableProps,le.dragHandleProps),p.a.createElement("div",null,p.a.createElement(K.a,{style:{backgroundColor:ie%2===0?"#f5f5f5":"#fff"}},p.a.createElement($.a,{span:12},ie+1),p.a.createElement($.a,{span:12},Y))))})}))}))))};Oe.a=t},"3/fG":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return Q});function te(B,J){let K;return J.length===0?K=B:K=B.replace(/\{(\d+)\}/g,function(N,$){const z=$[0];return typeof J[z]!="undefined"?J[z]:N}),K}function Q(B,J,...K){return te(J,K)}},"55Ip":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return u});var te=U("Ty5D"),Q=U("dI71"),B=U("q1tI"),J=U.n(B),K=U("YS25"),N=U("17x9"),$=U.n(N),z=U("wx14"),r=U("zLVn"),D=U("9R94"),m=function(b){Object(Q.a)(h,b);function h(){for(var C,E=arguments.length,_=new Array(E),W=0;W<E;W++)_[W]=arguments[W];return C=b.call.apply(b,[this].concat(_))||this,C.history=Object(K.a)(C.props),C}var f=h.prototype;return f.render=function(){return J.a.createElement(te.c,{history:this.history,children:this.props.children})},h}(J.a.Component),g=function(b){Object(Q.a)(h,b);function h(){for(var C,E=arguments.length,_=new Array(E),W=0;W<E;W++)_[W]=arguments[W];return C=b.call.apply(b,[this].concat(_))||this,C.history=Object(K.b)(C.props),C}var f=h.prototype;return f.render=function(){return J.a.createElement(te.c,{history:this.history,children:this.props.children})},h}(J.a.Component),p=function(h,f){return typeof h=="function"?h(f):h},a=function(h,f){return typeof h=="string"?Object(K.c)(h,null,null,f):h},c=function(h){return h},s=J.a.forwardRef;typeof s=="undefined"&&(s=c);function i(b){return!!(b.metaKey||b.altKey||b.ctrlKey||b.shiftKey)}var t=s(function(b,h){var f=b.innerRef,C=b.navigate,E=b.onClick,_=Object(r.a)(b,["innerRef","navigate","onClick"]),W=_.target,j=Object(z.a)({},_,{onClick:function(F){try{E&&E(F)}catch(P){throw F.preventDefault(),P}!F.defaultPrevented&&F.button===0&&(!W||W==="_self")&&!i(F)&&(F.preventDefault(),C())}});return c!==s?j.ref=h||f:j.ref=f,J.a.createElement("a",j)}),u=s(function(b,h){var f=b.component,C=f===void 0?t:f,E=b.replace,_=b.to,W=b.innerRef,j=Object(r.a)(b,["component","replace","to","innerRef"]);return J.a.createElement(te.e.Consumer,null,function(w){w||Object(D.a)(!1);var F=w.history,P=a(p(_,w.location),w.location),v=P?F.createHref(P):"",H=Object(z.a)({},j,{href:v,navigate:function(){var ie=p(_,w.location),le=E?F.replace:F.push;le(ie)}});return c!==s?H.ref=h||W:H.innerRef=W,J.a.createElement(C,H)})});if(!1)var o,R;var T=function(h){return h},S=J.a.forwardRef;typeof S=="undefined"&&(S=T);function A(){for(var b=arguments.length,h=new Array(b),f=0;f<b;f++)h[f]=arguments[f];return h.filter(function(C){return C}).join(" ")}var I=S(function(b,h){var f=b["aria-current"],C=f===void 0?"page":f,E=b.activeClassName,_=E===void 0?"active":E,W=b.activeStyle,j=b.className,w=b.exact,F=b.isActive,P=b.location,v=b.sensitive,H=b.strict,Y=b.style,ie=b.to,le=b.innerRef,he=Object(r.a)(b,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return J.a.createElement(te.e.Consumer,null,function(xe){xe||Object(D.a)(!1);var Le=P||xe.location,we=a(p(ie,Le),Le),Ae=we.pathname,pe=Ae&&Ae.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),be=pe?Object(te.f)(Le.pathname,{path:pe,exact:w,sensitive:v,strict:H}):null,ne=!!(F?F(be,Le):be),fe=ne?A(j,_):j,_e=ne?Object(z.a)({},Y,{},W):Y,ke=Object(z.a)({"aria-current":ne&&C||null,className:fe,style:_e,to:we},he);return T!==S?ke.ref=h||le:ke.innerRef=le,J.a.createElement(u,ke)})});if(!1)var x},"5VLF":function(It,Oe,U){"use strict";var te,Q;function B(J,K,N){var $=function(z,r){return J.js_beautify(z,r)};return $.js=J.js_beautify,$.css=K.css_beautify,$.html=N.html_beautify,$.js_beautify=J.js_beautify,$.css_beautify=K.css_beautify,$.html_beautify=N.html_beautify,$}!(te=[U("6UM0"),U("TXwP"),U("psGv")],Q=function(J,K,N){return B(J,K,N)}.apply(Oe,te),Q!==void 0&&(It.exports=Q))},"5Y4S":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return B});var te=U("MNsG");const Q=te.b.performance&&typeof te.b.performance.now=="function";class B{constructor(J){this._highResolution=Q&&J,this._startTime=this._now(),this._stopTime=-1}static create(J=!0){return new B(J)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?te.b.performance.now():Date.now()}}},"6+eU":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return S});var te=U("wx14"),Q=U("rePB"),B=U("VTBJ"),J=U("1OyB"),K=U("vuIU"),N=U("Ji7U"),$=U("LK+K"),z=U("q1tI"),r=U.n(z),D=U("TSYQ"),m=U.n(D),g=function(I){var x,b="".concat(I.rootPrefixCls,"-item"),h=m()(b,"".concat(b,"-").concat(I.page),(x={},Object(Q.a)(x,"".concat(b,"-active"),I.active),Object(Q.a)(x,I.className,!!I.className),Object(Q.a)(x,"".concat(b,"-disabled"),!I.page),x)),f=function(){I.onClick(I.page)},C=function(_){I.onKeyPress(_,I.onClick,I.page)};return r.a.createElement("li",{title:I.showTitle?I.page:null,className:h,onClick:f,onKeyPress:C,tabIndex:"0"},I.itemRender(I.page,"page",r.a.createElement("a",{rel:"nofollow"},I.page)))},p=g,a={ZERO:48,NINE:57,NUMPAD_ZERO:96,NUMPAD_NINE:105,BACKSPACE:8,DELETE:46,ENTER:13,ARROW_UP:38,ARROW_DOWN:40},c=function(A){Object(N.a)(x,A);var I=Object($.a)(x);function x(){var b;Object(J.a)(this,x);for(var h=arguments.length,f=new Array(h),C=0;C<h;C++)f[C]=arguments[C];return b=I.call.apply(I,[this].concat(f)),b.state={goInputText:""},b.buildOptionText=function(E){return"".concat(E," ").concat(b.props.locale.items_per_page)},b.changeSize=function(E){b.props.changeSize(Number(E))},b.handleChange=function(E){b.setState({goInputText:E.target.value})},b.handleBlur=function(E){var _=b.props,W=_.goButton,j=_.quickGo,w=_.rootPrefixCls,F=b.state.goInputText;if(W||F==="")return;if(E.relatedTarget&&(E.relatedTarget.className.indexOf("".concat(w,"-prev"))>=0||E.relatedTarget.className.indexOf("".concat(w,"-next"))>=0))return;b.setState({goInputText:""}),j(b.getValidValue())},b.go=function(E){var _=b.state.goInputText;if(_==="")return;(E.keyCode===a.ENTER||E.type==="click")&&(b.setState({goInputText:""}),b.props.quickGo(b.getValidValue()))},b}return Object(K.a)(x,[{key:"getValidValue",value:function(){var h=this.state,f=h.goInputText,C=h.current;return!f||isNaN(f)?C:Number(f)}},{key:"getPageSizeOptions",value:function(){var h=this.props,f=h.pageSize,C=h.pageSizeOptions;return C.some(function(E){return E.toString()===f.toString()})?C:C.concat([f.toString()]).sort(function(E,_){var W=isNaN(Number(E))?0:Number(E),j=isNaN(Number(_))?0:Number(_);return W-j})}},{key:"render",value:function(){var h=this,f=this.props,C=f.pageSize,E=f.locale,_=f.rootPrefixCls,W=f.changeSize,j=f.quickGo,w=f.goButton,F=f.selectComponentClass,P=f.buildOptionText,v=f.selectPrefixCls,H=f.disabled,Y=this.state.goInputText,ie="".concat(_,"-options"),le=F,he=null,xe=null,Le=null;if(!W&&!j)return null;var we=this.getPageSizeOptions();if(W&&le){var Ae=we.map(function(pe,be){return r.a.createElement(le.Option,{key:be,value:pe.toString()},(P||h.buildOptionText)(pe))});he=r.a.createElement(le,{disabled:H,prefixCls:v,showSearch:!1,className:"".concat(ie,"-size-changer"),optionLabelProp:"children",dropdownMatchSelectWidth:!1,value:(C||we[0]).toString(),onChange:this.changeSize,getPopupContainer:function(be){return be.parentNode}},Ae)}return j&&(w&&(Le=typeof w=="boolean"?r.a.createElement("button",{type:"button",onClick:this.go,onKeyUp:this.go,disabled:H,className:"".concat(ie,"-quick-jumper-button")},E.jump_to_confirm):r.a.createElement("span",{onClick:this.go,onKeyUp:this.go},w)),xe=r.a.createElement("div",{className:"".concat(ie,"-quick-jumper")},E.jump_to,r.a.createElement("input",{disabled:H,type:"text",value:Y,onChange:this.handleChange,onKeyUp:this.go,onBlur:this.handleBlur}),E.page,Le)),r.a.createElement("li",{className:"".concat(ie)},he,xe)}}]),x}(r.a.Component);c.defaultProps={pageSizeOptions:["10","20","50","100"]};var s=c,i=U("N2Kk");function t(){}function u(A){return typeof A=="number"&&isFinite(A)&&Math.floor(A)===A}function o(A,I,x){return x}function R(A,I,x){var b=typeof A=="undefined"?I.pageSize:A;return Math.floor((x.total-1)/b)+1}var T=function(A){Object(N.a)(x,A);var I=Object($.a)(x);function x(b){var h;Object(J.a)(this,x),h=I.call(this,b),h.getJumpPrevPage=function(){return Math.max(1,h.state.current-(h.props.showLessItems?3:5))},h.getJumpNextPage=function(){return Math.min(R(void 0,h.state,h.props),h.state.current+(h.props.showLessItems?3:5))},h.getItemIcon=function(W,j){var w=h.props.prefixCls,F=W||r.a.createElement("button",{type:"button","aria-label":j,className:"".concat(w,"-item-link")});return typeof W=="function"&&(F=r.a.createElement(W,Object(B.a)({},h.props))),F},h.savePaginationNode=function(W){h.paginationNode=W},h.isValid=function(W){return u(W)&&W!==h.state.current},h.shouldDisplayQuickJumper=function(){var W=h.props,j=W.showQuickJumper,w=W.pageSize,F=W.total;return F<=w?!1:j},h.handleKeyDown=function(W){(W.keyCode===a.ARROW_UP||W.keyCode===a.ARROW_DOWN)&&W.preventDefault()},h.handleKeyUp=function(W){var j=h.getValidValue(W),w=h.state.currentInputValue;j!==w&&h.setState({currentInputValue:j}),W.keyCode===a.ENTER?h.handleChange(j):W.keyCode===a.ARROW_UP?h.handleChange(j-1):W.keyCode===a.ARROW_DOWN&&h.handleChange(j+1)},h.changePageSize=function(W){var j=h.state.current,w=R(W,h.state,h.props);j=j>w?w:j,w===0&&(j=h.state.current),typeof W=="number"&&("pageSize"in h.props||h.setState({pageSize:W}),"current"in h.props||h.setState({current:j,currentInputValue:j})),h.props.onShowSizeChange(j,W),"onChange"in h.props&&h.props.onChange&&h.props.onChange(j,W)},h.handleChange=function(W){var j=h.props.disabled,w=W;if(h.isValid(w)&&!j){var F=R(void 0,h.state,h.props);w>F?w=F:w<1&&(w=1),"current"in h.props||h.setState({current:w,currentInputValue:w});var P=h.state.pageSize;return h.props.onChange(w,P),w}return h.state.current},h.prev=function(){h.hasPrev()&&h.handleChange(h.state.current-1)},h.next=function(){h.hasNext()&&h.handleChange(h.state.current+1)},h.jumpPrev=function(){h.handleChange(h.getJumpPrevPage())},h.jumpNext=function(){h.handleChange(h.getJumpNextPage())},h.hasPrev=function(){return h.state.current>1},h.hasNext=function(){return h.state.current<R(void 0,h.state,h.props)},h.runIfEnter=function(W,j){if(W.key==="Enter"||W.charCode===13){for(var w=arguments.length,F=new Array(w>2?w-2:0),P=2;P<w;P++)F[P-2]=arguments[P];j.apply(void 0,F)}},h.runIfEnterPrev=function(W){h.runIfEnter(W,h.prev)},h.runIfEnterNext=function(W){h.runIfEnter(W,h.next)},h.runIfEnterJumpPrev=function(W){h.runIfEnter(W,h.jumpPrev)},h.runIfEnterJumpNext=function(W){h.runIfEnter(W,h.jumpNext)},h.handleGoTO=function(W){(W.keyCode===a.ENTER||W.type==="click")&&h.handleChange(h.state.currentInputValue)};var f=b.onChange!==t,C="current"in b;C&&!f&&console.warn("Warning: You provided a `current` prop to a Pagination component without an `onChange` handler. This will render a read-only component.");var E=b.defaultCurrent;"current"in b&&(E=b.current);var _=b.defaultPageSize;return"pageSize"in b&&(_=b.pageSize),E=Math.min(E,R(_,void 0,b)),h.state={current:E,currentInputValue:E,pageSize:_},h}return Object(K.a)(x,[{key:"componentDidUpdate",value:function(h,f){var C=this.props.prefixCls;if(f.current!==this.state.current&&this.paginationNode){var E=this.paginationNode.querySelector(".".concat(C,"-item-").concat(f.current));E&&document.activeElement===E&&E.blur()}}},{key:"getValidValue",value:function(h){var f=h.target.value,C=R(void 0,this.state,this.props),E=this.state.currentInputValue,_;return f===""?_=f:isNaN(Number(f))?_=E:f>=C?_=C:_=Number(f),_}},{key:"getShowSizeChanger",value:function(){var h=this.props,f=h.showSizeChanger,C=h.total,E=h.totalBoundaryShowSizeChanger;return typeof f!="undefined"?f:C>E}},{key:"renderPrev",value:function(h){var f=this.props,C=f.prevIcon,E=f.itemRender,_=E(h,"prev",this.getItemIcon(C,"prev page")),W=!this.hasPrev();return Object(z.isValidElement)(_)?Object(z.cloneElement)(_,{disabled:W}):_}},{key:"renderNext",value:function(h){var f=this.props,C=f.nextIcon,E=f.itemRender,_=E(h,"next",this.getItemIcon(C,"next page")),W=!this.hasNext();return Object(z.isValidElement)(_)?Object(z.cloneElement)(_,{disabled:W}):_}},{key:"render",value:function(){var h=this,f=this.props,C=f.prefixCls,E=f.className,_=f.style,W=f.disabled,j=f.hideOnSinglePage,w=f.total,F=f.locale,P=f.showQuickJumper,v=f.showLessItems,H=f.showTitle,Y=f.showTotal,ie=f.simple,le=f.itemRender,he=f.showPrevNextJumpers,xe=f.jumpPrevIcon,Le=f.jumpNextIcon,we=f.selectComponentClass,Ae=f.selectPrefixCls,pe=f.pageSizeOptions,be=this.state,ne=be.current,fe=be.pageSize,_e=be.currentInputValue;if(j===!0&&w<=fe)return null;var ke=R(void 0,this.state,this.props),et=[],je=null,ot=null,_t=null,Re=null,Be=null,Qe=P&&P.goButton,Ve=v?1:2,Et=ne-1>0?ne-1:0,kt=ne+1<ke?ne+1:ke,Vt=Object.keys(this.props).reduce(function(ge,Ee){return(Ee.substr(0,5)==="data-"||Ee.substr(0,5)==="aria-"||Ee==="role")&&(ge[Ee]=h.props[Ee]),ge},{});if(ie)return Qe&&(typeof Qe=="boolean"?Be=r.a.createElement("button",{type:"button",onClick:this.handleGoTO,onKeyUp:this.handleGoTO},F.jump_to_confirm):Be=r.a.createElement("span",{onClick:this.handleGoTO,onKeyUp:this.handleGoTO},Qe),Be=r.a.createElement("li",{title:H?"".concat(F.jump_to).concat(ne,"/").concat(ke):null,className:"".concat(C,"-simple-pager")},Be)),r.a.createElement("ul",Object(te.a)({className:m()(C,"".concat(C,"-simple"),Object(Q.a)({},"".concat(C,"-disabled"),W),E),style:_,ref:this.savePaginationNode},Vt),r.a.createElement("li",{title:H?F.prev_page:null,onClick:this.prev,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterPrev,className:m()("".concat(C,"-prev"),Object(Q.a)({},"".concat(C,"-disabled"),!this.hasPrev())),"aria-disabled":!this.hasPrev()},this.renderPrev(Et)),r.a.createElement("li",{title:H?"".concat(ne,"/").concat(ke):null,className:"".concat(C,"-simple-pager")},r.a.createElement("input",{type:"text",value:_e,disabled:W,onKeyDown:this.handleKeyDown,onKeyUp:this.handleKeyUp,onChange:this.handleKeyUp,size:"3"}),r.a.createElement("span",{className:"".concat(C,"-slash")},"/"),ke),r.a.createElement("li",{title:H?F.next_page:null,onClick:this.next,tabIndex:this.hasPrev()?0:null,onKeyPress:this.runIfEnterNext,className:m()("".concat(C,"-next"),Object(Q.a)({},"".concat(C,"-disabled"),!this.hasNext())),"aria-disabled":!this.hasNext()},this.renderNext(kt)),Be);if(ke<=3+Ve*2){var Qt={locale:F,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,showTitle:H,itemRender:le};ke||et.push(r.a.createElement(p,Object(te.a)({},Qt,{key:"noPager",page:ke,className:"".concat(C,"-disabled")})));for(var an=1;an<=ke;an+=1){var sn=ne===an;et.push(r.a.createElement(p,Object(te.a)({},Qt,{key:an,page:an,active:sn})))}}else{var qe=v?F.prev_3:F.prev_5,Ze=v?F.next_3:F.next_5;he&&(je=r.a.createElement("li",{title:H?qe:null,key:"prev",onClick:this.jumpPrev,tabIndex:"0",onKeyPress:this.runIfEnterJumpPrev,className:m()("".concat(C,"-jump-prev"),Object(Q.a)({},"".concat(C,"-jump-prev-custom-icon"),!!xe))},le(this.getJumpPrevPage(),"jump-prev",this.getItemIcon(xe,"prev page"))),ot=r.a.createElement("li",{title:H?Ze:null,key:"next",tabIndex:"0",onClick:this.jumpNext,onKeyPress:this.runIfEnterJumpNext,className:m()("".concat(C,"-jump-next"),Object(Q.a)({},"".concat(C,"-jump-next-custom-icon"),!!Le))},le(this.getJumpNextPage(),"jump-next",this.getItemIcon(Le,"next page")))),Re=r.a.createElement(p,{locale:F,last:!0,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ke,page:ke,active:!1,showTitle:H,itemRender:le}),_t=r.a.createElement(p,{locale:F,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:1,page:1,active:!1,showTitle:H,itemRender:le});var Ct=Math.max(1,ne-Ve),At=Math.min(ne+Ve,ke);ne-1<=Ve&&(At=1+Ve*2),ke-ne<=Ve&&(Ct=ke-Ve*2);for(var ct=Ct;ct<=At;ct+=1){var ft=ne===ct;et.push(r.a.createElement(p,{locale:F,rootPrefixCls:C,onClick:this.handleChange,onKeyPress:this.runIfEnter,key:ct,page:ct,active:ft,showTitle:H,itemRender:le}))}ne-1>=Ve*2&&ne!==1+2&&(et[0]=Object(z.cloneElement)(et[0],{className:"".concat(C,"-item-after-jump-prev")}),et.unshift(je)),ke-ne>=Ve*2&&ne!==ke-2&&(et[et.length-1]=Object(z.cloneElement)(et[et.length-1],{className:"".concat(C,"-item-before-jump-next")}),et.push(ot)),Ct!==1&&et.unshift(_t),At!==ke&&et.push(Re)}var He=null;Y&&(He=r.a.createElement("li",{className:"".concat(C,"-total-text")},Y(w,[w===0?0:(ne-1)*fe+1,ne*fe>w?w:ne*fe])));var Ne=!this.hasPrev()||!ke,Ue=!this.hasNext()||!ke;return r.a.createElement("ul",Object(te.a)({className:m()(C,E,Object(Q.a)({},"".concat(C,"-disabled"),W)),style:_,unselectable:"unselectable",ref:this.savePaginationNode},Vt),He,r.a.createElement("li",{title:H?F.prev_page:null,onClick:this.prev,tabIndex:Ne?null:0,onKeyPress:this.runIfEnterPrev,className:m()("".concat(C,"-prev"),Object(Q.a)({},"".concat(C,"-disabled"),Ne)),"aria-disabled":Ne},this.renderPrev(Et)),et,r.a.createElement("li",{title:H?F.next_page:null,onClick:this.next,tabIndex:Ue?null:0,onKeyPress:this.runIfEnterNext,className:m()("".concat(C,"-next"),Object(Q.a)({},"".concat(C,"-disabled"),Ue)),"aria-disabled":Ue},this.renderNext(kt)),r.a.createElement(s,{disabled:W,locale:F,rootPrefixCls:C,selectComponentClass:we,selectPrefixCls:Ae,changeSize:this.getShowSizeChanger()?this.changePageSize:null,current:ne,pageSize:fe,pageSizeOptions:pe,quickGo:this.shouldDisplayQuickJumper()?this.handleChange:null,goButton:Qe}))}}],[{key:"getDerivedStateFromProps",value:function(h,f){var C={};if("current"in h&&(C.current=h.current,h.current!==f.current&&(C.currentInputValue=C.current)),"pageSize"in h&&h.pageSize!==f.pageSize){var E=f.current,_=R(h.pageSize,f,h);E=E>_?_:E,"current"in h||(C.current=E,C.currentInputValue=E),C.pageSize=h.pageSize}return C}}]),x}(r.a.Component);T.defaultProps={defaultCurrent:1,total:0,defaultPageSize:10,onChange:t,className:"",selectPrefixCls:"rc-select",prefixCls:"rc-pagination",selectComponentClass:null,hideOnSinglePage:!1,showPrevNextJumpers:!0,showQuickJumper:!1,showLessItems:!1,showTitle:!0,onShowSizeChange:t,locale:i.a,style:{},itemRender:o,totalBoundaryShowSizeChanger:50};var S=T},"69hG":function(It,Oe,U){It.exports={customModal:"customModal___1AnAw",content:"content___1zYYV",upload:"upload___1W2G-"}},"6RRn":function(It,Oe,U){"use strict";var te=U("wCXF"),Q=U("n6Qo");U.d(Oe,"b",function(){return Q.a});var B=U("IBYe"),J=U("6eGT"),K=U("hW8S");U.d(Oe,"a",function(){return K.a}),Oe.c=te.b},"6UM0":function(It,Oe,U){var te,Q;(function(){var B;(function(){"use strict";var K=[function(r,D,m){var g=m(1).Beautifier,p=m(5).Options;function a(c,s){var i=new g(c,s);return i.beautify()}r.exports=a,r.exports.defaultOptions=function(){return new p}},function(r,D,m){var g=m(2).Output,p=m(3).Token,a=m(4),c=m(5).Options,s=m(7).Tokenizer,i=m(7).line_starters,t=m(7).positionable_operators,u=m(7).TOKEN;function o(v,H){return H.indexOf(v)!==-1}function R(v){return v.replace(/^\s+/g,"")}function T(v){for(var H={},Y=0;Y<v.length;Y++)H[v[Y].replace(/-/g,"_")]=v[Y];return H}function S(v,H){return v&&v.type===u.RESERVED&&v.text===H}function A(v,H){return v&&v.type===u.RESERVED&&o(v.text,H)}var I=["case","return","do","if","throw","else","await","break","continue","async"],x=["before-newline","after-newline","preserve-newline"],b=T(x),h=[b.before_newline,b.preserve_newline],f={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function C(v,H){if(H.multiline_frame||H.mode===f.ForInitializer||H.mode===f.Conditional)return;v.remove_indent(H.start_line_index)}function E(v){v=v.replace(a.allLineBreaks,`
`);for(var H=[],Y=v.indexOf(`
`);Y!==-1;)H.push(v.substring(0,Y)),v=v.substring(Y+1),Y=v.indexOf(`
`);return v.length&&H.push(v),H}function _(v){return v===f.ArrayLiteral}function W(v){return o(v,[f.Expression,f.ForInitializer,f.Conditional])}function j(v,H){for(var Y=0;Y<v.length;Y++){var ie=v[Y].trim();if(ie.charAt(0)!==H)return!1}return!0}function w(v,H){for(var Y=0,ie=v.length,le;Y<ie;Y++)if(le=v[Y],le&&le.indexOf(H)!==0)return!1;return!0}function F(v,H){H=H||{},this._source_text=v||"",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 c(H)}F.prototype.create_flags=function(v,H){var Y=0;v&&(Y=v.indentation_level,!this._output.just_added_newline()&&v.line_indent_level>Y&&(Y=v.line_indent_level));var ie={mode:H,parent:v,last_token:v?v.last_token:new p(u.START_BLOCK,""),last_word:v?v.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:Y,alignment:0,line_indent_level:v?v.line_indent_level:Y,start_line_index:this._output.get_line_number(),ternary_depth:0};return ie},F.prototype._reset=function(v){var H=v.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new g(this._options,H),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(f.BlockStatement);var Y=new s(v,this._options);return this._tokens=Y.tokenize(),v},F.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var v,H=this._reset(this._source_text),Y=this._options.eol;this._options.eol==="auto"&&(Y=`
`,H&&a.lineBreak.test(H||"")&&(Y=H.match(a.lineBreak)[0]));for(var ie=this._tokens.next();ie;)this.handle_token(ie),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ie,ie=this._tokens.next();return v=this._output.get_code(Y),v},F.prototype.handle_token=function(v,H){v.type===u.START_EXPR?this.handle_start_expr(v):v.type===u.END_EXPR?this.handle_end_expr(v):v.type===u.START_BLOCK?this.handle_start_block(v):v.type===u.END_BLOCK?this.handle_end_block(v):v.type===u.WORD?this.handle_word(v):v.type===u.RESERVED?this.handle_word(v):v.type===u.SEMICOLON?this.handle_semicolon(v):v.type===u.STRING?this.handle_string(v):v.type===u.EQUALS?this.handle_equals(v):v.type===u.OPERATOR?this.handle_operator(v):v.type===u.COMMA?this.handle_comma(v):v.type===u.BLOCK_COMMENT?this.handle_block_comment(v,H):v.type===u.COMMENT?this.handle_comment(v,H):v.type===u.DOT?this.handle_dot(v):v.type===u.EOF?this.handle_eof(v):v.type===u.UNKNOWN?this.handle_unknown(v,H):this.handle_unknown(v,H)},F.prototype.handle_whitespace_and_comments=function(v,H){var Y=v.newlines,ie=this._options.keep_array_indentation&&_(this._flags.mode);if(v.comments_before)for(var le=v.comments_before.next();le;)this.handle_whitespace_and_comments(le,H),this.handle_token(le,H),le=v.comments_before.next();if(ie)for(var he=0;he<Y;he+=1)this.print_newline(he>0,H);else if(this._options.max_preserve_newlines&&Y>this._options.max_preserve_newlines&&(Y=this._options.max_preserve_newlines),this._options.preserve_newlines&&Y>1){this.print_newline(!1,H);for(var xe=1;xe<Y;xe+=1)this.print_newline(!0,H)}};var P=["async","break","continue","return","throw","yield"];F.prototype.allow_wrap_or_preserved_newline=function(v,H){if(H=H===void 0?!1:H,this._output.just_added_newline())return;var Y=this._options.preserve_newlines&&v.newlines||H,ie=o(this._flags.last_token.text,t)||o(v.text,t);if(ie){var le=o(this._flags.last_token.text,t)&&o(this._options.operator_position,h)||o(v.text,t);Y=Y&&le}if(Y)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(A(this._flags.last_token,P))return;this._output.set_wrap_point()}},F.prototype.print_newline=function(v,H){if(!H&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Y=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&S(Y,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(v)&&(this._flags.multiline_frame=!0)},F.prototype.print_token_line_indentation=function(v){this._output.just_added_newline()&&(this._options.keep_array_indentation&&v.newlines&&(v.text==="["||_(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(v.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))},F.prototype.print_token=function(v){if(this._output.raw){this._output.add_raw_token(v);return}if(this._options.comma_first&&v.previous&&v.previous.type===u.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var H=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(H),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(v),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(v),this._output.non_breaking_space=!0,this._output.add_token(v.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},F.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.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))},F.prototype.set_mode=function(v){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,v),this._flags=this.create_flags(this._previous_flags,v),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},F.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===f.Statement&&C(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},F.prototype.start_of_object_property=function(){return this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"]))},F.prototype.start_of_statement=function(v){var H=!1;return H=H||A(this._flags.last_token,["var","let","const"])&&v.type===u.WORD,H=H||S(this._flags.last_token,"do"),H=H||!(this._flags.parent.mode===f.ObjectLiteral&&this._flags.mode===f.Statement)&&A(this._flags.last_token,P)&&!v.newlines,H=H||S(this._flags.last_token,"else")&&!(S(v,"if")&&!v.comments_before),H=H||this._flags.last_token.type===u.END_EXPR&&(this._previous_flags.mode===f.ForInitializer||this._previous_flags.mode===f.Conditional),H=H||this._flags.last_token.type===u.WORD&&this._flags.mode===f.BlockStatement&&!this._flags.in_case&&!(v.text==="--"||v.text==="++")&&this._last_last_text!=="function"&&v.type!==u.WORD&&v.type!==u.RESERVED,H=H||this._flags.mode===f.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||A(this._flags.last_token,["get","set"])),H?(this.set_mode(f.Statement),this.indent(),this.handle_whitespace_and_comments(v,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v,A(v,["do","for","if","while"])),!0):!1},F.prototype.handle_start_expr=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v);var H=f.Expression;if(v.text==="["){if(this._flags.last_token.type===u.WORD||this._flags.last_token.text===")"){A(this._flags.last_token,i)&&(this._output.space_before_token=!0),this.print_token(v),this.set_mode(H),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}H=f.ArrayLiteral,_(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())),o(this._flags.last_token.type,[u.START_EXPR,u.END_EXPR,u.WORD,u.OPERATOR,u.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===u.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,H=f.ForInitializer):o(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,H=f.Conditional):o(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&v.whitespace_before===""?this._output.space_before_token=!1:(o(this._flags.last_token.text,i)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v);else if(this._flags.last_token.type===u.WORD){this._output.space_before_token=!1;var Y=this._tokens.peek(-3);if(this._options.space_after_named_function&&Y){var ie=this._tokens.peek(-4);A(Y,["async","function"])||Y.text==="*"&&A(ie,["async","function"])?this._output.space_before_token=!0:this._flags.mode===f.ObjectLiteral?(Y.text==="{"||Y.text===","||Y.text==="*"&&(ie.text==="{"||ie.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(v);(this._flags.last_token.type===u.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&o(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===u.START_BLOCK?this.print_newline():(this._flags.last_token.type===u.END_EXPR||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===u.COMMA)&&this.allow_wrap_or_preserved_newline(v,v.newlines),this.print_token(v),this.set_mode(H),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},F.prototype.handle_end_expr=function(v){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(v,v.text==="]"&&_(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===u.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(v),this.restore_mode(),C(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===f.Conditional&&(this._previous_flags.mode=f.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},F.prototype.handle_start_block=function(v){this.handle_whitespace_and_comments(v);var H=this._tokens.peek(),Y=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===u.END_EXPR?(this.set_mode(f.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(f.BlockStatement):Y&&(o(Y.text,[":",","])&&o(H.type,[u.STRING,u.WORD,u.RESERVED])||o(H.text,["get","set","..."])&&o(Y.type,[u.WORD,u.RESERVED]))?o(this._last_last_text,["class","interface"])&&!o(Y.text,[":",","])?this.set_mode(f.BlockStatement):this.set_mode(f.ObjectLiteral):this._flags.last_token.type===u.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(f.BlockStatement):o(this._flags.last_token.type,[u.EQUALS,u.START_EXPR,u.COMMA,u.OPERATOR])||A(this._flags.last_token,["return","throw","import","default"])?this.set_mode(f.ObjectLiteral):this.set_mode(f.BlockStatement),this._flags.last_token&&(A(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ie=!H.comments_before&&H.text==="}",le=ie&&this._flags.last_word==="function"&&this._flags.last_token.type===u.END_EXPR;if(this._options.brace_preserve_inline){var he=0,xe=null;this._flags.inline_frame=!0;do if(he+=1,xe=this._tokens.peek(he-1),xe.newlines){this._flags.inline_frame=!1;break}while(xe.type!==u.EOF&&!(xe.type===u.END_BLOCK&&xe.opened===v))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==u.OPERATOR&&(le||this._flags.last_token.type===u.EQUALS||A(this._flags.last_token,I)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(_(this._previous_flags.mode)&&(this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.COMMA)&&((this._flags.last_token.type===u.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(v),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==u.OPERATOR&&this._flags.last_token.type!==u.START_EXPR&&(this._flags.last_token.type===u.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(v),this.indent(),!ie&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},F.prototype.handle_end_block=function(v){for(this.handle_whitespace_and_comments(v);this._flags.mode===f.Statement;)this.restore_mode();var H=this._flags.last_token.type===u.START_BLOCK;this._flags.inline_frame&&!H?this._output.space_before_token=!0:this._options.brace_style==="expand"?H||this.print_newline():H||(_(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(v)},F.prototype.handle_word=function(v){if(v.type===u.RESERVED){if(o(v.text,["set","get"])&&this._flags.mode!==f.ObjectLiteral)v.type=u.WORD;else if(v.text==="import"&&o(this._tokens.peek().text,["(","."]))v.type=u.WORD;else if(o(v.text,["as","from"])&&!this._flags.import_block)v.type=u.WORD;else if(this._flags.mode===f.ObjectLiteral){var H=this._tokens.peek();H.text===":"&&(v.type=u.WORD)}}if(this.start_of_statement(v)?A(this._flags.last_token,["var","let","const"])&&v.type===u.WORD&&(this._flags.declaration_statement=!0):v.newlines&&!W(this._flags.mode)&&(this._flags.last_token.type!==u.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==u.EQUALS&&(this._options.preserve_newlines||!A(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(v),this.print_newline()):this.handle_whitespace_and_comments(v),this._flags.do_block&&!this._flags.do_while)if(S(v,"while")){this._output.space_before_token=!0,this.print_token(v),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&&S(v,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===f.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&A(v,["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(v),this._flags.in_case=!0;return}if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v)),S(v,"function")){(o(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(o(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===u.OPERATOR))&&(!this._output.just_added_blankline()&&!v.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD?A(this._flags.last_token,["get","set","new","export"])||A(this._flags.last_token,P)?this._output.space_before_token=!0:S(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===u.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(W(this._flags.mode)||_(this._flags.mode))||this.print_newline(),this.print_token(v),this._flags.last_word=v.text;return}var Y="NONE";if(this._flags.last_token.type===u.END_BLOCK?this._previous_flags.inline_frame?Y="SPACE":A(v,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines?Y="NEWLINE":(Y="SPACE",this._output.space_before_token=!0):Y="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&this._flags.mode===f.BlockStatement?Y="NEWLINE":this._flags.last_token.type===u.SEMICOLON&&W(this._flags.mode)?Y="SPACE":this._flags.last_token.type===u.STRING?Y="NEWLINE":this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.last_token.text==="*"&&(o(this._last_last_text,["function","yield"])||this._flags.mode===f.ObjectLiteral&&o(this._last_last_text,["{",","]))?Y="SPACE":this._flags.last_token.type===u.START_BLOCK?this._flags.inline_frame?Y="SPACE":Y="NEWLINE":this._flags.last_token.type===u.END_EXPR&&(this._output.space_before_token=!0,Y="NEWLINE"),A(v,i)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Y="SPACE":Y="NEWLINE"),A(v,["else","catch","finally"]))if((!(this._flags.last_token.type===u.END_BLOCK&&this._previous_flags.mode===f.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&v.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ie=this._output.current_line;ie.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Y==="NEWLINE"?A(this._flags.last_token,I)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&A(v,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==u.END_EXPR?(this._flags.last_token.type!==u.START_EXPR||!A(v,["var","let","const"]))&&this._flags.last_token.text!==":"&&(S(v,"if")&&S(v.previous,"else")?this._output.space_before_token=!0:this.print_newline()):A(v,i)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&_(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Y==="SPACE"&&(this._output.space_before_token=!0);v.previous&&(v.previous.type===u.WORD||v.previous.type===u.RESERVED)&&(this._output.space_before_token=!0),this.print_token(v),this._flags.last_word=v.text,v.type===u.RESERVED&&(v.text==="do"?this._flags.do_block=!0:v.text==="if"?this._flags.if_block=!0:v.text==="import"?this._flags.import_block=!0:this._flags.import_block&&S(v,"from")&&(this._flags.import_block=!1))},F.prototype.handle_semicolon=function(v){this.start_of_statement(v)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(v);for(var H=this._tokens.peek();this._flags.mode===f.Statement&&!(this._flags.if_block&&S(H,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(v)},F.prototype.handle_string=function(v){v.text.startsWith("`")&&v.newlines===0&&v.whitespace_before===""&&(v.previous.text===")"||this._flags.last_token.type===u.WORD)||(this.start_of_statement(v)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(v),this._flags.last_token.type===u.RESERVED||this._flags.last_token.type===u.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR||this._flags.last_token.type===u.EQUALS||this._flags.last_token.type===u.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(v):v.text.startsWith("`")&&this._flags.last_token.type===u.END_EXPR&&(v.previous.text==="]"||v.previous.text===")")&&v.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(v)},F.prototype.handle_equals=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0},F.prototype.handle_comma=function(v){this.handle_whitespace_and_comments(v,!0),this.print_token(v),this._output.space_before_token=!0,this._flags.declaration_statement?(W(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(v)):this._flags.mode===f.ObjectLiteral||this._flags.mode===f.Statement&&this._flags.parent.mode===f.ObjectLiteral?(this._flags.mode===f.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(v)},F.prototype.handle_operator=function(v){var H=v.text==="*"&&(A(this._flags.last_token,["function","yield"])||o(this._flags.last_token.type,[u.START_BLOCK,u.COMMA,u.END_BLOCK,u.SEMICOLON])),Y=o(v.text,["-","+"])&&(o(this._flags.last_token.type,[u.START_BLOCK,u.START_EXPR,u.EQUALS,u.OPERATOR])||o(this._flags.last_token.text,i)||this._flags.last_token.text===",");if(!this.start_of_statement(v)){var ie=!H;this.handle_whitespace_and_comments(v,ie)}if(v.text==="*"&&this._flags.last_token.type===u.DOT){this.print_token(v);return}if(v.text==="::"){this.print_token(v);return}if(this._flags.last_token.type===u.OPERATOR&&o(this._options.operator_position,h)&&this.allow_wrap_or_preserved_newline(v),v.text===":"&&this._flags.in_case){this.print_token(v),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==u.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 le=!0,he=!0,xe=!1;if(v.text===":"?this._flags.ternary_depth===0?le=!1:(this._flags.ternary_depth-=1,xe=!0):v.text==="?"&&(this._flags.ternary_depth+=1),!Y&&!H&&this._options.preserve_newlines&&o(v.text,t)){var Le=v.text===":",we=Le&&xe,Ae=Le&&!xe;switch(this._options.operator_position){case b.before_newline:this._output.space_before_token=!Ae,this.print_token(v),(!Le||we)&&this.allow_wrap_or_preserved_newline(v),this._output.space_before_token=!0;return;case b.after_newline:this._output.space_before_token=!0,!Le||we?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(v):this._output.space_before_token=!1,this.print_token(v),this._output.space_before_token=!0;return;case b.preserve_newline:Ae||this.allow_wrap_or_preserved_newline(v),le=!(this._output.just_added_newline()||Ae),this._output.space_before_token=le,this.print_token(v),this._output.space_before_token=!0;return}}if(H){this.allow_wrap_or_preserved_newline(v),le=!1;var pe=this._tokens.peek();he=pe&&o(pe.type,[u.WORD,u.RESERVED])}else if(v.text==="...")this.allow_wrap_or_preserved_newline(v),le=this._flags.last_token.type===u.START_BLOCK,he=!1;else if(o(v.text,["--","++","!","~"])||Y){if((this._flags.last_token.type===u.COMMA||this._flags.last_token.type===u.START_EXPR)&&this.allow_wrap_or_preserved_newline(v),le=!1,he=!1,v.newlines&&(v.text==="--"||v.text==="++"||v.text==="~")){var be=A(this._flags.last_token,I)&&v.newlines;be&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(be,!0)}this._flags.last_token.text===";"&&W(this._flags.mode)&&(le=!0),this._flags.last_token.type===u.RESERVED?le=!0:this._flags.last_token.type===u.END_EXPR?le=!(this._flags.last_token.text==="]"&&(v.text==="--"||v.text==="++")):this._flags.last_token.type===u.OPERATOR&&(le=o(v.text,["--","-","++","+"])&&o(this._flags.last_token.text,["--","-","++","+"]),o(v.text,["+","-"])&&o(this._flags.last_token.text,["--","++"])&&(he=!0)),(this._flags.mode===f.BlockStatement&&!this._flags.inline_frame||this._flags.mode===f.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||le,this.print_token(v),this._output.space_before_token=he},F.prototype.handle_block_comment=function(v,H){if(this._output.raw){this._output.add_raw_token(v),v.directives&&v.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(v.directives){this.print_newline(!1,H),this.print_token(v),v.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(v.text)&&!v.newlines){this._output.space_before_token=!0,this.print_token(v),this._output.space_before_token=!0;return}else this.print_block_commment(v,H)},F.prototype.print_block_commment=function(v,H){var Y=E(v.text),ie,le=!1,he=!1,xe=v.whitespace_before,Le=xe.length;if(this.print_newline(!1,H),this.print_token_line_indentation(v),this._output.add_token(Y[0]),this.print_newline(!1,H),Y.length>1){for(Y=Y.slice(1),le=j(Y,"*"),he=w(Y,xe),le&&(this._flags.alignment=1),ie=0;ie<Y.length;ie++)le?(this.print_token_line_indentation(v),this._output.add_token(R(Y[ie]))):he&&Y[ie]?(this.print_token_line_indentation(v),this._output.add_token(Y[ie].substring(Le))):(this._output.current_line.set_indent(-1),this._output.add_token(Y[ie])),this.print_newline(!1,H);this._flags.alignment=0}},F.prototype.handle_comment=function(v,H){v.newlines?this.print_newline(!1,H):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(v),this.print_newline(!1,H)},F.prototype.handle_dot=function(v){this.start_of_statement(v)||this.handle_whitespace_and_comments(v,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),A(this._flags.last_token,I)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(v,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(v)},F.prototype.handle_unknown=function(v,H){this.print_token(v),v.text[v.text.length-1]===`
`&&this.print_newline(!1,H)},F.prototype.handle_eof=function(v){for(;this._flags.mode===f.Statement;)this.restore_mode();this.handle_whitespace_and_comments(v)},r.exports.Beautifier=F},function(r){function D(p){this.__parent=p,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 p=new D(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},D.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},D.prototype.has_match=function(p){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(p))return!0;return!1},D.prototype.set_indent=function(p,a){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=a||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 p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__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(p){this.__items.push(p);var a=p.lastIndexOf(`
`);a!==-1?this.__character_count=p.length-a:this.__character_count+=p.length},D.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},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 p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function m(p,a){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),a=a||"",p.indent_level>0&&(a=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}m.prototype.get_indent_size=function(p,a){var c=this.__base_string_length;return a=a||0,p<0&&(c=0),c+=p*this.__indent_size,c+=a,c},m.prototype.get_indent_string=function(p,a){var c=this.__base_string;return a=a||0,p<0&&(p=0,c=""),a+=p*this.__indent_size,this.__ensure_cache(a),c+=this.__cache[a],c},m.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var p=this.__cache.length,a=0,c="";this.__indent_size&&p>=this.__indent_size&&(a=Math.floor(p/this.__indent_size),p-=a*this.__indent_size,c=new Array(a+1).join(this.__indent_string)),p&&(c+=new Array(p+1).join(" ")),this.__cache.push(c)};function g(p,a){this.__indent_cache=new m(p,a),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.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(p,a){return this.__indent_cache.get_indent_string(p,a)},g.prototype.get_indent_size=function(p,a){return this.__indent_cache.get_indent_size(p,a)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(p){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 c=this.__lines.join(`
`);return p!==`
`&&(c=c.replace(/[\n]/g,p)),c},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(p,a){return p=p||0,a=a||0,this.next_line.set_indent(p,a),this.__lines.length>1?(this.current_line.set_indent(p,a),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(p){for(var a=0;a<p.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),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(p){for(var a=this.__lines.length;p<a;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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(p,a){for(var c=this.__lines.length-2;c>=0;){var s=this.__lines[c];if(s.is_empty())break;if(s.item(0).indexOf(p)!==0&&s.item(-1)!==a){this.__lines.splice(c+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},r.exports.Output=g},function(r){function D(m,g,p,a){this.type=m,this.text=g,this.comments_before=null,this.newlines=p||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}r.exports.Token=D},function(r,D){var m="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",g="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\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",a="\\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",c="(?:\\\\u[0-9a-fA-F]{4}|["+m+p+"])",s="(?:\\\\u[0-9a-fA-F]{4}|["+g+p+a+"])*";D.identifier=new RegExp(c+s,"g"),D.identifierStart=new RegExp(c),D.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+g+p+a+"])+");var i=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;D.newline=/[\n\r\u2028\u2029]/,D.lineBreak=new RegExp(`\r
|`+D.newline.source),D.allLineBreaks=new RegExp(D.lineBreak.source,"g")},function(r,D,m){var g=m(6).Options,p=["before-newline","after-newline","preserve-newline"];function a(c){g.call(this,c,"js");var s=this.raw_options.brace_style||null;s==="expand-strict"?this.raw_options.brace_style="expand":s==="collapse-preserve-inline"?this.raw_options.brace_style="collapse,preserve-inline":this.raw_options.braces_on_own_line!==void 0&&(this.raw_options.brace_style=this.raw_options.braces_on_own_line?"expand":"collapse");var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var t=0;t<i.length;t++)i[t]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=i[t];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",p),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}a.prototype=new g,r.exports.Options=a},function(r){function D(p,a){this.raw_options=m(p,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"])}D.prototype._get_array=function(p,a){var c=this.raw_options[p],s=a||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(s=c.concat()):typeof c=="string"&&(s=c.split(/[^a-zA-Z0-9_\/\-]+/)),s},D.prototype._get_boolean=function(p,a){var c=this.raw_options[p],s=c===void 0?!!a:!!c;return s},D.prototype._get_characters=function(p,a){var c=this.raw_options[p],s=a||"";return typeof c=="string"&&(s=c.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},D.prototype._get_number=function(p,a){var c=this.raw_options[p];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(c,10);return isNaN(s)&&(s=a),s},D.prototype._get_selection=function(p,a,c){var s=this._get_selection_list(p,a,c);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[p]+"'");return s[0]},D.prototype._get_selection_list=function(p,a,c){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[a[0]],!this._is_valid_selection(c,a))throw new Error("Invalid Default Value!");var s=this._get_array(p,c);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[p]+"'");return s},D.prototype._is_valid_selection=function(p,a){return p.length&&a.length&&!p.some(function(c){return a.indexOf(c)===-1})};function m(p,a){var c={};p=g(p);var s;for(s in p)s!==a&&(c[s]=p[s]);if(a&&p[a])for(s in p[a])c[s]=p[a][s];return c}function g(p){var a={},c;for(c in p){var s=c.replace(/-/g,"_");a[s]=p[c]}return a}r.exports.Options=D,r.exports.normalizeOpts=g,r.exports.mergeOpts=m},function(r,D,m){var g=m(8).InputScanner,p=m(9).Tokenizer,a=m(9).TOKEN,c=m(13).Directives,s=m(4),i=m(12).Pattern,t=m(14).TemplatablePattern;function u(j,w){return w.indexOf(j)!==-1}var o={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:a.START,RAW:a.RAW,EOF:a.EOF},R=new c(/\/\*/,/\*\//),T=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,S=/[0-9]/,A=/[^\d\.]/,I=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),x=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";x=x.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),x="\\?\\.(?!\\d) "+x,x=x.replace(/ /g,"|");var b=new RegExp(x),h="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),f=h.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),C=new RegExp("^(?:"+f.join("|")+")$"),E,_=function(j,w){p.call(this,j,w),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var F=new i(this._input),P=new t(this._input).read_options(this._options);this.__patterns={template:P,identifier:P.starting_with(s.identifier).matching(s.identifierMatch),number:F.matching(T),punct:F.matching(b),comment:F.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:F.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:F.matching(/<!--/),html_comment_end:F.matching(/-->/),include:F.starting_with(/#include/).until_after(s.lineBreak),shebang:F.starting_with(/#!/).until_after(s.lineBreak),xml:F.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(/[`}\\]/)}};_.prototype=new p,_.prototype._is_comment=function(j){return j.type===o.COMMENT||j.type===o.BLOCK_COMMENT||j.type===o.UNKNOWN},_.prototype._is_opening=function(j){return j.type===o.START_BLOCK||j.type===o.START_EXPR},_.prototype._is_closing=function(j,w){return(j.type===o.END_BLOCK||j.type===o.END_EXPR)&&w&&(j.text==="]"&&w.text==="["||j.text===")"&&w.text==="("||j.text==="}"&&w.text==="{")},_.prototype._reset=function(){E=!1},_.prototype._get_next_token=function(j,w){var F=null;this._readWhitespace();var P=this._input.peek();return P===null?this._create_token(o.EOF,""):(F=F||this._read_non_javascript(P),F=F||this._read_string(P),F=F||this._read_word(j),F=F||this._read_singles(P),F=F||this._read_comment(P),F=F||this._read_regexp(P,j),F=F||this._read_xml(P,j),F=F||this._read_punctuation(),F=F||this._create_token(o.UNKNOWN,this._input.next()),F)},_.prototype._read_word=function(j){var w;if(w=this.__patterns.identifier.read(),w!=="")return w=w.replace(s.allLineBreaks,`
`),!(j.type===o.DOT||j.type===o.RESERVED&&(j.text==="set"||j.text==="get"))&&C.test(w)?(w==="in"||w==="of")&&(j.type===o.WORD||j.type===o.STRING)?this._create_token(o.OPERATOR,w):this._create_token(o.RESERVED,w):this._create_token(o.WORD,w);if(w=this.__patterns.number.read(),w!=="")return this._create_token(o.WORD,w)},_.prototype._read_singles=function(j){var w=null;return j==="("||j==="["?w=this._create_token(o.START_EXPR,j):j===")"||j==="]"?w=this._create_token(o.END_EXPR,j):j==="{"?w=this._create_token(o.START_BLOCK,j):j==="}"?w=this._create_token(o.END_BLOCK,j):j===";"?w=this._create_token(o.SEMICOLON,j):j==="."&&A.test(this._input.peek(1))?w=this._create_token(o.DOT,j):j===","&&(w=this._create_token(o.COMMA,j)),w&&this._input.next(),w},_.prototype._read_punctuation=function(){var j=this.__patterns.punct.read();if(j!=="")return j==="="?this._create_token(o.EQUALS,j):j==="?."?this._create_token(o.DOT,j):this._create_token(o.OPERATOR,j)},_.prototype._read_non_javascript=function(j){var w="";if(j==="#"){if(this._is_first_token()&&(w=this.__patterns.shebang.read(),w))return this._create_token(o.UNKNOWN,w.trim()+`
`);if(w=this.__patterns.include.read(),w)return this._create_token(o.UNKNOWN,w.trim()+`
`);j=this._input.next();var F="#";if(this._input.hasNext()&&this._input.testChar(S)){do j=this._input.next(),F+=j;while(this._input.hasNext()&&j!=="#"&&j!=="=");return j==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(F+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(F+="{}",this._input.next(),this._input.next())),this._create_token(o.WORD,F)}this._input.back()}else if(j==="<"&&this._is_first_token()){if(w=this.__patterns.html_comment_start.read(),w){for(;this._input.hasNext()&&!this._input.testChar(s.newline);)w+=this._input.next();return E=!0,this._create_token(o.COMMENT,w)}}else if(E&&j==="-"&&(w=this.__patterns.html_comment_end.read(),w))return E=!1,this._create_token(o.COMMENT,w);return null},_.prototype._read_comment=function(j){var w=null;if(j==="/"){var F="";if(this._input.peek(1)==="*"){F=this.__patterns.block_comment.read();var P=R.get_directives(F);P&&P.ignore==="start"&&(F+=R.readIgnored(this._input)),F=F.replace(s.allLineBreaks,`
`),w=this._create_token(o.BLOCK_COMMENT,F),w.directives=P}else this._input.peek(1)==="/"&&(F=this.__patterns.comment.read(),w=this._create_token(o.COMMENT,F))}return w},_.prototype._read_string=function(j){if(j==="`"||j==="'"||j==='"'){var w=this._input.next();return this.has_char_escapes=!1,j==="`"?w+=this._read_string_recursive("`",!0,"${"):w+=this._read_string_recursive(j),this.has_char_escapes&&this._options.unescape_strings&&(w=W(w)),this._input.peek()===j&&(w+=this._input.next()),w=w.replace(s.allLineBreaks,`
`),this._create_token(o.STRING,w)}return null},_.prototype._allow_regexp_or_xml=function(j){return j.type===o.RESERVED&&u(j.text,["return","case","throw","else","do","typeof","yield"])||j.type===o.END_EXPR&&j.text===")"&&j.opened.previous.type===o.RESERVED&&u(j.opened.previous.text,["if","while","for"])||u(j.type,[o.COMMENT,o.START_EXPR,o.START_BLOCK,o.START,o.END_BLOCK,o.OPERATOR,o.EQUALS,o.EOF,o.SEMICOLON,o.COMMA])},_.prototype._read_regexp=function(j,w){if(j==="/"&&this._allow_regexp_or_xml(w)){for(var F=this._input.next(),P=!1,v=!1;this._input.hasNext()&&(P||v||this._input.peek()!==j)&&!this._input.testChar(s.newline);)F+=this._input.peek(),P?P=!1:(P=this._input.peek()==="\\",this._input.peek()==="["?v=!0:this._input.peek()==="]"&&(v=!1)),this._input.next();return this._input.peek()===j&&(F+=this._input.next(),F+=this._input.read(s.identifier)),this._create_token(o.STRING,F)}return null},_.prototype._read_xml=function(j,w){if(this._options.e4x&&j==="<"&&this._allow_regexp_or_xml(w)){var F="",P=this.__patterns.xml.read_match();if(P){for(var v=P[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),H=v.indexOf("{")===0,Y=0;P;){var ie=!!P[1],le=P[2],he=!!P[P.length-1]||le.slice(0,8)==="![CDATA[";if(!he&&(le===v||H&&le.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ie?--Y:++Y),F+=P[0],Y<=0)break;P=this.__patterns.xml.read_match()}return P||(F+=this._input.match(/[\s\S]*/g)[0]),F=F.replace(s.allLineBreaks,`
`),this._create_token(o.STRING,F)}}return null};function W(j){for(var w="",F=0,P=new g(j),v=null;P.hasNext();)if(v=P.match(/([\s]|[^\\]|\\\\)+/g),v&&(w+=v[0]),P.peek()==="\\"){if(P.next(),P.peek()==="x")v=P.match(/x([0-9A-Fa-f]{2})/g);else if(P.peek()==="u")v=P.match(/u([0-9A-Fa-f]{4})/g);else{w+="\\",P.hasNext()&&(w+=P.next());continue}if(!v)return j;if(F=parseInt(v[1],16),F>126&&F<=255&&v[0].indexOf("x")===0)return j;if(F>=0&&F<32){w+="\\"+v[0];continue}else F===34||F===39||F===92?w+="\\"+String.fromCharCode(F):w+=String.fromCharCode(F)}return w}_.prototype._read_string_recursive=function(j,w,F){var P,v;j==="'"?v=this.__patterns.single_quote:j==='"'?v=this.__patterns.double_quote:j==="`"?v=this.__patterns.template_text:j==="}"&&(v=this.__patterns.template_expression);for(var H=v.read(),Y="";this._input.hasNext();){if(Y=this._input.next(),Y===j||!w&&s.newline.test(Y)){this._input.back();break}else Y==="\\"&&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(),Y+=this._input.next()):F&&(F==="${"&&Y==="$"&&this._input.peek()==="{"&&(Y+=this._input.next()),F===Y&&(j==="`"?Y+=this._read_string_recursive("}",w,"`"):Y+=this._read_string_recursive("`",w,"${"),this._input.hasNext()&&(Y+=this._input.next())));Y+=v.read(),H+=Y}return H},r.exports.Tokenizer=_,r.exports.TOKEN=o,r.exports.positionable_operators=I.slice(),r.exports.line_starters=h.slice()},function(r){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 p=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(p=this.__input.charAt(g)),p},m.prototype.__match=function(g,p){g.lastIndex=p;var a=g.exec(this.__input);return a&&!(D&&g.sticky)&&(a.index!==p&&(a=null)),a},m.prototype.test=function(g,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(g,p):!1},m.prototype.testChar=function(g,p){var a=this.peek(p);return g.lastIndex=0,a!==null&&g.test(a)},m.prototype.match=function(g){var p=this.__match(g,this.__position);return p?this.__position+=p[0].length:p=null,p},m.prototype.read=function(g,p,a){var c="",s;return g&&(s=this.match(g),s&&(c+=s[0])),p&&(s||!g)&&(c+=this.readUntil(p,a)),c},m.prototype.readUntil=function(g,p){var a="",c=this.__position;g.lastIndex=this.__position;var s=g.exec(this.__input);return s?(c=s.index,p&&(c+=s[0].length)):c=this.__input_length,a=this.__input.substring(this.__position,c),this.__position=c,a},m.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},m.prototype.get_regexp=function(g,p){var a=null,c="g";return p&&D&&(c="y"),typeof g=="string"&&g!==""?a=new RegExp(g,c):g&&(a=new RegExp(g.source,c)),a},m.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(g){var p=this.__position,a=this.readUntilAfter(g);return this.__position=p,a},m.prototype.lookBack=function(g){var p=this.__position-1;return p>=g.length&&this.__input.substring(p-g.length,p).toLowerCase()===g},r.exports.InputScanner=m},function(r,D,m){var g=m(8).InputScanner,p=m(3).Token,a=m(10).TokenStream,c=m(11).WhitespacePattern,s={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,u){this._input=new g(t),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new c(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var t,u=new p(s.START,""),o=null,R=[],T=new a;u.type!==s.EOF;){for(t=this._get_next_token(u,o);this._is_comment(t);)T.add(t),t=this._get_next_token(u,o);T.isEmpty()||(t.comments_before=T,T=new a),t.parent=o,this._is_opening(t)?(R.push(o),o=t):o&&this._is_closing(t,o)&&(t.opened=o,o.closed=t,o=R.pop(),t.parent=o),t.previous=u,u.next=t,this.__tokens.add(t),u=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,u){this._readWhitespace();var o=this._input.read(/.+/g);return o?this._create_token(s.RAW,o):this._create_token(s.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,u){return!1},i.prototype._create_token=function(t,u){var o=new p(t,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return o},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},r.exports.Tokenizer=i,r.exports.TOKEN=s},function(r){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},r.exports.TokenStream=D},function(r,D,m){var g=m(12).Pattern;function p(a,c){g.call(this,a,c),c?this._line_regexp=this._input.get_regexp(c._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}p.prototype=new g,p.prototype.__set_whitespace_patterns=function(a,c){a+="\\t ",c+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+c+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+c+"]")},p.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 c=this.__split(this._newline_regexp,a);this.newline_count=c.length-1,this.whitespace_before_token=c[this.newline_count]}return a},p.prototype.matching=function(a,c){var s=this._create();return s.__set_whitespace_patterns(a,c),s._update(),s},p.prototype._create=function(){return new p(this._input,this)},p.prototype.__split=function(a,c){a.lastIndex=0;for(var s=0,i=[],t=a.exec(c);t;)i.push(c.substring(s,t.index)),s=t.index+t[0].length,t=a.exec(c);return s<c.length?i.push(c.substring(s,c.length)):i.push(""),i},r.exports.WhitespacePattern=p},function(r){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(){},r.exports.Pattern=D},function(r){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 p=this.__directive_pattern.exec(m);p;)g[p[1]]=p[2],p=this.__directive_pattern.exec(m);return g},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=D},function(r,D,m){var g=m(12).Pattern,p={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(c,s){g.call(this,c,s),this.__template_pattern=null,this._disabled=Object.assign({},p),this._excluded=Object.assign({},p),s&&(this.__template_pattern=this._input.get_regexp(s.__template_pattern),this._excluded=Object.assign(this._excluded,s._excluded),this._disabled=Object.assign(this._disabled,s._disabled));var i=new g(c);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new g,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(c){var s=this._create();return s._disabled[c]=!0,s._update(),s},a.prototype.read_options=function(c){var s=this._create();for(var i in p)s._disabled[i]=c.templating.indexOf(i)===-1;return s._update(),s},a.prototype.exclude=function(c){var s=this._create();return s._excluded[c]=!0,s._update(),s},a.prototype.read=function(){var c="";this._match_pattern?c=this._input.read(this._starting_pattern):c=this._input.read(this._starting_pattern,this.__template_pattern);for(var s=this._read_template();s;)this._match_pattern?s+=this._input.read(this._match_pattern):s+=this._input.readUntil(this.__template_pattern),c+=s,s=this._read_template();return this._until_after&&(c+=this._input.readUntilAfter(this._until_pattern)),c},a.prototype.__set_templated_pattern=function(){var c=[];this._disabled.php||c.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||c.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||c.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(c.push(this.__patterns.django._starting_pattern.source),c.push(this.__patterns.django_value._starting_pattern.source),c.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||c.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&c.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+c.join("|")+")")},a.prototype._read_template=function(){var c="",s=this._input.peek();if(s==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(c=c||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(c=c||this.__patterns.erb.read())}else s==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(c=c||this.__patterns.handlebars_comment.read(),c=c||this.__patterns.handlebars_unescaped.read(),c=c||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(c=c||this.__patterns.django_value.read()),this._excluded.django||(c=c||this.__patterns.django_comment.read(),c=c||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(c=c||this.__patterns.smarty_comment.read(),c=c||this.__patterns.smarty_literal.read(),c=c||this.__patterns.smarty.read()));return c},r.exports.TemplatablePattern=a}],N={};function $(r){var D=N[r];if(D!==void 0)return D.exports;var m=N[r]={exports:{}};return K[r](m,m.exports,$),m.exports}var z=$(0);B=z})();var J=B;!(te=[],Q=function(){return{js_beautify:J}}.apply(Oe,te),Q!==void 0&&(It.exports=Q))})()},"6eGT":function(It,Oe,U){"use strict";function te(Q){return null}Oe.a=te},"746U":function(It,Oe,U){"use strict";U.d(Oe,"f",function(){return te}),U.d(Oe,"l",function(){return Q}),U.d(Oe,"k",function(){return B}),U.d(Oe,"j",function(){return J}),U.d(Oe,"g",function(){return K}),U.d(Oe,"m",function(){return N}),U.d(Oe,"h",function(){return $}),U.d(Oe,"n",function(){return z}),U.d(Oe,"c",function(){return r}),U.d(Oe,"a",function(){return D}),U.d(Oe,"i",function(){return m}),U.d(Oe,"o",function(){return g}),U.d(Oe,"e",function(){return c}),U.d(Oe,"d",function(){return s}),U.d(Oe,"p",function(){return i}),U.d(Oe,"b",function(){return t});function te(u){return Array.isArray(u)}function Q(u){return typeof u=="string"}function B(u){return typeof u=="object"&&u!==null&&!Array.isArray(u)&&!(u instanceof RegExp)&&!(u instanceof Date)}function J(u){return typeof u=="number"&&!isNaN(u)}function K(u){return u===!0||u===!1}function N(u){return typeof u=="undefined"}function $(u){return!z(u)}function z(u){return N(u)||u===null}function r(u,o){if(!u)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}function D(u){if(z(u))throw new Error("Assertion Failed: argument is undefined or null");return u}function m(u){return typeof u=="function"}function g(u,o){const R=Math.min(u.length,o.length);for(let T=0;T<R;T++)p(u[T],o[T])}function p(u,o){if(Q(o)){if(typeof u!==o)throw new Error(`argument does not match constraint: typeof ${o}`)}else if(m(o)){try{if(u instanceof o)return}catch(R){}if(!z(u)&&u.constructor===o)return;if(o.length===1&&o.call(void 0,u)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(u){let o=[],R=Object.getPrototypeOf(u);for(;Object.prototype!==R;)o=o.concat(Object.getOwnPropertyNames(R)),R=Object.getPrototypeOf(R);return o}function c(u){const o=[];for(const R of a(u))typeof u[R]=="function"&&o.push(R);return o}function s(u,o){const R=S=>function(){const A=Array.prototype.slice.call(arguments,0);return o(S,A)};let T={};for(const S of u)T[S]=R(S);return T}function i(u){return u===null?void 0:u}function t(u,o="Unreachable"){throw new Error(o)}},"7Cbv":function(It,Oe,U){"use strict";var te=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||typeof msCrypto!="undefined"&&typeof msCrypto.getRandomValues=="function"&&msCrypto.getRandomValues.bind(msCrypto),Q=new Uint8Array(16);function B(){if(!te)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return te(Q)}var J=/^(?:[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 K(p){return typeof p=="string"&&J.test(p)}for(var N=K,$=[],z=0;z<256;++z)$.push((z+256).toString(16).substr(1));function r(p){var a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,c=($[p[a+0]]+$[p[a+1]]+$[p[a+2]]+$[p[a+3]]+"-"+$[p[a+4]]+$[p[a+5]]+"-"+$[p[a+6]]+$[p[a+7]]+"-"+$[p[a+8]]+$[p[a+9]]+"-"+$[p[a+10]]+$[p[a+11]]+$[p[a+12]]+$[p[a+13]]+$[p[a+14]]+$[p[a+15]]).toLowerCase();if(!N(c))throw TypeError("Stringified UUID is invalid");return c}var D=r;function m(p,a,c){p=p||{};var s=p.random||(p.rng||B)();if(s[6]=s[6]&15|64,s[8]=s[8]&63|128,a){c=c||0;for(var i=0;i<16;++i)a[c+i]=s[i];return a}return D(s)}var g=Oe.a=m},"7ahc":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return R});var te=U("k1fw"),Q=U("0Owb"),B=U("+L6B"),J=U("2/Rp"),K=U("y8nQ"),N=U("Vl3Y"),$=U("tJVT"),z=U("OaEy"),r=U("2fM7"),D=U("q1tI"),m=U.n(D),g=U("VrN/"),p=U.n(g),a=U("p77/"),c=U.n(a),s=U("c5Ni"),i=U.n(s),t=r.a.Option,u={labelCol:{span:4},wrapperCol:{span:20}},o={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"]};Oe.b=function(T){var S=T.callback,A=T.onCancel,I=Object(D.useState)("python"),x=Object($.a)(I,2),b=x[0],h=x[1];function f(E){h(o[E][1])}function C(E){S(E)}return m.a.createElement(N.a,Object(Q.a)({},u,{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:C}),m.a.createElement(N.a.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},m.a.createElement(r.a,{onChange:f},Object.keys(o).map(function(E){return m.a.createElement(t,{key:E,value:E},o[E][0])}))),m.a.createElement(N.a.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},m.a.createElement(R,{mode:b})),m.a.createElement("div",{className:"flex-container flex-end"},m.a.createElement(J.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),m.a.createElement(J.a,{type:"ghost",onClick:A},"\u53D6\u6D88")))};function R(T){var S=T.value,A=T.onChange,I=T.mode,x=T.options,b=x===void 0?{}:x,h=Object(D.useRef)(),f=Object(D.useState)(),C=Object($.a)(f,2),E=C[0],_=C[1];return Object(D.useEffect)(function(){if(E){function W(j){var w=j.getValue();A&&A(w)}return E.on("change",W),function(){E.off("change",W)}}},[E,A]),Object(D.useEffect)(function(){E&&E.setOption("mode",I)},[E,I]),Object(D.useEffect)(function(){E&&((S!==E.getValue()||S==="")&&setTimeout(function(){E.setValue(S||" ")},300))},[E,S]),Object(D.useEffect)(function(){if(h.current&&!E){var W=p.a.fromTextArea(h.current,Object(te.a)({mode:I,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},b));_(W)}},[h.current,E]),m.a.createElement("div",{className:"my-codemirror-container"},m.a.createElement("textarea",{ref:h}))}},"7qnI":function(It,Oe,U){"use strict";var te=U("5Dmo"),Q=U("3S7+"),B=U("fWQN"),J=U("mtLc"),K=U("yKVA"),N=U("879j"),$=U("5NDa"),z=U("5rEg"),r=U("q1tI"),D=U.n(r),m=U("O2Wb"),g=U.n(m),p=z.a.TextArea,a=function(c){Object(K.a)(i,c);var s=Object(N.a)(i);function i(){return Object(B.a)(this,i),s.apply(this,arguments)}return Object(J.a)(i,[{key:"render",value:function(){var u=this,o=this.props,R=o.index,T=o.onAnswerChange,S=o.addChildAnswer,A=o.exerciseIsPublish,I=o.answers,x=o.activeOptionErrorIndex,b=o.flex,h=b===void 0?"0 0 1000px":b;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",R+1,"):"),D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),style:{flexDirection:"column"}},I.map(function(f,C){var E="".concat(R,"-").concat(C);return D.a.createElement("div",{className:"".concat(g.a.flex," ").concat(g.a.flex1),key:C},D.a.createElement("div",{className:g.a.flex1,style:{flex:h}},D.a.createElement("div",null,D.a.createElement(p,{className:E===x?g.a.error:"",spellCheck:!1,rows:4,value:f||"",defaultValue:"\u8BF7\u8F93\u5165\u53C2\u8003\u7B54\u6848".concat(C==0?"":"(\u53EF\u9009)"),onChange:function(W){return T(R,C,W.target.value)},style:{minHeight:95}}))),!A&&D.a.createElement(D.a.Fragment,null,C!=0&&D.a.createElement(Q.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return u.props.deleteChildAnswer(R,C)},style:{float:"right"}})),C===0&&D.a.createElement(Q.a,{title:"\u5220\u9664"},D.a.createElement("i",{className:"".concat(g.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return u.props.deleteChildAnswermain(R,C)},style:{float:"right"}})),D.a.createElement(Q.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},D.a.createElement("i",{className:"".concat(g.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return S(R)},style:{float:"right",visibility:C==I.length-1?"":"hidden"}}))))})))}}]),i}(r.Component);Oe.a=a},"815F":function(It,Oe,U){"use strict";U.d(Oe,"e",function(){return $}),U.d(Oe,"c",function(){return r}),U.d(Oe,"d",function(){return D}),U.d(Oe,"a",function(){return g}),U.d(Oe,"f",function(){return p}),U.d(Oe,"b",function(){return a});var te=U("KQm4"),Q=U("VTBJ"),B=U("Ff2n"),J=U("Zm9Q"),K=U("Kwbf"),N=U("OZM5");function $(c,s){return c!=null?c:s}function z(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=new Map;function i(t){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(t||[]).forEach(function(o){var R=o.key,T=o.children;Object(K.a)(R!=null,"Tree node must have a certain key: [".concat(u).concat(R,"]"));var S=String(R);Object(K.a)(!s.has(S)||R===null||R===void 0,"Same 'key' exist in the Tree: ".concat(S)),s.set(S,!0),i(T,"".concat(u).concat(S," > "))})}i(c)}function r(c){function s(i){var t=Object(J.a)(i);return t.map(function(u){if(!Object(N.i)(u))return Object(K.a)(!u,"Tree/TreeNode can only accept TreeNode as children."),null;var o=u.key,R=u.props,T=R.children,S=Object(B.a)(R,["children"]),A=Object(Q.a)({key:o},S),I=s(T);return I.length&&(A.children=I),A}).filter(function(u){return u})}return s(c)}function D(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],i=new Set(s===!0?[]:s),t=[];function u(o){var R=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return o.map(function(T,S){var A=Object(N.h)(R?R.pos:"0",S),I=$(T.key,A),x=Object(Q.a)(Object(Q.a)({},T),{},{parent:R,pos:A,children:null,data:T,isStart:[].concat(Object(te.a)(R?R.isStart:[]),[S===0]),isEnd:[].concat(Object(te.a)(R?R.isEnd:[]),[S===o.length-1])});return t.push(x),s===!0||i.has(I)?x.children=u(T.children||[],x):x.children=[],x})}return u(c),t}function m(c,s,i){var t;i?typeof i=="string"?t=function(R){return R[i]}:typeof i=="function"&&(t=function(R){return i(R)}):t=function(R,T){return $(R.key,T)};function u(o,R,T){var S=o?o.children:c,A=o?Object(N.h)(T.pos,R):"0";if(o){var I=t(o,A),x={node:o,index:R,pos:A,key:I,parentPos:T.node?T.pos:null,level:T.level+1};s(x)}S&&S.forEach(function(b,h){u(b,h,{node:o,pos:A,level:T?T.level+1:-1})})}u(null)}function g(c){var s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=s.initWrapper,t=s.processEntity,u=s.onProcessFinished,o=arguments.length>2?arguments[2]:void 0,R={},T={},S={posEntities:R,keyEntities:T};return i&&(S=i(S)||S),m(c,function(A){var I=A.node,x=A.index,b=A.pos,h=A.key,f=A.parentPos,C=A.level,E={node:I,index:x,key:h,pos:b,level:C},_=$(h,b);R[b]=E,T[_]=E,E.parent=R[f],E.parent&&(E.parent.children=E.parent.children||[],E.parent.children.push(E)),t&&t(E,S)},o),u&&u(S),S}function p(c,s){var i=s.expandedKeys,t=s.selectedKeys,u=s.loadedKeys,o=s.loadingKeys,R=s.checkedKeys,T=s.halfCheckedKeys,S=s.dragOverNodeKey,A=s.dropPosition,I=s.keyEntities,x=I[c],b={eventKey:c,expanded:i.indexOf(c)!==-1,selected:t.indexOf(c)!==-1,loaded:u.indexOf(c)!==-1,loading:o.indexOf(c)!==-1,checked:R.indexOf(c)!==-1,halfChecked:T.indexOf(c)!==-1,pos:String(x?x.pos:""),dragOver:S===c&&A===0,dragOverGapTop:S===c&&A===-1,dragOverGapBottom:S===c&&A===1};return b}function a(c){var s=c.data,i=c.expanded,t=c.selected,u=c.checked,o=c.loaded,R=c.loading,T=c.halfChecked,S=c.dragOver,A=c.dragOverGapTop,I=c.dragOverGapBottom,x=c.pos,b=c.active,h=Object(Q.a)(Object(Q.a)({},s),{},{expanded:i,selected:t,checked:u,loaded:o,loading:R,halfChecked:T,dragOver:S,dragOverGapTop:A,dragOverGapBottom:I,pos:x,active:b});return"props"in h||Object.defineProperty(h,"props",{get:function(){return Object(K.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),c}}),h}},"8EBN":function(It,Oe,U){(function(te){te(U("VrN/"))})(function(te){"use strict";te.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var Q=0;Q<te.modeInfo.length;Q++){var B=te.modeInfo[Q];B.mimes&&(B.mime=B.mimes[0])}te.findModeByMIME=function(J){J=J.toLowerCase();for(var K=0;K<te.modeInfo.length;K++){var N=te.modeInfo[K];if(N.mime==J)return N;if(N.mimes){for(var $=0;$<N.mimes.length;$++)if(N.mimes[$]==J)return N}}if(/\+xml$/.test(J))return te.findModeByMIME("application/xml");if(/\+json$/.test(J))return te.findModeByMIME("application/json")},te.findModeByExtension=function(J){J=J.toLowerCase();for(var K=0;K<te.modeInfo.length;K++){var N=te.modeInfo[K];if(N.ext){for(var $=0;$<N.ext.length;$++)if(N.ext[$]==J)return N}}},te.findModeByFileName=function(J){for(var K=0;K<te.modeInfo.length;K++){var N=te.modeInfo[K];if(N.file&&N.file.test(J))return N}var $=J.lastIndexOf("."),z=$>-1&&J.substring($+1,J.length);if(z)return te.findModeByExtension(z)},te.findModeByName=function(J){J=J.toLowerCase();for(var K=0;K<te.modeInfo.length;K++){var N=te.modeInfo[K];if(N.name.toLowerCase()==J)return N;if(N.alias){for(var $=0;$<N.alias.length;$++)if(N.alias[$].toLowerCase()==J)return N}}}})},"8HAY":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return K}),U.d(Oe,"b",function(){return N}),U.d(Oe,"d",function(){return $}),U.d(Oe,"e",function(){return z}),U.d(Oe,"c",function(){return r});var te=U("MI8n"),Q=U("pmY6"),B=U("3/fG"),J=function(D,m,g,p){function a(c){return c instanceof g?c:new g(function(s){s(c)})}return new(g||(g=Promise))(function(c,s){function i(o){try{u(p.next(o))}catch(R){s(R)}}function t(o){try{u(p.throw(o))}catch(R){s(R)}}function u(o){o.done?c(o.value):a(o.value).then(i,t)}u((p=p.apply(D,m||[])).next())})};class K extends Q.a{constructor(D,m="",g="",p=!0,a){super();this._onDidChange=this._register(new te.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=D,this._label=m,this._cssClass=g,this._enabled=p,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(D){this._setLabel(D)}_setLabel(D){this._label!==D&&(this._label=D,this._onDidChange.fire({label:D}))}get tooltip(){return this._tooltip||""}set tooltip(D){this._setTooltip(D)}_setTooltip(D){this._tooltip!==D&&(this._tooltip=D,this._onDidChange.fire({tooltip:D}))}get class(){return this._cssClass}set class(D){this._setClass(D)}_setClass(D){this._cssClass!==D&&(this._cssClass=D,this._onDidChange.fire({class:D}))}get enabled(){return this._enabled}set enabled(D){this._setEnabled(D)}_setEnabled(D){this._enabled!==D&&(this._enabled=D,this._onDidChange.fire({enabled:D}))}get checked(){return this._checked}set checked(D){this._setChecked(D)}_setChecked(D){this._checked!==D&&(this._checked=D,this._onDidChange.fire({checked:D}))}run(D,m){return J(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(D))})}}class N extends Q.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new te.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new te.b),this.onDidRun=this._onDidRun.event}run(D,m){return J(this,void 0,void 0,function*(){if(!D.enabled)return;this._onBeforeRun.fire({action:D});let g;try{yield this.runAction(D,m)}catch(p){g=p}this._onDidRun.fire({action:D,error:g})})}runAction(D,m){return J(this,void 0,void 0,function*(){yield D.run(m)})}}class $ extends K{constructor(D){super($.ID,D,D?"separator text":"separator");this.checked=!1,this.enabled=!1}}$.ID="vs.actions.separator";class z{constructor(D,m,g,p){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=D,this.label=m,this.class=p,this._actions=g}get actions(){return this._actions}dispose(){}run(){return J(this,void 0,void 0,function*(){})}}class r extends K{constructor(){super(r.ID,B.a("submenu.empty","(empty)"),void 0,!1)}}r.ID="vs.actions.empty"},"8hTe":function(It,Oe,U){It.exports={button:"button___1wy9m"}},"9Bee":function(It,Oe,U){"use strict";var te=U("DYRE"),Q=U("zeV3"),B=U("+L6B"),J=U("2/Rp"),K=U("k1fw"),N=U("9og8"),$=U("tJVT"),z=U("WmNS"),r=U.n(z),D=U("q1tI"),m=U.n(D),g=U("vg9a"),p=U("DlQD"),a=U.n(p),c=U("rUJ1");function s(q,O){var M=q.match(/^(\s+)(?:```)/);if(M===null)return O;var X=M[1];return O.split(`
`).map(function(se){var Z=se.match(/^\s+/);if(Z===null)return se;var Pe=Object($.a)(Z,1),st=Pe[0];return st.length>=X.length?se.slice(X.length):se}).join(`
`)}var i=[],t=["<ul>"],u=new a.a.Renderer,o=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function R(){i.length=0,t=["<ul>"]}var T={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function S(q,O,M,X){if(O>=q.length||q[O].level<=M)return O;var se=q[O];X.push("<li><a href='#"+se.anchor+"'>"+se.text+"</a>"),O++;var Z=[];return O=S(q,O,se.level,Z),Z.length>0&&(X.push("<ul>"),Z.forEach(function(Pe){X.push(Pe)}),X.push("</ul>")),X.push("</li>"),O=S(q,O,M,X),O}function A(){return S(i,0,0,t),t.push("</ul>"),t.join("")}var I={heading:function(O){var M=o.exec(O);if(M)return{type:"heading",raw:M[0],depth:M[1].length,text:M[2]}},fences:function(O){var M=this.rules.block.fences.exec(O);if(M){var X=M[0],se=s(X,M[3]||""),Z=M[2]?M[2].trim():M[2];if(["latex","katex","math"].indexOf(Z)>=0){var Pe=h(),st=se;se=Pe,f[Pe]={type:"block",expression:st}}return{type:"code",raw:X,lang:Z,text:se}}}},x=/(?:\${2})([^\n`]+?)(?:\${2})/gi,b=0,h=function(){return"__special_katext_id_".concat(b++,"__")},f={};function C(){return f}function E(){b=0,f={}}function _(q){return q=q.replace(x,function(O,M){var X=h();return f[X]={type:"inline",expression:M},X}),q}var W=u.listitem;u.listitem=function(q){return W(_(q))};var j=u.paragraph;u.paragraph=function(q){return j(_(q))};var w=u.tablecell;u.tablecell=function(q,O){return w(_(q),O)},u.code=function(q,O,M){var X=(O||"").match(/\S*/)[0];return X?["latex","katex","math"].indexOf(X)>=0?"<p class='editormd-tex'>".concat(q,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(O,'">').concat(M?q:Object(c.escape)(q,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(M?q:Object(c.escape)(q,!0))+"</code></pre>"},u.heading=function(q,O,M){var X=this.options.headerPrefix+M.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return i.push({anchor:X,level:O,text:q}),"<h"+O+' id="'+X+'">'+q+"</h"+O+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:I,renderer:u});var F=a.a,P=U("SJMd"),v=U("ulZh"),H=U.n(v),Y=U("m3rI"),ie=U("Oy/b"),le=U("p5ED"),he=U("ErOA");/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var xe=function(q,O){return(xe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,X){M.__proto__=X}||function(M,X){for(var se in X)Object.prototype.hasOwnProperty.call(X,se)&&(M[se]=X[se])})(q,O)};function Le(q,O){function M(){this.constructor=q}xe(q,O),q.prototype=O===null?Object.create(O):(M.prototype=O.prototype,new M)}function we(q,O,M,X){return new(M||(M=Promise))(function(se,Z){function Pe(Pt){try{wt(X.next(Pt))}catch(dt){Z(dt)}}function st(Pt){try{wt(X.throw(Pt))}catch(dt){Z(dt)}}function wt(Pt){var dt;Pt.done?se(Pt.value):(dt=Pt.value,dt instanceof M?dt:new M(function(bt){bt(dt)})).then(Pe,st)}wt((X=X.apply(q,O||[])).next())})}function Ae(q,O){var M,X,se,Z,Pe={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return Z={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function st(wt){return function(Pt){return function(dt){if(M)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(M=1,X&&(se=2&dt[0]?X.return:dt[0]?X.throw||((se=X.return)&&se.call(X),0):X.next)&&!(se=se.call(X,dt[1])).done)return se;switch(X=0,se&&(dt=[2&dt[0],se.value]),dt[0]){case 0:case 1:se=dt;break;case 4:return Pe.label++,{value:dt[1],done:!1};case 5:Pe.label++,X=dt[1],dt=[0];continue;case 7:dt=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(se=Pe.trys,(se=se.length>0&&se[se.length-1])||dt[0]!==6&&dt[0]!==2)){Pe=0;continue}if(dt[0]===3&&(!se||dt[1]>se[0]&&dt[1]<se[3])){Pe.label=dt[1];break}if(dt[0]===6&&Pe.label<se[1]){Pe.label=se[1],se=dt;break}if(se&&Pe.label<se[2]){Pe.label=se[2],Pe.ops.push(dt);break}se[2]&&Pe.ops.pop(),Pe.trys.pop();continue}dt=O.call(q,Pe)}catch(bt){dt=[6,bt],X=0}finally{M=se=0}if(5&dt[0])throw dt[1];return{value:dt[0]?dt[1]:void 0,done:!0}}([wt,Pt])}}}function pe(){for(var q=0,O=0,M=arguments.length;O<M;O++)q+=arguments[O].length;var X=Array(q),se=0;for(O=0;O<M;O++)for(var Z=arguments[O],Pe=0,st=Z.length;Pe<st;Pe++,se++)X[se]=Z[Pe];return X}var be=function(){function q(){}return q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},q.setAttributes=function(O,M){for(var X=0,se=M;X<se.length;X++){var Z=se[X],Pe=Z[0],st=Z[1];O.setAttribute(Pe,st)}},q.createRect=function(O,M,X){var se=document.createElementNS("http://www.w3.org/2000/svg","rect");return se.setAttribute("width",O.toString()),se.setAttribute("height",M.toString()),X&&q.setAttributes(se,X),se},q.createLine=function(O,M,X,se,Z){var Pe=document.createElementNS("http://www.w3.org/2000/svg","line");return Pe.setAttribute("x1",O.toString()),Pe.setAttribute("y1",M.toString()),Pe.setAttribute("x2",X.toString()),Pe.setAttribute("y2",se.toString()),Z&&q.setAttributes(Pe,Z),Pe},q.createPolygon=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","polygon");return X.setAttribute("points",O),M&&q.setAttributes(X,M),X},q.createCircle=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","circle");return X.setAttribute("cx",(O/2).toString()),X.setAttribute("cy",(O/2).toString()),X.setAttribute("r",O.toString()),M&&q.setAttributes(X,M),X},q.createEllipse=function(O,M,X){var se=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return se.setAttribute("cx",(O/2).toString()),se.setAttribute("cy",(M/2).toString()),se.setAttribute("rx",(O/2).toString()),se.setAttribute("ry",(M/2).toString()),X&&q.setAttributes(se,X),se},q.createGroup=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","g");return O&&q.setAttributes(M,O),M},q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},q.createMarker=function(O,M,X,se,Z,Pe,st){var wt=document.createElementNS("http://www.w3.org/2000/svg","marker");return q.setAttributes(wt,[["id",O],["orient",M],["markerWidth",X.toString()],["markerHeight",se.toString()],["refX",Z.toString()],["refY",Pe.toString()]]),wt.appendChild(st),wt},q.createText=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","text");return M.setAttribute("x","0"),M.setAttribute("y","0"),O&&q.setAttributes(M,O),M},q.createTSpan=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","tspan");return X.textContent=O,M&&q.setAttributes(X,M),X},q.createImage=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","image");return O&&q.setAttributes(M,O),M},q.createPoint=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return X.x=O,X.y=M,X},q.createPath=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","path");return X.setAttribute("d",O),M&&q.setAttributes(X,M),X},q}(),ne=function(){function q(){}return q.addKey=function(O){q.key=O},Object.defineProperty(q,"isLicensed",{get:function(){return!!q.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(q.key)},enumerable:!1,configurable:!0}),q}(),fe=function(){function q(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return q.prototype.rasterize=function(O,M,X){var se=this;return new Promise(function(Z){var Pe=X!==void 0?X:document.createElement("canvas");O===null&&(se.markersOnly=!0,se.naturalSize=!1);var st=document.createElementNS("http://www.w3.org/2000/svg","svg");st.setAttribute("xmlns","http://www.w3.org/2000/svg"),st.setAttribute("width",M.width.baseVal.valueAsString),st.setAttribute("height",M.height.baseVal.valueAsString),st.setAttribute("viewBox","0 0 "+M.viewBox.baseVal.width.toString()+" "+M.viewBox.baseVal.height.toString()),st.innerHTML=M.innerHTML,se.naturalSize===!0?(st.width.baseVal.value=O.naturalWidth,st.height.baseVal.value=O.naturalHeight):se.width!==void 0&&se.height!==void 0&&(st.width.baseVal.value=se.width,st.height.baseVal.value=se.height),Pe.width=st.width.baseVal.value,Pe.height=st.height.baseVal.value;var wt=st.outerHTML,Pt=Pe.getContext("2d");se.markersOnly!==!0&&Pt.drawImage(O,0,0,Pe.width,Pe.height);var dt=window.URL,bt=new Image(Pe.width,Pe.height);bt.setAttribute("crossOrigin","anonymous");var Mt=new Blob([wt],{type:"image/svg+xml"}),Cn=dt.createObjectURL(Mt);bt.onload=function(){Pt.drawImage(bt,0,0),dt.revokeObjectURL(Cn);var Yn=Pe.toDataURL(se.imageType,se.imageQuality);Z(Yn)},bt.src=Cn})},q}(),_e=function(){},ke=function(){function q(O){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+O+"_"}return Object.defineProperty(q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),q.prototype.addClass=function(O){return this.styleSheet===void 0&&this.addStyleSheet(),O.name=""+this.classNamePrefix+O.localName,this.classes.push(O),this.styleSheet.sheet.insertRule("."+O.name+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length),O},q.prototype.addRule=function(O){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(O),this.styleSheet.sheet.insertRule(O.selector+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length)},q.prototype.addStyleSheet=function(){var O;this.styleSheet=document.createElement("style"),((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).appendChild(this.styleSheet),this.addRule(new et("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new et("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new et("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new je("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new je("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},q.prototype.removeStyleSheet=function(){var O;this.styleSheet&&(((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},q}(),et=function(q,O){this.selector=q,this.style=O},je=function(q,O){this.localName=q,this.style=O},ot=function(){function q(O,M,X,se,Z){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=O,this.displayMode=M,this.markerItems=X,this.uiStyleSettings=se,this.styles=Z,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return q.prototype.show=function(O){var M=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=O,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var X=document.createElement("div");X.className=this.toolbarBlockStyleClass.name,X.style.whiteSpace="nowrap",this.uiContainer.appendChild(X),this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(X,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Z){var Pe=document.createElement("div");Pe.className=""+M.toolbarButtonStyleClass.name,Pe.setAttribute("data-type-name",Z.typeName),Pe.innerHTML=Z.icon,Pe.addEventListener("click",function(){M.markerToolbarButtonClicked(Pe,Z)}),M.buttons.push(Pe),M.markerButtons.push(Pe)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var se=document.createElement("div");se.className=this.toolbarBlockStyleClass.name,se.style.whiteSpace="nowrap",se.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(se),this.addActionButton(se,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(se,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},q.prototype.addButtonClickListener=function(O){this.buttonClickListeners.push(O)},q.prototype.removeButtonClickListener=function(O){this.buttonClickListeners.indexOf(O)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(O),1)},q.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},q.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var O=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var M=0;M<this.markerButtons.length;M++)M<O||M===O&&this.markerButtons.length-1===O?this.markerButtonBlock.appendChild(this.markerButtons[M]):(M===O&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[M]))}},q.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},q.prototype.resetButtonStyles=function(){var O=this;this.buttons.forEach(function(M){M.className=M.className.replace(O.uiStyleSettings.toolbarButtonStyleColorsClassName?O.uiStyleSettings.toolbarButtonStyleColorsClassName:O.toolbarButtonStyleColorsClass.name,"").trim(),M.className=M.className.replace(O.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?O.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:O.toolbarActiveButtonStyleColorsClass.name,"").trim(),M.className+=" "+(O.uiStyleSettings.toolbarButtonStyleColorsClassName?O.uiStyleSettings.toolbarButtonStyleColorsClassName:O.toolbarButtonStyleColorsClass.name)})},q.prototype.addActionButton=function(O,M,X){var se=this,Z=document.createElement("div");switch(Z.className=""+this.toolbarButtonStyleClass.name,Z.innerHTML=M,Z.setAttribute("data-action",X),Z.addEventListener("click",function(){se.actionToolbarButtonClicked(Z,X)}),X){case"select":Z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Z.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Z.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Z.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Z.style.fill=this.uiStyleSettings.closeButtonColor}O.appendChild(Z),this.buttons.push(Z)},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new je("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new je("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new je("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new je("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new je("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var O=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new je("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*O)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*O)+`px;
padding: `+O+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new je("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new je("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new et("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new et("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},q.prototype.markerToolbarButtonClicked=function(O,M){this.setActiveButton(O),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(X){return X("marker",M)}),this.markerButtonOverflowBlock.style.display="none"},q.prototype.actionToolbarButtonClicked=function(O,M){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(X){return X("action",M)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},q.prototype.setActiveButton=function(O){this.resetButtonStyles(),O.className=O.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),O.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},q.prototype.setActiveMarkerButton=function(O){var M=this.markerButtons.find(function(X){return X.getAttribute("data-type-name")===O});M&&this.setActiveButton(M)},q.prototype.setCurrentMarker=function(O){var M=this;this.currentMarker=O,this.buttons.filter(function(X){return/delete|notes/.test(X.getAttribute("data-action"))}).forEach(function(X){M.currentMarker===void 0?(X.style.fillOpacity="0.4",X.style.pointerEvents="none"):(X.style.fillOpacity="1",X.style.pointerEvents="all")})},q}(),_t=function(){function q(O,M,X,se){this.panels=[],this.panelButtons=[],this.markerjsContainer=O,this.displayMode=M,this.uiStyleSettings=X,this.styles=se,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return q.prototype.addStyles=function(){var O;this.toolboxStyleClass=this.styles.addClass(new je("toolbox",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: column;
font-family: sans-serif;
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
box-sizing: content-box;
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolboxStyleColorsClass=this.styles.addClass(new je("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var M=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new je("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new je("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new je("toolbox-panel-row",`
display: flex;
`+(this.displayMode==="inline"?"position: absolute;":"")+`
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
cursor: default;
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
`+(this.displayMode==="inline"?"width: 100%;":"")+`
box-sizing: content-box;
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new je("toolbox-panel-row_colors",`
background-color: `+((O=this.uiStyleSettings.toolboxBackgroundColor)!==null&&O!==void 0?O:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new je("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*M)+`px;
padding: `+M+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new je("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new je("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new et("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new et("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},q.prototype.show=function(O){var M;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=O,this.uiContainer.className=this.toolboxStyleClass.name+" "+((M=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},q.prototype.setPanelButtons=function(O){var M,X,se=this;this.panels=O,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((M=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&M!==void 0?M:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((X=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&X!==void 0?X:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Z){var Pe;Z.uiStyleSettings=se.uiStyleSettings;var st=document.createElement("div");st.className=se.toolboxButtonStyleClass.name+" "+((Pe=se.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&Pe!==void 0?Pe:se.toolboxButtonStyleColorsClass.name),st.innerHTML=Z.icon,st.title=Z.title,st.addEventListener("click",function(){se.panelButtonClick(Z)}),se.panelButtons.push(st),se.buttonRow.appendChild(st)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},q.prototype.panelButtonClick=function(O){var M=this,X=-1;if(O!==this.activePanel){X=this.panels.indexOf(O),this.panelRow.innerHTML="";var se=O.getUi();se.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(se),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=O}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){M.displayMode==="inline"?M.panelRow.style.display="none":M.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Z,Pe){var st,wt;Z.className=M.toolboxButtonStyleClass.name+" "+(Pe===X?""+((st=M.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&st!==void 0?st:M.toolboxActiveButtonStyleColorsClass.name):""+((wt=M.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&wt!==void 0?wt:M.toolboxButtonStyleColorsClass.name))})},q}(),Re=function(q,O){this.title=q,this.icon=O},Be=function(q){function O(M,X,se,Z){var Pe=q.call(this,M,Z||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return Pe.colors=[],Pe.addTransparent=!1,Pe.colorBoxes=[],Pe.colors=X,Pe.currentColor=se,Pe.setCurrentColor=Pe.setCurrentColor.bind(Pe),Pe.getColorBox=Pe.getColorBox.bind(Pe),Pe}return Le(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.overflow="hidden",X.style.whiteSpace="nowrap",this.colors.forEach(function(se){var Z=M.getColorBox(se);X.appendChild(Z),M.colorBoxes.push(Z)}),X},O.prototype.getColorBox=function(M){var X=this,se=this.uiStyleSettings.toolbarHeight/4,Z=this.uiStyleSettings.toolbarHeight-se,Pe=document.createElement("div");Pe.style.display="inline-block",Pe.style.boxSizing="content-box",Pe.style.width=Z-2+"px",Pe.style.height=Z-2+"px",Pe.style.padding="1px",Pe.style.marginRight="2px",Pe.style.marginBottom="2px",Pe.style.borderWidth="2px",Pe.style.borderStyle="solid",Pe.style.borderRadius=(Z+2)/2+"px",Pe.style.borderColor=M===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",Pe.addEventListener("click",function(){X.setCurrentColor(M,Pe)});var st=document.createElement("div");return st.style.display="inline-block",st.style.width=Z-2+"px",st.style.height=Z-2+"px",st.style.backgroundColor=M,st.style.borderRadius=Z/2+"px",M==="transparent"&&(st.style.fill=this.uiStyleSettings.toolboxAccentColor,st.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),Pe.appendChild(st),Pe},O.prototype.setCurrentColor=function(M,X){var se=this;this.currentColor=M,this.colorBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(M)},O}(Re),Qe=function(){function q(O,M,X){this._state="new",this._isSelected=!1,this._container=O,this._overlayContainer=M,this.globalSettings=X,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(q.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),q.prototype.ownsTarget=function(O){return!1},Object.defineProperty(q.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),q.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},q.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},q.prototype.pointerDown=function(O,M){},q.prototype.dblClick=function(O,M){},q.prototype.manipulate=function(O){},q.prototype.pointerUp=function(O){this.stateChanged()},q.prototype.dispose=function(){},q.prototype.addMarkerVisualToContainer=function(O){this.container.childNodes.length>0?this.container.insertBefore(O,this.container.childNodes[0]):this.container.appendChild(O)},q.prototype.getState=function(){return{typeName:q.typeName,state:this.state,notes:this.notes}},q.prototype.restoreState=function(O){this._state=O.state,this.notes=O.notes},q.prototype.scale=function(O,M){},q.prototype.colorChanged=function(O){this.onColorChanged&&this.onColorChanged(O),this.stateChanged()},q.prototype.fillColorChanged=function(O){this.onFillColorChanged&&this.onFillColorChanged(O),this.stateChanged()},q.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var O=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),O.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(O)&&this.onStateChanged(this)}},q.typeName="MarkerBase",q}(),Ve=function(){function q(){this.findGripByVisual=this.findGripByVisual.bind(this)}return q.prototype.findGripByVisual=function(O){return this.topLeft.ownsTarget(O)?this.topLeft:this.topCenter.ownsTarget(O)?this.topCenter:this.topRight.ownsTarget(O)?this.topRight:this.centerLeft.ownsTarget(O)?this.centerLeft:this.centerRight.ownsTarget(O)?this.centerRight:this.bottomLeft.ownsTarget(O)?this.bottomLeft:this.bottomCenter.ownsTarget(O)?this.bottomCenter:this.bottomRight.ownsTarget(O)?this.bottomRight:void 0},q}(),Et=function(){function q(){this.GRIP_SIZE=10,this.visual=be.createGroup(),this.visual.appendChild(be.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(be.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(O){return O===this.visual||O===this.visual.childNodes[0]||O===this.visual.childNodes[1]},q}(),kt=function(){function q(){}return q.toITransformMatrix=function(O){return{a:O.a,b:O.b,c:O.c,d:O.d,e:O.e,f:O.f}},q.toSVGMatrix=function(O,M){return O.a=M.a,O.b=M.b,O.c=M.c,O.d=M.d,O.e=M.e,O.f=M.f,O},q}(),Vt=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.left=0,Z.top=0,Z.width=0,Z.height=0,Z.defaultSize={x:50,y:20},Z.offsetX=0,Z.offsetY=0,Z.rotationAngle=0,Z.CB_DISTANCE=10,Z._suppressMarkerCreateEvent=!1,Z.container.transform.baseVal.appendItem(be.createTransform()),Z.setupControlBox(),Z}return Le(O,q),Object.defineProperty(O.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(O.prototype,"visual",{get:function(){return this._visual},set:function(M){this._visual=M;var X=be.createTransform();this._visual.transform.baseVal.appendItem(X)},enumerable:!1,configurable:!0}),O.prototype.ownsTarget=function(M){return!!q.prototype.ownsTarget.call(this,M)||!!(this.controlGrips.findGripByVisual(M)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(M))},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.left=M.x,this.top=M.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var se=this.unrotatePoint(M);if(this.manipulationStartX=se.x,this.manipulationStartY=se.y,this.offsetX=se.x-this.left,this.offsetY=se.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(X),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(X)){this.activeGrip=this.rotatorGrip;var Z=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Z.x-this.width/2,this.top=Z.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var Pe=this.container.transform.baseVal.getItem(0);Pe.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(Pe,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},O.prototype.pointerUp=function(M){var X=this.state;q.prototype.pointerUp.call(this,M),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(M),this._state="select",X==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},O.prototype.moveVisual=function(M){this.visual.style.transform="translate("+M.x+"px, "+M.y+"px)"},O.prototype.manipulate=function(M){var X=this.unrotatePoint(M);this.state==="creating"?this.resize(M):this.state==="move"?(this.left=this.manipulationStartLeft+(X.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(X.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(X):this.state==="rotate"&&this.rotate(M)},O.prototype.resize=function(M){var X=this.manipulationStartLeft,se=this.manipulationStartWidth,Z=this.manipulationStartTop,Pe=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:X=this.manipulationStartLeft+M.x-this.manipulationStartX,se=this.manipulationStartWidth+this.manipulationStartLeft-X;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:se=this.manipulationStartWidth+M.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Z=this.manipulationStartTop+M.y-this.manipulationStartY,Pe=this.manipulationStartHeight+this.manipulationStartTop-Z;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:Pe=this.manipulationStartHeight+M.y-this.manipulationStartY}se>=0?(this.left=X,this.width=se):(this.left=X+se,this.width=-se),Pe>=0?(this.top=Z,this.height=Pe):(this.top=Z+Pe,this.height=-Pe),this.setSize()},O.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},O.prototype.rotate=function(M){if(Math.abs(M.x-this.centerX)>.1){var X=Math.sign(M.x-this.centerX);this.rotationAngle=180*Math.atan((M.y-this.centerY)/(M.x-this.centerX))/Math.PI+90*X,this.applyRotation()}},O.prototype.applyRotation=function(){var M=this.container.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(M,0)},O.prototype.rotatePoint=function(M){if(this.rotationAngle===0)return M;var X=this.container.getCTM(),se=be.createPoint(M.x,M.y);return{x:(se=se.matrixTransform(X)).x,y:se.y}},O.prototype.unrotatePoint=function(M){if(this.rotationAngle===0)return M;var X=this.container.getCTM();X=X.inverse();var se=be.createPoint(M.x,M.y);return{x:(se=se.matrixTransform(X)).x,y:se.y}},O.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},O.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},O.prototype.setupControlBox=function(){this.controlBox=be.createGroup();var M=be.createTransform();M.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(M),this.container.appendChild(this.controlBox),this.controlRect=be.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=be.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new Ve,this.addControlGrips(),this.controlBox.style.display="none"},O.prototype.adjustControlBox=function(){var M=this.controlBox.transform.baseVal.getItem(0);M.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(M,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},O.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},O.prototype.createGrip=function(){var M=new Et;return M.visual.transform.baseVal.appendItem(be.createTransform()),this.controlBox.appendChild(M.visual),M},O.prototype.positionGrips=function(){var M=this.controlGrips.topLeft.GRIP_SIZE,X=-M/2,se=X,Z=(this.width+this.CB_DISTANCE)/2-M/2,Pe=(this.height+this.CB_DISTANCE)/2-M/2,st=this.height+this.CB_DISTANCE-M/2,wt=this.width+this.CB_DISTANCE-M/2;this.positionGrip(this.controlGrips.topLeft.visual,X,se),this.positionGrip(this.controlGrips.topCenter.visual,Z,se),this.positionGrip(this.controlGrips.topRight.visual,wt,se),this.positionGrip(this.controlGrips.centerLeft.visual,X,Pe),this.positionGrip(this.controlGrips.centerRight.visual,wt,Pe),this.positionGrip(this.controlGrips.bottomLeft.visual,X,st),this.positionGrip(this.controlGrips.bottomCenter.visual,Z,st),this.positionGrip(this.controlGrips.bottomRight.visual,wt,st),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Z,se-3*this.CB_DISTANCE)},O.prototype.positionGrip=function(M,X,se){var Z=M.transform.baseVal.getItem(0);Z.setTranslate(X,se),M.transform.baseVal.replaceItem(Z,0)},O.prototype.hideControlBox=function(){this.controlBox.style.display="none"},O.prototype.showControlBox=function(){this.controlBox.style.display=""},O.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:kt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:kt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},q.prototype.getState.call(this))},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.left=X.left,this.top=X.top,this.width=X.width,this.height=X.height,this.rotationAngle=X.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(kt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,X.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(kt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,X.containerTransformMatrix))},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X);var se=this.rotatePoint({x:this.left,y:this.top}),Z=this.unrotatePoint({x:se.x*M,y:se.y*X});this.left=Z.x,this.top=Z.y,this.width=this.width*M,this.height=this.height*X,this.adjustControlBox()},O}(Qe),Qt=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z}return Le(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual)},O.prototype.createVisual=function(){this.visual=be.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.manipulate=function(M){q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.setSize()},O.prototype.setSize=function(){q.prototype.setSize.call(this),be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},O.prototype.pointerUp=function(M){q.prototype.pointerUp.call(this,M),this.setSize()},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&be.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},O.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&be.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&be.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&be.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},O.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this))},O.prototype.restoreState=function(M){var X=M;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.opacity=X.opacity,this.createVisual(),q.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setSize()},O.title="Rectangle marker",O}(Vt),an=function(q){function O(M,X,se,Z){var Pe=q.call(this,M,Z||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return Pe.widths=[],Pe.widthBoxes=[],Pe.widths=X,Pe.currentWidth=se,Pe.setCurrentWidth=Pe.setCurrentWidth.bind(Pe),Pe}return Le(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",this.widths.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.flexGrow="2",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=se===M.currentWidth?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentWidth(se,Z)}),X.appendChild(Z);var Pe=document.createElement("div");Pe.innerText=se.toString(),Pe.style.marginRight="5px",Z.appendChild(Pe);var st=document.createElement("div");st.style.minHeight="20px",st.style.flexGrow="2",st.style.display="flex",st.style.alignItems="center";var wt=document.createElement("hr");wt.style.minWidth="20px",wt.style.border="0px",wt.style.borderTop=se+"px solid "+M.uiStyleSettings.toolboxColor,wt.style.flexGrow="2",st.appendChild(wt),Z.appendChild(st),M.widthBoxes.push(Z)}),X},O.prototype.setCurrentWidth=function(M,X){var se=this;this.currentWidth=M,this.widthBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},O}(Re),sn=function(q){function O(M,X,se,Z){var Pe=q.call(this,M,Z||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return Pe.styles=[],Pe.styleBoxes=[],Pe.styles=X,Pe.currentStyle=se,Pe.setCurrentStyle=Pe.setCurrentStyle.bind(Pe),Pe}return Le(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",this.styles.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/M.styles.length-5+"%",Z.style.borderColor=se===M.currentStyle?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentStyle(se,Z)}),X.appendChild(Z);var Pe=document.createElement("div");Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.overflow="hidden";var st=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+M.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(se!==""?'stroke-dasharray="'+se+'"':"")+` />
</svg>`;Pe.innerHTML=st,Z.appendChild(Pe),M.styleBoxes.push(Z)}),X},O.prototype.setCurrentStyle=function(M,X){var se=this;this.currentStyle=M,this.styleBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},O}(Re),qe=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new Be("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new sn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Le(O,q),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="FrameMarker",O.title="Frame marker",O.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',O}(Qt),Ze=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1},Ct=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.x1=0,Z.y1=0,Z.x2=0,Z.y2=0,Z.defaultLength=50,Z.manipulationStartX=0,Z.manipulationStartY=0,Z.manipulationStartX1=0,Z.manipulationStartY1=0,Z.manipulationStartX2=0,Z.manipulationStartY2=0,Z.setupControlBox(),Z}return Le(O,q),O.prototype.ownsTarget=function(M){return!!q.prototype.ownsTarget.call(this,M)||!(!this.grip1.ownsTarget(M)&&!this.grip2.ownsTarget(M))},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.manipulationStartX=M.x,this.manipulationStartY=M.y,this.state==="new"&&(this.x1=M.x,this.y1=M.y,this.x2=M.x,this.y2=M.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(X)?this.activeGrip=this.grip1:this.grip2.ownsTarget(X)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},O.prototype.pointerUp=function(M){var X=this.state;q.prototype.pointerUp.call(this,M),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(M),this._state="select",X==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},O.prototype.adjustVisual=function(){},O.prototype.manipulate=function(M){this.state==="creating"?this.resize(M):this.state==="move"?(this.x1=this.manipulationStartX1+M.x-this.manipulationStartX,this.y1=this.manipulationStartY1+M.y-this.manipulationStartY,this.x2=this.manipulationStartX2+M.x-this.manipulationStartX,this.y2=this.manipulationStartY2+M.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(M)},O.prototype.resize=function(M){switch(this.activeGrip){case this.grip1:this.x1=M.x,this.y1=M.y;break;case this.grip2:case void 0:this.x2=M.x,this.y2=M.y}this.adjustVisual(),this.adjustControlBox()},O.prototype.select=function(){q.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},O.prototype.deselect=function(){q.prototype.deselect.call(this),this.controlBox.style.display="none"},O.prototype.setupControlBox=function(){this.controlBox=be.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},O.prototype.adjustControlBox=function(){this.positionGrips()},O.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},O.prototype.createGrip=function(){var M=new Et;return M.visual.transform.baseVal.appendItem(be.createTransform()),this.controlBox.appendChild(M.visual),M},O.prototype.positionGrips=function(){var M=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-M/2,this.y1-M/2),this.positionGrip(this.grip2.visual,this.x2-M/2,this.y2-M/2)},O.prototype.positionGrip=function(M,X,se){var Z=M.transform.baseVal.getItem(0);Z.setTranslate(X,se),M.transform.baseVal.replaceItem(Z,0)},O.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},q.prototype.getState.call(this))},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.x1=X.x1,this.y1=X.y1,this.x2=X.x2,this.y2=X.y2},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.x1=this.x1*M,this.y1=this.y1*X,this.x2=this.x2*M,this.y2=this.y2*X,this.adjustVisual(),this.adjustControlBox()},O}(Qe),At=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new Be("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new sn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Le(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorLine&&M!==this.visibleLine)},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.selectorLine=be.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=be.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},O.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),be.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),be.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),be.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.createVisual(),this.adjustVisual()},O.typeName="LineMarker",O.title="Line marker",O.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',O}(Ct),ct=function(q){function O(M,X,se,Z){var Pe=q.call(this,M,Z||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return Pe.fonts=[],Pe.fontBoxes=[],Pe.fonts=X,Pe.currentFont=se,Pe.setCurrentFont=Pe.setCurrentFont.bind(Pe),Pe}return Le(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.overflow="hidden",X.style.flexGrow="2",this.fonts.forEach(function(se){var Z=document.createElement("div");Z.style.display="inline-block",Z.style.alignItems="center",Z.style.justifyContent="space-between",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.overflow="hidden",Z.style.maxWidth=100/M.fonts.length-5+"%",Z.style.borderColor=se===M.currentFont?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentFont(se,Z)}),X.appendChild(Z);var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.minHeight="20px",Pe.style.flexGrow="2",Pe.style.fontFamily=se,Pe.style.overflow="hidden";var st=document.createElement("div");st.style.whiteSpace="nowrap",st.style.overflow="hidden",st.style.textOverflow="ellipsis",st.innerHTML="The quick brown fox jumps over the lazy dog",Pe.appendChild(st),Z.appendChild(Pe),M.fontBoxes.push(Z)}),X},O.prototype.setCurrentFont=function(M,X){var se=this;this.currentFont=M,this.fontBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},O}(Re),ft=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.color="transparent",Z.padding=5,Z.DEFAULT_TEXT="your text here",Z.text=Z.DEFAULT_TEXT,Z.isMoved=!1,Z.color=se.defaultColor,Z.fontFamily=se.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setColor=Z.setColor.bind(Z),Z.setFont=Z.setFont.bind(Z),Z.renderText=Z.renderText.bind(Z),Z.sizeText=Z.sizeText.bind(Z),Z.textEditDivClicked=Z.textEditDivClicked.bind(Z),Z.showTextEditor=Z.showTextEditor.bind(Z),Z.setSize=Z.setSize.bind(Z),Z.positionTextEditor=Z.positionTextEditor.bind(Z),Z.colorPanel=new Be("Color",se.defaultColorSet,se.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.fontFamilyPanel=new ct("Font",se.defaultFontFamilies,se.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z}return Le(O,q),O.prototype.ownsTarget=function(M){if(q.prototype.ownsTarget.call(this,M)||M===this.visual||M===this.textElement||M===this.bgRectangle)return!0;var X=!1;return this.textElement.childNodes.forEach(function(se){se===M&&(X=!0)}),X},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.bgRectangle=be.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=be.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(be.createTransform()),this.textElement.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.isMoved=!1,this.pointerDownPoint=M,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.renderText=function(){var M=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(X){M.textElement.appendChild(be.createTSpan(X.trim()===""?" ":X.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},O.prototype.getTextScale=function(){var M=this.textElement.getBBox(),X=1;if(M.width>0&&M.height>0){var se=(1*this.width-this.width*this.padding*2/100)/M.width,Z=(1*this.height-this.height*this.padding*2/100)/M.height;X=Math.min(se,Z)}return X},O.prototype.getTextPosition=function(M){var X=this.textElement.getBBox(),se=0,Z=0;return X.width>0&&X.height>0&&(se=(this.width-X.width*M)/2,Z=this.height/2-X.height*M/2),{x:se,y:Z}},O.prototype.sizeText=function(){var M=this.textElement.getBBox(),X=this.getTextScale(),se=this.getTextPosition(X);se.y-=M.y*X,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+se.x+"px, "+se.y+"px) scale("+X+", "+X+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(se.x,se.y),this.textElement.transform.baseVal.getItem(1).setScale(X,X))},O.prototype.manipulate=function(M){q.prototype.manipulate.call(this,M),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(M.x-this.pointerDownPoint.x)>5||Math.abs(M.y-this.pointerDownPoint.y)>5)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.isMoved=!0,this.setSize(),this.sizeText()},O.prototype.setSize=function(){q.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},O.prototype.pointerUp=function(M){var X=this.state;X==="creating"&&(this._suppressMarkerCreateEvent=!0),q.prototype.pointerUp.call(this,M),this.setSize(),(X==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},O.prototype.showTextEditor=function(){var M=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(X){X.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var X=Number.parseFloat(M.textEditor.style.fontSize);M.textEditor.clientWidth>=Number.parseInt(M.textEditor.style.maxWidth)&&X>.9;)X-=.1,M.textEditor.style.fontSize=Math.max(X,.9)+"em"}),this.textEditor.addEventListener("keyup",function(X){X.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(X){if(X.clipboardData){var se=X.clipboardData.getData("text"),Z=window.getSelection();if(!Z.rangeCount)return!1;Z.deleteFromDocument(),Z.getRangeAt(0).insertNode(document.createTextNode(se)),X.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){M.textEditDivClicked(M.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},O.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var M=this.getTextScale(),X=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),se=this.textElement.getBBox(),Z={x:se.width*M,y:se.height*M};X.x-=Z.x/2,X.y-=Z.y/2,this.textEditor.style.top=X.y+"px",this.textEditor.style.left=X.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-X.x+"px",this.textEditor.style.fontSize=Math.max(16*M,12)+"px",this.textElement.style.display="none"}},O.prototype.textEditDivClicked=function(M){this.text=M.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},O.prototype.select=function(){q.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},O.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),q.prototype.deselect.call(this)},O.prototype.dblClick=function(M,X){q.prototype.dblClick.call(this,M,X),this.showTextEditor()},O.prototype.setColor=function(M){this.textElement&&be.setAttributes(this.textElement,[["fill",M]]),this.color=M,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(M)},O.prototype.setFont=function(M){this.textElement&&be.setAttributes(this.textElement,[["font-family",M]]),this.fontFamily=M,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},O.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},O.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var X=M;this.color=X.color,this.fontFamily=X.fontFamily,this.padding=X.padding,this.text=X.text,this.createVisual(),q.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setSize(),this.sizeText(),this.positionTextEditor()},O.typeName="TextMarker",O.title="Text marker",O.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',O}(Vt),He=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.color="transparent",Z.lineWidth=3,Z.drawing=!1,Z.pixelRatio=1,Z.color=se.defaultColor,Z.lineWidth=se.defaultStrokeWidth,Z.pixelRatio=se.freehandPixelRatio,Z.setColor=Z.setColor.bind(Z),Z.addCanvas=Z.addCanvas.bind(Z),Z.finishCreation=Z.finishCreation.bind(Z),Z.setLineWidth=Z.setLineWidth.bind(Z),Z.colorPanel=new Be("Color",se.defaultColorSet,se.defaultColor),Z.colorPanel.onColorChanged=Z.setColor,Z.lineWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.lineWidthPanel.onWidthChanged=Z.setLineWidth,Z}return Le(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.drawingImage)},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.drawingImage=be.createImage(),this.visual.appendChild(this.drawingImage);var M=be.createTransform();this.visual.transform.baseVal.appendItem(M),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(M.x,M.y),this.drawing=!0):q.prototype.pointerDown.call(this,M,X)},O.prototype.manipulate=function(M){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(M.x,M.y),this.canvasContext.stroke()):q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),be.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},O.prototype.pointerUp=function(M){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):q.prototype.pointerUp.call(this,M)},O.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},O.prototype.select=function(){this.state==="creating"&&this.finishCreation(),q.prototype.select.call(this)},O.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),q.prototype.deselect.call(this)},O.prototype.finishCreation=function(){for(var M=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),X=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],se=X[0],Z=X[1],Pe=X[2],st=X[3],wt=!1,Pt=0;Pt<this.canvasElement.height;Pt++)for(var dt=0;dt<this.canvasElement.width;dt++)M.data[Pt*this.canvasElement.width*4+4*dt+3]>0&&(wt=!0,Pt<Z&&(Z=Pt),dt<se&&(se=dt),Pt>st&&(st=Pt),dt>Pe&&(Pe=dt));if(wt){this.left=se/this.pixelRatio,this.top=Z/this.pixelRatio,this.width=(Pe-se)/this.pixelRatio,this.height=(st-Z)/this.pixelRatio;var bt=document.createElement("canvas");bt.width=Pe-se,bt.height=st-Z,bt.getContext("2d").putImageData(this.canvasContext.getImageData(se,Z,Pe-se,st-Z),0,0),this.drawingImgUrl=bt.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},O.prototype.setDrawingImage=function(){be.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),be.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},O.prototype.setColor=function(M){this.color=M,this.colorChanged(M)},O.prototype.setLineWidth=function(M){this.lineWidth=M},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({drawingImgUrl:this.drawingImgUrl},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){this.createVisual(),q.prototype.restoreState.call(this,M),this.drawingImgUrl=M.drawingImgUrl,this.setDrawingImage()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setDrawingImage()},O.typeName="FreehandMarker",O.title="Freehand marker",O.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',O}(Vt),Ne=function(q){function O(M,X,se){var Z=q.call(this,M,se||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Z.typeBoxes=[],Z.currentType=X,Z.setCurrentType=Z.setCurrentType.bind(Z),Z}return Le(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2";for(var se=function(st){var wt="both";switch(st){case 0:wt="both";break;case 1:wt="start";break;case 2:wt="end";break;case 3:wt="none"}var Pt=document.createElement("div");if(Pt.style.display="flex",Pt.style.flexGrow="2",Pt.style.alignItems="center",Pt.style.justifyContent="space-between",Pt.style.padding="5px",Pt.style.borderWidth="2px",Pt.style.borderStyle="solid",Pt.style.borderColor=wt===Z.currentType?Z.uiStyleSettings.toolboxAccentColor:"transparent",Pt.addEventListener("click",function(){M.setCurrentType(wt,Pt)}),X.appendChild(Pt),wt==="both"||wt==="start"){var dt=document.createElement("div");dt.style.display="flex",dt.style.alignItems="center",dt.style.minHeight="20px",dt.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,dt.style.marginLeft="5px",Pt.appendChild(dt)}var bt=document.createElement("div");bt.style.display="flex",bt.style.alignItems="center",bt.style.minHeight="20px",bt.style.flexGrow="2";var Mt=document.createElement("hr");if(Mt.style.minWidth="20px",Mt.style.border="0px",Mt.style.borderTop="3px solid "+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee"),Mt.style.flexGrow="2",bt.appendChild(Mt),Pt.appendChild(bt),wt==="both"||wt==="end"){var Cn=document.createElement("div");Cn.style.display="flex",Cn.style.alignItems="center",Cn.style.minHeight="20px",Cn.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(Z.uiStyleSettings!==void 0?Z.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Cn.style.marginRight="5px",Pt.appendChild(Cn)}Z.typeBoxes.push(Pt)},Z=this,Pe=0;Pe<4;Pe++)se(Pe);return X},O.prototype.setCurrentType=function(M,X){var se=this;this.currentType=M,this.typeBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings!==void 0?se.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},O}(Re),Ue=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.arrowType="end",Z.arrowBaseHeight=10,Z.arrowBaseWidth=10,Z.getArrowPoints=Z.getArrowPoints.bind(Z),Z.setArrowType=Z.setArrowType.bind(Z),Z.arrowTypePanel=new Ne("Arrow type","end"),Z.arrowTypePanel.onArrowTypeChanged=Z.setArrowType,Z}return Le(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.arrow1&&M!==this.arrow2)},O.prototype.getArrowPoints=function(M,X){var se=this.arrowBaseWidth+2*this.strokeWidth,Z=this.arrowBaseHeight+2*this.strokeWidth;return M-se/2+","+(X+Z/2)+" "+M+","+(X-Z/2)+" "+(M+se/2)+","+(X+Z/2)},O.prototype.createTips=function(){this.arrow1=be.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=be.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.arrow2)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="creating"&&this.createTips()},O.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2&&(this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",be.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),be.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),X=this.arrow1.transform.baseVal.getItem(0);X.setRotate(M,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(X,0);var se=this.arrow2.transform.baseVal.getItem(0);se.setRotate(M+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(se,0)}},O.prototype.setArrowType=function(M){this.arrowType=M,this.adjustVisual(),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({arrowType:this.arrowType},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.arrowType=X.arrowType,this.createTips(),this.adjustVisual()},O.typeName="ArrowMarker",O.title="Arrow marker",O.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',O}(At),ge=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.fillColor=se.defaultFillColor,Z.strokeWidth=0,Z.fillPanel=new Be("Color",se.defaultColorSet,se.defaultFillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z}return Le(O,q),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="CoverMarker",O.title="Cover marker",O.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',O}(Qt),Ee=function(q){function O(M,X,se,Z){var Pe=q.call(this,M,Z||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return Pe.opacities=[],Pe.opacityBoxes=[],Pe.opacities=X,Pe.currentOpacity=se,Pe.setCurrentOpacity=Pe.setCurrentOpacity.bind(Pe),Pe}return Le(O,q),O.prototype.getUi=function(){var M=this,X=document.createElement("div");return X.style.display="flex",X.style.overflow="hidden",X.style.flexGrow="2",X.style.justifyContent="space-between",this.opacities.forEach(function(se){var Z=document.createElement("div");Z.style.display="flex",Z.style.alignItems="center",Z.style.justifyContent="center",Z.style.padding="5px",Z.style.borderWidth="2px",Z.style.borderStyle="solid",Z.style.borderColor=se===M.currentOpacity?M.uiStyleSettings.toolboxAccentColor:"transparent",Z.addEventListener("click",function(){M.setCurrentOpacity(se,Z)}),X.appendChild(Z);var Pe=document.createElement("div");Pe.innerText=100*se+"%",Z.appendChild(Pe),M.opacityBoxes.push(Z)}),X},O.prototype.setCurrentOpacity=function(M,X){var se=this;this.currentOpacity=M,this.opacityBoxes.forEach(function(Z){Z.style.borderColor=Z===X?se.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},O}(Re),De=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.setOpacity=Z.setOpacity.bind(Z),Z.fillColor=se.defaultHighlightColor,Z.strokeWidth=0,Z.opacity=se.defaultHighlightOpacity,Z.fillPanel=new Be("Color",se.defaultColorSet,Z.fillColor),Z.fillPanel.onColorChanged=Z.setFillColor,Z.opacityPanel=new Ee("Opacity",se.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return Le(O,q),O.prototype.setOpacity=function(M){this.opacity=M,this.visual&&be.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="HighlightMarker",O.title="Highlight marker",O.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',O}(ge),ue='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Fe=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.bgColor="transparent",Z.tipPosition={x:0,y:0},Z.tipBase1Position={x:0,y:0},Z.tipBase2Position={x:0,y:0},Z.tipMoving=!1,Z.color=se.defaultStrokeColor,Z.bgColor=se.defaultFillColor,Z.fontFamily=se.defaultFontFamily,Z.defaultSize={x:100,y:30},Z.setBgColor=Z.setBgColor.bind(Z),Z.getTipPoints=Z.getTipPoints.bind(Z),Z.positionTip=Z.positionTip.bind(Z),Z.setTipPoints=Z.setTipPoints.bind(Z),Z.colorPanel=new Be("Text color",se.defaultColorSet,Z.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),Z.colorPanel.onColorChanged=Z.setColor,Z.bgColorPanel=new Be("Fill color",se.defaultColorSet,Z.bgColor,ue),Z.bgColorPanel.onColorChanged=Z.setBgColor,Z.fontFamilyPanel=new ct("Font",se.defaultFontFamilies,se.defaultFontFamily),Z.fontFamilyPanel.onFontChanged=Z.setFont,Z.tipGrip=new Et,Z.tipGrip.visual.transform.baseVal.appendItem(be.createTransform()),Z.controlBox.appendChild(Z.tipGrip.visual),Z}return Le(O,q),O.prototype.ownsTarget=function(M){return q.prototype.ownsTarget.call(this,M)||this.tipGrip.ownsTarget(M)||this.tip===M},O.prototype.createTip=function(){be.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=be.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},O.prototype.pointerDown=function(M,X){this.state==="new"&&q.prototype.pointerDown.call(this,M,X),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(X)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):q.prototype.pointerDown.call(this,M,X)},O.prototype.pointerUp=function(M){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,q.prototype.pointerUp.call(this,M);else{var X=this.state==="creating";q.prototype.pointerUp.call(this,M),this.setTipPoints(X),this.positionTip()}},O.prototype.manipulate=function(M){if(this.tipMoving){var X=this.unrotatePoint(M);this.tipPosition={x:X.x-this.manipulationStartLeft,y:X.y-this.manipulationStartTop},this.positionTip()}else q.prototype.manipulate.call(this,M)},O.prototype.setBgColor=function(M){this.bgRectangle&&this.tip&&(be.setAttributes(this.bgRectangle,[["fill",M]]),be.setAttributes(this.tip,[["fill",M]])),this.bgColor=M,this.fillColorChanged(M)},O.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},O.prototype.setTipPoints=function(M){M===void 0&&(M=!1);var X=Math.min(this.height/2,15),se=this.height/5;M&&(this.tipPosition={x:X+se/2,y:this.height+20});var Z=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Z<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(se=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:X,y:0},this.tipBase2Position={x:X+se,y:0}):(this.tipBase1Position={x:0,y:X},this.tipBase2Position={x:0,y:X+se}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Z<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(se=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-X-se,y:0},this.tipBase2Position={x:this.width-X,y:0}):(this.tipBase1Position={x:this.width,y:X},this.tipBase2Position={x:this.width,y:X+se}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Z<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(se=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-X-se,y:this.height},this.tipBase2Position={x:this.width-X,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-X-se},this.tipBase2Position={x:this.width,y:this.height-X}):Z<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(se=this.width/5,X=Math.min(this.width/2,15),this.tipBase1Position={x:X,y:this.height},this.tipBase2Position={x:X+se,y:this.height}):(this.tipBase1Position={x:0,y:this.height-X},this.tipBase2Position={x:0,y:this.height-X-se})},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.positionTip()},O.prototype.positionTip=function(){be.setAttributes(this.tip,[["points",this.getTipPoints()]]);var M=this.tipGrip.visual.transform.baseVal.getItem(0);M.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(M,0)},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),O.prototype.select=function(){this.positionTip(),q.prototype.select.call(this)},O.prototype.getState=function(){var M=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var X=M;this.bgColor=X.bgColor,this.tipPosition=X.tipPosition,q.prototype.restoreState.call(this,M),this.createTip(),this.setTipPoints()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.tipPosition={x:this.tipPosition.x*M,y:this.tipPosition.y*X},this.positionTip()},O.typeName="CalloutMarker",O.title="Callout marker",O.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',O}(ft),at=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.fillColor="transparent",Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.opacity=1,Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.fillColor=se.defaultFillColor,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setFillColor=Z.setFillColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.setOpacity=Z.setOpacity.bind(Z),Z.createVisual=Z.createVisual.bind(Z),Z.strokePanel=new Be("Line color",pe(se.defaultColorSet,["transparent"]),se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.fillPanel=new Be("Fill color",pe(se.defaultColorSet,["transparent"]),Z.fillColor,ue),Z.fillPanel.onColorChanged=Z.setFillColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new sn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z.opacityPanel=new Ee("Opacity",se.defaultOpacitySteps,Z.opacity),Z.opacityPanel.onOpacityChanged=Z.setOpacity,Z}return Le(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual)},O.prototype.createVisual=function(){this.visual=be.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="new"&&(this.createVisual(),this.moveVisual(M),this._state="creating")},O.prototype.manipulate=function(M){q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){q.prototype.resize.call(this,M),this.setSize()},O.prototype.setSize=function(){q.prototype.setSize.call(this),be.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},O.prototype.pointerUp=function(M){q.prototype.pointerUp.call(this,M),this.setSize()},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.visual&&be.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(M),this.stateChanged()},O.prototype.setFillColor=function(M){this.fillColor=M,this.visual&&be.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(M),this.stateChanged()},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.visual&&be.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.visual&&be.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},O.prototype.setOpacity=function(M){this.opacity=M,this.visual&&be.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){var X=M;this.fillColor=X.fillColor,this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.opacity=X.opacity,this.createVisual(),q.prototype.restoreState.call(this,M),this.setSize()},O.prototype.scale=function(M,X){q.prototype.scale.call(this,M,X),this.setSize()},O.typeName="EllipseMarker",O.title="Ellipse marker",O.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',O}(Vt),xt=function(q){function O(M,X,se){return q.call(this,M,X,se)||this}return Le(O,q),Object.defineProperty(O.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.tip1&&M!==this.tip2)},O.prototype.createTips=function(){this.tip1=be.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.tip1),this.tip2=be.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(be.createTransform()),this.visual.appendChild(this.tip2)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.state==="creating"&&this.createTips()},O.prototype.adjustVisual=function(){if(q.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(be.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),be.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var M=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),X=this.tip1.transform.baseVal.getItem(0);X.setRotate(M,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(X,0);var se=this.tip2.transform.baseVal.getItem(0);se.setRotate(M+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(se,0)}},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M),this.createTips(),this.adjustVisual()},O.typeName="MeasurementMarker",O.title="Measurement marker",O.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',O}(At),Kt=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokePanel.colors=se.defaultColorSet,Z.fillColor="transparent",Z}return Le(O,q),Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=q.prototype.getState.call(this);return M.typeName=O.typeName,M},O.typeName="EllipseFrameMarker",O.title="Ellipse frame marker",O.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',O}(at),Xt=function(){function q(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),q.prototype.addUndoStep=function(O){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(O)||(this.undoStack.push(O),JSON.stringify(this.lastRedoStep)!==JSON.stringify(O)&&this.redoStack.splice(0,this.redoStack.length))},q.prototype.replaceLastUndoStep=function(O){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=O)},q.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},q.prototype.undo=function(){if(this.undoStack.length>1){var O=this.undoStack.pop();return O!==void 0&&this.redoStack.push(O),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},q.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},q}(),$t=function(q){function O(M,X,se){var Z=q.call(this,M,X,se)||this;return Z.strokeColor="transparent",Z.strokeWidth=0,Z.strokeDasharray="",Z.curveX=0,Z.curveY=0,Z.manipulationStartCurveX=0,Z.manipulationStartCurveY=0,Z.setStrokeColor=Z.setStrokeColor.bind(Z),Z.setStrokeWidth=Z.setStrokeWidth.bind(Z),Z.setStrokeDasharray=Z.setStrokeDasharray.bind(Z),Z.positionGrips=Z.positionGrips.bind(Z),Z.addControlGrips=Z.addControlGrips.bind(Z),Z.adjustVisual=Z.adjustVisual.bind(Z),Z.setupControlBox=Z.setupControlBox.bind(Z),Z.resize=Z.resize.bind(Z),Z.strokeColor=se.defaultColor,Z.strokeWidth=se.defaultStrokeWidth,Z.strokeDasharray=se.defaultStrokeDasharray,Z.strokePanel=new Be("Line color",se.defaultColorSet,se.defaultColor),Z.strokePanel.onColorChanged=Z.setStrokeColor,Z.strokeWidthPanel=new an("Line width",se.defaultStrokeWidths,se.defaultStrokeWidth),Z.strokeWidthPanel.onWidthChanged=Z.setStrokeWidth,Z.strokeStylePanel=new sn("Line style",se.defaultStrokeDasharrays,se.defaultStrokeDasharray),Z.strokeStylePanel.onStyleChanged=Z.setStrokeDasharray,Z}return Le(O,q),O.prototype.ownsTarget=function(M){return!(!q.prototype.ownsTarget.call(this,M)&&M!==this.visual&&M!==this.selectorCurve&&M!==this.visibleCurve&&!this.curveGrip.ownsTarget(M))},O.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},O.prototype.createVisual=function(){this.visual=be.createGroup(),this.selectorCurve=be.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=be.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},O.prototype.pointerDown=function(M,X){q.prototype.pointerDown.call(this,M,X),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=M.x,this.curveY=M.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(X)&&(this.activeGrip=this.curveGrip,this._state="resize")},O.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),be.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),be.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),be.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},O.prototype.setupControlBox=function(){q.prototype.setupControlBox.call(this),this.curveControlLine1=be.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=be.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},O.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,q.prototype.addControlGrips.call(this)},O.prototype.positionGrips=function(){q.prototype.positionGrips.call(this);var M=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-M/2,this.curveY-M/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},O.prototype.manipulate=function(M){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+M.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+M.y-this.manipulationStartY),q.prototype.manipulate.call(this,M)},O.prototype.resize=function(M){this.activeGrip===this.curveGrip&&(this.curveX=M.x,this.curveY=M.y),q.prototype.resize.call(this,M),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},O.prototype.setStrokeColor=function(M){this.strokeColor=M,this.adjustVisual(),this.colorChanged(M)},O.prototype.setStrokeWidth=function(M){this.strokeWidth=M,this.adjustVisual()},O.prototype.setStrokeDasharray=function(M){this.strokeDasharray=M,this.adjustVisual()},O.prototype.scale=function(M,X){this.curveX=this.curveX*M,this.curveY=this.curveY*X,q.prototype.scale.call(this,M,X)},Object.defineProperty(O.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),O.prototype.getState=function(){var M=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},q.prototype.getState.call(this));return M.typeName=O.typeName,M},O.prototype.restoreState=function(M){q.prototype.restoreState.call(this,M);var X=M;this.strokeColor=X.strokeColor,this.strokeWidth=X.strokeWidth,this.strokeDasharray=X.strokeDasharray,this.curveX=X.curveX,this.curveY=X.curveY,this.createVisual(),this.adjustVisual()},O.typeName="CurveMarker",O.title="Curve marker",O.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',O}(Ct),$n=function(){function q(O,M){M===void 0&&(M=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=O,this.cancelable=M}return Object.defineProperty(q.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),q.prototype.preventDefault=function(){this._defaultPrevented=!0},q}(),vn=function(q){function O(M,X,se){var Z=q.call(this,M,!1)||this;return Z.dataUrl=X,Z.state=se,Z}return Le(O,q),O}($n),ln=function(q){function O(M,X,se){se===void 0&&(se=!1);var Z=q.call(this,M,se)||this;return Z.marker=X,Z}return Le(O,q),O}($n),hn=function(){function q(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return q.prototype.addEventListener=function(O,M){this[O].push(M)},q.prototype.removeEventListener=function(O,M){var X=this[O].indexOf(M);X>-1&&this[O].splice(X,1)},q}(),Gn=function(){function q(O){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Ze,this._isOpen=!1,this.undoRedoManager=new Xt,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new hn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=q.instanceCounter++,this.styles=new ke(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=O,this.targetRoot=document.body,this.width=O.clientWidth,this.height=O.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(q.prototype,"ALL_MARKER_TYPES",{get:function(){return[qe,He,Ue,ft,Kt,at,De,Fe,xt,ge,At,$t]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[qe,He,Ue,ft,at,De,Fe]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"BASIC_MARKER_TYPES",{get:function(){return[qe,He,Ue,ft,De]},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(O){var M=this;this._availableMarkerTypes.splice(0),O.forEach(function(X){if(typeof X=="string"){var se=M.ALL_MARKER_TYPES.find(function(Z){return Z.typeName===X});se!==void 0&&M._availableMarkerTypes.push(se)}else M._availableMarkerTypes.push(X)})},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(O){this._zoomLevel=O,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ne.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},q.prototype.show=function(){var O=this;this.styles.styleSheetRoot===void 0&&_e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=_e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(M){return M(new $n(O))})},q.prototype.render=function(){return we(this,void 0,void 0,function(){var O;return Ae(this,function(M){switch(M.label){case 0:return this.setCurrentMarker(),(O=new fe).naturalSize=this.renderAtNaturalSize,O.imageType=this.renderImageType,O.imageQuality=this.renderImageQuality,O.markersOnly=this.renderMarkersOnly,O.width=this.renderWidth,O.height=this.renderHeight,[4,O.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return M.sent(),[4,O.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,M.sent()]}})})},q.prototype.close=function(O){var M=this;if(O===void 0&&(O=!1),this.isOpen){var X=!1;O||this.eventListeners.beforeclose.forEach(function(se){var Z=new $n(M,!0);se(Z),Z.defaultPrevented&&(X=!0)}),X||(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(se){return se(new $n(M))}),this.detachEvents(),this._isOpen=!1)}},q.prototype.addMarkersToToolbar=function(){for(var O,M=[],X=0;X<arguments.length;X++)M[X]=arguments[X];(O=this._availableMarkerTypes).push.apply(O,M)},q.prototype.addRenderEventListener=function(O){this.addEventListener("render",function(M){O(M.dataUrl,M.state)})},q.prototype.removeRenderEventListener=function(O){},q.prototype.addCloseEventListener=function(O){this.addEventListener("close",function(){O()})},q.prototype.removeCloseEventListener=function(O){},q.prototype.setupResizeObserver=function(){var O=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){O.resize(O.target.clientWidth,O.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return O.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},q.prototype.onPopupTargetResize=function(){var O=1*this.target.clientWidth/this.target.clientHeight,M=this.editorCanvas.clientWidth/O>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*O:this.editorCanvas.clientWidth,X=M<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/O;this.resize(M,X)},q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},q.prototype.resize=function(O,M){this._isResizing=!0;var X=O/this.imageWidth,se=M/this.imageHeight;this.imageWidth=Math.round(O),this.imageHeight=Math.round(M),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(X,se),this._isResizing=!1},q.prototype.scaleMarkers=function(O,M){var X,se=this;this._currentMarker&&this._currentMarker instanceof ft?this._currentMarker.scale(O,M):(X=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Z){Z!==se._currentMarker&&Z.scale(O,M)}),X!==void 0&&this.setCurrentMarker(X)},q.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},q.prototype.setTopLeft=function(){var O=this.editingTarget.getBoundingClientRect(),M=this.editorCanvas.getBoundingClientRect();this.left=O.left-M.left,this.top=O.top-M.top},q.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},q.prototype.addDefs=function(){for(var O,M=[],X=0;X<arguments.length;X++)M[X]=arguments[X];this.defs=be.createDefs(),this.addDefsToImage(),(O=this.defs).append.apply(O,M)},q.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},q.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},q.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},q.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},q.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},q.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},q.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},q.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var O=document.createElement("a");O.href="https://markerjs.com/",O.target="_blank",O.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',O.title="Powered by marker.js",O.style.display="grid",O.style.alignItems="center",O.style.justifyItems="center",O.style.padding="3px",O.style.width="20px",O.style.height="20px",this.logoUI.appendChild(O),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},q.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},q.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var O=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new ot(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.target.getClientRects().item(0).y<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new _t(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},q.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.removeMarker=function(O){this.markerImage.removeChild(O.container),this.markers.indexOf(O)>-1&&this.markers.splice(this.markers.indexOf(O),1),O.dispose()},q.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},q.prototype.toolbarButtonClicked=function(O,M){if(O==="marker"&&M!==void 0)this.createNewMarker(M);else if(O==="action")switch(M){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},q.prototype.deleteSelectedMarker=function(){var O=this;if(this._currentMarker!==void 0){var M=!1;if(this.eventListeners.markerbeforedelete.forEach(function(se){var Z=new ln(O,O._currentMarker,!0);se(Z),Z.defaultPrevented&&(M=!0)}),!M){var X=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(se){return se(new ln(O,X))})}}},q.prototype.clear=function(){var O=this,M=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(Pe){var st=new ln(O,void 0,!0);Pe(st),st.defaultPrevented&&(M=!0)}),!M)){this.setCurrentMarker();for(var X=function(Pe){var st=se.markers[Pe];se.setCurrentMarker(se.markers[Pe]),se._currentMarker.dispose(),se.markerImage.removeChild(se._currentMarker.container),se.markers.splice(se.markers.indexOf(se._currentMarker),1),se.eventListeners.markerdelete.forEach(function(wt){return wt(new ln(O,st))})},se=this,Z=this.markers.length-1;Z>=0;Z--)X(Z);this.addUndoStep()}},Object.defineProperty(q.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),q.prototype.showNotesEditor=function(){var O;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(O=this._currentMarker.notes)!==null&&O!==void 0?O:"",this.overlayContainer.appendChild(this.notesArea))},q.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},q.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},q.prototype.addUndoStep=function(){var O=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var M=this.getState(),X=this.undoRedoManager.getLastUndoStep();if(!X||X.width===M.width&&X.height===M.height){var se=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(M),se<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Z){return Z(new $n(O))})}else this.undoRedoManager.replaceLastUndoStep(M),this.eventListeners.statechange.forEach(function(Z){return Z(new $n(O))})}},q.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},q.prototype.undoStep=function(){var O=this,M=this.undoRedoManager.undo();M!==void 0&&(this.restoreState(M),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(X){return X(new $n(O))}))},q.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},q.prototype.redoStep=function(){var O=this,M=this.undoRedoManager.redo();M!==void 0&&(this.restoreState(M),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(X){return X(new $n(O))}))},q.prototype.stepZoom=function(){var O=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=O<this.zoomSteps.length-1?this.zoomSteps[O+1]:this.zoomSteps[0]},q.prototype.panTo=function(O){this.contentDiv.scrollBy({left:this.prevPanPoint.x-O.x,top:this.prevPanPoint.y-O.y}),this.prevPanPoint=O},q.prototype.startRenderAndClose=function(){return we(this,void 0,void 0,function(){var O,M,X=this;return Ae(this,function(se){switch(se.label){case 0:return[4,this.render()];case 1:return O=se.sent(),M=this.getState(),this.eventListeners.render.forEach(function(Z){return Z(new vn(X,O,M))}),this.close(!0),[2]}})})},q.prototype.getState=function(O){O===!0&&this.setCurrentMarker();var M={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(X){return M.markers.push(X.getState())}),M},q.prototype.restoreState=function(O){var M=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);O.markers.forEach(function(X){var se=M._availableMarkerTypes.find(function(Pe){return Pe.typeName===X.typeName});if(se!==void 0){var Z=M.addNewMarker(se);Z.restoreState(X),M.markers.push(Z)}}),O.width&&O.height&&(O.width!==this.imageWidth||O.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/O.width,this.imageHeight/O.height),this.eventListeners.restorestate.forEach(function(X){return X(new $n(M))})},q.prototype.addNewMarker=function(O){var M=be.createGroup();return this.markerImage.appendChild(M),new O(M,this.overlayContainer,this.settings)},q.prototype.createNewMarker=function(O){var M,X=this;(M=typeof O=="string"?this._availableMarkerTypes.find(function(se){return se.typeName===O}):O)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(M),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(M.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(se){return se(new ln(X,X._currentMarker))}))},q.prototype.markerCreated=function(O){var M=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(O),this.setCurrentMarker(O),O instanceof He&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(He):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(X){return X(new ln(M,M._currentMarker))})},q.prototype.colorChanged=function(O){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=O,this.settings.defaultStrokeColor=O)},q.prototype.fillColorChanged=function(O){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=O)},q.prototype.markerStateChanged=function(O){var M=this;this.eventListeners.markerchange.forEach(function(X){return X(new ln(M,O))})},q.prototype.setCurrentMarker=function(O){var M=this;this._currentMarker!==O&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(X){return X(new ln(M,M._currentMarker))})),this._currentMarker=O,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(X){return X(new ln(M,M._currentMarker))}))},q.prototype.onPointerDown=function(O){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||O.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var M=this.markers.find(function(X){return X.ownsTarget(O.target)});M!==void 0?(this.setCurrentMarker(M),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(O.clientX,O.clientY),O.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:O.clientX,y:O.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(O.clientX,O.clientY))},q.prototype.onDblClick=function(O){if(this._isFocused||this.focus(),this.mode==="select"){var M=this.markers.find(function(X){return X.ownsTarget(O.target)});M!==void 0&&M!==this._currentMarker&&this.setCurrentMarker(M),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(O.clientX,O.clientY),O.target):this.setCurrentMarker()}},q.prototype.onPointerMove=function(O){this.touchPoints!==1&&O.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||O.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(O.clientX,O.clientY)):this.zoomLevel>1&&this.panTo({x:O.clientX,y:O.clientY}))},q.prototype.onPointerUp=function(O){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(O.clientX,O.clientY)),this.isDragging=!1,this.addUndoStep()},q.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},q.prototype.onKeyUp=function(O){this._currentMarker===void 0||this.notesArea!==void 0||O.key!=="Delete"&&O.key!=="Backspace"||this.deleteSelectedMarker()},q.prototype.clientToLocalCoordinates=function(O,M){var X=this.markerImage.getBoundingClientRect();return{x:(O-X.left)/this.zoomLevel,y:(M-X.top)/this.zoomLevel}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var O=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},q.prototype.addLicenseKey=function(O){ne.addKey(O)},q.prototype.addEventListener=function(O,M){this.eventListeners.addEventListener(O,M)},q.prototype.removeEventListener=function(O,M){this.eventListeners.removeEventListener(O,M)},q.prototype.renderState=function(O){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(O),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(q.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),q.prototype.focus=function(){var O=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(M){return M(new $n(O))}))},q.prototype.blur=function(){var O=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(M){return M(new $n(O))}))},q.instanceCounter=0,q}();/* **********************************
cropro version 1.2.0
@license SEE LICENSE IN LICENSE
copyright Alan Mendelevich
see README and LICENSE for details
********************************** *//*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var fr=function(q,O){return(fr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(M,X){M.__proto__=X}||function(M,X){for(var se in X)Object.prototype.hasOwnProperty.call(X,se)&&(M[se]=X[se])})(q,O)};function vr(q,O){if(typeof O!="function"&&O!==null)throw new TypeError("Class extends value "+String(O)+" is not a constructor or null");function M(){this.constructor=q}fr(q,O),q.prototype=O===null?Object.create(O):(M.prototype=O.prototype,new M)}function ir(q,O,M,X){return new(M||(M=Promise))(function(se,Z){function Pe(Pt){try{wt(X.next(Pt))}catch(dt){Z(dt)}}function st(Pt){try{wt(X.throw(Pt))}catch(dt){Z(dt)}}function wt(Pt){var dt;Pt.done?se(Pt.value):(dt=Pt.value,dt instanceof M?dt:new M(function(bt){bt(dt)})).then(Pe,st)}wt((X=X.apply(q,O||[])).next())})}function br(q,O){var M,X,se,Z,Pe={label:0,sent:function(){if(1&se[0])throw se[1];return se[1]},trys:[],ops:[]};return Z={next:st(0),throw:st(1),return:st(2)},typeof Symbol=="function"&&(Z[Symbol.iterator]=function(){return this}),Z;function st(wt){return function(Pt){return function(dt){if(M)throw new TypeError("Generator is already executing.");for(;Pe;)try{if(M=1,X&&(se=2&dt[0]?X.return:dt[0]?X.throw||((se=X.return)&&se.call(X),0):X.next)&&!(se=se.call(X,dt[1])).done)return se;switch(X=0,se&&(dt=[2&dt[0],se.value]),dt[0]){case 0:case 1:se=dt;break;case 4:return Pe.label++,{value:dt[1],done:!1};case 5:Pe.label++,X=dt[1],dt=[0];continue;case 7:dt=Pe.ops.pop(),Pe.trys.pop();continue;default:if(!(se=Pe.trys,(se=se.length>0&&se[se.length-1])||dt[0]!==6&&dt[0]!==2)){Pe=0;continue}if(dt[0]===3&&(!se||dt[1]>se[0]&&dt[1]<se[3])){Pe.label=dt[1];break}if(dt[0]===6&&Pe.label<se[1]){Pe.label=se[1],se=dt;break}if(se&&Pe.label<se[2]){Pe.label=se[2],Pe.ops.push(dt);break}se[2]&&Pe.ops.pop(),Pe.trys.pop();continue}dt=O.call(q,Pe)}catch(bt){dt=[6,bt],X=0}finally{M=se=0}if(5&dt[0])throw dt[1];return{value:dt[0]?dt[1]:void 0,done:!0}}([wt,Pt])}}}var Rr=function(){function q(){}return q.addKey=function(O){q.key=O},Object.defineProperty(q,"isLicensed",{get:function(){return!!q.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(q.key)},enumerable:!1,configurable:!0}),q}(),Jt=function(){function q(){}return q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},q.setAttributes=function(O,M){for(var X=0,se=M;X<se.length;X++){var Z=se[X],Pe=Z[0],st=Z[1];O.setAttribute(Pe,st)}},q.createRect=function(O,M,X){var se=document.createElementNS("http://www.w3.org/2000/svg","rect");return se.setAttribute("width",O.toString()),se.setAttribute("height",M.toString()),X&&q.setAttributes(se,X),se},q.createLine=function(O,M,X,se,Z){var Pe=document.createElementNS("http://www.w3.org/2000/svg","line");return Pe.setAttribute("x1",O.toString()),Pe.setAttribute("y1",M.toString()),Pe.setAttribute("x2",X.toString()),Pe.setAttribute("y2",se.toString()),Z&&q.setAttributes(Pe,Z),Pe},q.createPolygon=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","polygon");return X.setAttribute("points",O),M&&q.setAttributes(X,M),X},q.createCircle=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","circle");return X.setAttribute("cx",(O/2).toString()),X.setAttribute("cy",(O/2).toString()),X.setAttribute("r",O.toString()),M&&q.setAttributes(X,M),X},q.createEllipse=function(O,M,X){var se=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return se.setAttribute("cx",(O/2).toString()),se.setAttribute("cy",(M/2).toString()),se.setAttribute("rx",(O/2).toString()),se.setAttribute("ry",(M/2).toString()),X&&q.setAttributes(se,X),se},q.createGroup=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","g");return O&&q.setAttributes(M,O),M},q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},q.createMarker=function(O,M,X,se,Z,Pe,st){var wt=document.createElementNS("http://www.w3.org/2000/svg","marker");return q.setAttributes(wt,[["id",O],["orient",M],["markerWidth",X.toString()],["markerHeight",se.toString()],["refX",Z.toString()],["refY",Pe.toString()]]),wt.appendChild(st),wt},q.createText=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","text");return M.setAttribute("x","0"),M.setAttribute("y","0"),O&&q.setAttributes(M,O),M},q.createTSpan=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","tspan");return X.textContent=O,M&&q.setAttributes(X,M),X},q.createImage=function(O){var M=document.createElementNS("http://www.w3.org/2000/svg","image");return O&&q.setAttributes(M,O),M},q.createPoint=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return X.x=O,X.y=M,X},q.createPath=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg","path");return X.setAttribute("d",O),M&&q.setAttributes(X,M),X},q.createElement=function(O,M){var X=document.createElementNS("http://www.w3.org/2000/svg",O);return M&&q.setAttributes(X,M),X},q.getHollowRectanglePath=function(O,M,X,se,Z,Pe,st,wt){return"M"+O+","+M+"V"+(M+se)+"H"+(O+X)+"V"+M+"H"+Z+"V"+Pe+"H"+(Z+st)+"V"+(Pe+wt)+"H"+Z+"V"+M+"Z"},q}(),Ar=function(){function q(O){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+O+"_"}return Object.defineProperty(q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),q.prototype.addClass=function(O){return this.styleSheet===void 0&&this.addStyleSheet(),O.name=""+this.classNamePrefix+O.localName,this.classes.push(O),this.styleSheet.sheet.insertRule("."+O.name+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length),O},q.prototype.addRule=function(O){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(O),this.styleSheet.sheet.insertRule(O.selector+" {"+O.style+"}",this.styleSheet.sheet.cssRules.length)},q.prototype.addStyleSheet=function(){var O;this.styleSheet=document.createElement("style"),((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).appendChild(this.styleSheet),this.addRule(new Nn("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Nn("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new Nn("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new Tn("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new Tn("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},q.prototype.removeStyleSheet=function(){var O;this.styleSheet&&(((O=this.styleSheetRoot)!==null&&O!==void 0?O:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},q}(),Nn=function(q,O){this.selector=q,this.style=O},Tn=function(q,O){this.localName=q,this.style=O},pr=function(){function q(){this.blocks=[],this.display=""}return q.prototype.addButtonBlock=function(O){O.className=this.blockClassName,O.buttonClassName=this.buttonClassName,O.buttonColorsClassName=this.buttonColorsClassName,O.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(O)},q.prototype.addElementBlock=function(O){O.className===void 0&&(O.className=this.blockClassName),this.blocks.push(O)},q.prototype.getUI=function(){var O=document.createElement("div");return O.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,O.style.display=this.display,this.blocks.forEach(function(M){return O.appendChild(M.getUI())}),O},q}(),_r=function(){function q(){}return q.prototype.getUI=function(){var O=document.createElement("div");if(O.className=this.className,this.minWidth!==void 0&&(O.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":O.style.justifyContent="flex-start";break;case"center":O.style.justifyContent="center";break;case"end":O.style.justifyContent="flex-end"}return O.style.whiteSpace="nowrap",O},q}(),Pr=function(q){function O(){var M=q!==null&&q.apply(this,arguments)||this;return M.buttons=[],M}return vr(O,q),O.prototype.addButton=function(M){M.className=this.buttonClassName,M.colorsClassName=this.buttonColorsClassName,M.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(M)},O.prototype.getUI=function(){var M=q.prototype.getUI.call(this);return this.buttons.forEach(function(X){return M.appendChild(X.getUI())}),M},O}(_r),yr=function(){function q(O,M){this._isActive=!1,this._isHidden=!1,this._icon=O,this.title=M,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(q.prototype,"icon",{get:function(){return this._icon},set:function(O){this._icon=O,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isActive",{get:function(){return this._isActive},set:function(O){this._isActive=O,this.adjustClassName()},enumerable:!1,configurable:!0}),q.prototype.getUI=function(){var O=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return O.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},q.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},q.prototype.hide=function(){this._isHidden=!0},q}(),mt=function(q){function O(){var M=q!==null&&q.apply(this,arguments)||this;return M.elements=[],M}return vr(O,q),O.prototype.addElement=function(M){this.elements.push(M)},O.prototype.getUI=function(){var M=q.prototype.getUI.call(this);return this.elements.forEach(function(X){return M.appendChild(X)}),M},O}(_r),Ke=function(){function q(O,M){this.horizontal=O,this.vertical=M}return Object.defineProperty(q.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),q.prototype.getVerticalLength=function(O){return O/this.ratio},q.prototype.getHorizontalLength=function(O){return O*this.ratio},q}(),Ot=function(){function q(){}return q.getIcon=function(O,M){if(O>0&&M>0){var X=new Ke(O,M),se=X.ratio>=1?20:X.getHorizontalLength(20),Z=X.ratio<1?20:X.getVerticalLength(20),Pe=document.createElementNS("http://www.w3.org/2000/svg","svg");Pe.setAttribute("xmlns","http://www.w3.org/2000/svg"),Pe.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(Pe);var st=Jt.createDefs();Pe.appendChild(st);var wt=Jt.createElement("clipPath",[["id","text-bg-clip"]]);st.appendChild(wt);var Pt=Jt.createPath(Jt.getHollowRectanglePath((24-se)/2,(24-Z)/2,se,Z,(24-se)/2+2,(24-Z)/2+2,se-4,Z-4));Pe.appendChild(Pt);var dt=Jt.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);dt.appendChild(Jt.createTSpan(O+":"+M)),Pe.appendChild(dt);var bt=dt.getBBox();Jt.setAttributes(dt,[["x",((24-bt.width)/2).toString()],["y",((24-bt.height)/2-bt.y).toString()]]);var Mt=Jt.createPath(Jt.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(bt.width))/2,(24-Math.ceil(bt.height))/2,Math.ceil(bt.width),Math.ceil(bt.height)));return wt.appendChild(Mt),Jt.setAttributes(Pt,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(Pe),Pe.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},q}(),Me=function(q){function O(M,X,se){var Z=q.call(this,M,X)||this;return Z.isDropdownOpen=!1,Z.onClick=Z.dropdownButtonClicked,Z.dropdownButtons=se,Z}return vr(O,q),O.prototype.setupDropdown=function(){var M=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(X){X.className=M.className,X.colorsClassName=M.colorsClassName,M.dropdownBlock.appendChild(X.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},O.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},O.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},O.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},O.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},O.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},O}(yr),ye=function(){function q(O,M){this.GRIP_SIZE=10,this.color=O,this.fillColor=M,this.visual=Jt.createGroup(),this.visual.appendChild(Jt.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Jt.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return q.prototype.ownsTarget=function(O){return O===this.visual||O===this.visual.childNodes[0]||O===this.visual.childNodes[1]},q.prototype.setCenter=function(O,M){this.visual.childNodes.forEach(function(X){return Jt.setAttributes(X,[["cx",O.toString()],["cy",M.toString()]])})},q}(),ve=function(){function q(O,M,X,se){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=O,this.canvasHeight=M,this.margin=X,this.container=se,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(q.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(O){this._aspectRatio=O,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(O){this._isGridVisible=O,this.gridContainer&&Jt.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(O){this._zoomFactor=O,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),q.prototype.open=function(){var O=this;this.cropShadeElement=Jt.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Jt.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var M=0;M<this.numberOfGridLines;M++)this.horizontalGridLines.push(Jt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Jt.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(X){return O.gridContainer.appendChild(X)}),this.verticalGridLines.forEach(function(X){return O.gridContainer.appendChild(X)}),this.cropRectElement=Jt.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new ye(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},q.prototype.setCropRectangle=function(O){this.cropRect=O;var M=Object.assign({},this.cropRect);this.zoomFactor!==1&&(M.width=this.cropRect.width*this.zoomFactor,M.height=this.cropRect.height*this.zoomFactor,M.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-M.width/2,M.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-M.height/2),Jt.setAttributes(this.cropRectElement,[["x",M.x.toString()],["y",M.y.toString()],["width",M.width.toString()],["height",M.height.toString()]]);var X=M.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Z,Pe){var st=M.y+X*(Pe+1);Jt.setAttributes(Z,[["x1",""+M.x],["y1",""+st],["x2",""+(M.x+M.width)],["y2",""+st]])});var se=M.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Z,Pe){var st=M.x+se*(Pe+1);Jt.setAttributes(Z,[["x1",""+st],["y1",""+M.y],["x2",""+st],["y2",""+(M.y+M.height)]])}),Jt.setAttributes(this.cropShadeElement,[["d",Jt.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,M.x,M.y,M.width,M.height)]]),this.topLeftGrip.setCenter(M.x,M.y),this.topRightGrip.setCenter(M.x+M.width,M.y),this.bottomLeftGrip.setCenter(M.x,M.y+M.height),this.bottomRightGrip.setCenter(M.x+M.width,M.y+M.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},q.prototype.attachEvents=function(){this.container.style.touchAction="none",this.container.addEventListener("pointerdown",this.onPointerDown),this.container.addEventListener("pointermove",this.onPointerMove),this.container.addEventListener("pointerup",this.onPointerUp)},q.prototype.clientToLocalCoordinates=function(O,M){var X=this.container.getBoundingClientRect();return{x:O-X.left+this.margin,y:M-X.top+this.margin}},q.prototype.onPointerDown=function(O){this.container.setPointerCapture(O.pointerId),this.previousPoint=this.clientToLocalCoordinates(O.clientX,O.clientY),this.cropRectElement===O.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(O.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(O.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(O.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(O.target)&&(this.activeGrip=this.bottomRightGrip)},q.prototype.onPointerMove=function(O){if(this.isMoving)this.move(this.clientToLocalCoordinates(O.clientX,O.clientY));else if(this.activeGrip){var M=this.clientToLocalCoordinates(O.clientX,O.clientY);this.resize(M)}O.preventDefault()},q.prototype.onPointerUp=function(O){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(O.pointerId)},q.prototype.move=function(O){var M=O.x-this.previousPoint.x,X=O.y-this.previousPoint.y;this.zoomFactor!==1&&(M=-M/this.zoomFactor,X=-X/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+M),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+X),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=O},q.prototype.resize=function(O){var M=Object.assign({},this.cropRect),X=O.x-this.previousPoint.x,se=O.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:M.x+X<this.margin&&(X=this.margin-M.x),M.x+=X,M.width=this.cropRect.x+this.cropRect.width-M.x;break;case this.bottomRightGrip:case this.topRightGrip:M.width+X>this.canvasWidth*this.zoomFactor&&(X=this.canvasWidth*this.zoomFactor-M.width),M.width+=X}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(M.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(X),M.height=this.aspectRatio.getVerticalLength(M.width)):(M.y+=se,M.height=this.cropRect.y+this.cropRect.height-M.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?M.height=this.aspectRatio.getVerticalLength(M.width):M.height+=se}M.width<10&&(M.x=this.cropRect.x,M.width=10),M.height<10&&(M.y=this.cropRect.y,M.height=10),this.previousPoint=O,M.x>=this.margin&&M.y>=this.margin&&M.x-this.margin+M.width<=this.canvasWidth&&M.y-this.margin+M.height<=this.canvasHeight&&(this.cropRect=M,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},q.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var O=this.cropRect.x+this.cropRect.width/2,M=this.cropRect.y+this.cropRect.height/2,X=this.aspectRatio.getHorizontalLength(this.cropRect.height),se=this.aspectRatio.getVerticalLength(this.cropRect.width);X/this.canvasWidth<se/this.canvasHeight?this.cropRect.width=X:this.cropRect.height=se,this.cropRect.width>this.canvasWidth&&(this.cropRect.height/=this.cropRect.width/this.canvasWidth,this.cropRect.width=this.canvasWidth),this.cropRect.height>this.canvasHeight&&(this.cropRect.width/=this.cropRect.height/this.canvasHeight,this.cropRect.height=this.canvasHeight),this.cropRect.x=O-this.cropRect.width/2,this.cropRect.y=M-this.cropRect.height/2,this.cropRect.x+this.cropRect.width>this.margin+this.canvasWidth&&(this.cropRect.x=this.margin+this.canvasWidth-this.cropRect.width),this.cropRect.y+this.cropRect.height>this.margin+this.canvasHeight&&(this.cropRect.y=this.margin+this.canvasHeight-this.cropRect.height),this.cropRect.x=Math.max(this.cropRect.x,this.margin),this.cropRect.y=Math.max(this.cropRect.y,this.margin)}},q.prototype.getRescaledRect=function(O,M,X,se,Z,Pe){var st=X/O,wt=se/M;return{x:(Z.x-Pe)*st+Pe,y:(Z.y-Pe)*wt+Pe,width:Z.width*st,height:Z.height*wt}},q.prototype.scaleCanvas=function(O,M){var X=this.getRescaledRect(this.canvasWidth,this.canvasHeight,O,M,this.cropRect,this.margin);this.canvasWidth=O,this.canvasHeight=M,this.onCropChange&&this.onCropChange(X),this.setCropRectangle(X)},q}(),or=function(){function q(O){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=O,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(q.prototype,"angle",{get:function(){return this._angle},set:function(O){this._angle=O,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),q.prototype.getUI=function(){return this.controlContainer=document.createElement("div"),this.controlContainer.title=this.title,this.controlContainer.className=this.className+" "+this.colorsClassName,this.controlContainer.appendChild(this.getVisual()),this.controlContainer.addEventListener("pointerdown",this.onPointerDown),this.controlContainer.addEventListener("pointermove",this.onPointerMove),this.controlContainer.addEventListener("pointerup",this.onPointerUp),this.uiContainer.appendChild(this.controlContainer),this.uiContainer.style.display="inline-block",this.uiContainer.style.touchAction="none",this.setAngleLabel(),this.positionScaleShape(),this.uiContainer},q.prototype.onPointerDown=function(O){this.controlContainer.setPointerCapture(O.pointerId),this.isDragging=!0,this.previousPoint={x:O.clientX,y:O.clientY}},q.prototype.onPointerMove=function(O){this.isDragging&&(this.onAngleChange&&this.onAngleChange((O.clientX-this.previousPoint.x)/5),this.previousPoint.x=O.clientX)},q.prototype.onPointerUp=function(O){this.isDragging&&this.onAngleChange&&this.onAngleChange((O.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(O.pointerId)},q.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var O=this.angleLabelText.getBBox();Jt.setAttributes(this.angleLabelElement,[["x",((this.width-O.width)/2).toString()],["y",(this.height/2).toString()]])}},q.prototype.positionScaleShape=function(){if(this.scaleShape){var O=this.scaleShape.transform.baseVal.getItem(0);O.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(O,0)}},q.prototype.getVisual=function(){var O=document.createElementNS("http://www.w3.org/2000/svg","svg");O.setAttribute("xmlns","http://www.w3.org/2000/svg"),O.setAttribute("width",this.width+"px"),O.setAttribute("height",this.height+"px"),O.setAttribute("viewBox","0 0 "+this.width+" "+this.height),O.style.flexShrink="0",document.body.appendChild(O);for(var M="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,X=1;X<=this.width/5+10;X++){var se=X%5==0?this.height/3:this.height/6;M+="h4v"+-se+"h1v"+se}M+="v1H0Z",this.scaleShape=Jt.createPath(M);var Z=Jt.createTransform();this.scaleShape.transform.baseVal.appendItem(Z),O.appendChild(this.scaleShape),this.angleLabelElement=Jt.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Jt.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var Pe=Jt.createTSpan("");return Pe.innerHTML="&deg;",this.angleLabelElement.appendChild(Pe),O.appendChild(this.angleLabelElement),document.body.removeChild(O),O},q}(),en=function(){function q(){this.naturalSize=!1,this.imageType="image/png"}return q.prototype.rasterize=function(O,M,X,se,Z,Pe,st){var wt=this;return new Promise(function(Pt){var dt=document.createElement("canvas");dt.width=O.width.baseVal.value-2*se,dt.height=O.height.baseVal.value-2*se;var bt=1,Mt=1;wt.naturalSize===!0?(bt=M.naturalWidth/(O.width.baseVal.value-2*se)/Pe,Mt=M.naturalHeight/(O.height.baseVal.value-2*se)/st,dt.width=M.naturalWidth/Pe,dt.height=M.naturalHeight/st):wt.width!==void 0&&wt.height!==void 0&&(bt=wt.width/X.width,Mt=wt.height/X.height,dt.width*=bt,dt.height*=Mt);var Cn=dt.getContext("2d");Cn.translate(dt.width/2,dt.height/2),Cn.rotate(Z*Math.PI/180),Cn.scale(Pe,st),Cn.translate(-dt.width/2,-dt.height/2),Cn.drawImage(M,0,0,dt.width,dt.height);var Yn=document.createElement("canvas");Yn.width=X.width*bt,Yn.height=X.height*Mt,Yn.getContext("2d").putImageData(Cn.getImageData((X.x-se)*bt,(X.y-se)*Mt,X.width*bt,X.height*Mt),0,0),Pt(Yn.toDataURL(wt.imageType,wt.imageQuality))})},q}(),Ie=function(){function q(O){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=q.instanceCounter++,this.styles=new Ar(this.instanceNo),this.target=O,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(O){this._zoomToCropEnabled=O,O?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(O){this._isGridVisible=O,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"gridLines",{get:function(){return this._gridLines},set:function(O){this._gridLines=O,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(O){this._rotationAngle=O,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(q.prototype,"aspectRatio",{get:function(){var O;return(O=this._aspectRatio)!==null&&O!==void 0?O:this.aspectRatios[0]},set:function(O){this._aspectRatio=O},enumerable:!1,configurable:!0}),q.prototype.open=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.setupResizeObserver(),this.initCropCanvas(),this.setEditingTarget(),this.setTopLeft(),this.initCropLayer(),this.attachEvents(),this.applyAspectRatio(),this.displayMode==="popup"&&this.onPopupResize(),this._isOpen=!0},q.prototype.show=function(){this.showUI(),this.open()},q.prototype.close=function(O){O===void 0&&(O=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),O||this.closeEventListeners.forEach(function(M){return M()}),this._isOpen=!1)},q.prototype.addRenderEventListener=function(O){this.renderEventListeners.push(O)},q.prototype.removeRenderEventListener=function(O){this.renderEventListeners.indexOf(O)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(O),1)},q.prototype.addCloseEventListener=function(O){this.closeEventListeners.push(O)},q.prototype.removeCloseEventListener=function(O){this.closeEventListeners.indexOf(O)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(O),1)},q.prototype.setupResizeObserver=function(){var O=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){O.resize(O.target.clientWidth,O.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},q.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var O=1*this.target.clientWidth/this.target.clientHeight,M=this.contentDiv.clientWidth/O>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*O:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,X=M+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/O;this.resize(M,X)}},q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},q.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",Jt.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},q.prototype.resize=function(O,M){this.imageWidth=Math.round(O),this.imageHeight=Math.round(M),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},q.prototype.setEditingTarget=function(){var O=document.createElement("canvas");O.width=this.target.naturalWidth,O.height=this.target.naturalHeight,O.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var M=O.toDataURL();Jt.setAttributes(this.editingTarget,[["href",M]]),this.setEditingTargetSize()},q.prototype.setTopLeft=function(){var O=this.target.getBoundingClientRect(),M=this.editorCanvas.getBoundingClientRect();this.left=O.left-M.left-this.CANVAS_MARGIN,this.top=O.top-M.top-this.CANVAS_MARGIN},q.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=Jt.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Jt.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Jt.createGroup(),this.editingTargetRotationScaleContainer=Jt.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var O=Jt.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(O);var M=Jt.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(M),this.editingTargetContainer=Jt.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},q.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},q.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Jt.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new ve(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},q.prototype.zoomToCrop=function(){if(this.cropRect){var O=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,M=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=O+"px "+M+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-O+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-M+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},q.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},q.prototype.cropRectChanged=function(O){this.cropRect=O,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},q.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},q.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},q.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var O=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,M=this.target.offsetTop>O+this.CANVAS_MARGIN?this.target.offsetTop-(O+this.CANVAS_MARGIN):0;this.coverDiv.style.top=M+"px",this.coverDiv.style.left=(this.target.offsetLeft>this.CANVAS_MARGIN?this.target.offsetLeft-this.CANVAS_MARGIN:0)+"px",this.coverDiv.style.width=this.target.offsetWidth+this.CANVAS_MARGIN+"px",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.styles.settings.zIndex!==void 0?this.styles.settings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.displayMode==="popup"?this.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.addToolbars(),this.uiDiv.appendChild(this.topToolbar.getUI()),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.alignItems="center",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.contentDiv.style.overflow="hidden",this.contentDiv.style.backgroundColor=this.styles.settings.canvasBackgroundColor,this.displayMode==="popup"&&(this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.popupMargin+"px)"),this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.contentDiv.appendChild(this.editorCanvas),this.uiDiv.appendChild(this.bottomToolbar.getUI()),this.straightener.angle=this.rotationAngle},q.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},q.prototype.addTopToolbar=function(){var O=this;this.topToolbar=new pr,this.topToolbar.display=this.styles.settings.hideTopToolbar?"none":"",this.topToolbar.className=this.toolbarStyleClass.name,this.topToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.topToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.topToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.topToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.topToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.topToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var M=new Pr;M.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(M);var X=[];this.aspectRatios.forEach(function(Mt){var Cn=new yr(Ot.getIcon(Mt.horizontal,Mt.vertical),Mt.horizontal===0&&Mt.vertical===0?"FREE":Mt.horizontal+":"+Mt.vertical);Cn.onClick=function(){return O.ratioButtonClicked(Mt)},X.push(Cn)}),this.aspectRatioButton=new Me(Ot.getIcon(0,0),"Aspect ratio",X),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,M.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var se=new yr('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");se.isActive=this.isGridVisible,se.onClick=function(){O.isGridVisible=!O.isGridVisible,se.isActive=O.isGridVisible},M.addButton(se);var Z=new yr('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(Z.isActive=this.zoomToCropEnabled,Z.onClick=function(){O.zoomToCropEnabled=!O.zoomToCropEnabled,Z.isActive=O.zoomToCropEnabled},M.addButton(Z),!Rr.isLicensed){var Pe=new mt;this.topToolbar.addElementBlock(Pe);var st=document.createElement("div");st.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var wt=document.createElement("a");wt.style.color="currentColor",wt.href="https://markerjs.com/products/cropro",wt.target="_blank",wt.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',st.appendChild(wt),Pe.addElement(st)}var Pt=new Pr;Pt.minWidth=3*this.toolbarHeight+"px",Pt.contentAlign="end",this.topToolbar.addButtonBlock(Pt);var dt=new yr('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");dt.onClick=this.startRenderAndClose,Pt.addButton(dt),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(dt.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var bt=new yr('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");bt.onClick=this.close,Pt.addButton(bt),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(bt.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},q.prototype.addBottomToolbar=function(){var O=this;this.bottomToolbar=new pr,this.bottomToolbar.display=this.styles.settings.hideBottomToolbar?"none":"",this.bottomToolbar.className=this.toolbarStyleClass.name,this.bottomToolbar.colorsClassName=this.styles.settings.toolbarStyleColorsClassName?this.styles.settings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name,this.bottomToolbar.fadeInClassName=this.styles.fadeInAnimationClassName,this.bottomToolbar.blockClassName=this.toolbarBlockStyleClass.name,this.bottomToolbar.buttonClassName=this.toolbarButtonStyleClass.name,this.bottomToolbar.buttonColorsClassName=this.styles.settings.toolbarButtonStyleColorsClassName?this.styles.settings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,this.bottomToolbar.buttonActiveColorsClassName=this.styles.settings.toolbarActiveButtonStyleColorsClassName?this.styles.settings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name;var M=new Pr;M.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(M);var X=new yr('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");X.onClick=this.rotateLeftButtonClicked,M.addButton(X);var se=new yr('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");se.onClick=this.rotateRightButtonClicked,M.addButton(se);var Z=new mt;Z.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Z),this.straightener=new or("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(Pt){O.rotateBy(Pt),O.straightener.angle=O.rotationAngle},Z.addElement(this.straightener.getUI());var Pe=new Pr;Pe.minWidth=2*this.toolbarHeight+"px",Pe.contentAlign="end",this.bottomToolbar.addButtonBlock(Pe);var st=new yr('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");st.onClick=this.flipHorizontallyButtonClicked,Pe.addButton(st);var wt=new yr('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");wt.onClick=this.flipVerticallyButtonClicked,Pe.addButton(wt)},q.prototype.ratioButtonClicked=function(O){this.aspectRatio=O,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},q.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=Ot.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},q.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ke(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},q.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},q.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},q.prototype.restoreState=function(O){if(O){var M=this.cropLayer.getRescaledRect(O.width,O.height,this.imageWidth,this.imageHeight,O.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(M),this.cropRectChanged(M),this.flippedHorizontally=O.flippedHorizontally,this.flippedVertically=O.flippedVertically,this.applyFlip(),this.rotationAngle=O.rotationAngle,this.applyRotation()}},q.prototype.clientToLocalCoordinates=function(O,M){var X=this.cropImage.getBoundingClientRect();return{x:O-X.left,y:M-X.top}},q.prototype.onWindowResize=function(){this.positionUI()},q.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var O=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=O+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},q.prototype.rotateLeftButtonClicked=function(){var O=this.rotationAngle-90;this.rotationAngle%90!=0&&(O+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(O)},q.prototype.rotateRightButtonClicked=function(){var O=this.rotationAngle+90;this.rotationAngle%90!=0&&(O-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(O)},q.prototype.rotateTo=function(O){O=(O=O>180?O-360:O)<=-180?O+360:O,this.rotationAngle=O,this.applyRotation()},q.prototype.rotateBy=function(O){this.rotateTo((this.rotationAngle+O)%360)},q.prototype.applyRotation=function(){var O=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var M=this.editingTargetRotationContainer.transform.baseVal.getItem(0);M.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(M,0);var X=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/X.width,this.imageHeight/X.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=O},q.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},q.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},q.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},q.prototype.startRenderAndClose=function(){return ir(this,void 0,void 0,function(){var O,M;return br(this,function(X){switch(X.label){case 0:return[4,this.render()];case 1:return O=X.sent(),M=this.getState(),this.renderEventListeners.forEach(function(se){return se(O,M)}),this.close(!0),[2]}})})},q.prototype.render=function(){return ir(this,void 0,void 0,function(){var O;return br(this,function(M){switch(M.label){case 0:return(O=new en).naturalSize=this.renderAtNaturalSize,O.imageType=this.renderImageType,O.imageQuality=this.renderImageQuality,O.width=this.renderWidth,O.height=this.renderHeight,this.unzoomFromCrop(),Jt.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,O.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return M.sent(),[4,O.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,M.sent()]}})})},q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Tn("toolbar",`
width: `+(this.displayMode==="inline"?"100%":"calc(100vw - "+2*this.popupMargin+"px)")+`;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.toolbarHeight+`px;
box-sizing: content-box;
overflow: hidden;
line-height: 0px;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Tn("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Tn("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var O=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Tn("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*O)+`px;
height: `+(this.toolbarHeight-2*O)+`px;
padding: `+O+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Tn("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Tn("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new Nn("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new Nn("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Tn("toolbar_dropdown",`
position: absolute;
max-width: `+4*this.toolbarHeight+`px;
z-index: 20;
white-space: normal;
box-sizing: content-box;
box-shadow: 3px 3px rgba(33, 33, 33, 0.1);
margin: `+(this.displayMode==="inline"?"0":this.popupMargin)+`px;
line-height: 0px;
`)),this.toolbarDropdownStyleColorsClass=this.styles.addClass(new Tn("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Tn("toolbar_straightener_block",`
display: flex;
overflow: hidden;
justify-content: center;
-webkit-mask-image: linear-gradient(90deg, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 30%, rgba(0,0,0,1) 70%, rgba(0,0,0,0) 100%);
`)),this.toolbarStraightenerStyleClass=this.styles.addClass(new Tn("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*O)+`px;
padding: `+O+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Tn("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},q.instanceCounter=0,q}(),gt=U("8hTe"),Ce=U.n(gt),dn=/<pre[^>]*>/g;function hr(q){var O=document.createElement("div");return O.innerHTML=q,O.childNodes.length===0?"":O.childNodes[0].nodeValue}var mr=Oe.a=function(q){var O=q.value,M=O===void 0?"":O,X=q.edit,se=X===void 0?!1:X,Z=q.className,Pe=q.showTextOnly,st=q.showLines,wt=q.replaces,Pt=q.zoomImg,dt=q.hasMask,bt=q.style,Mt=bt===void 0?{}:bt,Cn=q.stylesPrev,Yn=Cn===void 0?{}:Cn,Hn=String(M),fn=Object(D.useRef)(),Wt=Object(D.useRef)(),rn=Object(D.useState)(""),qt=Object($.a)(rn,2),Ft=qt[0],Qn=qt[1],Bn=Object(D.useState)("office"),xn=Object($.a)(Bn,2),Jn=xn[0],pn=xn[1],Sn=function(){var _n=new Ie(Wt.current);_n.displayMode="popup",_n.addRenderEventListener(function(){var In=Object(N.a)(r.a.mark(function wn(Zn){var yn;return r.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:return fn.current.style.display="none",qn.next=3,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Zn}});case 3:yn=qn.sent,yn!=null&&yn.id&&wt(Wt.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(yn==null?void 0:yn.id,"?type=").concat(yn.content_type));case 5:case"end":return qn.stop()}},wn)}));return function(wn){return In.apply(this,arguments)}}()),_n.show()},un=function(){var _n=new Gn(Wt.current);_n.settings.displayMode="popup",_n.addEventListener("render",function(){var In=Object(N.a)(r.a.mark(function wn(Zn){var yn;return r.a.wrap(function(qn){for(;;)switch(qn.prev=qn.next){case 0:if(fn.current.style.display="none",!Wt.current){qn.next=6;break}return qn.next=4,Object(he.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Zn.dataUrl}});case 4:yn=qn.sent,yn!=null&&yn.id&&wt(Wt.current.getAttribute("src").replace(Y.a.API_SERVER,""),"/api/attachments/".concat(yn==null?void 0:yn.id,"?type=").concat(yn.content_type));case 6:case"end":return qn.stop()}},wn)}));return function(wn){return In.apply(this,arguments)}}()),_n.show(),window.markerArea=_n},Un=Object(D.useMemo)(function(){fn.current&&(fn.current.style.zIndex=-1);try{var nn=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,_n=/\"\/api\/attachments\/|\"\/attachments\/download\//g,In=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Hn=Hn.replace(nn,"("+Y.a.API_SERVER+"/api/attachments/").replace(_n,'"'+Y.a.API_SERVER+"/api/attachments/").replace(In,'"'+Y.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
`)}catch(Vn){}var wn=F(Hn),Zn=C();if(Hn.match(/\[TOC\]/)&&(wn=wn.replace("<p>[TOC]</p>",A()),R()),wn=wn.replace(/(__special_katext_id_\d+__)/g,function(Vn,qn){var kn=Zn[qn],Pn=kn.type,Mn=kn.expression;return Object(ie.renderToString)(hr(Mn)||"",{displayMode:Pn==="block",throwOnError:!1,output:"html"})}),wn=wn.replace(/▁/g,"\u2581\u2581\u2581"),E(),Pe){var yn=document.createElement("div");return yn.innerHTML=wn,yn.innerText}return setTimeout(function(){return Ln()},500),wn},[Hn]),Xn=Object(D.useRef)();T.WebkitLineClamp=st,st&&(Mt=Object(K.a)(Object(K.a)({},Mt),T));function nr(nn){var _n=nn.target;if(_n.tagName.toUpperCase()==="IMG"){if(Pt){var In=_n.getAttribute("src");Qn(In),pn("image")}}else if(_n.tagName.toUpperCase()==="A"){var wn=_n.getAttribute("href");if(wn.indexOf("office")>-1)nn.preventDefault(),Qn(wn),pn("office");else if(wn.indexOf("application/pdf")>-1)nn.preventDefault(),Qn(wn),pn("pdf");else if(wn.indexOf("text/html")>-1)nn.preventDefault(),Qn(wn),pn("html");else if(wn.startsWith("#")){nn.preventDefault();var Zn=document.getElementById(wn.replace("#",""));Zn&&Zn.scrollIntoView(!0)}}}var Ln=function(){var _n,In=(_n=Xn.current)===null||_n===void 0?void 0:_n.querySelectorAll("video");In==null||In.forEach(function(wn){if(wn.oncontextmenu=function(){return!1},wn.src.indexOf(".m3u8")>-1&&!wn.canPlayType("application/vnd.apple.mpegurl")){if(H.a.isSupported()){var Zn=new H.a;Zn.loadSource(wn.src),Zn.attachMedia(wn)}}})};Object(D.useEffect)(function(){if(Xn.current&&Un&&(Un.match(dn)&&window.PR.prettyPrint()),Xn.current)return Xn.current.addEventListener("click",nr),function(){Xn.current.removeEventListener("click",nr),E(),R()}},[Un,Xn.current,nr]);var Kn=function(_n){if(!se)return;_n.target.nodeName==="IMG"?(fn.current.style.zIndex=1,fn.current.style.display="flex",fn.current.style.width=_n.target.clientWidth+"px",fn.current.style.height=_n.target.clientHeight+"px",fn.current.style.top=_n.target.offsetTop+"px",fn.current.style.left=_n.target.offsetLeft+"px",Wt.current.src=_n.target.getAttribute("src")):fn.current.style.display="none"};return m.a.createElement("div",{style:{position:"relative"}},m.a.createElement("div",{ref:Xn,style:Object(K.a)({},Mt),className:"".concat(Z||""," markdown-body ").concat(Ce.a.mdBody),onMouseOver:Kn,dangerouslySetInnerHTML:{__html:Un}}),m.a.createElement("div",{ref:fn,className:Ce.a.button},m.a.createElement(Q.a,null,m.a.createElement(J.a,{onClick:function(){return Sn()}},"\u88C1\u526A"),m.a.createElement(J.a,{onClick:function(){return un()}},"\u7F16\u8F91"))),m.a.createElement("img",{ref:Wt,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),m.a.createElement(le.a,{close:!0,data:Ft,type:Ft!=null&&Ft.length?Jn:"",style:Object(K.a)({},Yn),onClose:function(){return Qn("")}}))}},"9VGf":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return B});var te=U("q1tI"),Q=U.n(te);function B(J,K){var N=Object(te.useRef)();Object(te.useEffect)(function(){N.current=J}),Object(te.useEffect)(function(){function $(){N.current()}if(K!==null){var z=setInterval($,K);return function(){return clearInterval(z)}}},[K])}},"9z17":function(It,Oe,U){"use strict";U.d(Oe,"b",function(){return S});var te=U("g9YV"),Q=U("wCAj"),B=U("5NDa"),J=U("5rEg"),K=U("y8nQ"),N=U("Vl3Y"),$=U("2qtc"),z=U("kLXV"),r=U("7Kak"),D=U("9yH6"),m=U("9og8"),g=U("tJVT"),p=U("WmNS"),a=U.n(p),c=U("q1tI"),s=U.n(c),i=U("ie49"),t=U.n(i),u=U("HBuW"),o=function(b){var h=b.total,f=b.used,C=b.copy,E=b.canNotCopy,_=b.inPaper,W="";return C>0&&E>0?W="\u5176\u4E2D\u6709".concat(C,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236\uFF0C\u6709").concat(E,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236"):C>0&&E===0?W="\u5176\u4E2D\u6709".concat(C,"\u4E2A\u5B9E\u8BAD\u53EF\u4EE5\u590D\u5236"):C===0&&E>0&&(W="\u5176\u4E2D\u6709".concat(E,"\u4E2A\u5B9E\u8BAD\u672A\u5F00\u653E\u590D\u5236")),"\u5F53\u524D\u9009\u4E2D".concat(h,"\u4E2A\u5B9E\u8BAD\u4E2D\uFF0C\u6709").concat(f,"\u4E2A\u5B9E\u8BAD\u5DF2\u5728\u8BFE\u5802\u4E2D\u4F7F\u7528\uFF0C").concat(W).concat(_?"\uFF0C\u8BF7\u786E\u8BA4\u662F\u5426\u4F7F\u7528\u8BD5\u5377\uFF1F":"")},R=function(b){return b?{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"}},T=function(b){var h=b.onCancel,f=b.onOk,C=b.visible,E=b.inPaper,_=b.renderData,W=b.type,j=Object(c.useState)(1),w=Object(g.a)(j,2),F=w[0],P=w[1],v=Object(c.useState)(!1),H=Object(g.a)(v,2),Y=H[0],ie=H[1],le=Object(c.useMemo)(function(){return(_==null?void 0:_.total_num)===1&&(_==null?void 0:_.can_copy_num)===1},[_]);return s.a.createElement(s.a.Fragment,null,le?s.a.createElement(z.a,{centered:!0,closable:!0,visible:C,title:"\u63D0\u793A",width:600,confirmLoading:Y,onCancel:h,onOk:Object(m.a)(a.a.mark(function he(){return a.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:return ie(!0),Le.next=3,f(F);case 3:ie(!1);case 4:case"end":return Le.stop()}},he)}))},s.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"),s.a.createElement(D.a.Group,{value:F,onChange:function(xe){return P(xe.target.value)},className:t.a.content,style:{marginBottom:30}},s.a.createElement(D.a,{value:1,style:{color:"#464f66"}},"\u590D\u5236\u5B9E\u8BAD"),s.a.createElement(D.a,{value:0,style:{color:"#464f66"}},"\u4E0D\u590D\u5236\u5B9E\u8BAD")),s.a.createElement("div",{className:t.a.content,style:{marginBottom:10}},"\u8BF4\u660E\uFF1A"),s.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"),s.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")):s.a.createElement(z.a,{centered:!0,closable:!0,visible:C,title:"\u63D0\u793A",width:600,onCancel:h,onOk:Object(m.a)(a.a.mark(function he(){return a.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:return ie(!0),Le.next=3,f(0);case 3:ie(!1);case 4:case"end":return Le.stop()}},he)}))},s.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")))},S=function(){var b=Object(c.useState)(!1),h=Object(g.a)(b,2),f=h[0],C=h[1],E=Object(c.useState)(),_=Object(g.a)(E,2),W=_[0],j=_[1],w=function(){return C(!1)},F=function(){var P=Object(m.a)(a.a.mark(function v(H){var Y;return a.a.wrap(function(le){for(;;)switch(le.prev=le.next){case 0:return le.next=2,Object(u.p)(H);case 2:if(Y=le.sent,!("status"in Y)){le.next=5;break}return le.abrupt("return",!1);case 5:if(!(Y.repeat_shixun_num===0)){le.next=7;break}return le.abrupt("return",!1);case 7:return j(Y),C(!0),le.abrupt("return",!0);case 10:case"end":return le.stop()}},v)}));return function(H){return P.apply(this,arguments)}}();return[f,w,W,F]},A=function(b){var h=N.a.useForm(),f=Object(g.a)(h,1),C=f[0],E=Object(c.useState)(!1),_=Object(g.a)(E,2),W=_[0],j=_[1],w=b.onCancel,F=b.onOk,P=b.visible,v=b.inPaper,H=v===void 0?!1:v,Y=b.renderData,ie=b.type,le=Object(c.useMemo)(function(){return H?[{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(Ae,pe){return s.a.createElement(s.a.Fragment,null,s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe.stage_shixun_id:pe.id),"is_copy"],initialValue:1},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426"))),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(J.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(Ae,pe){return s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe.stage_shixun_id:pe.id),"is_use"],initialValue:1},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426")))}},{title:"\u662F\u5426\u590D\u5236",dataIndex:"is_copy",align:"center",render:function(Ae,pe){return s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe.stage_shixun_id:pe.id),"is_copy"],initialValue:1},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426")))}}]},[H]),he=Object(c.useMemo)(function(){return H?[{title:"\u5B9E\u8BAD\u540D\u79F0",dataIndex:"name",width:424,className:t.a.tableCell,align:"center",render:function(Ae,pe){return s.a.createElement(s.a.Fragment,null,s.a.createElement("span",null,Ae),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(J.a,{type:"hidden"})),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(J.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(Ae,pe){return s.a.createElement(s.a.Fragment,null,s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_use"],initialValue:0},s.a.createElement(D.a.Group,null,s.a.createElement(D.a,{value:1},"\u662F"),s.a.createElement(D.a,{value:0},"\u5426"))),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?pe==null?void 0:pe.stage_shixun_id:pe.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(J.a,{type:"hidden"})))}}]},[H]),xe=Object(c.useMemo)(function(){return o({total:Y==null?void 0:Y.total_num,used:Y==null?void 0:Y.repeat_shixun_num,copy:Y==null?void 0:Y.can_copy_num,canNotCopy:Y==null?void 0:Y.no_copy_num,inPaper:H})},[Y,H]),Le=Object(c.useMemo)(function(){return R(H)},[H]);return s.a.createElement(z.a,{title:"\u5B9E\u8BAD\u91CD\u590D\u4F7F\u7528\u63D0\u793A",centered:!0,visible:P,confirmLoading:W,onOk:Object(m.a)(a.a.mark(function we(){var Ae,pe;return a.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return j(!0),Ae=C.getFieldsValue(),pe=Object.keys(Ae).map(function(fe){return{id:parseInt(fe),is_use:Ae[fe].is_use,is_copy:Ae[fe].is_copy}}),ne.next=5,F(pe);case 5:j(!1);case 6:case"end":return ne.stop()}},we)})),onCancel:w,width:800,okText:"\u786E\u8BA4",className:t.a.antdModal,destroyOnClose:!0},s.a.createElement(N.a,{form:C,preserve:!1},s.a.createElement("div",{className:t.a.brief},xe),(Y==null?void 0:Y.can_copy_num)>0&&s.a.createElement("div",null,s.a.createElement("div",{className:t.a.contentTitle},"\u53EF\u590D\u5236\u5B9E\u8BAD"),s.a.createElement("div",{className:t.a.content},Le.reproducible),s.a.createElement("div",{className:t.a.tips},s.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"),s.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")),s.a.createElement(Q.a,{columns:le,className:t.a.antdTable,dataSource:Y==null?void 0:Y.can_copy_list,rowKey:ie==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:240},bordered:!0})),(Y==null?void 0:Y.no_copy_num)>0&&s.a.createElement("div",null,s.a.createElement("div",{className:t.a.contentTitle},"\u4E0D\u53EF\u590D\u5236\u5B9E\u8BAD"),s.a.createElement("div",{className:t.a.content},Le.irreproducible),s.a.createElement(Q.a,{columns:he,className:t.a.antdTable,dataSource:Y==null?void 0:Y.no_copy_list,rowKey:ie==="subject"?"stage_shixun_id":"id",pagination:!1,scroll:{y:200},bordered:!0})),(Y==null?void 0:Y.no_use_list.length)>0&&(Y==null?void 0:Y.no_use_list.map(function(we){return s.a.createElement("div",{key:ie==="subject"?we.stage_shixun_id:we.id},s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?we==null?void 0:we.stage_shixun_id:we.id),"is_copy"],hidden:!0,initialValue:0},s.a.createElement(J.a,{type:"hidden"})),s.a.createElement(N.a.Item,{name:["".concat(ie==="subject"?we==null?void 0:we.stage_shixun_id:we.id),"is_use"],hidden:!0,initialValue:1},s.a.createElement(J.a,{type:"hidden"})))}))))},I=function(b){var h=b.modalType;return h==="multiple"?s.a.createElement(A,b):s.a.createElement(T,b)};Oe.a=I},BU3w:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return N});var te=U("MNnm"),Q="rc-util-key";function B($){if($.attachTo)return $.attachTo;var z=document.querySelector("head");return z||document.body}function J($){var z,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var D=document.createElement("style");if((z=r.csp)===null||z===void 0?void 0:z.nonce){var m;D.nonce=(m=r.csp)===null||m===void 0?void 0:m.nonce}D.innerHTML=$;var g=B(r),p=g.firstChild;return r.prepend&&g.prepend?g.prepend(D):r.prepend&&p?g.insertBefore(D,p):g.appendChild(D),D}var K=new Map;function N($,z){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=B(r);if(!K.has(D)){var m=J("",r),g=m.parentNode;K.set(D,g),g.removeChild(m)}var p=Array.from(K.get(D).children).find(function(t){return t.tagName==="STYLE"&&t[Q]===z});if(p){var a,c;if(((a=r.csp)===null||a===void 0?void 0:a.nonce)&&p.nonce!==((c=r.csp)===null||c===void 0?void 0:c.nonce)){var s;p.nonce=(s=r.csp)===null||s===void 0?void 0:s.nonce}return p.innerHTML!==$&&(p.innerHTML=$),p}var i=J($,r);return i[Q]=z,i}},Bd2K:function(It,Oe,U){(function(te){te(U("VrN/"),U("osHv"))})(function(te){te.defineOption("autoCloseTags",!1,function(r,D,m){if(m!=te.Init&&m&&r.removeKeyMap("autoCloseTags"),!D)return;var g={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(g["'/'"]=function(p){return N(p)}),(typeof D!="object"||D.whenOpening!==!1)&&(g["'>'"]=function(p){return J(p)}),r.addKeyMap(g)});var Q=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],B=["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 J(r){if(r.getOption("disableInput"))return te.Pass;for(var D=r.listSelections(),m=[],g=r.getOption("autoCloseTags"),p=0;p<D.length;p++){if(!D[p].empty())return te.Pass;var a=D[p].head,c=r.getTokenAt(a),s=te.innerMode(r.getMode(),c.state),i=s.state,t=s.mode.xmlCurrentTag&&s.mode.xmlCurrentTag(i),u=t&&t.name;if(!u)return te.Pass;var o=s.mode.configuration=="html",R=typeof g=="object"&&g.dontCloseTags||o&&Q,T=typeof g=="object"&&g.indentTags||o&&B;c.end>a.ch&&(u=u.slice(0,u.length-c.end+a.ch));var S=u.toLowerCase();if(!u||c.type=="string"&&(c.end!=a.ch||!/[\"\']/.test(c.string.charAt(c.string.length-1))||c.string.length==1)||c.type=="tag"&&t.close||c.string.indexOf("/")==a.ch-c.start-1||R&&$(R,S)>-1||z(r,s.mode.xmlCurrentContext&&s.mode.xmlCurrentContext(i)||[],u,a,!0))return te.Pass;var A=typeof g=="object"&&g.emptyTags;if(A&&$(A,u)>-1){m[p]={text:"/>",newPos:te.Pos(a.line,a.ch+2)};continue}var I=T&&$(T,S)>-1;m[p]={indent:I,text:">"+(I?`
`:"")+"</"+u+">",newPos:I?te.Pos(a.line+1,0):te.Pos(a.line,a.ch+1)}}for(var x=typeof g=="object"&&g.dontIndentOnAutoClose,p=D.length-1;p>=0;p--){var b=m[p];r.replaceRange(b.text,D[p].head,D[p].anchor,"+insert");var h=r.listSelections().slice(0);h[p]={head:b.newPos,anchor:b.newPos},r.setSelections(h),!x&&b.indent&&(r.indentLine(b.newPos.line,null,!0),r.indentLine(b.newPos.line+1,null,!0))}}function K(r,D){for(var m=r.listSelections(),g=[],p=D?"/":"</",a=r.getOption("autoCloseTags"),c=typeof a=="object"&&a.dontIndentOnSlash,s=0;s<m.length;s++){if(!m[s].empty())return te.Pass;var i=m[s].head,t=r.getTokenAt(i),u=te.innerMode(r.getMode(),t.state),o=u.state;if(D&&(t.type=="string"||t.string.charAt(0)!="<"||t.start!=i.ch-1))return te.Pass;var R,T=u.mode.name!="xml"&&r.getMode().name=="htmlmixed";if(T&&u.mode.name=="javascript")R=p+"script";else if(T&&u.mode.name=="css")R=p+"style";else{var S=u.mode.xmlCurrentContext&&u.mode.xmlCurrentContext(o);if(!S||S.length&&z(r,S,S[S.length-1],i))return te.Pass;R=p+S[S.length-1]}r.getLine(i.line).charAt(t.end)!=">"&&(R+=">"),g[s]=R}if(r.replaceSelections(g),m=r.listSelections(),!c)for(var s=0;s<m.length;s++)(s==m.length-1||m[s].head.line<m[s+1].head.line)&&r.indentLine(m[s].head.line)}function N(r){return r.getOption("disableInput")?te.Pass:K(r,!0)}te.commands.closeTag=function(r){return K(r)};function $(r,D){if(r.indexOf)return r.indexOf(D);for(var m=0,g=r.length;m<g;++m)if(r[m]==D)return m;return-1}function z(r,D,m,g,p){if(!te.scanForClosingTag)return!1;var a=Math.min(r.lastLine()+1,g.line+500),c=te.scanForClosingTag(r,g,null,a);if(!c||c.tag!=m)return!1;for(var s=p?1:0,i=D.length-1;i>=0&&D[i]==m;i--)++s;g=c.to;for(var i=1;i<s;i++){var t=te.scanForClosingTag(r,g,null,a);if(!t||t.tag!=m)return!1;g=t.to}return!0}})},BjJ7:function(It,Oe,U){"use strict";U.d(Oe,"d",function(){return Q}),U.d(Oe,"c",function(){return B}),U.d(Oe,"e",function(){return J}),U.d(Oe,"b",function(){return K}),U.d(Oe,"a",function(){return $});var te=U("m3rI");function Q(z){var r=!0;if(z.length>0){for(var D=0;D<z.length;D++)if(z[D].compile_success==0||!z[D].compile_success){r=!1;break}}else r=!1;return r}function B(z){for(var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",D=[],m=0;m<z.length;m++){var g=z[m],p=r?"".concat(r,"/").concat(g.name):"".concat(g.name);D.push({title:g.name,isLeaf:!(g.type==="tree"),key:p})}return D}function J(z,r,D){for(var m=0;m<z.length;m++){var g=z[m];if(g.key===r){g.children=D;break}g.children&&J(g.children,r,D)}return z}function K(z,r,D){var m;return function(){var g=this,p=arguments,a=function(){m=null,D||z.apply(g,p)},c=D&&!m;clearTimeout(m),m=setTimeout(a,r),c&&z.apply(g,p)}}var N=!0,$=te.a.API_SERVER},"C+DQ":function(It,Oe,U){},"C/vA":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return te});function te(Q){const B=this;let J=!1,K;return function(){return J||(J=!0,K=Q.apply(B,arguments)),K}}},"Cg/j":function(It,Oe,U){"use strict";U.d(Oe,"b",function(){return te}),U.d(Oe,"a",function(){return Q}),U.d(Oe,"c",function(){return J}),U.d(Oe,"d",function(){return K});var te;(function(N){N.serviceIds=new Map,N.DI_TARGET="$di$target",N.DI_DEPENDENCIES="$di$dependencies";function $(z){return z[N.DI_DEPENDENCIES]||[]}N.getServiceDependencies=$})(te||(te={}));const Q=J("instantiationService");function B(N,$,z,r){$[te.DI_TARGET]===$?$[te.DI_DEPENDENCIES].push({id:N,index:z,optional:r}):($[te.DI_DEPENDENCIES]=[{id:N,index:z,optional:r}],$[te.DI_TARGET]=$)}function J(N){if(te.serviceIds.has(N))return te.serviceIds.get(N);const $=function(z,r,D){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");B($,z,D,!1)};return $.toString=()=>N,te.serviceIds.set(N,$),$}function K(N){return function($,z,r){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");B(N,$,r,!0)}}},DlQD:function(It,Oe,U){(function(te,Q){It.exports=Q()})(this,function(){"use strict";function te(He,Ne){for(var Ue=0;Ue<Ne.length;Ue++){var ge=Ne[Ue];ge.enumerable=ge.enumerable||!1,ge.configurable=!0,"value"in ge&&(ge.writable=!0),Object.defineProperty(He,ge.key,ge)}}function Q(He,Ne,Ue){return Ne&&te(He.prototype,Ne),Ue&&te(He,Ue),He}function B(He,Ne){if(!He)return;if(typeof He=="string")return J(He,Ne);var Ue=Object.prototype.toString.call(He).slice(8,-1);if(Ue==="Object"&&He.constructor&&(Ue=He.constructor.name),Ue==="Map"||Ue==="Set")return Array.from(He);if(Ue==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Ue))return J(He,Ne)}function J(He,Ne){(Ne==null||Ne>He.length)&&(Ne=He.length);for(var Ue=0,ge=new Array(Ne);Ue<Ne;Ue++)ge[Ue]=He[Ue];return ge}function K(He,Ne){var Ue;if(typeof Symbol=="undefined"||He[Symbol.iterator]==null){if(Array.isArray(He)||(Ue=B(He))||Ne&&He&&typeof He.length=="number"){Ue&&(He=Ue);var ge=0;return function(){return ge>=He.length?{done:!0}:{done:!1,value:He[ge++]}}}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 Ue=He[Symbol.iterator](),Ue.next.bind(Ue)}function N(He,Ne){return Ne={exports:{}},He(Ne,Ne.exports),Ne.exports}var $=N(function(He){function Ne(){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 Ue(ge){He.exports.defaults=ge}He.exports={defaults:Ne(),getDefaults:Ne,changeDefaults:Ue}}),z=$.defaults,r=$.getDefaults,D=$.changeDefaults,m=/[&<>"']/,g=/[&<>"']/g,p=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,c={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},s=function(Ne){return c[Ne]};function i(He,Ne){if(Ne){if(m.test(He))return He.replace(g,s)}else if(p.test(He))return He.replace(a,s);return He}var t=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function u(He){return He.replace(t,function(Ne,Ue){return Ue=Ue.toLowerCase(),Ue==="colon"?":":Ue.charAt(0)==="#"?Ue.charAt(1)==="x"?String.fromCharCode(parseInt(Ue.substring(2),16)):String.fromCharCode(+Ue.substring(1)):""})}var o=/(^|[^\[])\^/g;function R(He,Ne){He=He.source||He,Ne=Ne||"";var Ue={replace:function(Ee,De){return De=De.source||De,De=De.replace(o,"$1"),He=He.replace(Ee,De),Ue},getRegex:function(){return new RegExp(He,Ne)}};return Ue}var T=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function A(He,Ne,Ue){if(He){var ge;try{ge=decodeURIComponent(u(Ue)).replace(T,"").toLowerCase()}catch(Ee){return null}if(ge.indexOf("javascript:")===0||ge.indexOf("vbscript:")===0||ge.indexOf("data:")===0)return null}Ne&&!S.test(Ue)&&(Ue=f(Ne,Ue));try{Ue=encodeURI(Ue).replace(/%25/g,"%")}catch(Ee){return null}return Ue}var I={},x=/^[^:]+:\/*[^/]*$/,b=/^([^:]+:)[\s\S]*$/,h=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(He,Ne){I[" "+He]||(x.test(He)?I[" "+He]=He+"/":I[" "+He]=W(He,"/",!0)),He=I[" "+He];var Ue=He.indexOf(":")===-1;return Ne.substring(0,2)==="//"?Ue?Ne:He.replace(b,"$1")+Ne:Ne.charAt(0)==="/"?Ue?Ne:He.replace(h,"$1")+Ne:He+Ne}var C={exec:function(){}};function E(He){for(var Ne=1,Ue,ge;Ne<arguments.length;Ne++){Ue=arguments[Ne];for(ge in Ue)Object.prototype.hasOwnProperty.call(Ue,ge)&&(He[ge]=Ue[ge])}return He}function _(He,Ne){var Ue=He.replace(/\|/g,function(De,ue,Fe){for(var at=!1,xt=ue;--xt>=0&&Fe[xt]==="\\";)at=!at;return at?"|":" |"}),ge=Ue.split(/ \|/),Ee=0;if(ge.length>Ne)ge.splice(Ne);else for(;ge.length<Ne;)ge.push("");for(;Ee<ge.length;Ee++)ge[Ee]=ge[Ee].trim().replace(/\\\|/g,"|");return ge}function W(He,Ne,Ue){var ge=He.length;if(ge===0)return"";for(var Ee=0;Ee<ge;){var De=He.charAt(ge-Ee-1);if(De===Ne&&!Ue)Ee++;else if(De!==Ne&&Ue)Ee++;else break}return He.substr(0,ge-Ee)}function j(He,Ne){if(He.indexOf(Ne[1])===-1)return-1;for(var Ue=He.length,ge=0,Ee=0;Ee<Ue;Ee++)if(He[Ee]==="\\")Ee++;else if(He[Ee]===Ne[0])ge++;else if(He[Ee]===Ne[1]&&(ge--,ge<0))return Ee;return-1}function w(He){He&&He.sanitize&&!He.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 F={escape:i,unescape:u,edit:R,cleanUrl:A,resolveUrl:f,noopTest:C,merge:E,splitCells:_,rtrim:W,findClosingBracket:j,checkSanitizeDeprecation:w},P=$.defaults,v=F.rtrim,H=F.splitCells,Y=F.escape,ie=F.findClosingBracket;function le(He,Ne,Ue){var ge=Ne.href,Ee=Ne.title?Y(Ne.title):null,De=He[1].replace(/\\([\[\]])/g,"$1");return He[0].charAt(0)!=="!"?{type:"link",raw:Ue,href:ge,title:Ee,text:De}:{type:"image",raw:Ue,href:ge,title:Ee,text:Y(De)}}function he(He,Ne){var Ue=He.match(/^(\s+)(?:```)/);if(Ue===null)return Ne;var ge=Ue[1];return Ne.split(`
`).map(function(Ee){var De=Ee.match(/^\s+/);if(De===null)return Ee;var ue=De[0];return ue.length>=ge.length?Ee.slice(ge.length):Ee}).join(`
`)}var xe=function(){function He(Ue){this.options=Ue||P}var Ne=He.prototype;return Ne.space=function(ge){var Ee=this.rules.block.newline.exec(ge);if(Ee)return Ee[0].length>1?{type:"space",raw:Ee[0]}:{raw:`
`}},Ne.code=function(ge,Ee){var De=this.rules.block.code.exec(ge);if(De){var ue=Ee[Ee.length-1];if(ue&&ue.type==="paragraph")return{raw:De[0],text:De[0].trimRight()};var Fe=De[0].replace(/^ {4}/gm,"");return{type:"code",raw:De[0],codeBlockStyle:"indented",text:this.options.pedantic?Fe:v(Fe,`
`)}}},Ne.fences=function(ge){var Ee=this.rules.block.fences.exec(ge);if(Ee){var De=Ee[0],ue=he(De,Ee[3]||"");return{type:"code",raw:De,lang:Ee[2]?Ee[2].trim():Ee[2],text:ue}}},Ne.heading=function(ge){var Ee=this.rules.block.heading.exec(ge);if(Ee)return{type:"heading",raw:Ee[0],depth:Ee[1].length,text:Ee[2]}},Ne.nptable=function(ge){var Ee=this.rules.block.nptable.exec(ge);if(Ee){var De={type:"table",header:H(Ee[1].replace(/^ *| *\| *$/g,"")),align:Ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ee[3]?Ee[3].replace(/\n$/,"").split(`
`):[],raw:Ee[0]};if(De.header.length===De.align.length){var ue=De.align.length,Fe;for(Fe=0;Fe<ue;Fe++)/^ *-+: *$/.test(De.align[Fe])?De.align[Fe]="right":/^ *:-+: *$/.test(De.align[Fe])?De.align[Fe]="center":/^ *:-+ *$/.test(De.align[Fe])?De.align[Fe]="left":De.align[Fe]=null;for(ue=De.cells.length,Fe=0;Fe<ue;Fe++)De.cells[Fe]=H(De.cells[Fe],De.header.length);return De}}},Ne.hr=function(ge){var Ee=this.rules.block.hr.exec(ge);if(Ee)return{type:"hr",raw:Ee[0]}},Ne.blockquote=function(ge){var Ee=this.rules.block.blockquote.exec(ge);if(Ee){var De=Ee[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Ee[0],text:De}}},Ne.list=function(ge){var Ee=this.rules.block.list.exec(ge);if(Ee){for(var De=Ee[0],ue=Ee[2],Fe=ue.length>1,at=ue[ue.length-1]===")",xt={type:"list",raw:De,ordered:Fe,start:Fe?+ue.slice(0,-1):"",loose:!1,items:[]},Kt=Ee[0].match(this.rules.block.item),Xt=!1,$t,$n,vn,ln,hn,Gn,fr,vr=Kt.length,ir=0;ir<vr;ir++)$t=Kt[ir],De=$t,$n=$t.length,$t=$t.replace(/^ *([*+-]|\d+[.)]) */,""),~$t.indexOf(`
`)&&($n-=$t.length,$t=this.options.pedantic?$t.replace(/^ {1,4}/gm,""):$t.replace(new RegExp("^ {1,"+$n+"}","gm"),"")),ir!==vr-1&&(vn=this.rules.block.bullet.exec(Kt[ir+1])[0],(Fe?vn.length===1||!at&&vn[vn.length-1]===")":vn.length>1||this.options.smartLists&&vn!==ue)&&(ln=Kt.slice(ir+1).join(`
`),xt.raw=xt.raw.substring(0,xt.raw.length-ln.length),ir=vr-1)),hn=Xt||/\n\n(?!\s*$)/.test($t),ir!==vr-1&&(Xt=$t.charAt($t.length-1)===`
`,hn||(hn=Xt)),hn&&(xt.loose=!0),Gn=/^\[[ xX]\] /.test($t),fr=void 0,Gn&&(fr=$t[1]!==" ",$t=$t.replace(/^\[[ xX]\] +/,"")),xt.items.push({type:"list_item",raw:De,task:Gn,checked:fr,loose:hn,text:$t});return xt}},Ne.html=function(ge){var Ee=this.rules.block.html.exec(ge);if(Ee)return{type:this.options.sanitize?"paragraph":"html",raw:Ee[0],pre:!this.options.sanitizer&&(Ee[1]==="pre"||Ee[1]==="script"||Ee[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Ee[0]):Y(Ee[0]):Ee[0]}},Ne.def=function(ge){var Ee=this.rules.block.def.exec(ge);if(Ee){Ee[3]&&(Ee[3]=Ee[3].substring(1,Ee[3].length-1));var De=Ee[1].toLowerCase().replace(/\s+/g," ");return{tag:De,raw:Ee[0],href:Ee[2],title:Ee[3]}}},Ne.table=function(ge){var Ee=this.rules.block.table.exec(ge);if(Ee){var De={type:"table",header:H(Ee[1].replace(/^ *| *\| *$/g,"")),align:Ee[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Ee[3]?Ee[3].replace(/\n$/,"").split(`
`):[]};if(De.header.length===De.align.length){De.raw=Ee[0];var ue=De.align.length,Fe;for(Fe=0;Fe<ue;Fe++)/^ *-+: *$/.test(De.align[Fe])?De.align[Fe]="right":/^ *:-+: *$/.test(De.align[Fe])?De.align[Fe]="center":/^ *:-+ *$/.test(De.align[Fe])?De.align[Fe]="left":De.align[Fe]=null;for(ue=De.cells.length,Fe=0;Fe<ue;Fe++)De.cells[Fe]=H(De.cells[Fe].replace(/^ *\| *| *\| *$/g,""),De.header.length);return De}}},Ne.lheading=function(ge){var Ee=this.rules.block.lheading.exec(ge);if(Ee)return{type:"heading",raw:Ee[0],depth:Ee[2].charAt(0)==="="?1:2,text:Ee[1]}},Ne.paragraph=function(ge){var Ee=this.rules.block.paragraph.exec(ge);if(Ee)return{type:"paragraph",raw:Ee[0],text:Ee[1].charAt(Ee[1].length-1)===`
`?Ee[1].slice(0,-1):Ee[1]}},Ne.text=function(ge,Ee){var De=this.rules.block.text.exec(ge);if(De){var ue=Ee[Ee.length-1];return ue&&ue.type==="text"?{raw:De[0],text:De[0]}:{type:"text",raw:De[0],text:De[0]}}},Ne.escape=function(ge){var Ee=this.rules.inline.escape.exec(ge);if(Ee)return{type:"escape",raw:Ee[0],text:Y(Ee[1])}},Ne.tag=function(ge,Ee,De){var ue=this.rules.inline.tag.exec(ge);if(ue)return!Ee&&/^<a /i.test(ue[0])?Ee=!0:Ee&&/^<\/a>/i.test(ue[0])&&(Ee=!1),!De&&/^<(pre|code|kbd|script)(\s|>)/i.test(ue[0])?De=!0:De&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ue[0])&&(De=!1),{type:this.options.sanitize?"text":"html",raw:ue[0],inLink:Ee,inRawBlock:De,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):Y(ue[0]):ue[0]}},Ne.link=function(ge){var Ee=this.rules.inline.link.exec(ge);if(Ee){var De=ie(Ee[2],"()");if(De>-1){var ue=Ee[0].indexOf("!")===0?5:4,Fe=ue+Ee[1].length+De;Ee[2]=Ee[2].substring(0,De),Ee[0]=Ee[0].substring(0,Fe).trim(),Ee[3]=""}var at=Ee[2],xt="";if(this.options.pedantic){var Kt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(at);Kt?(at=Kt[1],xt=Kt[3]):xt=""}else xt=Ee[3]?Ee[3].slice(1,-1):"";at=at.trim().replace(/^<([\s\S]*)>$/,"$1");var Xt=le(Ee,{href:at&&at.replace(this.rules.inline._escapes,"$1"),title:xt&&xt.replace(this.rules.inline._escapes,"$1")},Ee[0]);return Xt}},Ne.reflink=function(ge,Ee){var De;if((De=this.rules.inline.reflink.exec(ge))||(De=this.rules.inline.nolink.exec(ge))){var ue=(De[2]||De[1]).replace(/\s+/g," ");if(ue=Ee[ue.toLowerCase()],!ue||!ue.href){var Fe=De[0].charAt(0);return{type:"text",raw:Fe,text:Fe}}var at=le(De,ue,De[0]);return at}},Ne.strong=function(ge,Ee,De){De===void 0&&(De="");var ue=this.rules.inline.strong.start.exec(ge);if(ue&&(!ue[1]||ue[1]&&(De===""||this.rules.inline.punctuation.exec(De)))){Ee=Ee.slice(-1*ge.length);var Fe=ue[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;Fe.lastIndex=0;for(var at;(ue=Fe.exec(Ee))!=null;)if(at=this.rules.inline.strong.middle.exec(Ee.slice(0,ue.index+3)),at)return{type:"strong",raw:ge.slice(0,at[0].length),text:ge.slice(2,at[0].length-2)}}},Ne.em=function(ge,Ee,De){De===void 0&&(De="");var ue=this.rules.inline.em.start.exec(ge);if(ue&&(!ue[1]||ue[1]&&(De===""||this.rules.inline.punctuation.exec(De)))){Ee=Ee.slice(-1*ge.length);var Fe=ue[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;Fe.lastIndex=0;for(var at;(ue=Fe.exec(Ee))!=null;)if(at=this.rules.inline.em.middle.exec(Ee.slice(0,ue.index+2)),at)return{type:"em",raw:ge.slice(0,at[0].length),text:ge.slice(1,at[0].length-1)}}},Ne.codespan=function(ge){var Ee=this.rules.inline.code.exec(ge);if(Ee){var De=Ee[2].replace(/\n/g," "),ue=/[^ ]/.test(De),Fe=De.startsWith(" ")&&De.endsWith(" ");return ue&&Fe&&(De=De.substring(1,De.length-1)),De=Y(De,!0),{type:"codespan",raw:Ee[0],text:De}}},Ne.br=function(ge){var Ee=this.rules.inline.br.exec(ge);if(Ee)return{type:"br",raw:Ee[0]}},Ne.del=function(ge){var Ee=this.rules.inline.del.exec(ge);if(Ee)return{type:"del",raw:Ee[0],text:Ee[1]}},Ne.autolink=function(ge,Ee){var De=this.rules.inline.autolink.exec(ge);if(De){var ue,Fe;return De[2]==="@"?(ue=Y(this.options.mangle?Ee(De[1]):De[1]),Fe="mailto:"+ue):(ue=Y(De[1]),Fe=ue),{type:"link",raw:De[0],text:ue,href:Fe,tokens:[{type:"text",raw:ue,text:ue}]}}},Ne.url=function(ge,Ee){var De;if(De=this.rules.inline.url.exec(ge)){var ue,Fe;if(De[2]==="@")ue=Y(this.options.mangle?Ee(De[0]):De[0]),Fe="mailto:"+ue;else{var at;do at=De[0],De[0]=this.rules.inline._backpedal.exec(De[0])[0];while(at!==De[0]);ue=Y(De[0]),De[1]==="www."?Fe="http://"+ue:Fe=ue}return{type:"link",raw:De[0],text:ue,href:Fe,tokens:[{type:"text",raw:ue,text:ue}]}}},Ne.inlineText=function(ge,Ee,De){var ue=this.rules.inline.text.exec(ge);if(ue){var Fe;return Ee?Fe=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ue[0]):Y(ue[0]):ue[0]:Fe=Y(this.options.smartypants?De(ue[0]):ue[0]),{type:"text",raw:ue[0],text:Fe}}},He}(),Le=F.noopTest,we=F.edit,Ae=F.merge,pe={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:Le,table:Le,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=we(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=we(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=we(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._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",pe._comment=/<!--(?!-?>)[\s\S]*?-->/,pe.html=we(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=we(pe._paragraph).replace("hr",pe.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",pe._tag).getRegex(),pe.blockquote=we(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Ae({},pe),pe.gfm=Ae({},pe.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*|$)"}),pe.gfm.nptable=we(pe.gfm.nptable).replace("hr",pe.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",pe._tag).getRegex(),pe.gfm.table=we(pe.gfm.table).replace("hr",pe.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",pe._tag).getRegex(),pe.pedantic=Ae({},pe.normal,{html:we(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._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:Le,paragraph:we(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var be={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:Le,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:Le,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};be._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",be.punctuation=we(be.punctuation).replace(/punctuation/g,be._punctuation).getRegex(),be._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",be._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",be.em.start=we(be.em.start).replace(/punctuation/g,be._punctuation).getRegex(),be.em.middle=we(be.em.middle).replace(/punctuation/g,be._punctuation).replace(/overlapSkip/g,be._overlapSkip).getRegex(),be.em.endAst=we(be.em.endAst,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.em.endUnd=we(be.em.endUnd,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.strong.start=we(be.strong.start).replace(/punctuation/g,be._punctuation).getRegex(),be.strong.middle=we(be.strong.middle).replace(/punctuation/g,be._punctuation).replace(/blockSkip/g,be._blockSkip).getRegex(),be.strong.endAst=we(be.strong.endAst,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.strong.endUnd=we(be.strong.endUnd,"g").replace(/punctuation/g,be._punctuation).getRegex(),be.blockSkip=we(be._blockSkip,"g").getRegex(),be.overlapSkip=we(be._overlapSkip,"g").getRegex(),be._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,be._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,be._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])?)+(?![-_])/,be.autolink=we(be.autolink).replace("scheme",be._scheme).replace("email",be._email).getRegex(),be._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,be.tag=we(be.tag).replace("comment",pe._comment).replace("attribute",be._attribute).getRegex(),be._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,be._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,be._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,be.link=we(be.link).replace("label",be._label).replace("href",be._href).replace("title",be._title).getRegex(),be.reflink=we(be.reflink).replace("label",be._label).getRegex(),be.reflinkSearch=we(be.reflinkSearch,"g").replace("reflink",be.reflink).replace("nolink",be.nolink).getRegex(),be.normal=Ae({},be),be.pedantic=Ae({},be.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:we(/^!?\[(label)\]\((.*?)\)/).replace("label",be._label).getRegex(),reflink:we(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",be._label).getRegex()}),be.gfm=Ae({},be.normal,{escape:we(be.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.!#$%&'*+\/=?_`{\|}~-]+@))/}),be.gfm.url=we(be.gfm.url,"i").replace("email",be.gfm._extended_email).getRegex(),be.breaks=Ae({},be.gfm,{br:we(be.br).replace("{2,}","*").getRegex(),text:we(be.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ne={block:pe,inline:be},fe=$.defaults,_e=ne.block,ke=ne.inline;function et(He){return He.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 je(He){var Ne="",Ue,ge,Ee=He.length;for(Ue=0;Ue<Ee;Ue++)ge=He.charCodeAt(Ue),Math.random()>.5&&(ge="x"+ge.toString(16)),Ne+="&#"+ge+";";return Ne}var ot=function(){function He(Ue){this.tokens=[],this.tokens.links=Object.create(null),this.options=Ue||fe,this.options.tokenizer=this.options.tokenizer||new xe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ge={block:_e.normal,inline:ke.normal};this.options.pedantic?(ge.block=_e.pedantic,ge.inline=ke.pedantic):this.options.gfm&&(ge.block=_e.gfm,this.options.breaks?ge.inline=ke.breaks:ge.inline=ke.gfm),this.tokenizer.rules=ge}He.lex=function(ge,Ee){var De=new He(Ee);return De.lex(ge)};var Ne=He.prototype;return Ne.lex=function(ge){return ge=ge.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(ge,this.tokens,!0),this.inline(this.tokens),this.tokens},Ne.blockTokens=function(ge,Ee,De){Ee===void 0&&(Ee=[]),De===void 0&&(De=!0),ge=ge.replace(/^ +$/gm,"");for(var ue,Fe,at,xt;ge;){if(ue=this.tokenizer.space(ge)){ge=ge.substring(ue.raw.length),ue.type&&Ee.push(ue);continue}if(ue=this.tokenizer.code(ge,Ee)){ge=ge.substring(ue.raw.length),ue.type?Ee.push(ue):(xt=Ee[Ee.length-1],xt.raw+=`
`+ue.raw,xt.text+=`
`+ue.text);continue}if(ue=this.tokenizer.fences(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.heading(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.nptable(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.hr(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.blockquote(ge)){ge=ge.substring(ue.raw.length),ue.tokens=this.blockTokens(ue.text,[],De),Ee.push(ue);continue}if(ue=this.tokenizer.list(ge)){for(ge=ge.substring(ue.raw.length),at=ue.items.length,Fe=0;Fe<at;Fe++)ue.items[Fe].tokens=this.blockTokens(ue.items[Fe].text,[],!1);Ee.push(ue);continue}if(ue=this.tokenizer.html(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(De&&(ue=this.tokenizer.def(ge))){ge=ge.substring(ue.raw.length),this.tokens.links[ue.tag]||(this.tokens.links[ue.tag]={href:ue.href,title:ue.title});continue}if(ue=this.tokenizer.table(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.lheading(ge)){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(De&&(ue=this.tokenizer.paragraph(ge))){ge=ge.substring(ue.raw.length),Ee.push(ue);continue}if(ue=this.tokenizer.text(ge,Ee)){ge=ge.substring(ue.raw.length),ue.type?Ee.push(ue):(xt=Ee[Ee.length-1],xt.raw+=`
`+ue.raw,xt.text+=`
`+ue.text);continue}if(ge){var Kt="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error(Kt);break}else throw new Error(Kt)}}return Ee},Ne.inline=function(ge){var Ee,De,ue,Fe,at,xt,Kt=ge.length;for(Ee=0;Ee<Kt;Ee++){xt=ge[Ee];switch(xt.type){case"paragraph":case"text":case"heading":{xt.tokens=[],this.inlineTokens(xt.text,xt.tokens);break}case"table":{for(xt.tokens={header:[],cells:[]},Fe=xt.header.length,De=0;De<Fe;De++)xt.tokens.header[De]=[],this.inlineTokens(xt.header[De],xt.tokens.header[De]);for(Fe=xt.cells.length,De=0;De<Fe;De++)for(at=xt.cells[De],xt.tokens.cells[De]=[],ue=0;ue<at.length;ue++)xt.tokens.cells[De][ue]=[],this.inlineTokens(at[ue],xt.tokens.cells[De][ue]);break}case"blockquote":{this.inline(xt.tokens);break}case"list":{for(Fe=xt.items.length,De=0;De<Fe;De++)this.inline(xt.items[De].tokens);break}}}return ge},Ne.inlineTokens=function(ge,Ee,De,ue,Fe){Ee===void 0&&(Ee=[]),De===void 0&&(De=!1),ue===void 0&&(ue=!1),Fe===void 0&&(Fe="");var at,xt=ge,Kt;if(this.tokens.links){var Xt=Object.keys(this.tokens.links);if(Xt.length>0)for(;(Kt=this.tokenizer.rules.inline.reflinkSearch.exec(xt))!=null;)Xt.includes(Kt[0].slice(Kt[0].lastIndexOf("[")+1,-1))&&(xt=xt.slice(0,Kt.index)+"["+"a".repeat(Kt[0].length-2)+"]"+xt.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Kt=this.tokenizer.rules.inline.blockSkip.exec(xt))!=null;)xt=xt.slice(0,Kt.index)+"["+"a".repeat(Kt[0].length-2)+"]"+xt.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ge;){if(at=this.tokenizer.escape(ge)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.tag(ge,De,ue)){ge=ge.substring(at.raw.length),De=at.inLink,ue=at.inRawBlock,Ee.push(at);continue}if(at=this.tokenizer.link(ge)){ge=ge.substring(at.raw.length),at.type==="link"&&(at.tokens=this.inlineTokens(at.text,[],!0,ue)),Ee.push(at);continue}if(at=this.tokenizer.reflink(ge,this.tokens.links)){ge=ge.substring(at.raw.length),at.type==="link"&&(at.tokens=this.inlineTokens(at.text,[],!0,ue)),Ee.push(at);continue}if(at=this.tokenizer.strong(ge,xt,Fe)){ge=ge.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],De,ue),Ee.push(at);continue}if(at=this.tokenizer.em(ge,xt,Fe)){ge=ge.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],De,ue),Ee.push(at);continue}if(at=this.tokenizer.codespan(ge)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.br(ge)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.del(ge)){ge=ge.substring(at.raw.length),at.tokens=this.inlineTokens(at.text,[],De,ue),Ee.push(at);continue}if(at=this.tokenizer.autolink(ge,je)){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(!De&&(at=this.tokenizer.url(ge,je))){ge=ge.substring(at.raw.length),Ee.push(at);continue}if(at=this.tokenizer.inlineText(ge,ue,et)){ge=ge.substring(at.raw.length),Fe=at.raw.slice(-1),Ee.push(at);continue}if(ge){var $t="Infinite loop on byte: "+ge.charCodeAt(0);if(this.options.silent){console.error($t);break}else throw new Error($t)}}return Ee},Q(He,null,[{key:"rules",get:function(){return{block:_e,inline:ke}}}]),He}(),_t=$.defaults,Re=F.cleanUrl,Be=F.escape,Qe=function(){function He(Ue){this.options=Ue||_t}var Ne=He.prototype;return Ne.code=function(ge,Ee,De){var ue=(Ee||"").match(/\S*/)[0];if(this.options.highlight){var Fe=this.options.highlight(ge,ue);Fe!=null&&Fe!==ge&&(De=!0,ge=Fe)}return ue?'<pre><code class="'+this.options.langPrefix+Be(ue,!0)+'">'+(De?ge:Be(ge,!0))+`</code></pre>
`:"<pre><code>"+(De?ge:Be(ge,!0))+`</code></pre>
`},Ne.blockquote=function(ge){return`<blockquote>
`+ge+`</blockquote>
`},Ne.html=function(ge){return ge},Ne.heading=function(ge,Ee,De,ue){return this.options.headerIds?"<h"+Ee+' id="'+this.options.headerPrefix+ue.slug(De)+'">'+ge+"</h"+Ee+`>
`:"<h"+Ee+">"+ge+"</h"+Ee+`>
`},Ne.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},Ne.list=function(ge,Ee,De){var ue=Ee?"ol":"ul",Fe=Ee&&De!==1?' start="'+De+'"':"";return"<"+ue+Fe+`>
`+ge+"</"+ue+`>
`},Ne.listitem=function(ge){return"<li>"+ge+`</li>
`},Ne.checkbox=function(ge){return"<input "+(ge?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},Ne.paragraph=function(ge){return"<p>"+ge+`</p>
`},Ne.table=function(ge,Ee){return Ee&&(Ee="<tbody>"+Ee+"</tbody>"),`<table>
<thead>
`+ge+`</thead>
`+Ee+`</table>
`},Ne.tablerow=function(ge){return`<tr>
`+ge+`</tr>
`},Ne.tablecell=function(ge,Ee){var De=Ee.header?"th":"td",ue=Ee.align?"<"+De+' align="'+Ee.align+'">':"<"+De+">";return ue+ge+"</"+De+`>
`},Ne.strong=function(ge){return"<strong>"+ge+"</strong>"},Ne.em=function(ge){return"<em>"+ge+"</em>"},Ne.codespan=function(ge){return"<code>"+ge+"</code>"},Ne.br=function(){return this.options.xhtml?"<br/>":"<br>"},Ne.del=function(ge){return"<del>"+ge+"</del>"},Ne.link=function(ge,Ee,De){if(ge=Re(this.options.sanitize,this.options.baseUrl,ge),ge===null)return De;var ue='<a href="'+Be(ge)+'"';return Ee&&(ue+=' title="'+Ee+'"'),ue+=">"+De+"</a>",ue},Ne.image=function(ge,Ee,De){if(ge=Re(this.options.sanitize,this.options.baseUrl,ge),ge===null)return De;var ue='<img src="'+ge+'" alt="'+De+'"';return Ee&&(ue+=' title="'+Ee+'"'),ue+=this.options.xhtml?"/>":">",ue},Ne.text=function(ge){return ge},He}(),Ve=function(){function He(){}var Ne=He.prototype;return Ne.strong=function(ge){return ge},Ne.em=function(ge){return ge},Ne.codespan=function(ge){return ge},Ne.del=function(ge){return ge},Ne.html=function(ge){return ge},Ne.text=function(ge){return ge},Ne.link=function(ge,Ee,De){return""+De},Ne.image=function(ge,Ee,De){return""+De},Ne.br=function(){return""},He}(),Et=function(){function He(){this.seen={}}var Ne=He.prototype;return Ne.slug=function(ge){var Ee=ge.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Ee)){var De=Ee;do this.seen[De]++,Ee=De+"-"+this.seen[De];while(this.seen.hasOwnProperty(Ee))}return this.seen[Ee]=0,Ee},He}(),kt=$.defaults,Vt=F.unescape,Qt=function(){function He(Ue){this.options=Ue||kt,this.options.renderer=this.options.renderer||new Qe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Ve,this.slugger=new Et}He.parse=function(ge,Ee){var De=new He(Ee);return De.parse(ge)};var Ne=He.prototype;return Ne.parse=function(ge,Ee){Ee===void 0&&(Ee=!0);var De="",ue,Fe,at,xt,Kt,Xt,$t,$n,vn,ln,hn,Gn,fr,vr,ir,br,Rr,Jt,Ar=ge.length;for(ue=0;ue<Ar;ue++){ln=ge[ue];switch(ln.type){case"space":continue;case"hr":{De+=this.renderer.hr();continue}case"heading":{De+=this.renderer.heading(this.parseInline(ln.tokens),ln.depth,Vt(this.parseInline(ln.tokens,this.textRenderer)),this.slugger);continue}case"code":{De+=this.renderer.code(ln.text,ln.lang,ln.escaped);continue}case"table":{for($n="",$t="",xt=ln.header.length,Fe=0;Fe<xt;Fe++)$t+=this.renderer.tablecell(this.parseInline(ln.tokens.header[Fe]),{header:!0,align:ln.align[Fe]});for($n+=this.renderer.tablerow($t),vn="",xt=ln.cells.length,Fe=0;Fe<xt;Fe++){for(Xt=ln.tokens.cells[Fe],$t="",Kt=Xt.length,at=0;at<Kt;at++)$t+=this.renderer.tablecell(this.parseInline(Xt[at]),{header:!1,align:ln.align[at]});vn+=this.renderer.tablerow($t)}De+=this.renderer.table($n,vn);continue}case"blockquote":{vn=this.parse(ln.tokens),De+=this.renderer.blockquote(vn);continue}case"list":{for(hn=ln.ordered,Gn=ln.start,fr=ln.loose,xt=ln.items.length,vn="",Fe=0;Fe<xt;Fe++)ir=ln.items[Fe],br=ir.checked,Rr=ir.task,vr="",ir.task&&(Jt=this.renderer.checkbox(br),fr?ir.tokens.length>0&&ir.tokens[0].type==="text"?(ir.tokens[0].text=Jt+" "+ir.tokens[0].text,ir.tokens[0].tokens&&ir.tokens[0].tokens.length>0&&ir.tokens[0].tokens[0].type==="text"&&(ir.tokens[0].tokens[0].text=Jt+" "+ir.tokens[0].tokens[0].text)):ir.tokens.unshift({type:"text",text:Jt}):vr+=Jt),vr+=this.parse(ir.tokens,fr),vn+=this.renderer.listitem(vr,Rr,br);De+=this.renderer.list(vn,hn,Gn);continue}case"html":{De+=this.renderer.html(ln.text);continue}case"paragraph":{De+=this.renderer.paragraph(this.parseInline(ln.tokens));continue}case"text":{for(vn=ln.tokens?this.parseInline(ln.tokens):ln.text;ue+1<Ar&&ge[ue+1].type==="text";)ln=ge[++ue],vn+=`
`+(ln.tokens?this.parseInline(ln.tokens):ln.text);De+=Ee?this.renderer.paragraph(vn):vn;continue}default:{var Nn='Token with "'+ln.type+'" type was not found.';if(this.options.silent){console.error(Nn);return}else throw new Error(Nn)}}}return De},Ne.parseInline=function(ge,Ee){Ee=Ee||this.renderer;var De="",ue,Fe,at=ge.length;for(ue=0;ue<at;ue++){Fe=ge[ue];switch(Fe.type){case"escape":{De+=Ee.text(Fe.text);break}case"html":{De+=Ee.html(Fe.text);break}case"link":{De+=Ee.link(Fe.href,Fe.title,this.parseInline(Fe.tokens,Ee));break}case"image":{De+=Ee.image(Fe.href,Fe.title,Fe.text);break}case"strong":{De+=Ee.strong(this.parseInline(Fe.tokens,Ee));break}case"em":{De+=Ee.em(this.parseInline(Fe.tokens,Ee));break}case"codespan":{De+=Ee.codespan(Fe.text);break}case"br":{De+=Ee.br();break}case"del":{De+=Ee.del(this.parseInline(Fe.tokens,Ee));break}case"text":{De+=Ee.text(Fe.text);break}default:{var xt='Token with "'+Fe.type+'" type was not found.';if(this.options.silent){console.error(xt);return}else throw new Error(xt)}}}return De},He}(),an=F.merge,sn=F.checkSanitizeDeprecation,qe=F.escape,Ze=$.getDefaults,Ct=$.changeDefaults,At=$.defaults;function ct(He,Ne,Ue){if(typeof He=="undefined"||He===null)throw new Error("marked(): input parameter is undefined or null");if(typeof He!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(He)+", string expected");if(typeof Ne=="function"&&(Ue=Ne,Ne=null),Ne=an({},ct.defaults,Ne||{}),sn(Ne),Ue){var ge=Ne.highlight,Ee;try{Ee=ot.lex(He,Ne)}catch(at){return Ue(at)}var De=function(xt){var Kt;if(!xt)try{Kt=Qt.parse(Ee,Ne)}catch(Xt){xt=Xt}return Ne.highlight=ge,xt?Ue(xt):Ue(null,Kt)};if(!ge||ge.length<3)return De();if(delete Ne.highlight,!Ee.length)return De();var ue=0;ct.walkTokens(Ee,function(at){at.type==="code"&&(ue++,setTimeout(function(){ge(at.text,at.lang,function(xt,Kt){if(xt)return De(xt);Kt!=null&&Kt!==at.text&&(at.text=Kt,at.escaped=!0),ue--,ue===0&&De()})},0))}),ue===0&&De();return}try{var Fe=ot.lex(He,Ne);return Ne.walkTokens&&ct.walkTokens(Fe,Ne.walkTokens),Qt.parse(Fe,Ne)}catch(at){if(at.message+=`
Please report this to https://github.com/markedjs/marked.`,Ne.silent)return"<p>An error occurred:</p><pre>"+qe(at.message+"",!0)+"</pre>";throw at}}ct.options=ct.setOptions=function(He){return an(ct.defaults,He),Ct(ct.defaults),ct},ct.getDefaults=Ze,ct.defaults=At,ct.use=function(He){var Ne=an({},He);if(He.renderer&&function(){var ge=ct.defaults.renderer||new Qe,Ee=function(Fe){var at=ge[Fe];ge[Fe]=function(){for(var xt=arguments.length,Kt=new Array(xt),Xt=0;Xt<xt;Xt++)Kt[Xt]=arguments[Xt];var $t=He.renderer[Fe].apply(ge,Kt);return $t===!1&&($t=at.apply(ge,Kt)),$t}};for(var De in He.renderer)Ee(De);Ne.renderer=ge}(),He.tokenizer&&function(){var ge=ct.defaults.tokenizer||new xe,Ee=function(Fe){var at=ge[Fe];ge[Fe]=function(){for(var xt=arguments.length,Kt=new Array(xt),Xt=0;Xt<xt;Xt++)Kt[Xt]=arguments[Xt];var $t=He.tokenizer[Fe].apply(ge,Kt);return $t===!1&&($t=at.apply(ge,Kt)),$t}};for(var De in He.tokenizer)Ee(De);Ne.tokenizer=ge}(),He.walkTokens){var Ue=ct.defaults.walkTokens;Ne.walkTokens=function(ge){He.walkTokens(ge),Ue&&Ue(ge)}}ct.setOptions(Ne)},ct.walkTokens=function(He,Ne){for(var Ue=K(He),ge;!(ge=Ue()).done;){var Ee=ge.value;Ne(Ee);switch(Ee.type){case"table":{for(var De=K(Ee.tokens.header),ue;!(ue=De()).done;){var Fe=ue.value;ct.walkTokens(Fe,Ne)}for(var at=K(Ee.tokens.cells),xt;!(xt=at()).done;)for(var Kt=xt.value,Xt=K(Kt),$t;!($t=Xt()).done;){var $n=$t.value;ct.walkTokens($n,Ne)}break}case"list":{ct.walkTokens(Ee.items,Ne);break}default:Ee.tokens&&ct.walkTokens(Ee.tokens,Ne)}}},ct.Parser=Qt,ct.parser=Qt.parse,ct.Renderer=Qe,ct.TextRenderer=Ve,ct.Lexer=ot,ct.lexer=ot.lex,ct.Tokenizer=xe,ct.Slugger=Et,ct.parse=ct;var ft=ct;return ft})},ELLl:function(It,Oe,U){(function(te){te(U("VrN/"))})(function(te){var Q={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},B=te.Pos;te.defineOption("autoCloseBrackets",!1,function(c,s,i){i&&i!=te.Init&&(c.removeKeyMap(K),c.state.closeBrackets=null),s&&(N(J(s,"pairs")),c.state.closeBrackets=s,c.addKeyMap(K))});function J(c,s){return s=="pairs"&&typeof c=="string"?c:typeof c=="object"&&c[s]!=null?c[s]:Q[s]}var K={Backspace:r,Enter:D};function N(c){for(var s=0;s<c.length;s++){var i=c.charAt(s),t="'"+i+"'";K[t]||(K[t]=$(i))}}N(Q.pairs+"`");function $(c){return function(s){return g(s,c)}}function z(c){var s=c.state.closeBrackets;if(!s||s.override)return s;var i=c.getModeAt(c.getCursor());return i.closeBrackets||s}function r(c){var s=z(c);if(!s||c.getOption("disableInput"))return te.Pass;for(var i=J(s,"pairs"),t=c.listSelections(),u=0;u<t.length;u++){if(!t[u].empty())return te.Pass;var o=p(c,t[u].head);if(!o||i.indexOf(o)%2!=0)return te.Pass}for(var u=t.length-1;u>=0;u--){var R=t[u].head;c.replaceRange("",B(R.line,R.ch-1),B(R.line,R.ch+1),"+delete")}}function D(c){var s=z(c),i=s&&J(s,"explode");if(!i||c.getOption("disableInput"))return te.Pass;for(var t=c.listSelections(),u=0;u<t.length;u++){if(!t[u].empty())return te.Pass;var o=p(c,t[u].head);if(!o||i.indexOf(o)%2!=0)return te.Pass}c.operation(function(){var R=c.lineSeparator()||`
`;c.replaceSelection(R+R,null),c.execCommand("goCharLeft"),t=c.listSelections();for(var T=0;T<t.length;T++){var S=t[T].head.line;c.indentLine(S,null,!0),c.indentLine(S+1,null,!0)}})}function m(c){var s=te.cmpPos(c.anchor,c.head)>0;return{anchor:new B(c.anchor.line,c.anchor.ch+(s?-1:1)),head:new B(c.head.line,c.head.ch+(s?1:-1))}}function g(c,s){var i=z(c);if(!i||c.getOption("disableInput"))return te.Pass;var t=J(i,"pairs"),u=t.indexOf(s);if(u==-1)return te.Pass;for(var o=J(i,"closeBefore"),R=J(i,"triples"),T=t.charAt(u+1)==s,S=c.listSelections(),A=u%2==0,I,x=0;x<S.length;x++){var b=S[x],h=b.head,f,C=c.getRange(h,B(h.line,h.ch+1));if(A&&!b.empty())f="surround";else if((T||!A)&&C==s)T&&a(c,h)?f="both":R.indexOf(s)>=0&&c.getRange(h,B(h.line,h.ch+3))==s+s+s?f="skipThree":f="skip";else if(T&&h.ch>1&&R.indexOf(s)>=0&&c.getRange(B(h.line,h.ch-2),h)==s+s){if(h.ch>2&&/\bstring/.test(c.getTokenTypeAt(B(h.line,h.ch-2))))return te.Pass;f="addFour"}else if(T){var E=h.ch==0?" ":c.getRange(B(h.line,h.ch-1),h);if(!te.isWordChar(C)&&E!=s&&!te.isWordChar(E))f="both";else return te.Pass}else if(A&&(C.length===0||/\s/.test(C)||o.indexOf(C)>-1))f="both";else return te.Pass;if(!I)I=f;else if(I!=f)return te.Pass}var _=u%2?t.charAt(u-1):s,W=u%2?s:t.charAt(u+1);c.operation(function(){if(I=="skip")c.execCommand("goCharRight");else if(I=="skipThree")for(var j=0;j<3;j++)c.execCommand("goCharRight");else if(I=="surround"){for(var w=c.getSelections(),j=0;j<w.length;j++)w[j]=_+w[j]+W;c.replaceSelections(w,"around"),w=c.listSelections().slice();for(var j=0;j<w.length;j++)w[j]=m(w[j]);c.setSelections(w)}else I=="both"?(c.replaceSelection(_+W,null),c.triggerElectric(_+W),c.execCommand("goCharLeft")):I=="addFour"&&(c.replaceSelection(_+_+_+_,"before"),c.execCommand("goCharRight"))})}function p(c,s){var i=c.getRange(B(s.line,s.ch-1),B(s.line,s.ch+1));return i.length==2?i:null}function a(c,s){var i=c.getTokenAt(B(s.line,s.ch+1));return/\bstring/.test(i.type)&&i.start==s.ch&&(s.ch==0||!/\bstring/.test(c.getTokenTypeAt(s)))}})},FWmy:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return te});function te(Q,B){if(!Q)throw new Error(B?`Assertion failed (${B})`:"Assertion Failed")}},GfqC:function(It,Oe,U){"use strict";var te=U("q1tI"),Q=U.n(te),B=U("TSYQ"),J=U.n(B);function K(F,P){var v="cannot "+F.method+" "+F.action+" "+P.status+"'",H=new Error(v);return H.status=P.status,H.method=F.method,H.url=F.action,H}function N(F){var P=F.responseText||F.response;if(!P)return P;try{return JSON.parse(P)}catch(v){return P}}function $(F){var P=new XMLHttpRequest;F.onProgress&&P.upload&&(P.upload.onprogress=function(ie){ie.total>0&&(ie.percent=ie.loaded/ie.total*100),F.onProgress(ie)});var v=new FormData;F.data&&Object.keys(F.data).forEach(function(Y){var ie=F.data[Y];if(Array.isArray(ie)){ie.forEach(function(le){v.append(Y+"[]",le)});return}v.append(Y,F.data[Y])}),F.file instanceof Blob?v.append(F.filename,F.file,F.file.name):v.append(F.filename,F.file),P.onerror=function(ie){F.onError(ie)},P.onload=function(){return P.status<200||P.status>=300?F.onError(K(F,P),N(P)):F.onSuccess(N(P),P)},P.open(F.method,F.action,!0),F.withCredentials&&"withCredentials"in P&&(P.withCredentials=!0);var H=F.headers||{};return H["X-Requested-With"]!==null&&P.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(H).forEach(function(Y){H[Y]!==null&&P.setRequestHeader(Y,H[Y])}),P.send(v),{abort:function(){P.abort()}}}var z=+new Date,r=0;function D(){return"rc-upload-"+z+"-"+ ++r}function m(F,P){return F.indexOf(P,F.length-P.length)!==-1}var g=function(F,P){if(F&&P){var v=Array.isArray(P)?P:P.split(","),H=F.name||"",Y=F.type||"",ie=Y.replace(/\/.*$/,"");return v.some(function(le){var he=le.trim();return he.charAt(0)==="."?m(H.toLowerCase(),he.toLowerCase()):/\/\*$/.test(he)?ie===he.replace(/\/.*$/,""):Y===he})}return!0};function p(F,P){var v=F.createReader(),H=[];function Y(){v.readEntries(function(ie){var le=Array.prototype.slice.apply(ie);H=H.concat(le);var he=!le.length;he?P(H):Y()})}Y()}var a=function(P,v,H){var Y=function ie(le,he){he=he||"",le.isFile?le.file(function(xe){H(xe)&&(le.fullPath&&!xe.webkitRelativePath&&(Object.defineProperties(xe,{webkitRelativePath:{writable:!0}}),xe.webkitRelativePath=le.fullPath.replace(/^\//,""),Object.defineProperties(xe,{webkitRelativePath:{writable:!1}})),v([xe]))}):le.isDirectory&&p(le,function(xe){xe.forEach(function(Le){ie(Le,""+he+le.name+"/")})})};P.forEach(function(ie){Y(ie.webkitGetAsEntry())})},c=a,s=Object.assign||function(F){for(var P=1;P<arguments.length;P++){var v=arguments[P];for(var H in v)Object.prototype.hasOwnProperty.call(v,H)&&(F[H]=v[H])}return F},i=function(){function F(P,v){var H=[],Y=!0,ie=!1,le=void 0;try{for(var he=P[Symbol.iterator](),xe;!(Y=(xe=he.next()).done)&&!(H.push(xe.value),v&&H.length===v);Y=!0);}catch(Le){ie=!0,le=Le}finally{try{!Y&&he.return&&he.return()}finally{if(ie)throw le}}return H}return function(P,v){if(Array.isArray(P))return P;if(Symbol.iterator in Object(P))return F(P,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),t=function(){function F(P,v){for(var H=0;H<v.length;H++){var Y=v[H];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(P,Y.key,Y)}}return function(P,v,H){return v&&F(P.prototype,v),H&&F(P,H),P}}();function u(F,P,v){return P in F?Object.defineProperty(F,P,{value:v,enumerable:!0,configurable:!0,writable:!0}):F[P]=v,F}function o(F,P){var v={};for(var H in F){if(P.indexOf(H)>=0)continue;if(!Object.prototype.hasOwnProperty.call(F,H))continue;v[H]=F[H]}return v}function R(F,P){if(!(F instanceof P))throw new TypeError("Cannot call a class as a function")}function T(F,P){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:F}function S(F,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);F.prototype=Object.create(P&&P.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(F,P):F.__proto__=P)}var A=function(P){return Object.keys(P).reduce(function(v,H){return(H.substr(0,5)==="data-"||H.substr(0,5)==="aria-"||H==="role")&&(v[H]=P[H]),v},{})},I=function(F){S(P,F);function P(){var v,H,Y,ie;R(this,P);for(var le=arguments.length,he=Array(le),xe=0;xe<le;xe++)he[xe]=arguments[xe];return ie=(H=(Y=T(this,(v=P.__proto__||Object.getPrototypeOf(P)).call.apply(v,[this].concat(he))),Y),Y.state={uid:D()},Y.reqs={},Y.onChange=function(Le){var we=Le.target.files;Y.uploadFiles(we),Y.reset()},Y.onClick=function(Le){var we=Y.fileInput;if(!we)return;var Ae=Y.props,pe=Ae.children,be=Ae.onClick;pe&&pe.type==="button"&&(we.parentNode.focus(),we.parentNode.querySelector("button").blur()),we.click(),be&&be(Le)},Y.onKeyDown=function(Le){Le.key==="Enter"&&Y.onClick()},Y.onFileDrop=function(Le){var we=Y.props.multiple;if(Le.preventDefault(),Le.type==="dragover")return;if(Y.props.directory)c(Array.prototype.slice.call(Le.dataTransfer.items),Y.uploadFiles,function(pe){return g(pe,Y.props.accept)});else{var Ae=Array.prototype.slice.call(Le.dataTransfer.files).filter(function(pe){return g(pe,Y.props.accept)});we===!1&&(Ae=Ae.slice(0,1)),Y.uploadFiles(Ae)}},Y.uploadFiles=function(Le){var we=Array.prototype.slice.call(Le);we.map(function(Ae){return Ae.uid=D(),Ae}).forEach(function(Ae){Y.upload(Ae,we)})},Y.saveFileInput=function(Le){Y.fileInput=Le},H),T(Y,ie)}return t(P,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(H,Y){var ie=this,le=this.props;if(!le.beforeUpload)return setTimeout(function(){return ie.post(H)},0);var he=le.beforeUpload(H,Y);he&&he.then?he.then(function(xe){var Le=Object.prototype.toString.call(xe);return Le==="[object File]"||Le==="[object Blob]"?ie.post(xe):ie.post(H)}).catch(function(xe){console.log(xe)}):he!==!1&&setTimeout(function(){return ie.post(H)},0);return}},{key:"post",value:function(H){var Y=this;if(!this._isMounted)return;var ie=this.props,le=ie.onStart,he=ie.onProgress,xe=ie.transformFile,Le=xe===void 0?function(we){return we}:xe;new Promise(function(we){var Ae=ie.action;return typeof Ae=="function"&&(Ae=Ae(H)),we(Ae)}).then(function(we){var Ae=H.uid,pe=ie.customRequest||$,be=Promise.resolve(Le(H)).then(function(ne){var fe=ie.data;return typeof fe=="function"&&(fe=fe(ne)),Promise.all([ne,fe])}).catch(function(ne){console.error(ne)});be.then(function(ne){var fe=i(ne,2),_e=fe[0],ke=fe[1],et={action:we,filename:ie.name,data:ke,file:_e,headers:ie.headers,withCredentials:ie.withCredentials,method:ie.method||"post",onProgress:he?function(je){he(je,H)}:null,onSuccess:function(ot,_t){delete Y.reqs[Ae],ie.onSuccess(ot,H,_t)},onError:function(ot,_t){delete Y.reqs[Ae],ie.onError(ot,_t,H)}};le(H),Y.reqs[Ae]=pe(et)})})}},{key:"reset",value:function(){this.setState({uid:D()})}},{key:"abort",value:function(H){var Y=this.reqs;if(H){var ie=H;H&&H.uid&&(ie=H.uid),Y[ie]&&Y[ie].abort&&Y[ie].abort(),delete Y[ie]}else Object.keys(Y).forEach(function(le){Y[le]&&Y[le].abort&&Y[le].abort(),delete Y[le]})}},{key:"render",value:function(){var H,Y=this.props,ie=Y.component,le=Y.prefixCls,he=Y.className,xe=Y.disabled,Le=Y.id,we=Y.style,Ae=Y.multiple,pe=Y.accept,be=Y.children,ne=Y.directory,fe=Y.openFileDialogOnClick,_e=Y.onMouseEnter,ke=Y.onMouseLeave,et=o(Y,["component","prefixCls","className","disabled","id","style","multiple","accept","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"]),je=J()((H={},u(H,le,!0),u(H,le+"-disabled",xe),u(H,he,he),H)),ot=xe?{}:{onClick:fe?this.onClick:function(){},onKeyDown:fe?this.onKeyDown:function(){},onMouseEnter:_e,onMouseLeave:ke,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return Q.a.createElement(ie,s({},ot,{className:je,role:"button",style:we}),Q.a.createElement("input",s({},A(et),{id:Le,type:"file",ref:this.saveFileInput,onClick:function(Re){return Re.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:pe,directory:ne?"directory":null,webkitdirectory:ne?"webkitdirectory":null,multiple:Ae,onChange:this.onChange})),be)}}]),P}(te.Component),x=I,b=Object.assign||function(F){for(var P=1;P<arguments.length;P++){var v=arguments[P];for(var H in v)Object.prototype.hasOwnProperty.call(v,H)&&(F[H]=v[H])}return F},h=function(){function F(P,v){for(var H=0;H<v.length;H++){var Y=v[H];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(P,Y.key,Y)}}return function(P,v,H){return v&&F(P.prototype,v),H&&F(P,H),P}}();function f(F,P){if(!(F instanceof P))throw new TypeError("Cannot call a class as a function")}function C(F,P){if(!F)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return P&&(typeof P=="object"||typeof P=="function")?P:F}function E(F,P){if(typeof P!="function"&&P!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof P);F.prototype=Object.create(P&&P.prototype,{constructor:{value:F,enumerable:!1,writable:!0,configurable:!0}}),P&&(Object.setPrototypeOf?Object.setPrototypeOf(F,P):F.__proto__=P)}function _(){}var W=function(F){E(P,F);function P(){var v,H,Y,ie;f(this,P);for(var le=arguments.length,he=Array(le),xe=0;xe<le;xe++)he[xe]=arguments[xe];return ie=(H=(Y=C(this,(v=P.__proto__||Object.getPrototypeOf(P)).call.apply(v,[this].concat(he))),Y),Y.saveUploader=function(Le){Y.uploader=Le},H),C(Y,ie)}return h(P,[{key:"abort",value:function(H){this.uploader.abort(H)}},{key:"render",value:function(){return Q.a.createElement(x,b({},this.props,{ref:this.saveUploader}))}}]),P}(te.Component);W.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:_,onError:_,onSuccess:_,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var j=W,w=Oe.a=j},HmJG:function(It,Oe,U){},IBYe:function(It,Oe,U){"use strict";function te(Q){return null}Oe.a=te},JYp7:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return te});var te;(function(Q){function B(o){return o&&typeof o=="object"&&typeof o[Symbol.iterator]=="function"}Q.is=B;const J=Object.freeze([]);function K(){return J}Q.empty=K;function*N(o){yield o}Q.single=N;function $(o){return o||J}Q.from=$;function z(o){return!o||o[Symbol.iterator]().next().done===!0}Q.isEmpty=z;function r(o){return o[Symbol.iterator]().next().value}Q.first=r;function D(o,R){for(const T of o)if(R(T))return!0;return!1}Q.some=D;function m(o,R){for(const T of o)if(R(T))return T;return}Q.find=m;function*g(o,R){for(const T of o)R(T)&&(yield T)}Q.filter=g;function*p(o,R){let T=0;for(const S of o)yield R(S,T++)}Q.map=p;function*a(...o){for(const R of o)for(const T of R)yield T}Q.concat=a;function*c(o){for(const R of o)for(const T of R)yield T}Q.concatNested=c;function s(o,R,T){let S=T;for(const A of o)S=R(S,A);return S}Q.reduce=s;function*i(o,R,T=o.length){for(R<0&&(R+=o.length),T<0?T+=o.length:T>o.length&&(T=o.length);R<T;R++)yield o[R]}Q.slice=i;function t(o,R=Number.POSITIVE_INFINITY){const T=[];if(R===0)return[T,o];const S=o[Symbol.iterator]();for(let A=0;A<R;A++){const I=S.next();if(I.done)return[T,Q.empty()];T.push(I.value)}return[T,{[Symbol.iterator](){return S}}]}Q.consume=t;function u(o,R,T=(S,A)=>S===A){const S=o[Symbol.iterator](),A=R[Symbol.iterator]();for(;;){const I=S.next(),x=A.next();if(I.done!==x.done)return!1;if(I.done)return!0;if(!T(I.value,x.value))return!1}}Q.equals=u})(te||(te={}))},LYsE:function(It,Oe,U){"use strict";var te=U("9og8"),Q=U("giR+"),B=U("fyUT"),J=U("2qtc"),K=U("kLXV"),N=U("/zsF"),$=U("PArb"),z=U("14J3"),r=U("BMrR"),D=U("+L6B"),m=U("2/Rp"),g=U("k1fw"),p=U("0Owb"),a=U("tJVT"),c=U("WmNS"),s=U.n(c),i=U("q1tI"),t=U.n(i),u=U("5Dmo"),o=U("3S7+"),R=U("5NDa"),T=U("5rEg"),S=U("jCWc"),A=U("kPKH"),I=U("BoS7"),x=U("Sdc0"),b=U("7Kak"),h=U("9yH6"),f=U("sRBo"),C=U("kaz8"),E=U("miYZ"),_=U("tsqr"),W=U("oBTY"),j=U("PpiC"),w=U("Ty5D"),F=U("9kvl"),P=U("V0Rq"),v=U("Ot1p"),H=U("kqOp"),Y=U("7qnI"),ie=U("1vsH"),le=U("YJx+"),he=U.n(le),xe=U("9Bee"),Le=U("u2Z1"),we=["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"],Ae="\u2581",pe=function(Ke,Ot){var Me=Ke.problemset,ye=Ke.globalSetting,ve=Ke.exercise,or=Ke.loading,en=Ke.dispatch,Ie=Ke.editData,gt=Ke.editKey,Ce=Ke.setEditKey,dn=Ce===void 0?function(){}:Ce,hr=Ke.cancelAdd,mr=hr===void 0?function(){}:hr,q=Ke.addCallback,O=q===void 0?function(){}:q,M=Ke.reload,X=M===void 0?function(){}:M,se=Ke.setIsClaer,Z=se===void 0?function(){}:se,Pe=Object(j.a)(Ke,["problemset","globalSetting","exercise","loading","dispatch","editData","editKey","setEditKey","cancelAdd","addCallback","reload","setIsClaer"]),st=Object(i.useState)(""),wt=Object(a.a)(st,2),Pt=wt[0],dt=wt[1],bt=Object(i.useState)(""),Mt=Object(a.a)(bt,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)([]),fn=Object(a.a)(Hn,2),Wt=fn[0],rn=fn[1],qt=Object(i.useState)(""),Ft=Object(a.a)(qt,2),Qn=Ft[0],Bn=Ft[1],xn=Object(i.useState)(),Jn=Object(a.a)(xn,2),pn=Jn[0],Sn=Jn[1],un=Object(i.useState)(!1),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(i.useState)(),Kn=Object(a.a)(Ln,2),nn=Kn[0],_n=Kn[1],In=Object(i.useState)(0),wn=Object(a.a)(In,2),Zn=wn[0],yn=wn[1],Vn=Object(i.useState)(!1),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=Object(i.useState)(!1),Dn=Object(a.a)(Mn,2),cn=Dn[0],Ut=Dn[1],Gt=Object(i.useState)([]),zt=Object(a.a)(Gt,2),jt=zt[0],tn=zt[1],bn=Object(i.useState)(1),gn=Object(a.a)(bn,2),yt=gn[0],lt=gn[1],Je=Object(i.useState)(!1),nt=Object(a.a)(Je,2),Ge=nt[0],pt=nt[1],rt=Object(i.useRef)(!1),Tt=Object(w.i)(),Nt=Object(i.useState)([]),St=Object(a.a)(Nt,2),Ht=St[0],Rt=St[1],Lt=function(lr){Rt([].concat(Object(W.a)(Ht),[Object(g.a)({},lr)]))};Object(i.useEffect)(function(){if(rt.current)return;if(!(Ie!=null&&Ie.question_title)){Pn(!0),dt(""),Sn(!1),_n(2),rn([]),Bn(""),nr(!1);return}dt(Ie==null?void 0:Ie.question_title),Sn(Ie==null?void 0:Ie.is_ordered),lt(Ie==null?void 0:Ie.difficulty),pt(!(Ie!=null&&Ie.repeat_answer)),_n(Ie==null?void 0:Ie.question_score);var xr=Ie==null?void 0:Ie.standard_answer.map(function(lr){return lr.answer_text});rn(Object(W.a)(xr)),tn(Ie.tag_discipline_ids),Yn(Ie==null?void 0:Ie.analysis)},[Ie,kn]),Object(i.useEffect)(function(){nr(!1),kn&&xr();function xr(){return lr.apply(this,arguments)}function lr(){return lr=Object(te.a)(s.a.mark(function wr(){var Er,Cr,Ur;return s.a.wrap(function(Fr){for(;;)switch(Fr.prev=Fr.next){case 0:return Fr.next=2,Object(P.I)({sub_discipline_id:(Er=ve.editData)===null||Er===void 0||((Cr=Er.exercise)===null||Cr===void 0)?void 0:Cr.sub_discipline_id});case 2:Ur=Fr.sent,Rt(Ur.tag_disciplines);case 4:case"end":return Fr.stop()}},wr)})),lr.apply(this,arguments)}},[kn]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:on,isEdit:kn}}),Object(i.useEffect)(function(){var xr,lr=ve!=null&&(xr=ve.tagDisciplineData)!==null&&xr!==void 0&&xr.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];Rt(lr)},[ve.tagDisciplineData]);var En=function(lr){(lr==null?void 0:lr.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Pn(!1),dn(-1),rt.current=!1,X())},on=function(){var xr=Object(te.a)(s.a.mark(function lr(){var wr,Er,Cr,Ur,Vr,Fr,kr;return s.a.wrap(function(Kr){for(;;)switch(Kr.prev=Kr.next){case 0:if(wr=[],Er=!1,Ut(!0),Wt.forEach(function(Si,Zr){wr.push({choice_id:Zr+1,answer_text:[]}),Si.forEach(function(ei,yi){wr[Zr].answer_text.push(ei),(!ei||!Object(ie.db)(ei,1e4))&&(Bn("".concat(Zr,"-").concat(yi)),_.b.info(ei?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),Er=!0)})}),!Er){Kr.next=7;break}return Ut(!1),Kr.abrupt("return",!1);case 7:if(rt.current=!0,!Ie.question_id){Kr.next=19;break}if(!((Ie==null?void 0:Ie.is_my)===1)){Kr.next=13;break}K.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 Si=Object(te.a)(s.a.mark(function ei(){var yi,Ri;return s.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return fi.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Pt,question_type:3,question_score:nn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(yi=ve.editData)===null||yi===void 0||((Ri=yi.exercise)===null||Ri===void 0)?void 0:Ri.sub_discipline_id,difficulty:yt,is_cover:1,repeat_answer:!Ge,analysis:Cn}});case 2:Cr=fi.sent,En(Cr);case 4:case"end":return fi.stop()}},ei)}));function Zr(){return Si.apply(this,arguments)}return Zr}(),onCancel:function(){var Si=Object(te.a)(s.a.mark(function ei(){var yi,Ri;return s.a.wrap(function(fi){for(;;)switch(fi.prev=fi.next){case 0:return fi.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Pt,question_type:3,question_score:nn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(yi=ve.editData)===null||yi===void 0||((Ri=yi.exercise)===null||Ri===void 0)?void 0:Ri.sub_discipline_id,difficulty:yt,repeat_answer:!Ge,analysis:Cn}});case 2:Cr=fi.sent,En(Cr);case 4:case"end":return fi.stop()}},ei)}));function Zr(){return Si.apply(this,arguments)}return Zr}()}),Kr.next=17;break;case 13:return Kr.next=15,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Pt,question_type:3,question_score:nn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(Ur=ve.editData)===null||Ur===void 0||((Vr=Ur.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,difficulty:yt,repeat_answer:!Ge,analysis:Cn}});case 15:Cr=Kr.sent,En(Cr);case 17:Kr.next=23;break;case 19:return Kr.next=21,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ie==null?void 0:Ie.insert_id,categoryId:Tt.categoryId,question_title:Pt,question_type:3,question_score:nn,is_ordered:pn,standard_answers:wr,tag_discipline_ids:jt,sub_discipline_id:(Fr=ve.editData)===null||Fr===void 0||((kr=Fr.exercise)===null||kr===void 0)?void 0:kr.sub_discipline_id,difficulty:yt,repeat_answer:!Ge,analysis:Cn}});case 21:Cr=Kr.sent,En(Cr);case 23:return Ut(!1),Kr.abrupt("return",{name:Pt,analysis:Cn,standard_answers:wr,is_ordered:pn});case 25:case"end":return Kr.stop()}},lr)}));return function(){return xr.apply(this,arguments)}}(),gr=function(lr,wr,Er){var Cr=Wt.slice();if(wr&&Cr.splice(lr,wr),Er&&Xn||!Ie.question_id)for(var Ur=0;Ur<Er;Ur++)Cr.splice(lr+Ur,0,[""]);yn(Cr==null?void 0:Cr.length),nr(!0),console.log(Cr,"newStandardAnswers"),rn(Cr)},er=function(lr,wr,Er){Bn("");var Cr=Wt.slice();Cr[lr][wr]=Er,rn(Cr)},tr=function(lr){var wr=Wt.slice();wr[lr]=[].concat(Object(W.a)(wr[lr]),[""]),rn(wr)},Yt=function(lr,wr){var Er=Wt.slice();if(!Er[lr][wr]){Er[lr]=Er[lr].filter(function(Cr,Ur){return Ur!==wr}),rn(Er);return}K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:he.a.modal,onOk:function(){Er[lr]=Er[lr].filter(function(Ur,Vr){return Vr!==wr}),rn(Er)}})},Rn=function(lr){K.a.confirm({centered:!0,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:"\u786E\u8BA4\u8981\u5220\u9664\u8FD9\u4E2A\u53C2\u8003\u7B54\u6848\u5417\uFF1F",className:he.a.modal,onOk:function(){var Er=0;dt(Pt.replace(/\▁/g,function(Cr){return Er++,Er-1===lr?"":Cr})),setTimeout(function(){var Cr=Wt.slice();Cr=Wt.filter(function(Ur,Vr){return lr!==Vr}),rn(Cr)},500)}})},zn=function(){},rr=function(){var lr,wr,Er,Cr,Ur,Vr;return console.log(Wt,"answers"),t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u586B\u7A7A\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848 \uFF1B\u652F\u6301\u6700\u591A5\u4E2A\u7A7A\uFF0C\u6BCF\u7A7A\u5F97\u5206\u6309\u7167\u672C\u9898\u7684\u603B\u5206\u5E73\u5747\u8BA1\u7B97\uFF09")),t.a.createElement("div",null,t.a.createElement(H.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:Pt,onChange:function(kr){return dt(kr)},showNullButton:((lr=ve.editData)===null||lr===void 0||((wr=lr.exercise)===null||wr===void 0)?void 0:wr.exercise_status)===1,deleteEmptyDisabled:!(((Er=ve.editData)===null||Er===void 0||((Cr=Er.exercise)===null||Cr===void 0)?void 0:Cr.exercise_status)===1)||cn,onPlaceholderChange:gr})),t.a.createElement("div",{className:"mt20"},Wt.map(function(Fr,kr){var Ti,Kr;return t.a.createElement(Y.a,{key:kr,answers:Fr,index:kr,is_md:!0,exerciseIsPublish:((Ti=ve.editData)===null||Ti===void 0||((Kr=Ti.exercise)===null||Kr===void 0)?void 0:Kr.exercise_status)!==1,activeOptionErrorIndex:Qn,onAnswerChange:er,addChildAnswer:tr,deleteChildAnswer:Yt,deleteChildAnswermain:Rn})})),t.a.createElement("div",{className:"mt20"},Wt.length>1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:pn,onChange:function(kr){return Sn(kr.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Cn,onChange:function(kr){return Yn(kr)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:nn,max:1e4,min:0,onChange:function(kr){_n(kr)}})," ","\u5206 \xA0"," ",!!nn&&!!Zn&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(nn/Zn).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:yt,onChange:function(kr){lt(kr.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Le.a,{value:jt,selectvalues:Ie==null?void 0:Ie.tag_discipline_ids,onChange:tn,subId:(Ur=ve.editData)===null||Ur===void 0||((Vr=Ur.exercise)===null||Vr===void 0)?void 0:Vr.sub_discipline_id,knowledgeOptions:Ht,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(x.a,{checked:Ge,onChange:function(kr){pt(kr)}}))),t.a.createElement("aside",{className:"tr"},(gt!==-1||Ie.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){mr(),Pn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){on()}},"\u4FDD\u5B58")))},On=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(xr){var lr,wr;return(ve==null||((lr=ve.editData)===null||lr===void 0||((wr=lr.exercise)===null||wr===void 0))?void 0:wr.exercise_status)===1?xr:xr.id!=="del"&&xr.id!=="add"}),Ir=function(){var xr=Object(te.a)(s.a.mark(function lr(wr){return s.a.wrap(function(Cr){for(;;)switch(Cr.prev=Cr.next){case 0:if(!(gt!==-1)){Cr.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Cr.abrupt("return");case 3:Cr.t0=wr.id,Cr.next=Cr.t0==="del"?6:Cr.t0==="up"||Cr.t0==="down"?8:Cr.t0==="edit"?12:Cr.t0==="add"?15:17;break;case 6:return K.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(te.a)(s.a.mark(function Vr(){return s.a.wrap(function(kr){for(;;)switch(kr.prev=kr.next){case 0:return kr.next=2,Object(P.n)({id:Ie.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Tt)});case 3:case"end":return kr.stop()}},Vr)}))()}}),Cr.abrupt("break",17);case 8:return Cr.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ie.question_id,opr:wr.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Tt)}),Cr.abrupt("break",17);case 12:return dn(Ie.dragKey),Pn(!0),Cr.abrupt("break",17);case 15:return O({key:Ie.key,insert_id:Ie==null?void 0:Ie.question_id,question_type:3}),Cr.abrupt("break",17);case 17:case"end":return Cr.stop()}},lr)}));return function(wr){return xr.apply(this,arguments)}}(),jr=function(){var lr;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ie!=null&&Ie.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ie.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",Ie.question_score,"\u5206\uFF09")),Ie!=null&&Ie.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ie.key,"."),t.a.createElement(xe.a,{value:Ie.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ie.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ie.question_title})),t.a.createElement("div",{className:he.a.questionChoices},Ie==null||((lr=Ie.standard_answer)===null||lr===void 0)?void 0:lr.map(function(wr,Er){return t.a.createElement(r.a,{key:Er,align:"middle"},t.a.createElement(A.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",wr.choice_id,"\uFF09\uFF1A"),t.a.createElement(A.a,{flex:"1"},t.a.createElement(r.a,{align:"middle",gutter:[1,1]},wr.answer_text.map(function(Cr,Ur){return t.a.createElement(A.a,{span:24,key:Ur},t.a.createElement(T.a,{key:Er,checked:Ie.standard_answer.includes(Er),disabled:!0,value:Cr}))}))))})),t.a.createElement("div",{className:he.a.action},!Ie.hideAction&&On.map(function(wr,Er){return wr.id==="up"&&Ie.key===1||wr.id==="down"&&Ie.key===Ie.len?null:t.a.createElement(o.a,{key:Er,placement:"bottom",title:wr.name},t.a.createElement("span",{onClick:function(){return Ir(wr)},className:wr.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!kn&&jr(),kn&&rr())},be=Object(F.a)(function(mt){var Ke=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ke,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(pe)),ne=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],fe=function(Ke,Ot){var Me=Ke.problemset,ye=Ke.globalSetting,ve=Ke.exercise,or=Ke.loading,en=Ke.dispatch,Ie=Ke.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ke.editData,dn=Ke.editKey,hr=Ke.setEditKey,mr=hr===void 0?function(){}:hr,q=Ke.cancelAdd,O=q===void 0?function(){}:q,M=Ke.reload,X=M===void 0?function(){}:M,se=Ke.addCallback,Z=se===void 0?function(){}:se,Pe=Ke.setIsClaer,st=Pe===void 0?function(){}:Pe,wt=Object(j.a)(Ke,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","editKey","setEditKey","cancelAdd","reload","addCallback","setIsClaer"]),Pt=Object(i.useState)(),dt=Object(a.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!1),rn=Object(a.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=Object(i.useState)(),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)([]),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],nn=Object(i.useState)(1),_n=Object(a.a)(nn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(!1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)(""),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],cn=Object(i.useRef)(!1),Ut=function(Je){Kn([].concat(Object(W.a)(Ln),[Object(g.a)({},Je)]))},Gt=Object(w.i)();Object(i.useEffect)(function(){if(cn.current)return;if(!(Ce!=null&&Ce.question_choices)){Ft(!0),fn(""),Jn(2),Mt("");return}qn(!(Ce!=null&&Ce.repeat_answer)),fn(Ce==null?void 0:Ce.question_title),Jn(Ce==null?void 0:Ce.question_score),wn(Ce==null?void 0:Ce.difficulty),Mt(Ce.standard_answer[0]+""),Un(Ce.tag_discipline_ids),Dn(Ce==null?void 0:Ce.analysis)},[Ce,qt]),Object(i.useEffect)(function(){qt&&lt();function lt(){return Je.apply(this,arguments)}function Je(){return Je=Object(te.a)(s.a.mark(function nt(){var Ge,pt,rt;return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(P.I)({sub_discipline_id:(Ge=ve.editData)===null||Ge===void 0||((pt=Ge.exercise)===null||pt===void 0)?void 0:pt.sub_discipline_id});case 2:rt=Nt.sent,Kn(rt.tag_disciplines);case 4:case"end":return Nt.stop()}},nt)})),Je.apply(this,arguments)}},[qt]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:jt,isEdit:qt}}),Object(i.useEffect)(function(){var lt,Je=ve!=null&&(lt=ve.tagDisciplineData)!==null&&lt!==void 0&&lt.tag_disciplines&&Array.isArray(ve.tagDisciplineData.tag_disciplines)?ve.tagDisciplineData.tag_disciplines:[];Kn(Je)},[ve.tagDisciplineData]);var zt=function(Je){(Je==null?void 0:Je.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Ft(!1),mr(-1),cn.current=!1,X())},jt=function(){var lt=Object(te.a)(s.a.mark(function Je(){var nt,Ge,pt,rt,Tt,Nt;return s.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:if(Hn){Ht.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Ht.abrupt("return",!1);case 3:if(bt){Ht.next=6;break}return _.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Ht.abrupt("return",!1);case 6:if(nt=[{choice_text:"\u6B63\u786E",is_answer:bt==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:bt==="2"?2:0}],cn.current=!0,!Ce.question_id){Ht.next=19;break}if(!((Ce==null?void 0:Ce.is_my)===1)){Ht.next=13;break}K.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 Rt=Object(te.a)(s.a.mark(function En(){var on,gr;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Yt){return Yt.choice_text}),standard_answers:nt.filter(function(Yt){return Yt.is_answer}).map(function(Yt){return Yt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(on=ve.editData)===null||on===void 0||((gr=on.exercise)===null||gr===void 0)?void 0:gr.sub_discipline_id,difficulty:In,is_cover:1,repeat_answer:!Vn,analysis:Mn}});case 2:Ge=tr.sent,zt(Ge);case 4:case"end":return tr.stop()}},En)}));function Lt(){return Rt.apply(this,arguments)}return Lt}(),onCancel:function(){var Rt=Object(te.a)(s.a.mark(function En(){var on,gr;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Yt){return Yt.choice_text}),standard_answers:nt.filter(function(Yt){return Yt.is_answer}).map(function(Yt){return Yt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(on=ve.editData)===null||on===void 0||((gr=on.exercise)===null||gr===void 0)?void 0:gr.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Mn}});case 2:Ge=tr.sent,zt(Ge);case 4:case"end":return tr.stop()}},En)}));function Lt(){return Rt.apply(this,arguments)}return Lt}()}),Ht.next=17;break;case 13:return Ht.next=15,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Rt){return Rt.choice_text}),standard_answers:nt.filter(function(Rt){return Rt.is_answer}).map(function(Rt){return Rt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(pt=ve.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Mn}});case 15:Ge=Ht.sent,zt(Ge);case 17:Ht.next=23;break;case 19:return Ht.next=21,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:Gt.categoryId,question_title:Hn,question_type:2,question_score:xn,question_choices:nt.map(function(Rt){return Rt.choice_text}),standard_answers:nt.filter(function(Rt){return Rt.is_answer}).map(function(Rt){return Rt.is_answer}),tag_discipline_ids:un,sub_discipline_id:(Tt=ve.editData)===null||Tt===void 0||((Nt=Tt.exercise)===null||Nt===void 0)?void 0:Nt.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Mn}});case 21:Ge=Ht.sent,zt(Ge);case 23:return Ht.abrupt("return",{name:Hn,choices:nt});case 24:case"end":return Ht.stop()}},Je)}));return function(){return lt.apply(this,arguments)}}(),tn=[{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(lt){var Je,nt;return(ve==null||((Je=ve.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0))?void 0:nt.exercise_status)===1?lt:lt.id!=="del"&&lt.id!=="add"}),bn=function(){var lt=Object(te.a)(s.a.mark(function Je(nt){return s.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:if(!(dn!==-1)){pt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),pt.abrupt("return");case 3:pt.t0=nt.id,pt.next=pt.t0==="del"?6:pt.t0==="up"||pt.t0==="down"?8:pt.t0==="edit"?12:pt.t0==="add"?15:17;break;case 6:return K.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(te.a)(s.a.mark(function Tt(){return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(P.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Gt)});case 3:case"end":return St.stop()}},Tt)}))()}}),pt.abrupt("break",17);case 8:return pt.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:nt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Gt)}),pt.abrupt("break",17);case 12:return mr(Ce.dragKey),Ft(!0),pt.abrupt("break",17);case 15:return Z({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:2}),pt.abrupt("break",17);case 17:case"end":return pt.stop()}},Je)}));return function(nt){return lt.apply(this,arguments)}}(),gn=function(){var Je;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(xe.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},Ce==null||((Je=Ce.question_choices)===null||Je===void 0)?void 0:Je.map(function(nt,Ge){return t.a.createElement(h.a,{key:Ge,checked:Ce.standard_answer.includes(Ge+1),disabled:!0},ne[Ge],"."," ",t.a.createElement("span",{className:"c-black font14"},nt.choice_text))})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&tn.map(function(nt,Ge){return nt.id==="up"&&Ce.key===1||nt.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:Ge,placement:"bottom",title:nt.name},t.a.createElement("span",{onClick:function(){return bn(nt)},className:nt.icon}))})))},yt=function(){var Je,nt;return t.a.createElement("aside",null,t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5224\u65AD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Hn,onChange:function(pt){return fn(pt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(h.a.Group,{buttonStyle:"solid",value:bt,onChange:function(pt){return Mt(pt.target.value)}},t.a.createElement(h.a.Button,{value:"1",className:"".concat(he.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(h.a.Button,{value:"2",className:he.a.radio},"\u9519\u8BEF")),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\uFF0C\u53EF\u4EE5\u76F4\u63A5\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Mn,onChange:function(pt){return Dn(pt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:xn,max:1e4,min:0,onChange:function(pt){Jn(pt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:In,onChange:function(pt){wn(pt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Le.a,{value:un,selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,onChange:Un,subId:(Je=ve.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0)?void 0:nt.sub_discipline_id,knowledgeOptions:Ln,onAddKnowledgeFinish:Ut})),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(x.a,{checked:Vn,onChange:function(pt){qn(pt)}}))),t.a.createElement("aside",{className:"tr"},(dn!==-1||Ce.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){O(),Ft(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){jt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!qt&&gn(),qt&&yt())},_e=Object(F.a)(function(mt){var Ke=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ke,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(fe)),ke=["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"],et=Object(i.forwardRef)(function(mt,Ke){var Ot=mt.problemset,Me=mt.globalSetting,ye=mt.exercise,ve=mt.loading,or=mt.dispatch,en=mt.onRef,Ie=en===void 0?function(){}:en,gt=mt.editData,Ce=mt.cancelAdd,dn=Ce===void 0?function(){}:Ce,hr=mt.editKey,mr=mt.setEditKey,q=mr===void 0?function(){}:mr,O=mt.setIsClaer,M=O===void 0?function(){}:O,X=mt.addCallback,se=X===void 0?function(Nt){}:X,Z=mt.reload,Pe=Z===void 0?function(){}:Z,st=Object(j.a)(mt,["problemset","globalSetting","exercise","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),wt=Object(i.useState)([]),Pt=Object(a.a)(wt,2),dt=Pt[0],bt=Pt[1],Mt=Object(i.useState)(),Cn=Object(a.a)(Mt,2),Yn=Cn[0],Hn=Cn[1],fn=Object(i.useState)([]),Wt=Object(a.a)(fn,2),rn=Wt[0],qt=Wt[1],Ft=Object(i.useState)(""),Qn=Object(a.a)(Ft,2),Bn=Qn[0],xn=Qn[1],Jn=Object(i.useState)(),pn=Object(a.a)(Jn,2),Sn=pn[0],un=pn[1],Un=Object(i.useState)(!1),Xn=Object(a.a)(Un,2),nr=Xn[0],Ln=Xn[1],Kn=Object(i.useState)([]),nn=Object(a.a)(Kn,2),_n=nn[0],In=nn[1],wn=Object(i.useState)(1),Zn=Object(a.a)(wn,2),yn=Zn[0],Vn=Zn[1],qn=Object(i.useState)(!1),kn=Object(a.a)(qn,2),Pn=kn[0],Mn=kn[1],Dn=Object(i.useState)(""),cn=Object(a.a)(Dn,2),Ut=cn[0],Gt=cn[1],zt=Object(i.useState)([]),jt=Object(a.a)(zt,2),tn=jt[0],bn=jt[1],gn=Object(i.useRef)(!1),yt=function(St){bn([].concat(Object(W.a)(tn),[Object(g.a)({},St)]))},lt=Object(w.i)();Object(i.useEffect)(function(){bt(["","","",""])},[]),Object(i.useEffect)(function(){if(gn.current)return;if(!(gt!=null&&gt.question_choices)){Ln(!0),xn(""),un(5),bt(["","","",""]),qt([]);return}xn(gt==null?void 0:gt.question_title),un(gt==null?void 0:gt.question_score),Mn(!(gt!=null&&gt.repeat_answer)),Vn(gt==null?void 0:gt.difficulty),bt(gt==null?void 0:gt.question_choices.map(function(St){return St.choice_text}));var Nt=[];gt==null||gt.standard_answer.map(function(St,Ht){Nt.push(St-1)}),qt(Nt),In(gt.tag_discipline_ids),Gt(gt==null?void 0:gt.analysis)},[gt,nr]),Object(i.useEffect)(function(){nr&&Nt();function Nt(){return St.apply(this,arguments)}function St(){return St=Object(te.a)(s.a.mark(function Ht(){var Rt,Lt,En;return s.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:return gr.next=2,Object(P.I)({sub_discipline_id:(Rt=ye.editData)===null||Rt===void 0||((Lt=Rt.exercise)===null||Lt===void 0)?void 0:Lt.sub_discipline_id});case 2:En=gr.sent,bn(En.tag_disciplines);case 4:case"end":return gr.stop()}},Ht)})),St.apply(this,arguments)}},[nr]),Object(i.useImperativeHandle)(Ke,function(){return{onSave:nt,isEdit:nr}}),Object(i.useEffect)(function(){var Nt,St=ye!=null&&(Nt=ye.tagDisciplineData)!==null&&Nt!==void 0&&Nt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];bn(St)},[ye.tagDisciplineData]);var Je=function(St){(St==null?void 0:St.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Ln(!1),q(-1),gn.current=!1,Pe())},nt=function(){var Nt=Object(te.a)(s.a.mark(function St(){var Ht,Rt,Lt,En,on,gr,er;return s.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:if(Bn){Yt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Yt.abrupt("return",!1);case 3:if(Ht=dt.findIndex(function(Rn){return!Rn}),!(Ht>-1)){Yt.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(ke[Ht]," \u9009\u9879\u7684\u5185\u5BB9")),Yt.abrupt("return",!1);case 7:if(rn.length){Yt.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Yt.abrupt("return",!1);case 10:if(!(rn.length<1)){Yt.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Yt.abrupt("return",!1);case 13:if(Rt=dt.map(function(Rn,zn){return{choice_text:Rn,is_answer:rn.includes(zn)?zn+1:0}}),gn.current=!0,!gt.question_id){Yt.next=26;break}if(!((gt==null?void 0:gt.is_my)===1)){Yt.next=20;break}K.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 Rn=Object(te.a)(s.a.mark(function rr(){var On,Ir;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,or({type:"exercise/editExerciseQuestion",payload:{id:gt.question_id,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(lr){return lr.choice_text}),standard_answers:Rt.filter(function(lr){return lr.is_answer}).map(function(lr){return lr.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(On=ye.editData)===null||On===void 0||((Ir=On.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:yn,is_cover:1,repeat_answer:!Pn,analysis:Ut}});case 2:Lt=xr.sent,Je(Lt);case 4:case"end":return xr.stop()}},rr)}));function zn(){return Rn.apply(this,arguments)}return zn}(),onCancel:function(){var Rn=Object(te.a)(s.a.mark(function rr(){var On,Ir;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,or({type:"exercise/editExerciseQuestion",payload:{id:gt.question_id,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(lr){return lr.choice_text}),standard_answers:Rt.filter(function(lr){return lr.is_answer}).map(function(lr){return lr.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(On=ye.editData)===null||On===void 0||((Ir=On.exercise)===null||Ir===void 0)?void 0:Ir.sub_discipline_id,difficulty:yn,repeat_answer:!Pn,analysis:Ut}});case 2:Lt=xr.sent,Je(Lt);case 4:case"end":return xr.stop()}},rr)}));function zn(){return Rn.apply(this,arguments)}return zn}()}),Yt.next=24;break;case 20:return Yt.next=22,or({type:"exercise/editExerciseQuestion",payload:{id:gt.question_id,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(Rn){return Rn.choice_text}),standard_answers:Rt.filter(function(Rn){return Rn.is_answer}).map(function(Rn){return Rn.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(En=ye.editData)===null||En===void 0||((on=En.exercise)===null||on===void 0)?void 0:on.sub_discipline_id,difficulty:yn,repeat_answer:!Pn,analysis:Ut}});case 22:Lt=Yt.sent,Je(Lt);case 24:Yt.next=30;break;case 26:return Yt.next=28,or({type:"exercise/addExerciseQuestion",payload:{insert_id:gt==null?void 0:gt.insert_id,categoryId:lt.categoryId,question_title:Bn,question_type:1,question_score:Sn,question_choices:Rt.map(function(Rn){return Rn.choice_text}),standard_answers:Rt.filter(function(Rn){return Rn.is_answer}).map(function(Rn){return Rn.is_answer}),tag_discipline_ids:_n,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:yn,repeat_answer:!Pn,analysis:Ut}});case 28:Lt=Yt.sent,Je(Lt);case 30:case"end":return Yt.stop()}},St)}));return function(){return Nt.apply(this,arguments)}}(),Ge=[{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(Nt){var St,Ht;return(ye==null||((St=ye.editData)===null||St===void 0||((Ht=St.exercise)===null||Ht===void 0))?void 0:Ht.exercise_status)===1?Nt:Nt.id!=="del"&&Nt.id!=="add"}),pt=function(){var Nt=Object(te.a)(s.a.mark(function St(Ht){return s.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:if(!(hr!==-1)){Lt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Lt.abrupt("return");case 3:Lt.t0=Ht.id,Lt.next=Lt.t0==="del"?6:Lt.t0==="up"||Lt.t0==="down"?8:Lt.t0==="edit"?12:Lt.t0==="add"?15:17;break;case 6:return K.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(te.a)(s.a.mark(function on(){return s.a.wrap(function(er){for(;;)switch(er.prev=er.next){case 0:return er.next=2,Object(P.n)({id:gt.question_id});case 2:or({type:"exercise/editExercise",payload:Object(g.a)({},lt)});case 3:case"end":return er.stop()}},on)}))()}}),Lt.abrupt("break",17);case 8:return Lt.next=10,or({type:"exercise/exeriseMoveUpDown",payload:{id:gt.question_id,opr:Ht.id}});case 10:return or({type:"exercise/editExercise",payload:Object(g.a)({},lt)}),Lt.abrupt("break",17);case 12:return q(gt.dragKey),Ln(!0),Lt.abrupt("break",17);case 15:return se({key:gt.key,insert_id:gt==null?void 0:gt.question_id,question_type:1}),Lt.abrupt("break",17);case 17:case"end":return Lt.stop()}},St)}));return function(Ht){return Nt.apply(this,arguments)}}(),rt=function(){var St;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(gt!=null&&gt.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},gt.key,"\u3001\u591A\u9009\u9898"),"\uFF08",gt.question_score,"\u5206\uFF09")),gt!=null&&gt.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},gt.key,"."),t.a.createElement(xe.a,{value:gt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",gt.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:gt.question_title})),t.a.createElement("div",{className:he.a.questionChoices},gt==null||((St=gt.question_choices)===null||St===void 0)?void 0:St.map(function(Ht,Rt){return t.a.createElement(r.a,{key:Rt},t.a.createElement(A.a,null,t.a.createElement(C.a,{key:Rt,checked:gt.standard_answer.includes(Rt+1),disabled:!0},ke[Rt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Ht.choice_text}))))})),t.a.createElement("div",{className:he.a.action},!gt.hideAction&&Ge.map(function(Ht,Rt){return Ht.id==="up"&&gt.key===1||Ht.id==="down"&&gt.key===gt.len?null:t.a.createElement(o.a,{key:Rt,placement:"bottom",title:Ht.name},t.a.createElement("span",{onClick:function(){return pt(Ht)},className:Ht.icon}))})))},Tt=function(){var St,Ht;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Bn,onChange:function(Lt){return xn(Lt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),dt.map(function(Rt,Lt){var En,on;return t.a.createElement("div",{className:he.a.choiceWrap,key:Lt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(rn.includes(Lt)?he.a.activeAnswer:""),onClick:function(){rn.includes(Lt)?qt(rn.filter(function(er){return er!==Lt})):qt([].concat(Object(W.a)(rn),[Lt]))}},ke[Lt])),t.a.createElement("div",{className:he.a.editorWrap},Yn===Lt?t.a.createElement(v.a,{id:"single-question-option-".concat(Lt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:Rt,onChange:function(er){dt[Lt]=er,bt(dt)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return Hn(Lt)}},t.a.createElement(xe.a,{value:Rt}))),((En=ye.editData)===null||En===void 0||((on=En.exercise)===null||on===void 0)?void 0:on.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,Lt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return bt(dt.filter(function(er,tr){return tr!==Lt}))}})),Lt<7&&Lt===dt.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return bt([].concat(Object(W.a)(dt),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Ut,onChange:function(Lt){return Gt(Lt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Sn,max:1e4,min:0,onChange:function(Lt){un(Lt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:yn,onChange:function(Lt){Vn(Lt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Le.a,{value:_n,selectvalues:gt==null?void 0:gt.tag_discipline_ids,onChange:In,subId:(St=ye.editData)===null||St===void 0||((Ht=St.exercise)===null||Ht===void 0)?void 0:Ht.sub_discipline_id,knowledgeOptions:tn,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(x.a,{checked:Pn,onChange:function(Lt){Mn(Lt)}}))),t.a.createElement("aside",{className:"tr"},(hr!==-1||gt.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){dn(),Ln(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){nt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!nr&&rt(),nr&&Tt())}),je=Object(F.a)(function(mt){var Ke=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ke,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(et),ot=U("55Ip"),_t=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Re=function(Ke,Ot){var Me=Ke.problemset,ye=Ke.globalSetting,ve=Ke.exercise,or=Ke.loading,en=Ke.dispatch,Ie=Ke.editData,gt=Ke.cancelAdd,Ce=gt===void 0?function(){}:gt,dn=Ke.editKey,hr=Ke.setEditKey,mr=hr===void 0?function(){}:hr,q=Ke.addCallback,O=q===void 0?function(){}:q,M=Ke.reload,X=M===void 0?function(){}:M,se=Ke.setIsClaer,Z=se===void 0?function(){}:se,Pe=Object(j.a)(Ke,["problemset","globalSetting","exercise","loading","dispatch","editData","cancelAdd","editKey","setEditKey","addCallback","reload","setIsClaer"]),st=Object(i.useState)(""),wt=Object(a.a)(st,2),Pt=wt[0],dt=wt[1],bt=Object(i.useState)(""),Mt=Object(a.a)(bt,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)(""),fn=Object(a.a)(Hn,2),Wt=fn[0],rn=fn[1],qt=Object(i.useState)([]),Ft=Object(a.a)(qt,2),Qn=Ft[0],Bn=Ft[1],xn=Object(i.useState)(""),Jn=Object(a.a)(xn,2),pn=Jn[0],Sn=Jn[1],un=Object(i.useState)(),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(i.useState)(!1),Kn=Object(a.a)(Ln,2),nn=Kn[0],_n=Kn[1],In=Object(i.useState)([]),wn=Object(a.a)(In,2),Zn=wn[0],yn=wn[1],Vn=Object(i.useState)(!1),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=Object(i.useState)(!1),Dn=Object(a.a)(Mn,2),cn=Dn[0],Ut=Dn[1],Gt=Object(w.i)(),zt=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Je;if(zt.current)return;Ie.edit&&(Pn(!0),Yn(""),dt(""),yn([])),dt(Ie.shixun_name),Yn(Ie.question_title);var nt=[];(Je=Ie.shixun)===null||Je===void 0||Je.map(function(Ge){nt.push(Ge.challenge_score)}),yn(nt)},[Ie]),Object(i.useEffect)(function(){_n(!1)},[kn]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:tn,isEdit:kn}});var jt=function(nt){(nt==null?void 0:nt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Pn(!1),mr(-1),zt.current=!1,X())},tn=function(){var Je=Object(te.a)(s.a.mark(function nt(){var Ge,pt,rt;return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:if(Ge=[],pt=!1,!pt){Nt.next=4;break}return Nt.abrupt("return",!1);case 4:if(zt.current=!0,Ut(!0),!Ie.question_id){Nt.next=12;break}return Nt.next=9,en({type:"exercise/editExerciseQuestion",payload:{id:Ie.question_id,question_title:Cn,shixun_name:Pt,shixun_id:Ie.shixun_id,question_type:5,question_scores:Zn}});case 9:rt=Nt.sent,Nt.next=15;break;case 12:return Nt.next=14,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ie==null?void 0:Ie.insert_id,categoryId:Gt.categoryId,question_title:Cn,shixun_name:Pt,shixun_id:Ie.shixun_id,question_type:5,question_scores:Zn,is_copy:Ie.is_copy}});case 14:rt=Nt.sent;case 15:return jt(rt),Ut(!1),Nt.abrupt("return",{name:Cn,analysis:Wt,standard_answers:Ge,is_ordered:Xn});case 18:case"end":return Nt.stop()}},nt)}));return function(){return Je.apply(this,arguments)}}(),bn=function(){var nt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u5B9E\u8BAD\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u5141\u8BB8\u624B\u52A8\u8C03\u5206\uFF09")),t.a.createElement("div",{className:"mt10"},t.a.createElement(T.a,{defaultValue:Pt,onChange:function(pt){dt(pt.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(v.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:Cn,onChange:function(pt){Yn(pt)}})),t.a.createElement("div",{className:"mt20"},(nt=Ie.shixun)===null||nt===void 0?void 0:nt.map(function(Ge,pt){return t.a.createElement(r.a,{gutter:[20,20]},t.a.createElement(A.a,{flex:"1"},pt+1,".",Ge.challenge_name),t.a.createElement(A.a,null,t.a.createElement(B.a,{defaultValue:Zn[pt],onChange:function(Tt){Zn[pt]=Tt,yn(Zn),console.log("srore:L",Zn[pt])}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Qn.length>1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:Xn,onChange:function(pt){return nr(pt.target.checked)},className:"".concat(he.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(he.a.color999," font12")},"\uFF08\u9009\u4E2D\uFF0C\u6BCF\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u987A\u5E8F\u5FC5\u987B\u4E0E\u53C2\u8003\u7B54\u6848\u4E00\u81F4\uFF09"))),t.a.createElement("aside",{className:"tr"},(dn!==-1||!(Ie!=null&&Ie.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){Ce(),Pn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:cn,className:"ml20",type:"primary",onClick:function(){tn()}},"\u4FDD\u5B58")))},gn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Je){var nt,Ge;return(ve==null||((nt=ve.editData)===null||nt===void 0||((Ge=nt.exercise)===null||Ge===void 0))?void 0:Ge.exercise_status)===1?Je:Je.id!=="del"&&Je.id!=="add"}),yt=function(){var Je=Object(te.a)(s.a.mark(function nt(Ge){return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(!(dn!==-1)){rt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),rt.abrupt("return");case 3:rt.t0=Ge.id,rt.next=rt.t0==="del"?6:rt.t0==="up"||rt.t0==="down"?8:rt.t0==="edit"?12:rt.t0==="add"?15:17;break;case 6:return K.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(te.a)(s.a.mark(function Nt(){return s.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(P.n)({id:Ie.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Gt)});case 3:case"end":return Ht.stop()}},Nt)}))()}}),rt.abrupt("break",17);case 8:return rt.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ie.question_id,opr:Ge.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Gt)}),rt.abrupt("break",17);case 12:return mr(Ie.dragKey),Pn(!0),rt.abrupt("break",17);case 15:return en({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:Ie.key,insert_id:Ie==null?void 0:Ie.question_id,question_type:5}}}),rt.abrupt("break",17);case 17:case"end":return rt.stop()}},nt)}));return function(Ge){return Je.apply(this,arguments)}}(),lt=function(){var nt,Ge;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ie!=null&&Ie.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ie.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",Ie.question_score,"\u5206\uFF09")),Ie!=null&&Ie.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ie.key,"."),t.a.createElement(xe.a,{value:Ie.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ie.question_score,"\u5206\uFF09"),!!((nt=Ie.schools)!==null&&nt!==void 0&&nt.length)&&t.a.createElement(o.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ie.shixun_name})),t.a.createElement("div",{className:"mt30"}),(Ge=Ie.shixun)===null||Ge===void 0?void 0:Ge.map(function(pt,rt){return t.a.createElement("div",{key:rt},"\u7B2C",rt+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},pt.challenge_name)," ",t.a.createElement("span",{className:"ml10"},pt.challenge_score," \u5206"))}),t.a.createElement("div",{className:he.a.action},t.a.createElement(ot.a,{target:"_blank",to:"/shixuns/".concat(Ie.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!Ie.hideAction&&gn.map(function(pt,rt){return pt.id==="up"&&Ie.key===1||pt.id==="down"&&Ie.key===Ie.len?null:t.a.createElement(o.a,{key:rt,placement:"bottom",title:pt.name},t.a.createElement("span",{onClick:function(){return yt(pt)},className:pt.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!kn&&lt(),kn&&bn())},Be=Object(F.a)(function(mt){var Ke=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ke,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Re)),Qe=["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"],Ve=function(Ke,Ot){var Me=Ke.problemset,ye=Ke.exercise,ve=Ke.globalSetting,or=Ke.loading,en=Ke.dispatch,Ie=Ke.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ke.editData,dn=Ke.cancelAdd,hr=dn===void 0?function(){}:dn,mr=Ke.editKey,q=Ke.setEditKey,O=q===void 0?function(){}:q,M=Ke.setIsClaer,X=M===void 0?function(){}:M,se=Ke.reload,Z=se===void 0?function(){}:se,Pe=Ke.addCallback,st=Pe===void 0?function(Ht){}:Pe,wt=Object(j.a)(Ke,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","reload","addCallback"]),Pt=Object(i.useState)([]),dt=Object(a.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=Object(i.useState)(),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)([]),rn=Object(a.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=Object(i.useState)(""),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],nn=Object(i.useState)(!1),_n=Object(a.a)(nn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)(!1),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],cn=Object(i.useState)(""),Ut=Object(a.a)(cn,2),Gt=Ut[0],zt=Ut[1],jt=Object(w.i)(),tn=Object(i.useRef)(null),bn=Object(i.useRef)(!1),gn=Object(i.useState)([]),yt=Object(a.a)(gn,2),lt=yt[0],Je=yt[1],nt=function(Rt){Je([].concat(Object(W.a)(lt),[Object(g.a)({},Rt)]))};Object(i.useEffect)(function(){Mt(["","","",""])},[]),Object(i.useEffect)(function(){if(bn.current)return;if(!(Ce!=null&&Ce.question_choices)){wn(!0),Jn(""),Un(5),Mt(["","","",""]),Ft([]);return}Jn(Ce==null?void 0:Ce.question_title),Un(Ce==null?void 0:Ce.question_score),Dn(!(Ce!=null&&Ce.repeat_answer)),zt(Ce==null?void 0:Ce.analysis),qn(Ce==null?void 0:Ce.difficulty),Mt(Ce==null?void 0:Ce.question_choices.map(function(Rt){return Rt.choice_text}));var Ht=[];Ce==null||Ce.standard_answer.map(function(Rt,Lt){Ht.push(Rt-1)}),Kn(Ce.tag_discipline_ids),Ft(Ht)},[Ce,In]),Object(i.useEffect)(function(){In&&Ht();function Ht(){return Rt.apply(this,arguments)}function Rt(){return Rt=Object(te.a)(s.a.mark(function Lt(){var En,on,gr;return s.a.wrap(function(tr){for(;;)switch(tr.prev=tr.next){case 0:return tr.next=2,Object(P.I)({sub_discipline_id:(En=ye.editData)===null||En===void 0||((on=En.exercise)===null||on===void 0)?void 0:on.sub_discipline_id});case 2:gr=tr.sent,Je(gr.tag_disciplines);case 4:case"end":return tr.stop()}},Lt)})),Rt.apply(this,arguments)}},[In]),Object(i.useEffect)(function(){var Ht,Rt=ye!=null&&(Ht=ye.tagDisciplineData)!==null&&Ht!==void 0&&Ht.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];Je(Rt)},[ye.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:pt,isEdit:In}});var Ge=function(Rt){(Rt==null?void 0:Rt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),wn(!1),O(-1),bn.current=!1,Z())},pt=function(){var Ht=Object(te.a)(s.a.mark(function Rt(){var Lt,En,on,gr,er,tr,Yt;return s.a.wrap(function(zn){for(;;)switch(zn.prev=zn.next){case 0:if(xn){zn.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),zn.abrupt("return",!1);case 3:if(Lt=bt.findIndex(function(rr){return!rr}),!(Lt>-1)){zn.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Qe[Lt]," \u9009\u9879\u7684\u5185\u5BB9")),zn.abrupt("return",!1);case 7:if(qt.length){zn.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),zn.abrupt("return",!1);case 10:if(!(qt.length<1)){zn.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),zn.abrupt("return",!1);case 13:if(En=bt.map(function(rr,On){return{choice_text:rr,is_answer:qt.includes(On)?On+1:0}}),bn.current=!0,!Ce.question_id){zn.next=26;break}if(!((Ce==null?void 0:Ce.is_my)===1)){zn.next=20;break}K.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 rr=Object(te.a)(s.a.mark(function Ir(){var jr,xr;return s.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return wr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(Er){return Er.choice_text}),standard_answers:En.filter(function(Er){return Er.is_answer}).map(function(Er){return Er.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(jr=ye.editData)===null||jr===void 0||((xr=jr.exercise)===null||xr===void 0)?void 0:xr.sub_discipline_id,difficulty:Vn,is_cover:1,repeat_answer:!Mn,analysis:Gt}});case 2:on=wr.sent,Ge(on);case 4:case"end":return wr.stop()}},Ir)}));function On(){return rr.apply(this,arguments)}return On}(),onCancel:function(){var rr=Object(te.a)(s.a.mark(function Ir(){var jr,xr;return s.a.wrap(function(wr){for(;;)switch(wr.prev=wr.next){case 0:return wr.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(Er){return Er.choice_text}),standard_answers:En.filter(function(Er){return Er.is_answer}).map(function(Er){return Er.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(jr=ye.editData)===null||jr===void 0||((xr=jr.exercise)===null||xr===void 0)?void 0:xr.sub_discipline_id,difficulty:Vn,repeat_answer:!Mn,analysis:Gt}});case 2:on=wr.sent,Ge(on);case 4:case"end":return wr.stop()}},Ir)}));function On(){return rr.apply(this,arguments)}return On}()}),zn.next=24;break;case 20:return zn.next=22,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(rr){return rr.choice_text}),standard_answers:En.filter(function(rr){return rr.is_answer}).map(function(rr){return rr.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:Vn,repeat_answer:!Mn,analysis:Gt}});case 22:on=zn.sent,Ge(on);case 24:zn.next=30;break;case 26:return zn.next=28,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:jt.categoryId,question_title:xn,question_type:1,question_score:un,question_choices:En.map(function(rr){return rr.choice_text}),standard_answers:En.filter(function(rr){return rr.is_answer}).map(function(rr){return rr.is_answer}),tag_discipline_ids:Ln,sub_discipline_id:(tr=ye.editData)===null||tr===void 0||((Yt=tr.exercise)===null||Yt===void 0)?void 0:Yt.sub_discipline_id,difficulty:Vn,repeat_answer:!Mn,analysis:Gt}});case 28:on=zn.sent,Ge(on);case 30:case"end":return zn.stop()}},Rt)}));return function(){return Ht.apply(this,arguments)}}(),rt=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5355\u9009\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}].filter(function(Ht){var Rt,Lt;return(ye==null||((Rt=ye.editData)===null||Rt===void 0||((Lt=Rt.exercise)===null||Lt===void 0))?void 0:Lt.exercise_status)===1?Ht:Ht.id!=="del"&&Ht.id!=="add"}),Tt=function(){var Ht=Object(te.a)(s.a.mark(function Rt(Lt){return s.a.wrap(function(on){for(;;)switch(on.prev=on.next){case 0:if(!(mr!==-1)){on.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),on.abrupt("return");case 3:on.t0=Lt.id,on.next=on.t0==="del"?6:on.t0==="up"||on.t0==="down"?8:on.t0==="edit"?12:on.t0==="add"?15:17;break;case 6:return K.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(te.a)(s.a.mark(function er(){return s.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,Object(P.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},jt)});case 3:case"end":return Yt.stop()}},er)}))()}}),on.abrupt("break",17);case 8:return on.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:Lt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},jt)}),on.abrupt("break",17);case 12:return O(Ce.dragKey),wn(!0),on.abrupt("break",17);case 15:return st({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:0}),on.abrupt("break",17);case 17:case"end":return on.stop()}},Rt)}));return function(Lt){return Ht.apply(this,arguments)}}(),Nt=function(){var Rt;return t.a.createElement("aside",{ref:tn},t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u5355\u9009\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(xe.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},Ce==null||((Rt=Ce.question_choices)===null||Rt===void 0)?void 0:Rt.map(function(Lt,En){return t.a.createElement(r.a,{key:En},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:En,checked:Ce.standard_answer.includes(En+1),disabled:!0},Qe[En],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Lt.choice_text}))))})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&rt.map(function(Lt,En){return Lt.id==="up"&&Ce.key===1||Lt.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:En,placement:"bottom",title:Lt.name},t.a.createElement("span",{onClick:function(){return Tt(Lt)},className:Lt.icon}))})))},St=function(){var Rt,Lt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:xn,onChange:function(on){return Jn(on)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),bt.map(function(En,on){var gr,er;return t.a.createElement("div",{className:he.a.choiceWrap,key:on},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(qt.includes(on)?he.a.activeAnswer:""),onClick:function(){qt.includes(on)?Ft(qt.filter(function(Yt){return Yt!==on})):Ft([].concat(Object(W.a)(qt),[on]))}},Qe[on])),t.a.createElement("div",{className:he.a.editorWrap},Hn===on?t.a.createElement(v.a,{id:"single-question-option-".concat(on),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:En,onChange:function(Yt){bt[on]=Yt,Mt(bt)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return fn(on)}},t.a.createElement(xe.a,{value:En}))),((gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,on>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Mt(bt.filter(function(Yt,Rn){return Rn!==on}))}})),on<7&&on===bt.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Mt([].concat(Object(W.a)(bt),[""]))}}))))}),t.a.createElement("p",{className:"c-orange"},"\u6E29\u99A8\u63D0\u793A\uFF1A\u70B9\u51FB\u9009\u9879\u8F93\u5165\u6846\u53EF\u8BBE\u7F6E\u7B54\u6848\uFF1B\u9009\u4E2D\u7684\u9009\u9879\u5373\u4E3A\u6B63\u786E\u7B54\u6848\uFF0C\u9009\u62E9\u591A\u4E2A\u7B54\u6848\u5373\u4E3A\u591A\u9009\u9898"),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Gt,onChange:function(on){return zt(on)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:un,max:1e4,min:0,onChange:function(on){Un(on)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Vn,onChange:function(on){qn(on.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Le.a,{selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,value:Ln,onChange:Kn,subId:(Rt=ye.editData)===null||Rt===void 0||((Lt=Rt.exercise)===null||Lt===void 0)?void 0:Lt.sub_discipline_id,knowledgeOptions:lt,onAddKnowledgeFinish:nt})),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(x.a,{checked:Mn,onChange:function(on){Dn(on)}}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Ce.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){hr(),wn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){pt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:he.a.wrap},!In&&Nt(),In&&St())},Et=Object(F.a)(function(mt){var Ke=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ke,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ve)),kt=U("Z9P2"),Vt=["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"],Qt=function(Ke,Ot){var Me=Ke.problemset,ye=Ke.exercise,ve=Ke.globalSetting,or=Ke.loading,en=Ke.dispatch,Ie=Ke.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ke.editData,dn=Ke.cancelAdd,hr=dn===void 0?function(){}:dn,mr=Ke.editKey,q=Ke.setEditKey,O=q===void 0?function(){}:q,M=Ke.reload,X=M===void 0?function(){}:M,se=Ke.addCallback,Z=se===void 0?function(){}:se,Pe=Ke.setIsClaer,st=Pe===void 0?function(){}:Pe,wt=Object(j.a)(Ke,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","reload","addCallback","setIsClaer"]),Pt=Object(i.useState)(""),dt=Object(a.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(""),rn=Object(a.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=Object(i.useState)(),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(!1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],nn=Object(i.useState)(1),_n=Object(a.a)(nn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(!1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)([[],[]]),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],cn=Object(i.useRef)(!1),Ut=Object(w.i)(),Gt=Object(i.useState)([]),zt=Object(a.a)(Gt,2),jt=zt[0],tn=zt[1],bn=function(rt){tn([].concat(Object(W.a)(jt),[Object(g.a)({},rt)]))};Object(i.useEffect)(function(){var pt;if(cn.current)return;if(!(Ce!=null&&Ce.question_title)){Un(!0),Mt(""),Ft(""),Jn(10);return}qn(!(Ce!=null&&Ce.repeat_answer)),Mt(Ce==null?void 0:Ce.question_title),Ft(Ce==null||((pt=Ce.standard_answer)===null||pt===void 0)?void 0:pt[0]),Jn(Ce==null?void 0:Ce.question_score),Kn(Ce.tag_discipline_ids),wn(Ce==null?void 0:Ce.difficulty),fn(Ce==null?void 0:Ce.analysis),Dn([Ce==null?void 0:Ce.normal_keywords,Ce==null?void 0:Ce.main_keywords])},[Me.editData,un]),Object(i.useEffect)(function(){var pt,rt=ye!=null&&(pt=ye.tagDisciplineData)!==null&&pt!==void 0&&pt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];tn(rt)},[ye.tagDisciplineData]),Object(i.useEffect)(function(){un&&pt();function pt(){return rt.apply(this,arguments)}function rt(){return rt=Object(te.a)(s.a.mark(function Tt(){var Nt,St,Ht;return s.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:return Lt.next=2,Object(P.I)({sub_discipline_id:(Nt=ye.editData)===null||Nt===void 0||((St=Nt.exercise)===null||St===void 0)?void 0:St.sub_discipline_id});case 2:Ht=Lt.sent,tn(Ht.tag_disciplines);case 4:case"end":return Lt.stop()}},Tt)})),rt.apply(this,arguments)}},[un]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:yt,isEdit:un}});var gn=function(rt){(rt==null?void 0:rt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Un(!1),O(-1),cn.current=!1,X())},yt=function(){var pt=Object(te.a)(s.a.mark(function rt(){var Tt,Nt,St,Ht,Rt,Lt,En;return s.a.wrap(function(gr){for(;;)switch(gr.prev=gr.next){case 0:if(bt){gr.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),gr.abrupt("return",!1);case 3:if(Tt=Mn[0],Nt=Mn[1],cn.current=!0,!Ce.question_id){gr.next=17;break}if(!((Ce==null?void 0:Ce.is_my)===1)){gr.next=11;break}K.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 er=Object(te.a)(s.a.mark(function Yt(){var Rn,zn;return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:bt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(Rn=ye.editData)===null||Rn===void 0||((zn=Rn.exercise)===null||zn===void 0)?void 0:zn.sub_discipline_id,difficulty:In,is_cover:1,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 2:St=On.sent,gn(St);case 4:case"end":return On.stop()}},Yt)}));function tr(){return er.apply(this,arguments)}return tr}(),onCancel:function(){var er=Object(te.a)(s.a.mark(function Yt(){var Rn,zn;return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:return On.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:bt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(Rn=ye.editData)===null||Rn===void 0||((zn=Rn.exercise)===null||zn===void 0)?void 0:zn.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 2:St=On.sent,gn(St);case 4:case"end":return On.stop()}},Yt)}));function tr(){return er.apply(this,arguments)}return tr}()}),gr.next=15;break;case 11:return gr.next=13,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:bt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(Ht=ye.editData)===null||Ht===void 0||((Rt=Ht.exercise)===null||Rt===void 0)?void 0:Rt.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 13:St=gr.sent,gn(St);case 15:gr.next=21;break;case 17:return gr.next=19,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:Ut.categoryId,exercise_bank_id:Ut.categoryId,question_title:bt,question_type:4,question_score:xn,standard_answers:[qt],tag_discipline_ids:Ln,sub_discipline_id:(Lt=ye.editData)===null||Lt===void 0||((En=Lt.exercise)===null||En===void 0)?void 0:En.sub_discipline_id,difficulty:In,repeat_answer:!Vn,analysis:Hn,normal_keywords:Tt,main_keywords:Nt}});case 19:St=gr.sent,gn(St);case 21:return gr.abrupt("return",{name:bt,answer_texts:[qt],analysis:Hn,normal_keywords:Tt,main_keywords:Nt});case 22:case"end":return gr.stop()}},rt)}));return function(){return pt.apply(this,arguments)}}(),lt=function(){var rt,Tt;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u4E3B\u89C2\u9898"),"\uFF08\u4E3B\u89C2\u9898\uFF0C\u672A\u4F5C\u7B54\u7684\u60C5\u51B5\u4E0B\u81EA\u52A8\u8BC4\u4E3A\u96F6\u5206\uFF09")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:bt,onChange:function(St){return Mt(St)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(v.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:qt,onChange:function(St){return Ft(St)}}),t.a.createElement(kt.a,{value:Mn,onChange:Dn}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Hn,onChange:function(St){return fn(St)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:xn,max:1e4,min:0,onChange:function(St){Jn(St)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:In,onChange:function(St){wn(St.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Le.a,{value:Ln,selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,onChange:Kn,subId:(rt=ye.editData)===null||rt===void 0||((Tt=rt.exercise)===null||Tt===void 0)?void 0:Tt.sub_discipline_id,knowledgeOptions:jt,onAddKnowledgeFinish:bn})),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(x.a,{checked:Vn,onChange:function(St){qn(St)}}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Ce.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){hr(),Un(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){yt()}},"\u4FDD\u5B58")))},Je=[{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(pt){var rt,Tt;return(ye==null||((rt=ye.editData)===null||rt===void 0||((Tt=rt.exercise)===null||Tt===void 0))?void 0:Tt.exercise_status)===1?pt:pt.id!=="del"&&pt.id!=="add"}),nt=function(){var pt=Object(te.a)(s.a.mark(function rt(Tt){return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:if(!(mr!==-1)){St.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),St.abrupt("return");case 3:St.t0=Tt.id,St.next=St.t0==="del"?6:St.t0==="up"||St.t0==="down"?8:St.t0==="edit"?12:St.t0==="add"?15:17;break;case 6:return K.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(te.a)(s.a.mark(function Rt(){return s.a.wrap(function(En){for(;;)switch(En.prev=En.next){case 0:return En.next=2,Object(P.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Ut)});case 3:case"end":return En.stop()}},Rt)}))()}}),St.abrupt("break",17);case 8:return St.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:Tt.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Ut)}),St.abrupt("break",17);case 12:return O(Ce.dragKey),Un(!0),St.abrupt("break",17);case 15:return Z({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:4}),St.abrupt("break",17);case 17:case"end":return St.stop()}},rt)}));return function(Tt){return pt.apply(this,arguments)}}(),Ge=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(xe.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(xe.a,{value:qt||""})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&Je.map(function(rt,Tt){return rt.id==="up"&&Ce.key===1||rt.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:Tt,placement:"bottom",title:rt.name},t.a.createElement("span",{onClick:function(){return nt(rt)},className:rt.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},!un&&Ge(),un&&lt())},an=Object(F.a)(function(mt){var Ke=mt.problemset,Ot=mt.loading,Me=mt.exercise,ye=mt.globalSetting;return{problemset:Ke,globalSetting:ye,exercise:Me,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Qt)),sn=["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,Ot){var Me=Ke.problemset,ye=Ke.exercise,ve=Ke.globalSetting,or=Ke.loading,en=Ke.dispatch,Ie=Ke.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ke.editData,dn=Ke.cancelAdd,hr=dn===void 0?function(){}:dn,mr=Ke.editKey,q=Ke.setEditKey,O=q===void 0?function(){}:q,M=Ke.addCallback,X=M===void 0?function(){}:M,se=Ke.setIsClaer,Z=se===void 0?function(){}:se,Pe=Object(j.a)(Ke,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","addCallback","setIsClaer"]),st=Object(i.useState)([]),wt=Object(a.a)(st,2),Pt=wt[0],dt=wt[1],bt=Object(i.useState)(),Mt=Object(a.a)(bt,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)([]),fn=Object(a.a)(Hn,2),Wt=fn[0],rn=fn[1],qt=Object(i.useState)(""),Ft=Object(a.a)(qt,2),Qn=Ft[0],Bn=Ft[1],xn=Object(i.useState)(5),Jn=Object(a.a)(xn,2),pn=Jn[0],Sn=Jn[1],un=Object(i.useState)(!1),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(w.g)(),Kn=Object(w.i)();Object(i.useEffect)(function(){dt(["","","",""])},[]),Object(i.useEffect)(function(){if(!(Ce!=null&&Ce.question_choices)){nr(!0),Bn(""),Sn(5),dt(["","","",""]),rn([]);return}Bn(Ce==null?void 0:Ce.question_title),Sn(Ce==null?void 0:Ce.question_score),dt(Ce==null?void 0:Ce.question_choices.map(function(Vn){return Vn.choice_text}));var yn=[];Ce==null||Ce.standard_answer.map(function(Vn,qn){yn.push(Vn-1)}),rn(yn)},[Ce]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:nn,isEdit:Xn}});var nn=function(){var yn=Object(te.a)(s.a.mark(function Vn(){var qn,kn,Pn;return s.a.wrap(function(Dn){for(;;)switch(Dn.prev=Dn.next){case 0:if(Qn){Dn.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Dn.abrupt("return",!1);case 3:if(qn=Pt.findIndex(function(cn){return!cn}),!(qn>-1)){Dn.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(sn[qn]," \u9009\u9879\u7684\u5185\u5BB9")),Dn.abrupt("return",!1);case 7:if(Wt.length){Dn.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Dn.abrupt("return",!1);case 10:if(!(Wt.length<1)){Dn.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Dn.abrupt("return",!1);case 13:if(kn=Pt.map(function(cn,Ut){return{choice_text:cn,is_answer:Wt.includes(Ut)?Ut+1:0}}),!Ce.question_id){Dn.next=20;break}return Dn.next=17,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Qn,question_type:1,question_score:pn,question_choices:kn.map(function(cn){return cn.choice_text}),standard_answers:kn.filter(function(cn){return cn.is_answer}).map(function(cn){return cn.is_answer})}});case 17:Pn=Dn.sent,Dn.next=23;break;case 20:return Dn.next=22,en({type:"exercise/addExerciseQuestion",payload:{insert_id:Ce==null?void 0:Ce.insert_id,categoryId:Kn.categoryId,question_title:Qn,question_type:1,question_score:"5.0",question_choices:kn.map(function(cn){return cn.choice_text}),standard_answers:kn.filter(function(cn){return cn.is_answer}).map(function(cn){return cn.is_answer})}});case 22:Pn=Dn.sent;case 23:Pn.status===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),nr(!1),en({type:"exercise/editExercise",payload:Object(g.a)({},Kn)}));case 24:case"end":return Dn.stop()}},Vn)}));return function(){return yn.apply(this,arguments)}}(),_n=[{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(yn){var Vn,qn;return(ye==null||((Vn=ye.editData)===null||Vn===void 0||((qn=Vn.exercise)===null||qn===void 0))?void 0:qn.exercise_status)===1?yn:yn.id!=="del"&&yn.id!=="add"}),In=function(){var yn=Object(te.a)(s.a.mark(function Vn(qn){return s.a.wrap(function(Pn){for(;;)switch(Pn.prev=Pn.next){case 0:if(!(mr!==-1)){Pn.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Pn.abrupt("return");case 3:Pn.t0=qn.id,Pn.next=Pn.t0==="del"?6:Pn.t0==="up"||Pn.t0==="down"?8:Pn.t0==="edit"?12:Pn.t0==="add"?14:16;break;case 6:return K.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(te.a)(s.a.mark(function Dn(){return s.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(P.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},Kn)});case 3:case"end":return Ut.stop()}},Dn)}))()}}),Pn.abrupt("break",16);case 8:return Pn.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:qn.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},Kn)}),Pn.abrupt("break",16);case 12:return Ln.push("/problems/".concat(Ce==null?void 0:Ce.hack_identifier,"/edit?type=exercises&express_id=").concat(Kn.categoryId,"&question_id=").concat(Ce==null?void 0:Ce.question_id,"&score=").concat(Ce==null?void 0:Ce.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Pn.abrupt("break",16);case 14:return X({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:6}),Pn.abrupt("break",16);case 16:case"end":return Pn.stop()}},Vn)}));return function(qn){return yn.apply(this,arguments)}}(),wn=function(){var yn=Object(te.a)(s.a.mark(function Vn(qn){var kn;return s.a.wrap(function(Mn){for(;;)switch(Mn.prev=Mn.next){case 0:return qn.preventDefault(),Mn.next=3,Object(P.X)({id:Ce==null?void 0:Ce.hack_identifier});case 3:kn=Mn.sent,kn.status===0&&Object(ie.S)("/myproblems/".concat(kn==null?void 0:kn.identifier));case 5:case"end":return Mn.stop()}},Vn)}));return function(qn){return yn.apply(this,arguments)}}(),Zn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(xe.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ce.question_title})),t.a.createElement("div",{className:he.a.questionChoices},t.a.createElement(xe.a,{value:Ce.description||""})),t.a.createElement("div",{className:he.a.action},!Ce.hideAction&&_n.map(function(Vn,qn){return Vn.id==="up"&&Ce.key===1||Vn.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:qn,placement:"bottom",title:Vn.name},t.a.createElement("span",{onClick:function(){return In(Vn)},className:Vn.icon}))})))};return t.a.createElement("section",{className:he.a.wrap},Zn())},Ze=Object(F.a)(function(mt){var Ke=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ke,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(qe)),Ct=U("LvDl"),At=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],ct=function(Ke,Ot){var Me=Ke.problemset,ye=Ke.exercise,ve=Ke.globalSetting,or=Ke.loading,en=Ke.dispatch,Ie=Ke.onRef,gt=Ie===void 0?function(){}:Ie,Ce=Ke.editData,dn=Ke.cancelAdd,hr=dn===void 0?function(){}:dn,mr=Ke.editKey,q=Ke.setEditKey,O=q===void 0?function(){}:q,M=Ke.setIsClaer,X=M===void 0?function(){}:M,se=Ke.addCallback,Z=se===void 0?function(yt){}:se,Pe=Ke.reload,st=Pe===void 0?function(){}:Pe,wt=Object(j.a)(Ke,["problemset","exercise","globalSetting","loading","dispatch","onRef","editData","cancelAdd","editKey","setEditKey","setIsClaer","addCallback","reload"]),Pt=Object(i.useState)([]),dt=Object(a.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=Object(i.useState)(!1),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!0),rn=Object(a.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=Object(i.useState)(1),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(!1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)([]),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],nn=Object(w.i)(),_n=Object(i.useRef)(null),In=Object(i.useState)(""),wn=Object(a.a)(In,2),Zn=wn[0],yn=wn[1],Vn=Object(i.useState)([]),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=Object(i.useRef)(!1),Dn=function(lt){Kn([].concat(Object(W.a)(Ln),[Object(g.a)({},lt)]))};Object(i.useEffect)(function(){var yt;if(Mn.current)return;if(!(Ce!=null&&Ce.question_title)){fn(!0),yn("");return}yn(Ce==null?void 0:Ce.question_title),Un(!(Ce!=null&&Ce.repeat_answer)),Jn(Ce==null?void 0:Ce.difficulty),Mt(Ce.tag_discipline_ids);var lt=Ce==null||((yt=Ce.sub_exercise_questions)===null||yt===void 0)?void 0:yt.map(function(Je){var nt,Ge,pt;return Object(g.a)(Object(g.a)({},Je),{},{id:Je.question_id,name:Je.question_title,open:!1,score:Je.question_score,qusList:Je==null||((nt=Je.question_choices)===null||nt===void 0)?void 0:nt.map(function(rt){return rt.choice_text}),activeQusEditor:null,qusAnswer:(Ge=[Je==null||((pt=Je.question_choices)===null||pt===void 0)?void 0:pt.findIndex(function(rt){return rt.standard_boolean})])===null||Ge===void 0?void 0:Ge.filter(function(rt){return rt!==-1})})});Pn(lt)},[Ce,Hn]),Object(i.useEffect)(function(){Hn&&yt();function yt(){return lt.apply(this,arguments)}function lt(){return lt=Object(te.a)(s.a.mark(function Je(){var nt,Ge,pt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(P.I)({sub_discipline_id:(nt=ye.editData)===null||nt===void 0||((Ge=nt.exercise)===null||Ge===void 0)?void 0:Ge.sub_discipline_id});case 2:pt=Tt.sent,Kn(pt.tag_disciplines);case 4:case"end":return Tt.stop()}},Je)})),lt.apply(this,arguments)}},[Hn]),Object(i.useEffect)(function(){var yt,lt=ye!=null&&(yt=ye.tagDisciplineData)!==null&&yt!==void 0&&yt.tag_disciplines&&Array.isArray(ye.tagDisciplineData.tag_disciplines)?ye.tagDisciplineData.tag_disciplines:[];Kn(lt)},[ye.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Ut,isEdit:Hn}});var cn=function(lt){(lt==null?void 0:lt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),fn(!1),O(-1),Mn.current=!1,st())},Ut=function(){var yt=Object(te.a)(s.a.mark(function lt(){var Je,nt,Ge,pt,rt,Tt,Nt,St;return s.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:if(Zn){Rt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Rt.abrupt("return",!1);case 3:if(!(kn.length===0)){Rt.next=6;break}return _.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),Rt.abrupt("return",!1);case 6:Je=0;case 7:if(!(Je<kn.length)){Rt.next=25;break}if(Ge=kn[Je],Ge!=null&&Ge.name){Rt.next=12;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Je+1,"\u5C0F\u9898\u9898\u5E72")),Rt.abrupt("return",!1);case 12:if(Ge!=null&&Ge.score){Rt.next=15;break}return _.b.info("\u7B2C".concat(Je+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),Rt.abrupt("return",!1);case 15:if(pt=Ge==null||((nt=Ge.qusList)===null||nt===void 0)?void 0:nt.findIndex(function(Lt){return!Lt}),!(pt>-1)){Rt.next=19;break}return _.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Je+1,"\u5C0F\u9898").concat(At[pt],"\u9009\u9879\u7684\u5185\u5BB9")),Rt.abrupt("return",!1);case 19:if(Ge!=null&&Ge.qusAnswer.length){Rt.next=22;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Je+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),Rt.abrupt("return",!1);case 22:Je++,Rt.next=7;break;case 25:if(rt=kn.map(function(Lt){var En;return{id:Lt.id>1?Lt.id:null,question_title:Lt.name,question_type:1,question_choices:Lt.qusList,question_score:Lt.score,standard_answers:[((En=Lt.qusAnswer)===null||En===void 0?void 0:En[0])+1]}}),Mn.current=!0,!Ce.question_id){Rt.next=36;break}if(!((Ce==null?void 0:Ce.is_my)===1)){Rt.next=32;break}K.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 Lt=Object(te.a)(s.a.mark(function on(){var gr,er;return s.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Zn,question_type:7,sub_questions:rt,tag_discipline_ids:bt,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:xn,is_cover:1,repeat_answer:!un}});case 2:Tt=Yt.sent,cn(Tt);case 4:case"end":return Yt.stop()}},on)}));function En(){return Lt.apply(this,arguments)}return En}(),onCancel:function(){var Lt=Object(te.a)(s.a.mark(function on(){var gr,er;return s.a.wrap(function(Yt){for(;;)switch(Yt.prev=Yt.next){case 0:return Yt.next=2,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Zn,question_type:7,sub_questions:rt,tag_discipline_ids:bt,sub_discipline_id:(gr=ye.editData)===null||gr===void 0||((er=gr.exercise)===null||er===void 0)?void 0:er.sub_discipline_id,difficulty:xn,repeat_answer:!un}});case 2:Tt=Yt.sent,cn(Tt);case 4:case"end":return Yt.stop()}},on)}));function En(){return Lt.apply(this,arguments)}return En}()}),Rt.next=36;break;case 32:return Rt.next=34,en({type:"exercise/editExerciseQuestion",payload:{id:Ce.question_id,question_title:Zn,question_type:7,sub_questions:rt,tag_discipline_ids:bt,sub_discipline_id:(Nt=ye.editData)===null||Nt===void 0||((St=Nt.exercise)===null||St===void 0)?void 0:St.sub_discipline_id,difficulty:xn,repeat_answer:!un}});case 34:Tt=Rt.sent,cn(Tt);case 36:case"end":return Rt.stop()}},lt)}));return function(){return yt.apply(this,arguments)}}(),Gt=[{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(yt){var lt,Je;return(ye==null||((lt=ye.editData)===null||lt===void 0||((Je=lt.exercise)===null||Je===void 0))?void 0:Je.exercise_status)===1?yt:yt.id!=="del"&&yt.id!=="add"}),zt=function(){var yt=Object(te.a)(s.a.mark(function lt(Je){return s.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:if(!(mr!==-1)){Ge.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ge.abrupt("return");case 3:Ge.t0=Je.id,Ge.next=Ge.t0==="del"?6:Ge.t0==="up"||Ge.t0==="down"?8:Ge.t0==="edit"?12:Ge.t0==="add"?15:17;break;case 6:return K.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(te.a)(s.a.mark(function rt(){return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(P.n)({id:Ce.question_id});case 2:en({type:"exercise/editExercise",payload:Object(g.a)({},nn)});case 3:case"end":return Nt.stop()}},rt)}))()}}),Ge.abrupt("break",17);case 8:return Ge.next=10,en({type:"exercise/exeriseMoveUpDown",payload:{id:Ce.question_id,opr:Je.id}});case 10:return en({type:"exercise/editExercise",payload:Object(g.a)({},nn)}),Ge.abrupt("break",17);case 12:return O(Ce.dragKey),fn(!0),Ge.abrupt("break",17);case 15:return Z({key:Ce.key,insert_id:Ce==null?void 0:Ce.question_id,question_type:0}),Ge.abrupt("break",17);case 17:case"end":return Ge.stop()}},lt)}));return function(Je){return yt.apply(this,arguments)}}(),jt=function(){var lt;return t.a.createElement("aside",{ref:_n},t.a.createElement("div",{className:he.a.questionType},!(Ce!=null&&Ce.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},Ce.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",Ce.question_score,"\u5206\uFF09")),Ce!=null&&Ce.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,"."),t.a.createElement(xe.a,{value:Ce.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",Ce==null?void 0:Ce.sub_q_count,"\u5C0F\u9898\uFF0C",Ce.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:Ce.question_title})),t.a.createElement("div",{style:{display:qt?"block":"none"},className:he.a.questionChoices},Ce==null||((lt=Ce.sub_exercise_questions)===null||lt===void 0)?void 0:lt.map(function(Je,nt){var Ge;return t.a.createElement("div",{key:nt},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},Ce.key,".",nt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(xe.a,{value:Je.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Je.question_score,"\u5206\uFF09")),Je==null||((Ge=Je.question_choices)===null||Ge===void 0)?void 0:Ge.map(function(pt,rt){return t.a.createElement(r.a,{key:rt},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:rt,checked:Je.standard_answer.includes(rt+1),disabled:!0},At[rt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:pt.choice_text}))))}))})),t.a.createElement("div",{className:he.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Ft(!qt)},style:{}},qt?"\u6536\u8D77":"\u5C55\u5F00"),!Ce.hideAction&&Gt.map(function(Je,nt){return Je.id==="up"&&Ce.key===1||Je.id==="down"&&Ce.key===Ce.len?null:t.a.createElement(o.a,{key:nt,placement:"bottom",title:Je.name},t.a.createElement("span",{onClick:function(){return zt(Je)},className:Je.icon}))})))},tn=function(){var lt,Je;return t.a.createElement("aside",null,t.a.createElement("div",{className:he.a.questionType},t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},"\u9009\u62E9\u9898"),"\uFF08\u5BA2\u89C2\u9898\uFF0C\u7531\u7CFB\u7EDF\u81EA\u52A8\u8BC4\u5206\uFF0C\u8BF7\u8BBE\u7F6E\u6807\u51C6\u7B54\u6848\uFF09")),t.a.createElement("section",{className:he.a.wrap,style:{padding:0}},t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Zn,onChange:function(Ge){return yn(Ge)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",kn==null?void 0:kn.length),kn==null?void 0:kn.map(function(nt,Ge){var pt;return t.a.createElement("div",{className:he.a.fold,key:nt.id},t.a.createElement("div",{onClick:function(){return gn("open",Ge)},className:he.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:nt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",Ge+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(Tt){Tt.stopPropagation(),gn("delete",Ge)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:nt.open?"block":"none"}},t.a.createElement(v.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:nt==null?void 0:nt.name,onChange:function(Tt){return gn("value",Ge,Tt)}}),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:he.a.required},"*"),t.a.createElement("span",{className:he.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),nt==null||((pt=nt.qusList)===null||pt===void 0)?void 0:pt.map(function(rt,Tt){var Nt,St;return t.a.createElement("div",{className:he.a.choiceWrap,key:Tt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(he.a.answer," ").concat(nt!=null&&(Nt=nt.qusAnswer)!==null&&Nt!==void 0&&Nt.includes(Tt)?he.a.activeAnswer:""),onClick:function(){return gn("answer",Ge,Tt)}},At[Tt])),t.a.createElement("div",{className:he.a.editorWrap},(nt==null?void 0:nt.activeQusEditor)===Tt?t.a.createElement(v.a,{id:"single-question-option-".concat(Tt),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:rt,onChange:function(Rt){return gn("details",Ge,Rt)}}):t.a.createElement("div",{className:he.a.htmlWrap,onClick:function(){return gn("edit",Ge,Tt)}},t.a.createElement(xe.a,{value:rt}))),Tt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(he.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return gn("deleteQus",Ge,Tt)}})),Tt<7&&Tt===(nt==null||((St=nt.qusList)===null||St===void 0)?void 0:St.length)-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(he.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return gn("addQus",Ge)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:nt.score,max:1e4,min:0,onChange:function(Tt){return gn("score",Ge,Tt)}})," ","\u5206")))}),kn.length<20&&t.a.createElement(m.a,{type:"primary",onClick:bn},t.a.createElement("i",{className:"iconfont icon-tianjiatimu mr5 font14"}),"\u6DFB\u52A0\u5C0F\u9898")),t.a.createElement("p",{className:"mt10"},t.a.createElement("span",{className:he.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:xn,onChange:function(Ge){Jn(Ge.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:he.a.titleWrap},t.a.createElement("span",{className:"".concat(he.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:he.a.colorGray},"\uFF08\u6240\u6709\u81EA\u5EFA\u77E5\u8BC6\u70B9\u4EC5\u672C\u4EBA\u53EF\u89C1\uFF0C\u88ABEduCoder\u5E73\u53F0\u5BA1\u6838\u901A\u8FC7\u4E3A\u5B98\u65B9\u77E5\u8BC6\u70B9\u540E\u6240\u6709\u7528\u6237\u53EF\u89C1\uFF09")),t.a.createElement("div",{className:"mt5"},t.a.createElement(Le.a,{selectvalues:Ce==null?void 0:Ce.tag_discipline_ids,value:bt,onChange:Mt,subId:(lt=ye.editData)===null||lt===void 0||((Je=lt.exercise)===null||Je===void 0)?void 0:Je.sub_discipline_id,knowledgeOptions:Ln,onAddKnowledgeFinish:Dn}))),t.a.createElement("aside",{className:"tr"},(mr!==-1||Ce.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){hr(),fn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Ut()}},"\u4FDD\u5B58")))},bn=function(){var lt={id:Math.random(),item_type:"SINGLE",open:!1,name:"",qusList:["","","",""],activeQusEditor:null,qusAnswer:[],analysis:""};Pn(kn.concat(lt))},gn=function(lt,Je,nt){var Ge=Object(Ct.cloneDeep)(kn);if(lt==="open"&&(Ge[Je].open=!Ge[Je].open),lt==="delete"&&Ge.splice(Je,1),lt==="value"&&(Ge[Je].name=nt),lt==="answer"&&(Ge[Je].qusAnswer=[nt]),lt==="edit"&&(Ge[Je].activeQusEditor=nt),lt==="details"&&(Ge[Je].qusList[Ge[Je].activeQusEditor]=nt),lt==="addQus"&&(Ge[Je].qusList=Ge[Je].qusList.concat("")),lt==="deleteQus"){var pt;Ge[Je].qusList=Ge[Je].qusList.filter(function(rt,Tt){return Tt!==nt}),Ge[Je].qusAnswer=(pt=Ge[Je].qusAnswer)===null||pt===void 0?void 0:pt.filter(function(rt){return rt!==nt})}lt==="analysis"&&(Ge[Je].analysis=nt),lt==="score"&&(Ge[Je].score=nt),Pn(Ge)};return t.a.createElement("section",{className:he.a.wrap},!Hn&&jt(),Hn&&tn())},ft=Object(F.a)(function(mt){var Ke=mt.problemset,Ot=mt.loading,Me=mt.globalSetting,ye=mt.exercise;return{problemset:Ke,globalSetting:Me,exercise:ye,loading:Ot.effects}},null,null,{forwardRef:!0})(Object(i.forwardRef)(ct)),He=U("ngQI"),Ne=U("loLm"),Ue=U.n(Ne),ge=U("ErOA"),Ee=U("vCeJ"),De=U("Nog9"),ue=U.n(De),Fe=U("hQp1"),at=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],xt=function(Ke,Ot){var Me=Ke.newExercisePaper,ye=Ke.dispatch,ve=Ke.editData,or=Ke.cancelAdd,en=or===void 0?function(){}:or,Ie=Ke.editKey,gt=Ke.setEditKey,Ce=gt===void 0?function(){}:gt,dn=Ke.reload,hr=dn===void 0?function(){}:dn,mr=Ke.addCallback,q=mr===void 0?function(Je){}:mr,O=Object(i.useState)([]),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(),Pe=Object(a.a)(Z,2),st=Pe[0],wt=Pe[1],Pt=Object(i.useState)([]),dt=Object(a.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(),rn=Object(a.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(!1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(1),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],nn=Object(i.useState)(!1),_n=Object(a.a)(nn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(""),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(w.i)(),Pn=Object(i.useRef)(null),Mn=Object(i.useRef)(!1),Dn=Object(i.useState)([]),cn=Object(a.a)(Dn,2),Ut=cn[0],Gt=cn[1],zt=function(nt){Gt([].concat(Object(W.a)(Ut),[Object(g.a)({},nt)]))};Object(i.useEffect)(function(){se(["","","",""])},[]),Object(i.useEffect)(function(){if(Mn.current)return;if(!(ve!=null&&ve.question_choices)){Un(!0),fn(""),Ft(5),se(["","","",""]),Mt([]);return}fn(ve==null?void 0:ve.question_title),Ft(ve==null?void 0:ve.question_score),wn(!(ve!=null&&ve.repeat_answer)),qn(ve==null?void 0:ve.analysis),Kn(ve==null?void 0:ve.difficulty),se(ve==null?void 0:ve.question_choices.map(function(nt){return nt.choice_text}));var Je=[];ve==null||ve.standard_answer.map(function(nt,Ge){Je.push(nt-1)}),Jn(ve.tag_discipline_ids),Mt(Je)},[ve,un]),Object(i.useEffect)(function(){un&&Je();function Je(){return nt.apply(this,arguments)}function nt(){return nt=Object(te.a)(s.a.mark(function Ge(){var pt,rt,Tt;return s.a.wrap(function(St){for(;;)switch(St.prev=St.next){case 0:return St.next=2,Object(P.I)({sub_discipline_id:(pt=Me.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id});case 2:Tt=St.sent,Gt(Tt.tag_disciplines);case 4:case"end":return St.stop()}},Ge)})),nt.apply(this,arguments)}},[un]),Object(i.useEffect)(function(){var Je,nt=Me!=null&&(Je=Me.tagDisciplineData)!==null&&Je!==void 0&&Je.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];Gt(nt)},[Me.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:tn,isEdit:un}});var jt=function(nt){(nt==null?void 0:nt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Un(!1),Ce(-1),Mn.current=!1,hr())},tn=function(){var Je=Object(te.a)(s.a.mark(function nt(){var Ge,pt,rt,Tt,Nt,St,Ht;return s.a.wrap(function(Lt){for(;;)switch(Lt.prev=Lt.next){case 0:if(Hn){Lt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Lt.abrupt("return",!1);case 3:if(Ge=X.findIndex(function(En){return!En}),!(Ge>-1)){Lt.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(at[Ge]," \u9009\u9879\u7684\u5185\u5BB9")),Lt.abrupt("return",!1);case 7:if(bt.length){Lt.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Lt.abrupt("return",!1);case 10:if(!(bt.length<1)){Lt.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Lt.abrupt("return",!1);case 13:if(pt=X.map(function(En,on){return{choice_text:En,is_answer:bt.includes(on)?1:0}}),Mn.current=!0,!ve.question_id){Lt.next=22;break}return Lt.next=18,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:kn.id,question_id:ve.question_id,name:Hn,item_type:bt.length>1?Fe.a.Multiple:Fe.a.Single,question_score:qt,choices:pt,tag_discipline_ids:xn,sub_discipline_id:(Tt=Me.editData)===null||Tt===void 0||((Nt=Tt.exercise)===null||Nt===void 0)?void 0:Nt.sub_discipline_id,difficulty:Ln,repeat_answer:!In,analysis:Vn}});case 18:rt=Lt.sent,jt(rt),Lt.next=26;break;case 22:return Lt.next=24,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:kn.id,name:Hn,item_type:bt.length>1?Fe.a.Multiple:Fe.a.Single,question_score:qt,choices:pt,tag_discipline_ids:xn,sub_discipline_id:(St=Me.editData)===null||St===void 0||((Ht=St.exercise)===null||Ht===void 0)?void 0:Ht.sub_discipline_id,difficulty:Ln,repeat_answer:!In,analysis:Vn}});case 24:rt=Lt.sent,jt(rt);case 26:case"end":return Lt.stop()}},nt)}));return function(){return Je.apply(this,arguments)}}(),bn=[{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"}],gn=function(){var Je=Object(te.a)(s.a.mark(function nt(Ge){return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(!(Ie!==-1)){rt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),rt.abrupt("return");case 3:rt.t0=Ge.id,rt.next=rt.t0==="del"?6:rt.t0==="edit"?8:rt.t0==="add"?11:13;break;case 6:return K.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(te.a)(s.a.mark(function Nt(){return s.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:return Ht.next=2,Object(Ee.g)({exam_id:kn.id,question_id:ve.question_id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},kn)});case 3:case"end":return Ht.stop()}},Nt)}))()}}),rt.abrupt("break",13);case 8:return Ce(ve.dragKey),Un(!0),rt.abrupt("break",13);case 11:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:0}),rt.abrupt("break",13);case 13:case"end":return rt.stop()}},nt)}));return function(Ge){return Je.apply(this,arguments)}}(),yt=function(){var nt;return t.a.createElement("aside",{ref:Pn},t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u5355\u9009\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ve==null||((nt=ve.question_choices)===null||nt===void 0)?void 0:nt.map(function(Ge,pt){return t.a.createElement(r.a,{key:pt},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:pt,checked:ve.standard_answer.includes(pt+1),disabled:!0},at[pt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Ge.choice_text}))))})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&bn.map(function(Ge,pt){return t.a.createElement(o.a,{key:pt,placement:"bottom",title:Ge.name},t.a.createElement("span",{onClick:function(){return gn(Ge)},className:Ge.icon}))})))},lt=function(){var nt,Ge;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.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:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Hn,onChange:function(rt){return fn(rt)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),X.map(function(pt,rt){return t.a.createElement("div",{className:ue.a.choiceWrap,key:rt},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(bt.includes(rt)?ue.a.activeAnswer:""),onClick:function(){bt.includes(rt)?Mt(function(Nt){return Nt.filter(function(St){return St!==rt})}):Mt(function(Nt){return[].concat(Object(W.a)(Nt),[rt])})}},at[rt])),t.a.createElement("div",{className:ue.a.editorWrap},st===rt?t.a.createElement(v.a,{id:"single-question-option-".concat(rt),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:pt,onChange:function(Nt){X[rt]=Nt,se(X)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return wt(rt)}},t.a.createElement(xe.a,{value:pt}))),t.a.createElement(t.a.Fragment,null,rt>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return se(X.filter(function(Nt,St){return St!==rt}))}})),rt<7&&rt===X.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return se([].concat(Object(W.a)(X),[""]))}}))))}),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:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:Vn,onChange:function(rt){return qn(rt)}}),t.a.createElement("div",{style:{marginBottom:14}},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:qt,max:1e4,min:0,onChange:function(rt){Ft(rt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Ln,onChange:function(rt){Kn(rt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("div",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.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(Le.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:xn,onChange:Jn,subId:(nt=Me.editData)===null||nt===void 0||((Ge=nt.exercise)===null||Ge===void 0)?void 0:Ge.sub_discipline_id,knowledgeOptions:Ut,onAddKnowledgeFinish:zt})),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(x.a,{checked:In,onChange:function(rt){wn(rt)}}))),t.a.createElement("aside",{className:"tr"},(Ie!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){en(),Un(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){tn()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!un&&yt(),un&&lt())},Kt=Object(F.a)(function(mt){var Ke=mt.newExercisePaper;return{newExercisePaper:Ke}},null,null,{forwardRef:!0})(Object(i.forwardRef)(xt)),Xt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],$t=Object(i.forwardRef)(function(mt,Ke){var Ot=mt.newExercisePaper,Me=mt.dispatch,ye=mt.editData,ve=mt.cancelAdd,or=ve===void 0?function(){}:ve,en=mt.editKey,Ie=mt.setEditKey,gt=Ie===void 0?function(){}:Ie,Ce=mt.addCallback,dn=Ce===void 0?function(yt){}:Ce,hr=mt.reload,mr=hr===void 0?function(){}:hr,q=Object(i.useState)([]),O=Object(a.a)(q,2),M=O[0],X=O[1],se=Object(i.useState)(),Z=Object(a.a)(se,2),Pe=Z[0],st=Z[1],wt=Object(i.useState)([]),Pt=Object(a.a)(wt,2),dt=Pt[0],bt=Pt[1],Mt=Object(i.useState)(""),Cn=Object(a.a)(Mt,2),Yn=Cn[0],Hn=Cn[1],fn=Object(i.useState)(),Wt=Object(a.a)(fn,2),rn=Wt[0],qt=Wt[1],Ft=Object(i.useState)(!1),Qn=Object(a.a)(Ft,2),Bn=Qn[0],xn=Qn[1],Jn=Object(i.useState)([]),pn=Object(a.a)(Jn,2),Sn=pn[0],un=pn[1],Un=Object(i.useState)(1),Xn=Object(a.a)(Un,2),nr=Xn[0],Ln=Xn[1],Kn=Object(i.useState)(!1),nn=Object(a.a)(Kn,2),_n=nn[0],In=nn[1],wn=Object(i.useState)(""),Zn=Object(a.a)(wn,2),yn=Zn[0],Vn=Zn[1],qn=Object(i.useState)([]),kn=Object(a.a)(qn,2),Pn=kn[0],Mn=kn[1],Dn=Object(i.useRef)(!1),cn=function(lt){Mn([].concat(Object(W.a)(Pn),[Object(g.a)({},lt)]))},Ut=Object(w.i)();Object(i.useEffect)(function(){X(["","","",""])},[]),Object(i.useEffect)(function(){if(Dn.current)return;if(!(ye!=null&&ye.question_choices)){xn(!0),Hn(""),qt(5),X(["","","",""]),bt([]);return}Hn(ye==null?void 0:ye.question_title),qt(ye==null?void 0:ye.question_score),In(!(ye!=null&&ye.repeat_answer)),Ln(ye==null?void 0:ye.difficulty),X(ye==null?void 0:ye.question_choices.map(function(lt){return lt.choice_text}));var yt=[];ye==null||ye.standard_answer.map(function(lt,Je){yt.push(lt-1)}),bt(yt),un(ye.tag_discipline_ids),Vn(ye==null?void 0:ye.analysis)},[ye,Bn]),Object(i.useEffect)(function(){Bn&&yt();function yt(){return lt.apply(this,arguments)}function lt(){return lt=Object(te.a)(s.a.mark(function Je(){var nt,Ge,pt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:return Tt.next=2,Object(P.I)({sub_discipline_id:(nt=Ot.editData)===null||nt===void 0||((Ge=nt.exercise)===null||Ge===void 0)?void 0:Ge.sub_discipline_id});case 2:pt=Tt.sent,Mn(pt.tag_disciplines);case 4:case"end":return Tt.stop()}},Je)})),lt.apply(this,arguments)}},[Bn]),Object(i.useImperativeHandle)(Ke,function(){return{onSave:zt,isEdit:Bn}}),Object(i.useEffect)(function(){var yt,lt=Ot!=null&&(yt=Ot.tagDisciplineData)!==null&&yt!==void 0&&yt.tag_disciplines&&Array.isArray(Ot.tagDisciplineData.tag_disciplines)?Ot.tagDisciplineData.tag_disciplines:[];Mn(lt)},[Ot.tagDisciplineData]);var Gt=function(lt){(lt==null?void 0:lt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),xn(!1),gt(-1),Dn.current=!1,mr())},zt=function(){var yt=Object(te.a)(s.a.mark(function lt(){var Je,nt,Ge,pt,rt,Tt,Nt;return s.a.wrap(function(Ht){for(;;)switch(Ht.prev=Ht.next){case 0:if(Yn){Ht.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ht.abrupt("return",!1);case 3:if(Je=M.findIndex(function(Rt){return!Rt}),!(Je>-1)){Ht.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Xt[Je]," \u9009\u9879\u7684\u5185\u5BB9")),Ht.abrupt("return",!1);case 7:if(dt.length){Ht.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ht.abrupt("return",!1);case 10:if(!(dt.length<1)){Ht.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ht.abrupt("return",!1);case 13:if(nt=M.map(function(Rt,Lt){return{choice_text:Rt,is_answer:dt.includes(Lt)?1:0}}),Dn.current=!0,!ye.question_id){Ht.next=22;break}return Ht.next=18,Me({type:"newExercisePaper/editExerciseQuestion",payload:{id:Ut.id,question_id:ye.question_id,name:Yn,item_type:dt.length>1?Fe.a.Multiple:Fe.a.Single,question_score:rn,choices:nt,tag_discipline_ids:Sn,sub_discipline_id:(pt=Ot.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.sub_discipline_id,difficulty:nr,repeat_answer:!_n,analysis:yn}});case 18:Ge=Ht.sent,Gt(Ge),Ht.next=26;break;case 22:return Ht.next=24,Me({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ye==null?void 0:ye.insert_id,id:Ut.id,name:Yn,item_type:dt.length>1?Fe.a.Multiple:Fe.a.Single,question_score:rn,choices:nt,tag_discipline_ids:Sn,sub_discipline_id:(Tt=Ot.editData)===null||Tt===void 0||((Nt=Tt.exercise)===null||Nt===void 0)?void 0:Nt.sub_discipline_id,difficulty:nr,repeat_answer:!_n,analysis:yn}});case 24:Ge=Ht.sent,Gt(Ge);case 26:case"end":return Ht.stop()}},lt)}));return function(){return yt.apply(this,arguments)}}(),jt=[{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"}],tn=function(){var yt=Object(te.a)(s.a.mark(function lt(Je){return s.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:if(!(en!==-1)){Ge.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ge.abrupt("return");case 3:Ge.t0=Je.id,Ge.next=Ge.t0==="del"?6:Ge.t0==="edit"?8:Ge.t0==="add"?11:13;break;case 6:return K.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(te.a)(s.a.mark(function rt(){return s.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(Ee.g)({question_id:ye.question_id,exam_id:Ut.id});case 2:Me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Ut)});case 3:case"end":return Nt.stop()}},rt)}))()}}),Ge.abrupt("break",13);case 8:return gt(ye.dragKey),xn(!0),Ge.abrupt("break",13);case 11:return dn({key:ye.key,insert_id:ye==null?void 0:ye.question_id,question_type:1}),Ge.abrupt("break",13);case 13:case"end":return Ge.stop()}},lt)}));return function(Je){return yt.apply(this,arguments)}}(),bn=function(){var lt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ye!=null&&ye.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ye.key,"\u3001\u591A\u9009\u9898"),"\uFF08",ye.question_score,"\u5206\uFF09")),ye!=null&&ye.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ye.key,"."),t.a.createElement(xe.a,{value:ye.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ye.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ye.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ye==null||((lt=ye.question_choices)===null||lt===void 0)?void 0:lt.map(function(Je,nt){return t.a.createElement(r.a,{key:nt},t.a.createElement(A.a,null,t.a.createElement(C.a,{key:nt,checked:ye.standard_answer.includes(nt+1),disabled:!0},Xt[nt],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:Je.choice_text}))))})),t.a.createElement("div",{className:ue.a.action},!ye.hideAction&&jt.map(function(Je,nt){return t.a.createElement(o.a,{key:nt,placement:"bottom",title:Je.name},t.a.createElement("span",{onClick:function(){return tn(Je)},className:Je.icon}))})))},gn=function(){var lt,Je;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.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:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Yn,onChange:function(Ge){return Hn(Ge)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),M.map(function(nt,Ge){var pt,rt;return t.a.createElement("div",{className:ue.a.choiceWrap,key:Ge},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(dt.includes(Ge)?ue.a.activeAnswer:""),onClick:function(){dt.includes(Ge)?bt(dt.filter(function(Nt){return Nt!==Ge})):bt([].concat(Object(W.a)(dt),[Ge]))}},Xt[Ge])),t.a.createElement("div",{className:ue.a.editorWrap},Pe===Ge?t.a.createElement(v.a,{id:"single-question-option-".concat(Ge),watch:!0,isFocus:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:nt,onChange:function(Nt){M[Ge]=Nt,X(M)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return st(Ge)}},t.a.createElement(xe.a,{value:nt}))),((pt=Ot.editData)===null||pt===void 0||((rt=pt.exercise)===null||rt===void 0)?void 0:rt.exercise_status)===1&&t.a.createElement(t.a.Fragment,null,Ge>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return X(M.filter(function(Nt,St){return St!==Ge}))}})),Ge<7&&Ge===M.length-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return X([].concat(Object(W.a)(M),[""]))}}))))}),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:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:yn,onChange:function(Ge){return Vn(Ge)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:rn,max:1e4,min:0,onChange:function(Ge){qt(Ge)}}),"\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:nr,onChange:function(Ge){Ln(Ge.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.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(Le.a,{value:Sn,selectvalues:ye==null?void 0:ye.tag_discipline_ids,onChange:un,subId:(lt=Ot.editData)===null||lt===void 0||((Je=lt.exercise)===null||Je===void 0)?void 0:Je.sub_discipline_id,knowledgeOptions:Pn,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(x.a,{checked:_n,onChange:function(Ge){In(Ge)}}))),t.a.createElement("aside",{className:"tr"},(en!==-1||ye.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){or(),xn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){zt()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!Bn&&bn(),Bn&&gn())}),$n=Object(F.a)(function(mt){var Ke=mt.newExercisePaper;return{newExercisePaper:Ke}},null,null,{forwardRef:!0})($t),vn=["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,Ot){var Me=Ke.newExercisePaper,ye=Ke.dispatch,ve=Ke.editData,or=Ke.editKey,en=Ke.setEditKey,Ie=en===void 0?function(){}:en,gt=Ke.cancelAdd,Ce=gt===void 0?function(){}:gt,dn=Ke.reload,hr=dn===void 0?function(){}:dn,mr=Ke.addCallback,q=mr===void 0?function(){}:mr,O=Object(i.useState)(),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(""),Pe=Object(a.a)(Z,2),st=Pe[0],wt=Pe[1],Pt=Object(i.useState)(!1),dt=Object(a.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=Object(i.useState)(),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)([]),rn=Object(a.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(!1),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],nn=Object(i.useState)(""),_n=Object(a.a)(nn,2),In=_n[0],wn=_n[1],Zn=Object(i.useRef)(!1),yn=function(Gt){Jn([].concat(Object(W.a)(xn),[Object(g.a)({},Gt)]))},Vn=Object(w.i)();Object(i.useEffect)(function(){if(Zn.current)return;if(!(ve!=null&&ve.question_choices)){Mt(!0),wt(""),fn(2),se("");return}Kn(!(ve!=null&&ve.repeat_answer)),wt(ve==null?void 0:ve.question_title),fn(ve==null?void 0:ve.question_score),Un(ve==null?void 0:ve.difficulty),se(ve.standard_answer[0]+""),Ft(ve.tag_discipline_ids),wn(ve==null?void 0:ve.analysis)},[ve,bt]),Object(i.useEffect)(function(){bt&&Ut();function Ut(){return Gt.apply(this,arguments)}function Gt(){return Gt=Object(te.a)(s.a.mark(function zt(){var jt,tn,bn;return s.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(P.I)({sub_discipline_id:(jt=Me.editData)===null||jt===void 0||((tn=jt.exercise)===null||tn===void 0)?void 0:tn.sub_discipline_id});case 2:bn=yt.sent,Jn(bn.tag_disciplines);case 4:case"end":return yt.stop()}},zt)})),Gt.apply(this,arguments)}},[bt]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:kn,isEdit:bt}}),Object(i.useEffect)(function(){var Ut,Gt=Me!=null&&(Ut=Me.tagDisciplineData)!==null&&Ut!==void 0&&Ut.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];Jn(Gt)},[Me.tagDisciplineData]);var qn=function(Gt){(Gt==null?void 0:Gt.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Mt(!1),Ie(-1),Zn.current=!1,hr())},kn=function(){var Ut=Object(te.a)(s.a.mark(function Gt(){var zt,jt,tn,bn,gn,yt;return s.a.wrap(function(Je){for(;;)switch(Je.prev=Je.next){case 0:if(st){Je.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Je.abrupt("return",!1);case 3:if(X){Je.next=6;break}return _.b.info("\u8BF7\u5148\u70B9\u51FB\u9009\u62E9\u672C\u9009\u62E9\u9898\u7684\u6B63\u786E\u9009\u9879"),Je.abrupt("return",!1);case 6:if(zt=[{choice_text:"\u6B63\u786E",is_answer:X==="1"?1:0},{choice_text:"\u9519\u8BEF",is_answer:X==="2"?1:0}],Zn.current=!0,!ve.question_id){Je.next=15;break}return Je.next=11,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:Vn.id,question_id:ve.question_id,name:st,item_type:Fe.a.Judge,question_score:Hn,choices:zt,tag_discipline_ids:qt,sub_discipline_id:(tn=Me.editData)===null||tn===void 0||((bn=tn.exercise)===null||bn===void 0)?void 0:bn.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:In}});case 11:jt=Je.sent,qn(jt),Je.next=19;break;case 15:return Je.next=17,ye({type:"newExercisePaper/addExerciseQuestion",payload:{id:Vn.id,insert_id:ve==null?void 0:ve.insert_id,name:st,item_type:Fe.a.Judge,question_score:Hn,choices:zt,tag_discipline_ids:qt,sub_discipline_id:(gn=Me.editData)===null||gn===void 0||((yt=gn.exercise)===null||yt===void 0)?void 0:yt.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:In}});case 17:jt=Je.sent,qn(jt);case 19:return Je.abrupt("return",{name:st,choices:zt});case 20:case"end":return Je.stop()}},Gt)}));return function(){return Ut.apply(this,arguments)}}(),Pn=[{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"}],Mn=function(){var Ut=Object(te.a)(s.a.mark(function Gt(zt){return s.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:if(!(or!==-1)){tn.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),tn.abrupt("return");case 3:tn.t0=zt.id,tn.next=tn.t0==="del"?6:tn.t0==="edit"?8:tn.t0==="add"?11:13;break;case 6:return K.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(te.a)(s.a.mark(function gn(){return s.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:return lt.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:Vn.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},Vn)});case 3:case"end":return lt.stop()}},gn)}))()}}),tn.abrupt("break",13);case 8:return Ie(ve.dragKey),Mt(!0),tn.abrupt("break",13);case 11:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:2}),tn.abrupt("break",13);case 13:case"end":return tn.stop()}},Gt)}));return function(zt){return Ut.apply(this,arguments)}}(),Dn=function(){var Gt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u5224\u65AD\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ve==null||((Gt=ve.question_choices)===null||Gt===void 0)?void 0:Gt.map(function(zt,jt){return t.a.createElement(h.a,{key:jt,checked:ve.standard_answer.includes(jt+1),disabled:!0},vn[jt],"."," ",t.a.createElement("span",{className:"c-black font14"},zt.choice_text))})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&Pn.map(function(zt,jt){return t.a.createElement(o.a,{key:jt,placement:"bottom",title:zt.name},t.a.createElement("span",{onClick:function(){return Mn(zt)},className:zt.icon}))})))},cn=function(){var Gt,zt;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:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:st,onChange:function(tn){return wt(tn)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),t.a.createElement(h.a.Group,{buttonStyle:"solid",value:X,onChange:function(tn){return se(tn.target.value)}},t.a.createElement(h.a.Button,{value:"1",className:"".concat(ue.a.radio," mr40")},"\u6B63\u786E"),t.a.createElement(h.a.Button,{value:"2",className:ue.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:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:In,onChange:function(tn){return wn(tn)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Hn,max:1e4,min:0,onChange:function(tn){fn(tn)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:un,onChange:function(tn){Un(tn.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.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(Le.a,{value:qt,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Ft,subId:(Gt=Me.editData)===null||Gt===void 0||((zt=Gt.exercise)===null||zt===void 0)?void 0:zt.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:yn})),t.a.createElement("div",{style:{marginTop:10}},t.a.createElement("span",{style:{marginRight:10}},"\u4E0D\u5141\u8BB8\u5B66\u751F\u91CD\u590D\u7B54\u9898"),t.a.createElement(x.a,{checked:Ln,onChange:function(tn){Kn(tn)}}))),t.a.createElement("aside",{className:"tr"},(or!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Ce(),Mt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){kn()}},"\u4FDD\u5B58")))};return t.a.createElement("section",{className:ue.a.wrap},!bt&&Dn(),bt&&cn())},hn=Object(F.a)(function(mt){var Ke=mt.newExercisePaper;return{newExercisePaper:Ke}},null,null,{forwardRef:!0})(Object(i.forwardRef)(ln)),Gn=function(Ke,Ot){var Me=Ke.newExercisePaper,ye=Ke.dispatch,ve=Ke.editData,or=Ke.editKey,en=Ke.setEditKey,Ie=en===void 0?function(){}:en,gt=Ke.cancelAdd,Ce=gt===void 0?function(){}:gt,dn=Ke.addCallback,hr=dn===void 0?function(){}:dn,mr=Ke.reload,q=mr===void 0?function(){}:mr,O=Object(i.useState)(""),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(""),Pe=Object(a.a)(Z,2),st=Pe[0],wt=Pe[1],Pt=Object(i.useState)([]),dt=Object(a.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=Object(i.useState)(""),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(),rn=Object(a.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=Object(i.useState)(!1),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(0),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],nn=Object(i.useState)(!1),_n=Object(a.a)(nn,2),In=_n[0],wn=_n[1],Zn=Object(i.useState)(!1),yn=Object(a.a)(Zn,2),Vn=yn[0],qn=yn[1],kn=Object(i.useState)([]),Pn=Object(a.a)(kn,2),Mn=Pn[0],Dn=Pn[1],cn=Object(i.useState)(1),Ut=Object(a.a)(cn,2),Gt=Ut[0],zt=Ut[1],jt=Object(i.useState)(!1),tn=Object(a.a)(jt,2),bn=tn[0],gn=tn[1],yt=Object(i.useRef)(!1),lt=Object(w.i)(),Je=Object(i.useState)([]),nt=Object(a.a)(Je,2),Ge=nt[0],pt=nt[1],rt=function(Rn){pt([].concat(Object(W.a)(Ge),[Object(g.a)({},Rn)]))};Object(i.useEffect)(function(){if(yt.current)return;if(!(ve!=null&&ve.question_title)){wn(!0),se(""),Ft(!1),Un(2),Mt([]),fn(""),Jn(!1);return}se(ve==null?void 0:ve.question_title),Ft(ve==null?void 0:ve.is_ordered),zt(ve==null?void 0:ve.difficulty),gn(!(ve!=null&&ve.repeat_answer)),Un(ve==null?void 0:ve.question_score);var Yt=ve==null?void 0:ve.standard_answer.map(function(Rn){return Rn.answer_text});Mt(Object(W.a)(Yt)),Dn(ve.tag_discipline_ids),wt(ve==null?void 0:ve.analysis)},[ve,In]),Object(i.useEffect)(function(){Jn(!1),In&&Yt();function Yt(){return Rn.apply(this,arguments)}function Rn(){return Rn=Object(te.a)(s.a.mark(function zn(){var rr,On,Ir;return s.a.wrap(function(xr){for(;;)switch(xr.prev=xr.next){case 0:return xr.next=2,Object(P.I)({sub_discipline_id:(rr=Me.editData)===null||rr===void 0||((On=rr.exercise)===null||On===void 0)?void 0:On.sub_discipline_id});case 2:Ir=xr.sent,pt(Ir.tag_disciplines);case 4:case"end":return xr.stop()}},zn)})),Rn.apply(this,arguments)}},[In]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Nt,isEdit:In}}),Object(i.useEffect)(function(){var Yt,Rn=Me!=null&&(Yt=Me.tagDisciplineData)!==null&&Yt!==void 0&&Yt.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];pt(Rn)},[Me.tagDisciplineData]);var Tt=function(Rn){(Rn==null?void 0:Rn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),wn(!1),Ie(-1),yt.current=!1,q())},Nt=function(){var Yt=Object(te.a)(s.a.mark(function Rn(){var zn,rr,On,Ir,jr,xr,lr;return s.a.wrap(function(Er){for(;;)switch(Er.prev=Er.next){case 0:if(zn=[],rr=!1,qn(!0),bt.forEach(function(Cr,Ur){zn.push({position:Ur+1,answer_text:[]}),Cr.forEach(function(Vr,Fr){zn[Ur].answer_text.push(Vr),(!Vr||!Object(ie.db)(Vr,1e4))&&(fn("".concat(Ur,"-").concat(Fr)),_.b.info(Vr?"\u7B54\u6848\u4E0D\u80FD\u8D85\u8FC710000\u5B57\u7B26":"\u7B54\u6848\uFF1A\u4E0D\u80FD\u4E3A\u7A7A"),rr=!0)})}),!rr){Er.next=7;break}return qn(!1),Er.abrupt("return",!1);case 7:if(yt.current=!0,!ve.question_id){Er.next=15;break}return Er.next=11,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:lt.id,question_id:ve.question_id,name:X,item_type:3,question_score:un,is_ordered:qt,standard_answers:zn,tag_discipline_ids:Mn,sub_discipline_id:(Ir=Me.editData)===null||Ir===void 0||((jr=Ir.exercise)===null||jr===void 0)?void 0:jr.sub_discipline_id,difficulty:Gt,repeat_answer:!bn,analysis:st}});case 11:On=Er.sent,Tt(On),Er.next=19;break;case 15:return Er.next=17,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:lt.id,name:X,item_type:3,question_score:un,is_ordered:qt,standard_answers:zn,tag_discipline_ids:Mn,sub_discipline_id:(xr=Me.editData)===null||xr===void 0||((lr=xr.exercise)===null||lr===void 0)?void 0:lr.sub_discipline_id,difficulty:Gt,repeat_answer:!bn,analysis:st}});case 17:On=Er.sent,Tt(On);case 19:return qn(!1),Er.abrupt("return",{name:X,analysis:st,standard_answers:zn,is_ordered:qt});case 21:case"end":return Er.stop()}},Rn)}));return function(){return Yt.apply(this,arguments)}}(),St=function(Rn,zn,rr){var On=bt.slice();if(zn&&On.splice(Rn,zn),rr&&xn||!ve.question_id)for(var Ir=0;Ir<rr;Ir++)On.splice(Rn+Ir,0,[""]);Kn(On==null?void 0:On.length),Jn(!0),Mt(On)},Ht=function(Rn,zn,rr){fn("");var On=bt.slice();On[Rn][zn]=rr,Mt(On)},Rt=function(Rn){var zn=bt.slice();zn[Rn]=[].concat(Object(W.a)(zn[Rn]),[""]),Mt(zn)},Lt=function(Rn,zn){var rr=bt.slice();if(!rr[Rn][zn]){rr[Rn]=rr[Rn].filter(function(On,Ir){return Ir!==zn}),Mt(rr);return}K.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:ue.a.modal,onOk:function(){rr[Rn]=rr[Rn].filter(function(Ir,jr){return jr!==zn}),Mt(rr)}})},En=function(Rn){K.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:ue.a.modal,onOk:function(){var rr=0;se(X.replace(/\▁/g,function(On){return rr++,rr-1===Rn?"":On})),setTimeout(function(){var On=bt.slice();On=bt.filter(function(Ir,jr){return Rn!==jr}),Mt(On)},500)}})},on=function(){var Rn,zn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.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(H.a,{id:"completion-question-tittle",placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE",height:155,defaultValue:X,onChange:function(On){return se(On)},showNullButton:!0,deleteEmptyDisabled:Vn,onPlaceholderChange:St})),t.a.createElement("div",{className:"mt20"},bt.map(function(rr,On){return t.a.createElement(Y.a,{key:On,answers:rr,index:On,is_md:!0,exerciseIsPublish:!1,activeOptionErrorIndex:Hn,onAnswerChange:Ht,addChildAnswer:Rt,deleteChildAnswer:Lt,deleteChildAnswermain:En})})),t.a.createElement("div",{className:"mt20"},bt.length>1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:qt,onChange:function(On){return Ft(On.target.checked)},className:"".concat(ue.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ue.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:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:st,onChange:function(On){return wt(On)}}),t.a.createElement("p",{className:""},t.a.createElement("span",{style:{color:"red"}},"*"),"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:un,max:1e4,min:0,onChange:function(On){Un(On)}})," ","\u5206 \xA0"," ",!!un&&!!Ln&&t.a.createElement("span",{style:{color:"red"}},"(\u6839\u636E\u5747\u5206\u89C4\u5219\uFF0C\u672C\u9898\u6BCF\u7A7A",(un/Ln).toFixed(1),"\u5206)"),t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Gt,onChange:function(On){zt(On.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.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(Le.a,{value:Mn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Dn,subId:(Rn=Me.editData)===null||Rn===void 0||((zn=Rn.exercise)===null||zn===void 0)?void 0:zn.sub_discipline_id,knowledgeOptions:Ge,onAddKnowledgeFinish:rt})),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(x.a,{checked:bn,onChange:function(On){gn(On)}}))),t.a.createElement("aside",{className:"tr"},(or!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){Ce(),wn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){Nt()}},"\u4FDD\u5B58")))},gr=[{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"}],er=function(){var Yt=Object(te.a)(s.a.mark(function Rn(zn){return s.a.wrap(function(On){for(;;)switch(On.prev=On.next){case 0:if(!(or!==-1)){On.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),On.abrupt("return");case 3:On.t0=zn.id,On.next=On.t0==="del"?6:On.t0==="edit"?8:On.t0==="add"?11:13;break;case 6:return K.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(te.a)(s.a.mark(function jr(){return s.a.wrap(function(lr){for(;;)switch(lr.prev=lr.next){case 0:return lr.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:lt.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},lt)});case 3:case"end":return lr.stop()}},jr)}))()}}),On.abrupt("break",13);case 8:return Ie(ve.dragKey),wn(!0),On.abrupt("break",13);case 11:return hr({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:3}),On.abrupt("break",13);case 13:case"end":return On.stop()}},Rn)}));return function(zn){return Yt.apply(this,arguments)}}(),tr=function(){var Rn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u586B\u7A7A\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},ve==null||((Rn=ve.standard_answer)===null||Rn===void 0)?void 0:Rn.map(function(zn,rr){return t.a.createElement(r.a,{key:rr,align:"middle"},t.a.createElement(A.a,null,"\u7B54\u6848\uFF08\u586B\u7A7A",zn.choice_id,"\uFF09\uFF1A"),t.a.createElement(A.a,{flex:"1"},t.a.createElement(r.a,{align:"middle",gutter:[1,1]},zn.answer_text.map(function(On,Ir){return t.a.createElement(A.a,{span:24,key:Ir},t.a.createElement(T.a,{key:rr,checked:ve.standard_answer.includes(rr),disabled:!0,value:On}))}))))})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&gr.map(function(zn,rr){return zn.id==="up"&&ve.key===1||zn.id==="down"&&ve.key===ve.len?null:t.a.createElement(o.a,{key:rr,placement:"bottom",title:zn.name},t.a.createElement("span",{onClick:function(){return er(zn)},className:zn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!In&&tr(),In&&on())},fr=Object(F.a)(function(mt){var Ke=mt.newExercisePaper;return{newExercisePaper:Ke}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Gn)),vr=function(Ke,Ot){var Me=Ke.newExercisePaper,ye=Ke.dispatch,ve=Ke.editData,or=Ke.cancelAdd,en=or===void 0?function(){}:or,Ie=Ke.editKey,gt=Ke.setEditKey,Ce=gt===void 0?function(){}:gt,dn=Ke.reload,hr=dn===void 0?function(){}:dn,mr=Ke.addCallback,q=mr===void 0?function(){}:mr,O=Object(i.useState)(""),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(""),Pe=Object(a.a)(Z,2),st=Pe[0],wt=Pe[1],Pt=Object(i.useState)(""),dt=Object(a.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=Object(i.useState)(),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!1),rn=Object(a.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(i.useState)(1),Sn=Object(a.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(i.useState)(!1),nr=Object(a.a)(Xn,2),Ln=nr[0],Kn=nr[1],nn=Object(i.useState)([[],[]]),_n=Object(a.a)(nn,2),In=_n[0],wn=_n[1],Zn=Object(i.useRef)(!1),yn=Object(w.i)(),Vn=Object(i.useState)([]),qn=Object(a.a)(Vn,2),kn=qn[0],Pn=qn[1],Mn=function(bn){Pn([].concat(Object(W.a)(kn),[Object(g.a)({},bn)]))};Object(i.useEffect)(function(){var tn;if(Zn.current)return;if(!(ve!=null&&ve.question_title)){Ft(!0),se(""),Mt(""),fn(10);return}Kn(!(ve!=null&&ve.repeat_answer)),se(ve==null?void 0:ve.question_title),Mt(ve==null||((tn=ve.standard_answer)===null||tn===void 0)?void 0:tn[0]),fn(ve==null?void 0:ve.question_score),Jn(ve.tag_discipline_ids),Un(ve==null?void 0:ve.difficulty),wt(ve==null?void 0:ve.analysis),wn([ve==null?void 0:ve.normal_keywords,ve==null?void 0:ve.main_keywords])},[Me.editData,qt]),Object(i.useEffect)(function(){var tn,bn=Me!=null&&(tn=Me.tagDisciplineData)!==null&&tn!==void 0&&tn.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];Pn(bn)},[Me.tagDisciplineData]),Object(i.useEffect)(function(){qt&&tn();function tn(){return bn.apply(this,arguments)}function bn(){return bn=Object(te.a)(s.a.mark(function gn(){var yt,lt,Je;return s.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:return Ge.next=2,Object(P.I)({sub_discipline_id:(yt=Me.editData)===null||yt===void 0||((lt=yt.exercise)===null||lt===void 0)?void 0:lt.sub_discipline_id});case 2:Je=Ge.sent,Pn(Je.tag_disciplines);case 4:case"end":return Ge.stop()}},gn)})),bn.apply(this,arguments)}},[qt]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:cn,isEdit:qt}});var Dn=function(bn){(bn==null?void 0:bn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Ft(!1),Ce(-1),Zn.current=!1,hr())},cn=function(){var tn=Object(te.a)(s.a.mark(function bn(){var gn,yt,lt,Je,nt,Ge,pt;return s.a.wrap(function(Tt){for(;;)switch(Tt.prev=Tt.next){case 0:if(X){Tt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),Tt.abrupt("return",!1);case 3:if(gn=In[0],yt=In[1],Zn.current=!0,!ve.question_id){Tt.next=13;break}return Tt.next=9,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:yn.id,question_id:ve.question_id,name:X,item_type:4,question_score:Hn,answer_texts:[bt],tag_discipline_ids:xn,sub_discipline_id:(Je=Me.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0)?void 0:nt.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:st,normal_keywords:gn,main_keywords:yt}});case 9:lt=Tt.sent,Dn(lt),Tt.next=17;break;case 13:return Tt.next=15,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,id:yn.id,name:X,item_type:4,question_score:Hn,answer_texts:[bt],tag_discipline_ids:xn,sub_discipline_id:(Ge=Me.editData)===null||Ge===void 0||((pt=Ge.exercise)===null||pt===void 0)?void 0:pt.sub_discipline_id,difficulty:un,repeat_answer:!Ln,analysis:st,normal_keywords:gn,main_keywords:yt}});case 15:lt=Tt.sent,Dn(lt);case 17:return Tt.abrupt("return",{name:X,answer_texts:[bt],analysis:st,normal_keywords:gn,main_keywords:yt});case 18:case"end":return Tt.stop()}},bn)}));return function(){return tn.apply(this,arguments)}}(),Ut=function(){var bn,gn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.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(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:X,onChange:function(lt){return se(lt)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(v.a,{id:"single-question-reference-answer",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u53C2\u8003\u7B54\u6848",defaultValue:bt,onChange:function(lt){return Mt(lt)}}),t.a.createElement(kt.a,{value:In,onChange:wn}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.title},"\u9898\u76EE\u89E3\u6790\uFF1A")),t.a.createElement(v.a,{id:"single-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u76EE\u89E3\u6790",defaultValue:st,onChange:function(lt){return wt(lt)}}),t.a.createElement("p",{className:""},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:Hn,max:1e4,min:0,onChange:function(lt){fn(lt)}})," ","\u5206",t.a.createElement("span",{style:{marginLeft:"30px"},className:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:un,onChange:function(lt){Un(lt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.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(Le.a,{value:xn,selectvalues:ve==null?void 0:ve.tag_discipline_ids,onChange:Jn,subId:(bn=Me.editData)===null||bn===void 0||((gn=bn.exercise)===null||gn===void 0)?void 0:gn.sub_discipline_id,knowledgeOptions:kn,onAddKnowledgeFinish:Mn})),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(x.a,{checked:Ln,onChange:function(lt){Kn(lt)}}))),t.a.createElement("aside",{className:"tr"},(Ie!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){en(),Ft(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){cn()}},"\u4FDD\u5B58")))},Gt=[{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"}],zt=function(){var tn=Object(te.a)(s.a.mark(function bn(gn){return s.a.wrap(function(lt){for(;;)switch(lt.prev=lt.next){case 0:if(!(Ie!==-1)){lt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),lt.abrupt("return");case 3:lt.t0=gn.id,lt.next=lt.t0==="del"?6:lt.t0==="up"||lt.t0==="down"?8:lt.t0==="edit"?12:lt.t0==="add"?15:17;break;case 6:return K.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(te.a)(s.a.mark(function nt(){return s.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:yn.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},yn)});case 3:case"end":return pt.stop()}},nt)}))()}}),lt.abrupt("break",17);case 8:return lt.next=10,ye({type:"newExercisePaper/exeriseMoveUpDown",payload:{id:ve.question_id,opr:gn.id}});case 10:return ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},yn)}),lt.abrupt("break",17);case 12:return Ce(ve.dragKey),Ft(!0),lt.abrupt("break",17);case 15:return q({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:4}),lt.abrupt("break",17);case 17:case"end":return lt.stop()}},bn)}));return function(gn){return tn.apply(this,arguments)}}(),jt=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7B80\u7B54\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},t.a.createElement("p",null,t.a.createElement("strong",null,"\u53C2\u8003\u7B54\u6848\uFF1A")),t.a.createElement(xe.a,{value:bt||""})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&Gt.map(function(bn,gn){return t.a.createElement(o.a,{key:gn,placement:"bottom",title:bn.name},t.a.createElement("span",{onClick:function(){return zt(bn)},className:bn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!qt&&jt(),qt&&Ut())},ir=Object(F.a)(function(mt){var Ke=mt.newExercisePaper;return{newExercisePaper:Ke}},null,null,{forwardRef:!0})(Object(i.forwardRef)(vr)),br=function(Ke,Ot){var Me=Ke.dispatch,ye=Ke.editData,ve=Ke.cancelAdd,or=ve===void 0?function(){}:ve,en=Ke.editKey,Ie=Ke.setEditKey,gt=Ie===void 0?function(){}:Ie,Ce=Ke.reload,dn=Ce===void 0?function(){}:Ce,hr=Object(i.useState)(""),mr=Object(a.a)(hr,2),q=mr[0],O=mr[1],M=Object(i.useState)(""),X=Object(a.a)(M,2),se=X[0],Z=X[1],Pe=Object(i.useState)(""),st=Object(a.a)(Pe,2),wt=st[0],Pt=st[1],dt=Object(i.useState)([]),bt=Object(a.a)(dt,2),Mt=bt[0],Cn=bt[1],Yn=Object(i.useState)(),Hn=Object(a.a)(Yn,2),fn=Hn[0],Wt=Hn[1],rn=Object(i.useState)(!1),qt=Object(a.a)(rn,2),Ft=qt[0],Qn=qt[1],Bn=Object(i.useState)([]),xn=Object(a.a)(Bn,2),Jn=xn[0],pn=xn[1],Sn=Object(i.useState)(!1),un=Object(a.a)(Sn,2),Un=un[0],Xn=un[1],nr=Object(i.useState)(!1),Ln=Object(a.a)(nr,2),Kn=Ln[0],nn=Ln[1],_n=Object(w.i)(),In=Object(i.useRef)(!1);Object(i.useEffect)(function(){var Pn;if(In.current)return;ye.edit&&(Xn(!0),Z(""),O(""),pn([])),O(ye.shixun_name),Z(ye.question_title);var Mn=[];(Pn=ye.shixun)===null||Pn===void 0||Pn.map(function(Dn){Mn.push(Dn.challenge_score)}),pn(Mn)},[ye]),Object(i.useEffect)(function(){Qn(!1)},[Un]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Zn,isEdit:Un}});var wn=function(Mn){(Mn==null?void 0:Mn.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),Xn(!1),gt(-1),In.current=!1,dn())},Zn=function(){var Pn=Object(te.a)(s.a.mark(function Mn(){var Dn,cn,Ut;return s.a.wrap(function(zt){for(;;)switch(zt.prev=zt.next){case 0:if(Dn=[],cn=!1,!cn){zt.next=4;break}return zt.abrupt("return",!1);case 4:if(In.current=!0,nn(!0),!ye.question_id){zt.next=12;break}return zt.next=9,Me({type:"newExercisePaper/editExerciseQuestion",payload:{id:_n.id,question_id:ye.question_id,name:se,shixun_name:q,shixun_id:ye.shixun_id,item_type:5,question_scores:Jn}});case 9:Ut=zt.sent,zt.next=15;break;case 12:return zt.next=14,Me({type:"newExercisePaper/addExerciseQuestion",payload:{id:_n.id,insert_id:ye==null?void 0:ye.insert_id,name:se,shixun_name:q,shixun_id:ye.shixun_id,item_type:5,question_scores:Jn,is_copy:ye.is_copy}});case 14:Ut=zt.sent;case 15:return wn(Ut),nn(!1),zt.abrupt("return",{name:se,analysis:wt,standard_answers:Dn,is_ordered:fn});case 18:case"end":return zt.stop()}},Mn)}));return function(){return Pn.apply(this,arguments)}}(),yn=function(){var Mn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.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(T.a,{defaultValue:q,onChange:function(cn){O(cn.target.value)}})),t.a.createElement("div",{className:"mt10"},t.a.createElement(v.a,{id:"single-question-option-0",height:155,placeholder:"\u8BF7\u8F93\u5165\u5B9E\u8BAD\u9898\u5B8C\u6210\u8981\u6C42",defaultValue:se,onChange:function(cn){Z(cn)}})),t.a.createElement("div",{className:"mt20"},(Mn=ye.shixun)===null||Mn===void 0?void 0:Mn.map(function(Dn,cn){return t.a.createElement(r.a,{gutter:[20,20]},t.a.createElement(A.a,{flex:"1"},cn+1,".",Dn.challenge_name),t.a.createElement(A.a,null,t.a.createElement(B.a,{defaultValue:Jn[cn],onChange:function(Gt){Jn[cn]=Gt,pn(Jn)}})," ","\u5206"))})),t.a.createElement("div",{className:"mt20"},Mt.length>1&&t.a.createElement("span",null,t.a.createElement(C.a,{checked:fn,onChange:function(cn){return Wt(cn.target.checked)},className:"".concat(ue.a.color333," font14")},"\u591A\u4E2A\u586B\u7A7A\u7684\u7B54\u6848\u6709\u987A\u5E8F\u8981\u6C42"),t.a.createElement("span",{className:"".concat(ue.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||!(ye!=null&&ye.edit))&&t.a.createElement(m.a,{type:"default",onClick:function(){or(),Xn(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{loading:Kn,className:"ml20",type:"primary",onClick:function(){Zn()}},"\u4FDD\u5B58")))},Vn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"(\u5411\u4E0B\u63D2\u5165\u5B9E\u8BAD\u9898)",icon:"iconfont c-light-primary ml30 icon-tianjia current",id:"add"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],qn=function(){var Pn=Object(te.a)(s.a.mark(function Mn(Dn){return s.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(!(en!==-1)){Ut.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),Ut.abrupt("return");case 3:Ut.t0=Dn.id,Ut.next=Ut.t0==="del"?6:Ut.t0==="edit"?8:Ut.t0==="add"?11:13;break;case 6:return K.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(te.a)(s.a.mark(function zt(){return s.a.wrap(function(tn){for(;;)switch(tn.prev=tn.next){case 0:return tn.next=2,Object(Ee.g)({question_id:ye.question_id,exam_id:_n.id});case 2:Me({type:"newExercisePaper/editExercise",payload:Object(g.a)({},_n)});case 3:case"end":return tn.stop()}},zt)}))()}}),Ut.abrupt("break",13);case 8:return gt(ye.dragKey),Xn(!0),Ut.abrupt("break",13);case 11:return Me({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",editData:{key:ye.key,insert_id:ye==null?void 0:ye.question_id,question_type:5}}}),Ut.abrupt("break",13);case 13:case"end":return Ut.stop()}},Mn)}));return function(Dn){return Pn.apply(this,arguments)}}(),kn=function(){var Mn,Dn;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ye!=null&&ye.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ye.key,"\u3001\u5B9E\u8BAD\u9898"),"\uFF08",ye.question_score,"\u5206\uFF09")),ye!=null&&ye.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ye.key,"."),t.a.createElement(xe.a,{value:ye.shixun_name}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ye.question_score,"\u5206\uFF09"),!!((Mn=ye.schools)!==null&&Mn!==void 0&&Mn.length)&&t.a.createElement(o.a,{title:"\u8BE5\u5B9E\u8BAD\u9898\u9762\u5411\u6307\u5B9A\u5355\u4F4D\u5F00\u653E"},t.a.createElement("i",{className:"iconfont icon-zhidinggongkai1 font18 line24 c-orange"}))):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ye.shixun_name})),t.a.createElement("div",{className:"mt30"}),(Dn=ye.shixun)===null||Dn===void 0?void 0:Dn.map(function(cn,Ut){return t.a.createElement("div",{key:Ut},"\u7B2C",Ut+1,"\u5173"," ",t.a.createElement("span",{className:"ml10"},cn.challenge_name)," ",t.a.createElement("span",{className:"ml10"},cn.challenge_score," \u5206"))}),t.a.createElement("div",{className:ue.a.action},t.a.createElement(ot.a,{target:"_blank",to:"/shixuns/".concat(ye.shixun_identifier,"/challenges?exercise=true")},"\u5B9E\u8BAD\u8BE6\u60C5"),!ye.hideAction&&Vn.map(function(cn,Ut){return t.a.createElement(o.a,{key:Ut,placement:"bottom",title:cn.name},t.a.createElement("span",{onClick:function(){return qn(cn)},className:cn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},!Un&&kn(),Un&&yn())},Rr=Object(F.a)(function(mt){var Ke=mt.newExercisePaper;return{newExercisePaper:Ke}},null,null,{forwardRef:!0})(Object(i.forwardRef)(br)),Jt=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"],Ar=function(Ke,Ot){var Me=Ke.newExercisePaper,ye=Ke.dispatch,ve=Ke.editData,or=Ke.editKey,en=Ke.addCallback,Ie=en===void 0?function(){}:en,gt=Object(i.useState)([]),Ce=Object(a.a)(gt,2),dn=Ce[0],hr=Ce[1],mr=Object(i.useState)(),q=Object(a.a)(mr,2),O=q[0],M=q[1],X=Object(i.useState)([]),se=Object(a.a)(X,2),Z=se[0],Pe=se[1],st=Object(i.useState)(""),wt=Object(a.a)(st,2),Pt=wt[0],dt=wt[1],bt=Object(i.useState)(5),Mt=Object(a.a)(bt,2),Cn=Mt[0],Yn=Mt[1],Hn=Object(i.useState)(!1),fn=Object(a.a)(Hn,2),Wt=fn[0],rn=fn[1],qt=Object(w.i)();Object(i.useEffect)(function(){hr(["","","",""])},[]),Object(i.useEffect)(function(){if(!(ve!=null&&ve.question_choices)){rn(!0),dt(""),Yn(5),hr(["","","",""]),Pe([]);return}dt(ve==null?void 0:ve.question_title),Yn(ve==null?void 0:ve.question_score),hr(ve==null?void 0:ve.question_choices.map(function(Sn){return Sn.choice_text}));var pn=[];ve==null||ve.standard_answer.map(function(Sn,un){pn.push(Sn-1)}),Pe(pn)},[ve]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:Ft,isEdit:Wt}});var Ft=function(){var pn=Object(te.a)(s.a.mark(function Sn(){var un,Un,Xn;return s.a.wrap(function(Ln){for(;;)switch(Ln.prev=Ln.next){case 0:if(Pt){Ln.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u76EE"),Ln.abrupt("return",!1);case 3:if(un=dn.findIndex(function(Kn){return!Kn}),!(un>-1)){Ln.next=7;break}return _.b.info("\u8BF7\u5148\u8F93\u5165 ".concat(Jt[un]," \u9009\u9879\u7684\u5185\u5BB9")),Ln.abrupt("return",!1);case 7:if(Z.length){Ln.next=10;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u672C\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E"),Ln.abrupt("return",!1);case 10:if(!(Z.length<1)){Ln.next=13;break}return _.b.info("\u8BF7\u9009\u62E9\u7B54\u6848"),Ln.abrupt("return",!1);case 13:if(Un=dn.map(function(Kn,nn){return{choice_text:Kn,is_answer:Z.includes(nn)?nn+1:0}}),!ve.question_id){Ln.next=20;break}return Ln.next=17,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:ve.question_id,question_title:Pt,question_type:1,question_score:Cn,question_choices:Un.map(function(Kn){return Kn.choice_text}),standard_answers:Un.filter(function(Kn){return Kn.is_answer}).map(function(Kn){return Kn.is_answer})}});case 17:Xn=Ln.sent,Ln.next=23;break;case 20:return Ln.next=22,ye({type:"newExercisePaper/addExerciseQuestion",payload:{insert_id:ve==null?void 0:ve.insert_id,categoryId:qt.categoryId,question_title:Pt,question_type:1,question_score:"5.0",question_choices:Un.map(function(Kn){return Kn.choice_text}),standard_answers:Un.filter(function(Kn){return Kn.is_answer}).map(function(Kn){return Kn.is_answer})}});case 22:Xn=Ln.sent;case 23:Xn.status===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),rn(!1),ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},qt)}));case 24:case"end":return Ln.stop()}},Sn)}));return function(){return pn.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"}],Bn=function(){var pn=Object(te.a)(s.a.mark(function Sn(un){return s.a.wrap(function(Xn){for(;;)switch(Xn.prev=Xn.next){case 0:if(!(or!==-1)){Xn.next=3;break}return _.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=un.id,Xn.next=Xn.t0==="del"?6:Xn.t0==="edit"?8:Xn.t0==="add"?10:12;break;case 6:return K.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(te.a)(s.a.mark(function Ln(){return s.a.wrap(function(nn){for(;;)switch(nn.prev=nn.next){case 0:return nn.next=2,Object(Ee.g)({exam_id:qt.id,question_id:ve.question_id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},qt)});case 3:case"end":return nn.stop()}},Ln)}))()}}),Xn.abrupt("break",12);case 8:return F.d.push("/problems/".concat(ve==null?void 0:ve.hack_identifier,"/edit?type=exercises&express_id=").concat(qt.id,"&question_id=").concat(ve==null?void 0:ve.question_id,"&score=").concat(ve==null?void 0:ve.question_score,"&exercise=true&callback_url=").concat(location.pathname)),Xn.abrupt("break",12);case 10:return Ie({key:ve.key,insert_id:ve==null?void 0:ve.question_id,question_type:6}),Xn.abrupt("break",12);case 12:case"end":return Xn.stop()}},Sn)}));return function(un){return pn.apply(this,arguments)}}(),xn=function(){var pn=Object(te.a)(s.a.mark(function Sn(un){var Un;return s.a.wrap(function(nr){for(;;)switch(nr.prev=nr.next){case 0:return un.preventDefault(),nr.next=3,Object(P.X)({id:ve==null?void 0:ve.hack_identifier});case 3:Un=nr.sent,Un.status===0&&Object(ie.S)("/myproblems/".concat(Un==null?void 0:Un.identifier));case 5:case"end":return nr.stop()}},Sn)}));return function(un){return pn.apply(this,arguments)}}(),Jn=function(){return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7F16\u7A0B\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{className:ue.a.questionChoices},t.a.createElement(xe.a,{value:ve.description||""})),t.a.createElement("div",{className:ue.a.action},!ve.hideAction&&Qn.map(function(Sn,un){return t.a.createElement(o.a,{key:un,placement:"bottom",title:Sn.name},t.a.createElement("span",{onClick:function(){return Bn(Sn)},className:Sn.icon}))})))};return t.a.createElement("section",{className:ue.a.wrap},Jn())},Nn=Object(F.a)(function(mt){var Ke=mt.newExercisePaper;return{newExercisePaper:Ke}},null,null,{forwardRef:!0})(Object(i.forwardRef)(Ar)),Tn=["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"],pr=function(Ke,Ot){var Me=Ke.newExercisePaper,ye=Ke.dispatch,ve=Ke.editData,or=Ke.cancelAdd,en=or===void 0?function(){}:or,Ie=Ke.editKey,gt=Ke.setEditKey,Ce=gt===void 0?function(){}:gt,dn=Ke.addCallback,hr=dn===void 0?function(cn){}:dn,mr=Ke.reload,q=mr===void 0?function(){}:mr,O=Object(i.useState)([]),M=Object(a.a)(O,2),X=M[0],se=M[1],Z=Object(i.useState)(!1),Pe=Object(a.a)(Z,2),st=Pe[0],wt=Pe[1],Pt=Object(i.useState)(!0),dt=Object(a.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=Object(i.useState)(1),Yn=Object(a.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(i.useState)(!1),rn=Object(a.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=Object(i.useState)([]),Bn=Object(a.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(w.i)(),Sn=Object(i.useRef)(null),un=Object(i.useState)(""),Un=Object(a.a)(un,2),Xn=Un[0],nr=Un[1],Ln=Object(i.useState)([]),Kn=Object(a.a)(Ln,2),nn=Kn[0],_n=Kn[1],In=Object(i.useRef)(!1),wn=function(Ut){Jn([].concat(Object(W.a)(xn),[Object(g.a)({},Ut)]))};Object(i.useEffect)(function(){var cn;if(In.current)return;if(!(ve!=null&&ve.question_title)){wt(!0),nr("");return}nr(ve==null?void 0:ve.question_title),Ft(!(ve!=null&&ve.repeat_answer)),fn(ve==null?void 0:ve.difficulty),se(ve.tag_discipline_ids);var Ut=ve==null||((cn=ve.sub_exercise_questions)===null||cn===void 0)?void 0:cn.map(function(Gt){return Object(g.a)(Object(g.a)({},Gt),{},{id:Gt.question_id,name:Gt.question_title,open:!1,question_score:Gt.question_score,choices:Gt==null?void 0:Gt.question_choices.map(function(zt){return{choice_text:zt.choice_text,is_answer:zt.standard_boolean?1:0}}),activeQusEditor:null})});_n(Ut)},[ve,st]),Object(i.useEffect)(function(){st&&cn();function cn(){return Ut.apply(this,arguments)}function Ut(){return Ut=Object(te.a)(s.a.mark(function Gt(){var zt,jt,tn;return s.a.wrap(function(gn){for(;;)switch(gn.prev=gn.next){case 0:return gn.next=2,Object(P.I)({sub_discipline_id:(zt=Me.editData)===null||zt===void 0||((jt=zt.exercise)===null||jt===void 0)?void 0:jt.sub_discipline_id});case 2:tn=gn.sent,Jn(tn.tag_disciplines);case 4:case"end":return gn.stop()}},Gt)})),Ut.apply(this,arguments)}},[st]),Object(i.useEffect)(function(){var cn,Ut=Me!=null&&(cn=Me.tagDisciplineData)!==null&&cn!==void 0&&cn.tag_disciplines&&Array.isArray(Me.tagDisciplineData.tag_disciplines)?Me.tagDisciplineData.tag_disciplines:[];Jn(Ut)},[Me.tagDisciplineData]),Object(i.useImperativeHandle)(Ot,function(){return{onSave:yn,isEdit:st}});var Zn=function(Ut){(Ut==null?void 0:Ut.status)===0&&(_.b.success("\u4FDD\u5B58\u6210\u529F"),wt(!1),Ce(-1),In.current=!1,q())},yn=function(){var cn=Object(te.a)(s.a.mark(function Ut(){var Gt,zt,jt,tn,bn,gn,yt,lt,Je,nt,Ge;return s.a.wrap(function(rt){for(;;)switch(rt.prev=rt.next){case 0:if(Xn){rt.next=3;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u9898\u5E72"),rt.abrupt("return",!1);case 3:if(!(nn.length===0)){rt.next=6;break}return _.b.info("\u8BF7\u60A8\u6DFB\u52A0\u5C0F\u9898"),rt.abrupt("return",!1);case 6:Gt=0;case 7:if(!(Gt<nn.length)){rt.next=25;break}if(jt=nn[Gt],jt!=null&&jt.name){rt.next=12;break}return _.b.info("\u8BF7\u60A8\u8F93\u5165\u7B2C".concat(Gt+1,"\u5C0F\u9898\u9898\u5E72")),rt.abrupt("return",!1);case 12:if(jt!=null&&jt.question_score){rt.next=15;break}return _.b.info("\u7B2C".concat(Gt+1,"\u5C0F\u9898\u5206\u6570\u4E0D\u80FD\u4E3A0\u6216\u7A7A")),rt.abrupt("return",!1);case 15:if(tn=jt==null||((zt=jt.choices)===null||zt===void 0)?void 0:zt.findIndex(function(Tt){return!Tt}),!(tn>-1)){rt.next=19;break}return _.b.info("\u8BF7\u5148\u8F93\u5165\u7B2C".concat(Gt+1,"\u5C0F\u9898").concat(Tn[tn],"\u9009\u9879\u7684\u5185\u5BB9")),rt.abrupt("return",!1);case 19:if(!(jt.choices.findIndex(function(Tt){return Tt.is_answer===1})===-1)){rt.next=22;break}return _.b.info("\u8BF7\u8BBE\u7F6E\u7B2C".concat(Gt+1,"\u5C0F\u9898\u7684\u6B63\u786E\u7B54\u6848\uFF0C\u70B9\u51FB\u9009\u9879A/B...\u5373\u53EF\u5B8C\u6210\u8BBE\u7F6E")),rt.abrupt("return",!1);case 22:Gt++,rt.next=7;break;case 25:if(bn=nn.map(function(Tt){return{id:Tt.id>1?Tt.id:null,name:Tt.name,item_type:Fe.a.Single,choices:Tt.choices,question_score:Tt.question_score}}),In.current=!0,!ve.question_id){rt.next=34;break}return rt.next=30,ye({type:"newExercisePaper/editExerciseQuestion",payload:{id:pn.id,question_id:ve.question_id,name:Xn,item_type:Fe.a.Combine,sub_item_banks:bn,tag_discipline_ids:X,sub_discipline_id:(yt=Me.editData)===null||yt===void 0||((lt=yt.exercise)===null||lt===void 0)?void 0:lt.sub_discipline_id,difficulty:Hn,repeat_answer:!qt}});case 30:gn=rt.sent,Zn(gn),rt.next=38;break;case 34:return rt.next=36,ye({type:"newExercisePaper/addExerciseQuestion",payload:{id:pn.id,insert_id:ve==null?void 0:ve.insert_id,name:Xn,item_type:Fe.a.Combine,tag_discipline_ids:X,sub_discipline_id:(Je=Me.editData)===null||Je===void 0||((nt=Je.exercise)===null||nt===void 0)?void 0:nt.sub_discipline_id,difficulty:Hn,repeat_answer:!qt,sub_item_banks:bn}});case 36:gn=rt.sent,((Ge=gn)===null||Ge===void 0?void 0:Ge.status)===0&&(Ce(-1),_.b.success("\u4FDD\u5B58\u6210\u529F"),wt(!1),ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},pn)}));case 38:case"end":return rt.stop()}},Ut)}));return function(){return cn.apply(this,arguments)}}(),Vn=[{name:"\u5220\u9664",icon:"iconfont c-light-black ml30 icon-shanchu current",id:"del"},{name:"\u7F16\u8F91",icon:"iconfont c-light-primary ml30 icon-bianjishijuan3x current",id:"edit"}],qn=function(){var cn=Object(te.a)(s.a.mark(function Ut(Gt){return s.a.wrap(function(jt){for(;;)switch(jt.prev=jt.next){case 0:if(!(Ie!==-1)){jt.next=3;break}return _.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002"),jt.abrupt("return");case 3:jt.t0=Gt.id,jt.next=jt.t0==="del"?6:jt.t0==="edit"?8:jt.t0==="add"?11:13;break;case 6:return K.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(te.a)(s.a.mark(function bn(){return s.a.wrap(function(yt){for(;;)switch(yt.prev=yt.next){case 0:return yt.next=2,Object(Ee.g)({question_id:ve.question_id,exam_id:pn.id});case 2:ye({type:"newExercisePaper/editExercise",payload:Object(g.a)({},pn)});case 3:case"end":return yt.stop()}},bn)}))()}}),jt.abrupt("break",13);case 8:return Ce(ve.dragKey),wt(!0),jt.abrupt("break",13);case 11:return hr({key:ve.key,insert_id:ve==null?void 0:ve.question_id,item_type:Fe.a.Single}),jt.abrupt("break",13);case 13:case"end":return jt.stop()}},Ut)}));return function(Gt){return cn.apply(this,arguments)}}(),kn=function(){var Ut;return t.a.createElement("aside",{ref:Sn},t.a.createElement("div",{className:ue.a.questionType},!(ve!=null&&ve.isPreview)&&t.a.createElement("div",null,t.a.createElement("span",{className:"font16 c-blue"},ve.key,"\u3001\u7EC4\u5408\u9898"),"\uFF08",ve.question_score,"\u5206\uFF09")),ve!=null&&ve.isPreview?t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,"."),t.a.createElement(xe.a,{value:ve.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08\u5171",ve==null?void 0:ve.sub_q_count,"\u5C0F\u9898\uFF0C",ve.question_score,"\u5206\uFF09")):t.a.createElement("div",{className:"mt5"},t.a.createElement(xe.a,{value:ve.question_title})),t.a.createElement("div",{style:{display:bt?"block":"none"},className:ue.a.questionChoices},ve==null||((Ut=ve.sub_exercise_questions)===null||Ut===void 0)?void 0:Ut.map(function(Gt,zt){var jt;return t.a.createElement("div",{key:zt},t.a.createElement("div",{style:{display:"flex",alignItems:"flex-start"}},t.a.createElement("span",{style:{flexShrink:0},className:"font18"},ve.key,".",zt+1,"\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement(xe.a,{value:Gt.question_title}),t.a.createElement("span",{style:{flexShrink:0},className:"font16"},"\uFF08",Gt.question_score,"\u5206\uFF09")),Gt==null||((jt=Gt.question_choices)===null||jt===void 0)?void 0:jt.map(function(tn,bn){return t.a.createElement(r.a,{key:bn},t.a.createElement(A.a,null,t.a.createElement(h.a,{key:bn,checked:tn.standard_boolean,disabled:!0},Tn[bn],".")),t.a.createElement(A.a,{flex:"1"},t.a.createElement("span",{className:"c-black font14"},t.a.createElement(xe.a,{value:tn.choice_text}))))}))})),t.a.createElement("div",{className:ue.a.action},t.a.createElement("span",{className:"c-light-primary current",onClick:function(){return Mt(!bt)},style:{}},bt?"\u6536\u8D77":"\u5C55\u5F00"),!ve.hideAction&&Vn.map(function(Gt,zt){return t.a.createElement(o.a,{key:zt,placement:"bottom",title:Gt.name},t.a.createElement("span",{onClick:function(){return qn(Gt)},className:Gt.icon}))})))},Pn=function(){var Ut,Gt;return t.a.createElement("aside",null,t.a.createElement("div",{className:ue.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:ue.a.wrap,style:{padding:0}},t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u9898\u5E72\uFF1A")),t.a.createElement(v.a,{id:"combination-question-title",watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:Xn,onChange:function(jt){return nr(jt)}}),t.a.createElement("p",null,"\u5C0F\u9898\u6570\uFF1A",nn==null?void 0:nn.length),nn==null?void 0:nn.map(function(zt,jt){var tn;return t.a.createElement("div",{className:ue.a.fold,key:zt.id},t.a.createElement("div",{onClick:function(){return Dn("open",jt)},className:ue.a.head},t.a.createElement("i",{className:"iconfont icon-sanjiaoxing",style:{transform:zt.open?"initial":"rotate(270deg) translate(2px, 4px)"}}),t.a.createElement("span",null,"\u7B2C",jt+1,"\u5C0F\u9898\uFF08\u5355\u9009\u9898\uFF09"),t.a.createElement("b",{onClick:function(gn){gn.stopPropagation(),Dn("delete",jt)},className:"iconfont icon-shanchu8"})),t.a.createElement("div",{className:"mb10",style:{display:zt.open?"block":"none"}},t.a.createElement(v.a,{watch:!0,height:155,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9898\u5E72",defaultValue:zt==null?void 0:zt.name,onChange:function(gn){return Dn("value",jt,gn)}}),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:ue.a.required},"*"),t.a.createElement("span",{className:ue.a.title},"\u7B54\u6848\u9009\u9879\uFF1A",t.a.createElement("span",{className:ue.a.colorGray},"\u70B9\u51FB\u9009\u9879\u53EF\u8BBE\u7F6E\u6B63\u786E\u7B54\u6848"))),zt==null||((tn=zt.choices)===null||tn===void 0)?void 0:tn.map(function(bn,gn){var yt;return t.a.createElement("div",{className:ue.a.choiceWrap,key:gn},t.a.createElement(o.a,{title:"\u70B9\u51FB\u8BBE\u7F6E\u4E3A\u6807\u51C6\u7B54\u6848",placement:"left"},t.a.createElement("div",{className:"".concat(ue.a.answer," ").concat(bn.is_answer===1?ue.a.activeAnswer:""),onClick:function(){return Dn("answer",jt,gn)}},Tn[gn])),t.a.createElement("div",{className:ue.a.editorWrap},(zt==null?void 0:zt.activeQusEditor)===gn?t.a.createElement(v.a,{id:"single-question-option-".concat(gn),watch:!0,height:155,isFocus:!0,placeholder:"\u8BF7\u60A8\u8F93\u5165\u9009\u9879",defaultValue:bn.choice_text,onChange:function(Je){return Dn("details",jt,Je)}}):t.a.createElement("div",{className:ue.a.htmlWrap,onClick:function(){return Dn("edit",jt,gn)}},t.a.createElement(xe.a,{value:bn.choice_text}))),gn>1&&t.a.createElement(o.a,{title:"\u5220\u9664"},t.a.createElement("i",{className:"".concat(ue.a.deleteIcon," iconfont icon-htmal5icon19"),onClick:function(){return Dn("deleteQus",jt,gn)}})),gn<7&&gn===(zt==null||((yt=zt.choices)===null||yt===void 0)?void 0:yt.length)-1&&t.a.createElement(o.a,{title:"\u65B0\u589E\u53C2\u8003\u7B54\u6848"},t.a.createElement("i",{className:"".concat(ue.a.addIcon," iconfont icon-roundaddfill ml6"),onClick:function(){return Dn("addQus",jt)}})))}),t.a.createElement("p",{className:"mt10"},"\u5206\u503C\uFF1A",t.a.createElement(B.a,{value:zt.question_score,max:1e4,min:0,onChange:function(gn){return Dn("score",jt,gn)}}),"\u5206")))}),nn.length<20&&t.a.createElement(m.a,{type:"primary",onClick:Mn},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:ue.a.difficult},t.a.createElement("label",{style:{color:"red"}},"*")," \u96BE\u5EA6\uFF1A",t.a.createElement(h.a.Group,{value:Hn,onChange:function(jt){fn(jt.target.value)}},t.a.createElement(h.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(h.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(h.a.Button,{value:3},"\u56F0\u96BE")))),t.a.createElement("p",{className:ue.a.titleWrap},t.a.createElement("span",{className:"".concat(ue.a.title)},"\u77E5\u8BC6\u70B9\uFF1A",t.a.createElement("span",{className:ue.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(Le.a,{selectvalues:ve==null?void 0:ve.tag_discipline_ids,value:X,onChange:se,subId:(Ut=Me.editData)===null||Ut===void 0||((Gt=Ut.exercise)===null||Gt===void 0)?void 0:Gt.sub_discipline_id,knowledgeOptions:xn,onAddKnowledgeFinish:wn}))),t.a.createElement("aside",{className:"tr"},(Ie!==-1||ve.question_id)&&t.a.createElement(m.a,{type:"default",onClick:function(){en(),wt(!1)}},"\u53D6\u6D88"),t.a.createElement(m.a,{className:"ml20",type:"primary",onClick:function(){yn()}},"\u4FDD\u5B58")))},Mn=function(){var Ut={id:Math.random(),item_type:"SINGLE",open:!1,name:"",choices:Array.from({length:4},function(){return{choice_text:"",is_answer:0}}),activeQusEditor:null,analysis:""};_n(nn.concat(Ut))},Dn=function(Ut,Gt,zt){var jt=Object(Ct.cloneDeep)(nn);Ut==="open"&&(jt[Gt].open=!jt[Gt].open),Ut==="delete"&&jt.splice(Gt,1),Ut==="value"&&(jt[Gt].name=zt),Ut==="answer"&&jt[Gt].choices.forEach(function(tn,bn){tn.is_answer=zt===bn?1:0}),Ut==="edit"&&(jt[Gt].activeQusEditor=zt),Ut==="details"&&(jt[Gt].choices[jt[Gt].activeQusEditor].choice_text=zt),Ut==="addQus"&&(jt[Gt].choices=jt[Gt].choices.concat({choice_text:"",is_answer:0})),Ut==="deleteQus"&&(jt[Gt].choices=jt[Gt].choices.filter(function(tn,bn){return bn!==zt})),Ut==="analysis"&&(jt[Gt].analysis=zt),Ut==="score"&&(jt[Gt].question_score=zt),_n(jt)};return t.a.createElement("section",{className:ue.a.wrap},!st&&kn(),st&&Pn())},_r=Object(F.a)(function(mt){var Ke=mt.newExercisePaper;return{newExercisePaper:Ke}},null,null,{forwardRef:!0})(Object(i.forwardRef)(pr)),Pr=function(Ke){var Ot=Ke.data,Me=Ke.isDragDisabled,ye=Me===void 0?!1:Me,ve=Ke.editorProps,or=ve===void 0?{}:ve,en=Ke.onDragEnd,Ie=en===void 0?function(){}:en,gt=Ke.dispatch,Ce=Ke.markBtnVisible,dn=Ce===void 0?!1:Ce,hr=Ke.batchScore,mr=hr===void 0?[]:hr,q=Ke.reload,O=q===void 0?function(){}:q,M=Ke.inNewPaperLibrary,X=M===void 0?!1:M,se=Object(i.useRef)(),Z=Object(w.i)(),Pe=function(){var Wt,rn,qt,Ft,Qn,Bn,xn,Jn,pn,Sn,un,Un,Xn,nr,Ln,Kn,nn=[{name:"\u5355\u9009\u9898",type:0,count:Ot==null||((Wt=Ot.exercise_types)===null||Wt===void 0)?void 0:Wt.q_singles,score:Ot==null||((rn=Ot.exercise_types)===null||rn===void 0)?void 0:rn.q_singles_scores,items:[]},{name:"\u591A\u9009\u9898",type:1,count:Ot==null||((qt=Ot.exercise_types)===null||qt===void 0)?void 0:qt.q_doubles,score:Ot==null||((Ft=Ot.exercise_types)===null||Ft===void 0)?void 0:Ft.q_doubles_scores,items:[]},{name:"\u5224\u65AD\u9898",type:2,count:Ot==null||((Qn=Ot.exercise_types)===null||Qn===void 0)?void 0:Qn.q_judges,score:Ot==null||((Bn=Ot.exercise_types)===null||Bn===void 0)?void 0:Bn.q_judges_scores,items:[]},{name:"\u586B\u7A7A\u9898",type:3,count:Ot==null||((xn=Ot.exercise_types)===null||xn===void 0)?void 0:xn.q_nulls,score:Ot==null||((Jn=Ot.exercise_types)===null||Jn===void 0)?void 0:Jn.q_nulls_scores,items:[]},{name:"\u7B80\u7B54\u9898",type:4,count:Ot==null||((pn=Ot.exercise_types)===null||pn===void 0)?void 0:pn.q_mains,score:Ot==null||((Sn=Ot.exercise_types)===null||Sn===void 0)?void 0:Sn.q_mains_scores,items:[]},{name:"\u5B9E\u8BAD\u9898",type:5,count:Ot==null||((un=Ot.exercise_types)===null||un===void 0)?void 0:un.q_shixuns,score:Ot==null||((Un=Ot.exercise_types)===null||Un===void 0)?void 0:Un.q_shixuns_scores,items:[]},{name:"\u7F16\u7A0B\u9898",type:6,count:Ot==null||((Xn=Ot.exercise_types)===null||Xn===void 0)?void 0:Xn.q_pros,score:Ot==null||((nr=Ot.exercise_types)===null||nr===void 0)?void 0:nr.q_pros_scores,items:[]},{name:"\u7EC4\u5408\u9898",type:7,count:Ot==null||((Ln=Ot.exercise_types)===null||Ln===void 0)?void 0:Ln.q_combinations,score:Ot==null||((Kn=Ot.exercise_types)===null||Kn===void 0)?void 0:Kn.q_combination_scores,items:[]}];return nn},st=function(Wt,rn,qt){var Ft=Array.from(Wt),Qn=Ft.splice(rn,1),Bn=Object(a.a)(Qn,1),xn=Bn[0];return Ft.splice(qt,0,xn),Ft},wt=function(Wt,rn,qt){if(!Wt.destination)return;var Ft=st(rn,Wt.source.index,Wt.destination.index);X?Ie(Wt,Ft,qt):Ie(Ft,qt)},Pt=function(Wt){gt({type:"exercise/setActionTabs",payload:{key:"\u6807\u8BB0\u9519\u9898",params:Wt}})},dt=function(Wt,rn){if(rn===0)return X?t.a.createElement(Kt,Object(p.a)({reload:O,editData:Wt},Wt)):t.a.createElement(Et,Object(p.a)({reload:O,editData:Wt},Wt));if(rn===1)return X?t.a.createElement($n,Object(p.a)({reload:O,editData:Wt},Wt)):t.a.createElement(je,Object(p.a)({reload:O,editData:Wt},Wt));if(rn===2)return X?t.a.createElement(hn,Object(p.a)({reload:O,editData:Wt},Wt)):t.a.createElement(_e,Object(p.a)({reload:O,editData:Wt},Wt));if(rn===3)return X?t.a.createElement(fr,Object(p.a)({reload:O,editData:Wt},Wt)):t.a.createElement(be,Object(p.a)({reload:O,editData:Wt},Wt));if(rn===4)return X?t.a.createElement(ir,Object(p.a)({reload:O,editData:Wt},Wt)):t.a.createElement(an,Object(p.a)({reload:O,editData:Wt},Wt));if(rn===5)return X?t.a.createElement(Rr,Object(p.a)({reload:O,editData:Wt},Wt)):t.a.createElement(Be,Object(p.a)({reload:O,editData:Wt},Wt));if(rn===6)return X?t.a.createElement(Nn,Object(p.a)({reload:O,editData:Wt},Wt)):t.a.createElement(Ze,Object(p.a)({editData:Wt},Wt));if(rn===7)return X?t.a.createElement(_r,Object(p.a)({reload:O,editData:Wt},Wt)):t.a.createElement(ft,Object(p.a)({reload:O,editData:Wt},Wt))},bt=function(Wt,rn,qt){return t.a.createElement(He.a,{onDragEnd:function(Qn){return wt(Qn,Wt,rn)}},t.a.createElement(He.c,{droppableId:"droppable"},function(Ft,Qn){return t.a.createElement("div",Object(p.a)({ref:Ft.innerRef},Ft.droppableProps,{style:{width:"100%"}}),Wt==null?void 0:Wt.map(function(Bn,xn){var Jn,pn=Object(g.a)(Object(g.a)({},Bn),{},{key:xn+1,hideAction:!0,isPreview:!0,dragKey:rn+"-"+xn},or);return t.a.createElement(He.b,{key:pn==null?void 0:pn.question_id,draggableId:pn==null||((Jn=pn.question_id)===null||Jn===void 0)?void 0:Jn.toString(),index:xn,isDragDisabled:ye},function(Sn,un){return t.a.createElement("aside",Object(p.a)({ref:Sn.innerRef},Sn.draggableProps,Sn.dragHandleProps),t.a.createElement("div",{className:Ue.a.posWarp,id:pn.dragKey},dt(pn,rn),dn&&t.a.createElement(r.a,{className:Ue.a.markWrongBtnWrapper},t.a.createElement(m.a,{onClick:function(){return Pt({value:pn,type:rn})}},pn!=null&&pn.is_wrong?"\u53D6\u6D88\u6807\u8BB0\u9519\u9898":"\u6807\u8BB0\u9519\u9898")),t.a.createElement($.a,null),!ye&&t.a.createElement("div",{className:Ue.a.pos},t.a.createElement("div",{className:Ue.a.tips},"\u62D6\u52A8\u53EF\u4EE5\u6539\u53D8\u8BD5\u9898\u663E\u793A\u987A\u5E8F"))))})}))}))},Mt=function(Wt){var rn=["\u96F6","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D","\u4E03","\u516B","\u4E5D"],qt=["","\u5341","\u767E","\u5343","\u4E07"];Wt=parseInt(Wt);var Ft=function(Jn){for(var pn=Jn.toString().split("").reverse(),Sn="",un=0;un<pn.length;un++)Sn=(un==0&&pn[un]==0||un>0&&pn[un]==0&&pn[un-1]==0?"":rn[pn[un]]+(pn[un]==0?qt[0]:qt[un]))+Sn;return Sn},Qn=Math.floor(Wt/1e4),Bn=Wt%1e4;return Bn.toString().length<4&&(Bn="0"+Bn),Qn?Ft(Qn)+"\u4E07"+Ft(Bn):Ft(Wt)},Cn=function(Wt){var rn={\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 rn[Wt]||0},Yn=function(Wt,rn){se.current=Cn(rn),K.a.confirm({centered:!0,title:"\u6279\u91CF\u8BBE\u7F6E\u5206\u6570",content:t.a.createElement("div",{className:""},t.a.createElement("span",null,rn==="\u7EC4\u5408\u9898"?"\u7EC4\u5408\u9898\u4E2D\u7684\u6BCF\u5C0F\u9898":rn,"\uFF1A"),t.a.createElement(B.a,{min:1,defaultValue:se.current,onChange:function(Ft){se.current=Ft}}),t.a.createElement("span",{className:"ml5"},"\u5206/\u9898"),t.a.createElement("br",null),rn==="\u586B\u7A7A\u9898"&&t.a.createElement("div",{style:{color:"rgb(255, 0, 0)"}},"\u6BCF\u7A7A\u5206\u503C\u6309\u6BCF\u9898\u5206\u503C\u53D6\u5E73\u5747\u5206\u8BA1\u7B97")),okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",onOk:function(){var qt=Object(te.a)(s.a.mark(function Qn(){var Bn,xn;return s.a.wrap(function(pn){for(;;)switch(pn.prev=pn.next){case 0:if(!X){pn.next=6;break}return pn.next=3,Object(Ee.t)(Z.id,{question_type:Wt,score:se.current});case 3:return Bn=pn.sent,Bn.status===0&&O(),pn.abrupt("return");case 6:return pn.next=8,Object(ge.a)("/api/exercises/".concat(Z.categoryId,"/batch_set_score.json"),{method:"post",body:{question_type:Wt,score:se.current}});case 8:xn=pn.sent,xn.status!==-1&&O();case 10:case"end":return pn.stop()}},Qn)}));function Ft(){return qt.apply(this,arguments)}return Ft}()})},Hn=function(){var Wt,rn=Pe();Ot==null||((Wt=Ot.exercise_questions)===null||Wt===void 0)||Wt.forEach(function(Ft,Qn){if(Ft.question_type===0){var Bn,xn;(Bn=rn[Ft.question_type])===null||Bn===void 0||((xn=Bn.items)===null||xn===void 0)||xn.push(Ft)}if(Ft.question_type===1){var Jn,pn;(Jn=rn[Ft.question_type])===null||Jn===void 0||((pn=Jn.items)===null||pn===void 0)||pn.push(Ft)}if(Ft.question_type===2){var Sn,un;(Sn=rn[Ft.question_type])===null||Sn===void 0||((un=Sn.items)===null||un===void 0)||un.push(Ft)}if(Ft.question_type===3){var Un,Xn;(Un=rn[Ft.question_type])===null||Un===void 0||((Xn=Un.items)===null||Xn===void 0)||Xn.push(Ft)}if(Ft.question_type===4){var nr,Ln;(nr=rn[Ft.question_type])===null||nr===void 0||((Ln=nr.items)===null||Ln===void 0)||Ln.push(Ft)}if(Ft.question_type===5){var Kn,nn;(Kn=rn[Ft.question_type])===null||Kn===void 0||((nn=Kn.items)===null||nn===void 0)||nn.push(Ft)}if(Ft.question_type===6){var _n,In;(_n=rn[Ft.question_type])===null||_n===void 0||((In=_n.items)===null||In===void 0)||In.push(Ft)}if(Ft.question_type===7){var wn,Zn;(wn=rn[Ft.question_type])===null||wn===void 0||((Zn=wn.items)===null||Zn===void 0)||Zn.push(Ft)}});var qt=Ot==null?void 0:Ot.map(function(Ft,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"},Mt(Qn+1),"\u3001",Ft.name),t.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5171",Ft.count,"\u9898",(Ft==null?void 0:Ft.question_type)===7?"\uFF0C\u5305\u542B".concat(Ft.sub_count,"\u5C0F\u9898"):"","\uFF1B\u5171",Ft.score,"\u5206\uFF09"),(mr==null?void 0:mr.includes(Ft==null?void 0:Ft.name))&&t.a.createElement(m.a,{onClick:function(){return Yn(Ft==null?void 0:Ft.question_type,Ft==null?void 0:Ft.name)},style:{float:"right"},type:"primary",ghost:!0},"\u6279\u91CF\u8BBE\u7F6E\u5F97\u5206")),bt(Ft.items,Ft==null?void 0:Ft.question_type,Ft==null?void 0:Ft.name))});return qt};return t.a.createElement("div",null," ",Hn()," ")},yr=Oe.a=Object(F.a)()(Pr)},LdHM:function(It,Oe,U){"use strict";U.d(Oe,"b",function(){return o}),U.d(Oe,"a",function(){return T});var te=U("1OyB"),Q=U("vuIU"),B=U("Ji7U"),J=U("LK+K"),K=U("q1tI"),N=U("rePB"),$=U("Ff2n"),z=U("ODXe"),r=U("4IlW"),D=U("bX4T"),m=U("YrtM"),g=U("TSYQ"),p=U.n(g),a=U("+nKL"),c=U("8OUc"),s=function(H,Y){var ie=H.prefixCls,le=H.id,he=H.flattenOptions,xe=H.childrenAsData,Le=H.values,we=H.searchValue,Ae=H.multiple,pe=H.defaultActiveFirstOption,be=H.height,ne=H.itemHeight,fe=H.notFoundContent,_e=H.open,ke=H.menuItemSelectedIcon,et=H.virtual,je=H.onSelect,ot=H.onToggleOpen,_t=H.onActiveValue,Re=H.onScroll,Be=H.onMouseEnter,Qe="".concat(ie,"-item"),Ve=Object(m.a)(function(){return he},[_e,he],function(ft,He){return He[0]&&ft[1]!==He[1]}),Et=K.useRef(null),kt=function(He){He.preventDefault()},Vt=function(He){Et.current&&Et.current.scrollTo({index:He})},Qt=function(He){for(var Ne=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,Ue=Ve.length,ge=0;ge<Ue;ge+=1){var Ee=(He+ge*Ne+Ue)%Ue,De=Ve[Ee],ue=De.group,Fe=De.data;if(!ue&&!Fe.disabled)return Ee}return-1},an=K.useState(function(){return Qt(0)}),sn=Object(z.a)(an,2),qe=sn[0],Ze=sn[1],Ct=function(He){Ze(He);var Ne=Ve[He];if(!Ne){_t(null,-1);return}_t(Ne.data.value,He)};K.useEffect(function(){Ct(pe!==!1?Qt(0):-1)},[Ve.length,we]),K.useEffect(function(){var ft=setTimeout(function(){if(!Ae&&_e&&Le.size===1){var He=Array.from(Le)[0],Ne=Ve.findIndex(function(Ue){var ge=Ue.data;return ge.value===He});Ct(Ne),Vt(Ne)}});return function(){return clearTimeout(ft)}},[_e]);var At=function(He){He!==void 0&&je(He,{selected:!Le.has(He)}),Ae||ot(!1)};if(K.useImperativeHandle(Y,function(){return{onKeyDown:function(He){var Ne=He.which;switch(Ne){case r.a.UP:case r.a.DOWN:{var Ue=0;if(Ne===r.a.UP?Ue=-1:Ne===r.a.DOWN&&(Ue=1),Ue!==0){var ge=Qt(qe+Ue,Ue);Vt(ge),Ct(ge)}break}case r.a.ENTER:{var Ee=Ve[qe];Ee&&!Ee.data.disabled?At(Ee.data.value):At(void 0),_e&&He.preventDefault();break}case r.a.ESC:ot(!1)}},onKeyUp:function(){},scrollTo:function(He){Vt(He)}}}),Ve.length===0)return K.createElement("div",{role:"listbox",id:"".concat(le,"_list"),className:"".concat(Qe,"-empty"),onMouseDown:kt},fe);function ct(ft){var He=Ve[ft];if(!He)return null;var Ne=He.data||{},Ue=Ne.value,ge=Ne.label,Ee=Ne.children,De=Object(D.a)(Ne,!0),ue=xe?Ee:ge;return He?K.createElement("div",Object.assign({"aria-label":typeof ue=="string"?ue:null},De,{key:ft,role:"option",id:"".concat(le,"_list_").concat(ft),"aria-selected":Le.has(Ue)}),Ue):null}return K.createElement(K.Fragment,null,K.createElement("div",{role:"listbox",id:"".concat(le,"_list"),style:{height:0,width:0,overflow:"hidden"}},ct(qe-1),ct(qe),ct(qe+1)),K.createElement(a.a,{itemKey:"key",ref:Et,data:Ve,height:be,itemHeight:ne,fullHeight:!1,onMouseDown:kt,onScroll:Re,virtual:et,onMouseEnter:Be},function(ft,He){var Ne,Ue=ft.group,ge=ft.groupOption,Ee=ft.data,De=Ee.label,ue=Ee.key;if(Ue)return K.createElement("div",{className:p()(Qe,"".concat(Qe,"-group"))},De!==void 0?De:ue);var Fe=Ee.disabled,at=Ee.value,xt=Ee.title,Kt=Ee.children,Xt=Ee.style,$t=Ee.className,$n=Object($.a)(Ee,["disabled","value","title","children","style","className"]),vn=Le.has(at),ln="".concat(Qe,"-option"),hn=p()(Qe,ln,$t,(Ne={},Object(N.a)(Ne,"".concat(ln,"-grouped"),ge),Object(N.a)(Ne,"".concat(ln,"-active"),qe===He&&!Fe),Object(N.a)(Ne,"".concat(ln,"-disabled"),Fe),Object(N.a)(Ne,"".concat(ln,"-selected"),vn),Ne)),Gn=xe?Kt:De,fr=!ke||typeof ke=="function"||vn;return K.createElement("div",Object.assign({},$n,{"aria-selected":vn,className:hn,title:xt,onMouseMove:function(){if(qe===He||Fe)return;Ct(He)},onClick:function(){Fe||At(at)},style:Xt}),K.createElement("div",{className:"".concat(ln,"-content")},Gn||at),K.isValidElement(ke)||vn,fr&&K.createElement(c.a,{className:"".concat(Qe,"-option-state"),customizeIcon:ke,customizeIconProps:{isSelected:vn}},vn?"\u2713":null))}))},i=K.forwardRef(s);i.displayName="OptionList";var t=i,u=function(){return null};u.isSelectOption=!0;var o=u,R=function(){return null};R.isSelectOptGroup=!0;var T=R,S=U("VTBJ"),A=U("Zm9Q");function I(v){var H=v.key,Y=v.props,ie=Y.children,le=Y.value,he=Object($.a)(Y,["children","value"]);return Object(S.a)({key:H,value:le!==void 0?le:H,children:ie},he)}function x(v){var H=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Object(A.a)(v).map(function(Y,ie){if(!K.isValidElement(Y)||!Y.type)return null;var le=Y.type.isSelectOptGroup,he=Y.key,xe=Y.props,Le=xe.children,we=Object($.a)(xe,["children"]);return H||!le?I(Y):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(he===null?ie:he,"__"),label:he},we),{},{options:x(Le)})}).filter(function(Y){return Y})}var b=U("2Qr1"),h=U("qNPg"),f=U("U8pU"),C=U("Kwbf"),E=U("WKfj");function _(v){var H=v.mode,Y=v.options,ie=v.children,le=v.backfill,he=v.allowClear,xe=v.placeholder,Le=v.getInputElement,we=v.showSearch,Ae=v.onSearch,pe=v.defaultOpen,be=v.autoFocus,ne=v.labelInValue,fe=v.value,_e=v.inputValue,ke=v.optionLabelProp,et=H==="multiple"||H==="tags",je=we!==void 0?we:et||H==="combobox",ot=Y||x(ie);if(Object(C.a)(H!=="tags"||ot.every(function(Qe){return!Qe.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),H==="tags"||H==="combobox"){var _t=ot.some(function(Qe){return Qe.options?Qe.options.some(function(Ve){return typeof("value"in Ve?Ve.value:Ve.key)=="number"}):typeof("value"in Qe?Qe.value:Qe.key)=="number"});Object(C.a)(!_t,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(C.a)(H!=="combobox"||!ke,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(C.a)(H==="combobox"||!le,"`backfill` only works with `combobox` mode."),Object(C.a)(H==="combobox"||!Le,"`getInputElement` only work with `combobox` mode."),Object(C.b)(H!=="combobox"||!Le||!he||!xe,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Ae&&!je&&H!=="combobox"&&H!=="tags"&&Object(C.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(C.b)(!pe||be,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),fe!=null){var Re=Object(E.d)(fe);Object(C.a)(!ne||Re.every(function(Qe){return Object(f.a)(Qe)==="object"&&("key"in Qe||"value"in Qe)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(C.a)(!et||Array.isArray(fe),"`value` should be array when `mode` is `multiple` or `tags`")}if(ie){var Be=null;Object(A.a)(ie).some(function(Qe){if(!K.isValidElement(Qe)||!Qe.type)return!1;var Ve=Qe.type;if(Ve.isSelectOption)return!1;if(Ve.isSelectOptGroup){var Et=Object(A.a)(Qe.props.children).every(function(kt){return!K.isValidElement(kt)||!Qe.type||kt.type.isSelectOption?!0:(Be=kt.type,!1)});return!Et}return Be=Ve,!0}),Be&&Object(C.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(Be.displayName||Be.name||Be,"`.")),Object(C.a)(_e===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var W=_,j=Object(h.a)({prefixCls:"rc-select",components:{optionList:t},convertChildrenToData:x,flattenOptions:b.d,getLabeledValue:b.e,filterOptions:b.b,isValueDisabled:b.g,findValueOption:b.c,warningProps:W,fillOptionsWithMissingValue:b.a}),w=function(v){Object(B.a)(Y,v);var H=Object(J.a)(Y);function Y(){var ie;return Object(te.a)(this,Y),ie=H.apply(this,arguments),ie.selectRef=K.createRef(),ie.focus=function(){ie.selectRef.current.focus()},ie.blur=function(){ie.selectRef.current.blur()},ie}return Object(Q.a)(Y,[{key:"render",value:function(){return K.createElement(j,Object.assign({ref:this.selectRef},this.props))}}]),Y}(K.Component);w.Option=o,w.OptGroup=T;var F=w,P=Oe.c=F},M8RZ:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return r});var te=U("fWQN"),Q=U("mtLc"),B=U("yKVA"),J=U("879j"),K=U("q1tI"),N=U.n(K),$=U("i8i4"),z=U.n($),r=function(D){Object(B.a)(g,D);var m=Object(J.a)(g);function g(p){var a;Object(te.a)(this,g),a=m.call(this,p);var c=window.document;return a.node=c.createElement("div"),c.body.appendChild(a.node),a}return Object(Q.a)(g,[{key:"render",value:function(){var a=this.props.children;return Object($.createPortal)(a,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),g}(N.a.Component)},MI8n:function(It,Oe,U){"use strict";U.d(Oe,"c",function(){return K}),U.d(Oe,"b",function(){return r}),U.d(Oe,"e",function(){return D}),U.d(Oe,"a",function(){return m}),U.d(Oe,"d",function(){return g}),U.d(Oe,"f",function(){return p});var te=U("/cxE"),Q=U("pmY6"),B=U("24hK"),J=U("5Y4S"),K;(function(a){a.None=()=>Q.a.None;function c(_){return(W,j=null,w)=>{let F=!1,P;return P=_(v=>F?void 0:(P?P.dispose():F=!0,W.call(j,v)),null,w),F&&P.dispose(),P}}a.once=c;function s(_,W){return T((j,w=null,F)=>_(P=>j.call(w,W(P)),null,F))}a.map=s;function i(_,W){return T((j,w=null,F)=>_(P=>{W(P),j.call(w,P)},null,F))}a.forEach=i;function t(_,W){return T((j,w=null,F)=>_(P=>W(P)&&j.call(w,P),null,F))}a.filter=t;function u(_){return _}a.signal=u;function o(..._){return(W,j=null,w)=>Object(Q.e)(..._.map(F=>F(P=>W.call(j,P),null,w)))}a.any=o;function R(_,W,j){let w=j;return s(_,F=>(w=W(w,F),w))}a.reduce=R;function T(_){let W;const j=new r({onFirstListenerAdd(){W=_(j.fire,j)},onLastListenerRemove(){W.dispose()}});return j.event}function S(_,W,j=100,w=!1,F){let P,v,H,Y=0;const ie=new r({leakWarningThreshold:F,onFirstListenerAdd(){P=_(le=>{Y++,v=W(v,le),w&&!H&&(ie.fire(v),v=void 0),clearTimeout(H),H=setTimeout(()=>{const he=v;v=void 0,H=void 0,(!w||Y>1)&&ie.fire(he),Y=0},j)})},onLastListenerRemove(){P.dispose()}});return ie.event}a.debounce=S;function A(_,W=(j,w)=>j===w){let j=!0,w;return t(_,F=>{const P=j||!W(F,w);return j=!1,w=F,P})}a.latch=A;function I(_,W){return[a.filter(_,W),a.filter(_,j=>!W(j))]}a.split=I;function x(_,W=!1,j=[]){let w=j.slice(),F=_(H=>{w?w.push(H):v.fire(H)});const P=()=>{w&&w.forEach(H=>v.fire(H)),w=null},v=new r({onFirstListenerAdd(){F||(F=_(H=>v.fire(H)))},onFirstListenerDidAdd(){w&&(W?setTimeout(P):P())},onLastListenerRemove(){F&&F.dispose(),F=null}});return v.event}a.buffer=x;class b{constructor(_){this.event=_}map(_){return new b(s(this.event,_))}forEach(_){return new b(i(this.event,_))}filter(_){return new b(t(this.event,_))}reduce(_,W){return new b(R(this.event,_,W))}latch(){return new b(A(this.event))}debounce(_,W=100,j=!1,w){return new b(S(this.event,_,W,j,w))}on(_,W,j){return this.event(_,W,j)}once(_,W,j){return c(this.event)(_,W,j)}}function h(_){return new b(_)}a.chain=h;function f(_,W,j=w=>w){const w=(...H)=>v.fire(j(...H)),F=()=>_.on(W,w),P=()=>_.removeListener(W,w),v=new r({onFirstListenerAdd:F,onLastListenerRemove:P});return v.event}a.fromNodeEventEmitter=f;function C(_,W,j=w=>w){const w=(...H)=>v.fire(j(...H)),F=()=>_.addEventListener(W,w),P=()=>_.removeEventListener(W,w),v=new r({onFirstListenerAdd:F,onLastListenerRemove:P});return v.event}a.fromDOMEventEmitter=C;function E(_){return new Promise(W=>c(_)(W))}a.toPromise=E})(K||(K={}));class N{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${N._idPool++}`}start(a){this._stopWatch=new J.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}N._idPool=0;let $=-1;class z{constructor(a,c=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=c,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let c=$;if(typeof this.customThreshold=="number"&&(c=this.customThreshold),c<=0||a<c)return;this._stacks||(this._stacks=new Map);const s=new Error().stack.split(`
`).slice(3).join(`
`),i=this._stacks.get(s)||0;if(this._stacks.set(s,i+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=c*.5;let t,u=0;for(const[o,R]of this._stacks)(!t||u<R)&&(t=o,u=R);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${u}):`),console.warn(t)}return()=>{const t=this._stacks.get(s)||0;this._stacks.set(s,t-1)}}}class r{constructor(a){var c;this._disposed=!1,this._options=a,this._leakageMon=$>0?new z(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((c=this._options)===null||c===void 0?void 0:c._profName)?new N(this._options._profName):void 0}get event(){return this._event||(this._event=(a,c,s)=>{var i;this._listeners||(this._listeners=new B.a);const t=this._listeners.isEmpty();t&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const u=this._listeners.push(c?[a,c]:a);t&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,c);const o=(i=this._leakageMon)===null||i===void 0?void 0:i.check(this._listeners.size),R=Object(Q.i)(()=>{if(o&&o(),!this._disposed&&(u(),this._options&&this._options.onLastListenerRemove)){const T=this._listeners&&!this._listeners.isEmpty();T||this._options.onLastListenerRemove(this)}});return s instanceof Q.b?s.add(R):Array.isArray(s)&&s.push(R),R}),this._event}fire(a){var c,s;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new B.a);for(let i of this._listeners)this._deliveryQueue.push([i,a]);for((c=this._perfMon)===null||c===void 0||c.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[i,t]=this._deliveryQueue.shift();try{typeof i=="function"?i.call(void 0,t):i[0].call(i[1],t)}catch(u){Object(te.f)(u)}}(s=this._perfMon)===null||s===void 0||s.stop()}}dispose(){var a,c,s,i,t;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(c=this._deliveryQueue)===null||c===void 0||c.clear(),(i=(s=this._options)===null||s===void 0?void 0:s.onLastListenerRemove)===null||i===void 0||i.call(s),(t=this._leakageMon)===null||t===void 0||t.dispose())}}class D extends r{constructor(a){super(a);this._isPaused=0,this._eventQueue=new B.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class m extends D{constructor(a){var c;super(a);this._delay=(c=a.delay)!==null&&c!==void 0?c:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class g{constructor(){this.buffers=[]}wrapEvent(a){return(c,s,i)=>a(t=>{const u=this.buffers[this.buffers.length-1];u?u.push(()=>c.call(s,t)):c.call(s,t)},void 0,i)}bufferEvents(a){const c=[];this.buffers.push(c);const s=a();return this.buffers.pop(),c.forEach(i=>i()),s}}class p{constructor(){this.listening=!1,this.inputEvent=K.None,this.inputEventListener=Q.a.None,this.emitter=new r({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(It,Oe,U){"use strict";(function(te,Q){U.d(Oe,"b",function(){return s}),U.d(Oe,"i",function(){return o}),U.d(Oe,"f",function(){return R}),U.d(Oe,"d",function(){return T}),U.d(Oe,"g",function(){return S}),U.d(Oe,"h",function(){return A}),U.d(Oe,"c",function(){return I}),U.d(Oe,"k",function(){return x}),U.d(Oe,"j",function(){return b}),U.d(Oe,"a",function(){return h}),U.d(Oe,"e",function(){return E});var B;const J="en";let K=!1,N=!1,$=!1,z=!1,r=!1,D=!1,m=!1,g,p=J,a,c;const s=typeof self=="object"?self:typeof te=="object"?te:{};let i;typeof s.vscode!="undefined"&&typeof s.vscode.process!="undefined"?i=s.vscode.process:typeof Q!="undefined"&&(i=Q);const t=typeof((B=i==null?void 0:i.versions)===null||B===void 0?void 0:B.electron)=="string"&&i.type==="renderer";if(typeof navigator=="object"&&!t)c=navigator.userAgent,K=c.indexOf("Windows")>=0,N=c.indexOf("Macintosh")>=0,m=(c.indexOf("Macintosh")>=0||c.indexOf("iPad")>=0||c.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,$=c.indexOf("Linux")>=0,D=!0,g=navigator.language,p=g;else if(typeof i=="object"){K=i.platform==="win32",N=i.platform==="darwin",$=i.platform==="linux",z=$&&!!i.env.SNAP&&!!i.env.SNAP_REVISION,g=J,p=J;const _=i.env.VSCODE_NLS_CONFIG;if(_)try{const W=JSON.parse(_),j=W.availableLanguages["*"];g=W.locale,p=j||J,a=W._translationsConfigFile}catch(W){}r=!0}else console.error("Unable to resolve platform.");let u=0;N?u=1:K?u=3:$&&(u=2);const o=K,R=N,T=$,S=r,A=D,I=m,x=c,b=function(){if(s.setImmediate)return s.setImmediate.bind(s);if(typeof s.postMessage=="function"&&!s.importScripts){let j=[];s.addEventListener("message",F=>{if(F.data&&F.data.vscodeSetImmediateId)for(let P=0,v=j.length;P<v;P++){const H=j[P];if(H.id===F.data.vscodeSetImmediateId){j.splice(P,1),H.callback();return}}});let w=0;return F=>{const P=++w;j.push({id:P,callback:F}),s.postMessage({vscodeSetImmediateId:P},"*")}}if(typeof(i==null?void 0:i.nextTick)=="function")return i.nextTick.bind(i);const W=Promise.resolve();return j=>W.then(j)}(),h=N||m?2:K?1:3;let f=!0,C=!1;function E(){if(!C){C=!0;const _=new Uint8Array(2);_[0]=1,_[1]=2;const W=new Uint16Array(_.buffer);f=W[0]===(2<<8)+1}return f}}).call(this,U("IyRk"),U("Q2Ig"))},N0LK:function(It,Oe,U){"use strict";U.d(Oe,"C",function(){return te}),U.d(Oe,"v",function(){return B}),U.d(Oe,"s",function(){return J}),U.d(Oe,"t",function(){return K}),U.d(Oe,"U",function(){return N}),U.d(Oe,"J",function(){return $}),U.d(Oe,"O",function(){return z}),U.d(Oe,"p",function(){return r}),U.d(Oe,"T",function(){return D}),U.d(Oe,"q",function(){return m}),U.d(Oe,"N",function(){return g}),U.d(Oe,"M",function(){return p}),U.d(Oe,"Q",function(){return a}),U.d(Oe,"u",function(){return c}),U.d(Oe,"x",function(){return s}),U.d(Oe,"I",function(){return i}),U.d(Oe,"f",function(){return t}),U.d(Oe,"h",function(){return u}),U.d(Oe,"g",function(){return o}),U.d(Oe,"i",function(){return R}),U.d(Oe,"G",function(){return T}),U.d(Oe,"H",function(){return S}),U.d(Oe,"r",function(){return A}),U.d(Oe,"R",function(){return I}),U.d(Oe,"d",function(){return x}),U.d(Oe,"e",function(){return b}),U.d(Oe,"E",function(){return h}),U.d(Oe,"F",function(){return f}),U.d(Oe,"j",function(){return C}),U.d(Oe,"z",function(){return E}),U.d(Oe,"K",function(){return W}),U.d(Oe,"L",function(){return j}),U.d(Oe,"m",function(){return F}),U.d(Oe,"k",function(){return v}),U.d(Oe,"A",function(){return Y}),U.d(Oe,"a",function(){return ie}),U.d(Oe,"n",function(){return le}),U.d(Oe,"l",function(){return he}),U.d(Oe,"D",function(){return xe}),U.d(Oe,"B",function(){return Le}),U.d(Oe,"b",function(){return we}),U.d(Oe,"S",function(){return Ae}),U.d(Oe,"o",function(){return pe}),U.d(Oe,"P",function(){return be}),U.d(Oe,"w",function(){return ne}),U.d(Oe,"c",function(){return fe}),U.d(Oe,"y",function(){return et});function te(Re){return!Re||typeof Re!="string"?!0:Re.trim().length===0}const Q=/{(\d+)}/g;function B(Re,...Be){return Be.length===0?Re:Re.replace(Q,function(Qe,Ve){const Et=parseInt(Ve,10);return isNaN(Et)||Et<0||Et>=Be.length?Qe:Be[Et]})}function J(Re){return Re.replace(/[<>&]/g,function(Be){switch(Be){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return Be}})}function K(Re){return Re.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function N(Re,Be=" "){const Qe=$(Re,Be);return z(Qe,Be)}function $(Re,Be){if(!Re||!Be)return Re;const Qe=Be.length;if(Qe===0||Re.length===0)return Re;let Ve=0;for(;Re.indexOf(Be,Ve)===Ve;)Ve=Ve+Qe;return Re.substring(Ve)}function z(Re,Be){if(!Re||!Be)return Re;const Qe=Be.length,Ve=Re.length;if(Qe===0||Ve===0)return Re;let Et=Ve,kt=-1;for(;!(kt=Re.lastIndexOf(Be,Et-1),kt===-1||kt+Qe!==Et);){if(kt===0)return"";Et=kt}return Re.substring(0,Et)}function r(Re){return Re.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(Re){return Re.replace(/\*/g,"")}function m(Re,Be,Qe={}){if(!Re)throw new Error("Cannot create regex from empty string");Be||(Re=K(Re)),Qe.wholeWord&&(/\B/.test(Re.charAt(0))||(Re="\\b"+Re),/\B/.test(Re.charAt(Re.length-1))||(Re=Re+"\\b"));let Ve="";return Qe.global&&(Ve+="g"),Qe.matchCase||(Ve+="i"),Qe.multiline&&(Ve+="m"),Qe.unicode&&(Ve+="u"),new RegExp(Re,Ve)}function g(Re){if(Re.source==="^"||Re.source==="^$"||Re.source==="$"||Re.source==="^\\s*$")return!1;const Be=Re.exec("");return!!(Be&&Re.lastIndex===0)}function p(Re){return(Re.global?"g":"")+(Re.ignoreCase?"i":"")+(Re.multiline?"m":"")+(Re.unicode?"u":"")}function a(Re){return Re.split(/\r\n|\r|\n/)}function c(Re){for(let Be=0,Qe=Re.length;Be<Qe;Be++){const Ve=Re.charCodeAt(Be);if(Ve!==32&&Ve!==9)return Be}return-1}function s(Re,Be=0,Qe=Re.length){for(let Ve=Be;Ve<Qe;Ve++){const Et=Re.charCodeAt(Ve);if(Et!==32&&Et!==9)return Re.substring(Be,Ve)}return Re.substring(Be,Qe)}function i(Re,Be=Re.length-1){for(let Qe=Be;Qe>=0;Qe--){const Ve=Re.charCodeAt(Qe);if(Ve!==32&&Ve!==9)return Qe}return-1}function t(Re,Be){return Re<Be?-1:Re>Be?1:0}function u(Re,Be,Qe=0,Ve=Re.length,Et=0,kt=Be.length){for(;Qe<Ve&&Et<kt;Qe++,Et++){let an=Re.charCodeAt(Qe),sn=Be.charCodeAt(Et);if(an<sn)return-1;if(an>sn)return 1}const Vt=Ve-Qe,Qt=kt-Et;return Vt<Qt?-1:Vt>Qt?1:0}function o(Re,Be){return R(Re,Be,0,Re.length,0,Be.length)}function R(Re,Be,Qe=0,Ve=Re.length,Et=0,kt=Be.length){for(;Qe<Ve&&Et<kt;Qe++,Et++){let an=Re.charCodeAt(Qe),sn=Be.charCodeAt(Et);if(an===sn)continue;if(an>=128||sn>=128)return u(Re.toLowerCase(),Be.toLowerCase(),Qe,Ve,Et,kt);T(an)&&(an-=32),T(sn)&&(sn-=32);const qe=an-sn;if(qe===0)continue;return qe}const Vt=Ve-Qe,Qt=kt-Et;return Vt<Qt?-1:Vt>Qt?1:0}function T(Re){return Re>=97&&Re<=122}function S(Re){return Re>=65&&Re<=90}function A(Re,Be){return Re.length===Be.length&&R(Re,Be)===0}function I(Re,Be){const Qe=Be.length;return Be.length>Re.length?!1:R(Re,Be,0,Qe)===0}function x(Re,Be){let Qe,Ve=Math.min(Re.length,Be.length);for(Qe=0;Qe<Ve;Qe++)if(Re.charCodeAt(Qe)!==Be.charCodeAt(Qe))return Qe;return Ve}function b(Re,Be){let Qe,Ve=Math.min(Re.length,Be.length);const Et=Re.length-1,kt=Be.length-1;for(Qe=0;Qe<Ve;Qe++)if(Re.charCodeAt(Et-Qe)!==Be.charCodeAt(kt-Qe))return Qe;return Ve}function h(Re){return 55296<=Re&&Re<=56319}function f(Re){return 56320<=Re&&Re<=57343}function C(Re,Be){return(Re-55296<<10)+(Be-56320)+65536}function E(Re,Be,Qe){const Ve=Re.charCodeAt(Qe);if(h(Ve)&&Qe+1<Be){const Et=Re.charCodeAt(Qe+1);if(f(Et))return C(Ve,Et)}return Ve}function _(Re,Be){const Qe=Re.charCodeAt(Be-1);if(f(Qe)&&Be>1){const Ve=Re.charCodeAt(Be-2);if(h(Ve))return C(Ve,Qe)}return Qe}function W(Re,Be){const Qe=_e.getInstance(),Ve=Be,Et=Re.length,kt=E(Re,Et,Be);Be+=kt>=65536?2:1;let Vt=Qe.getGraphemeBreakType(kt);for(;Be<Et;){const Qt=E(Re,Et,Be),an=Qe.getGraphemeBreakType(Qt);if(fe(Vt,an))break;Be+=Qt>=65536?2:1,Vt=an}return Be-Ve}function j(Re,Be){const Qe=_e.getInstance(),Ve=Be,Et=_(Re,Be);Be-=Et>=65536?2:1;let kt=Qe.getGraphemeBreakType(Et);for(;Be>0;){const Vt=_(Re,Be),Qt=Qe.getGraphemeBreakType(Vt);if(fe(Qt,kt))break;Be-=Vt>=65536?2:1,kt=Qt}return Ve-Be}const w=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function F(Re){return w.test(Re)}const P=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function v(Re){return P.test(Re)}const H=/^[\t\n\r\x20-\x7E]*$/;function Y(Re){return H.test(Re)}const ie=/[\u2028\u2029]/;function le(Re){return ie.test(Re)}function he(Re){for(let Be=0,Qe=Re.length;Be<Qe;Be++)if(xe(Re.charCodeAt(Be)))return!0;return!1}function xe(Re){return Re=+Re,Re>=11904&&Re<=55215||Re>=63744&&Re<=64255||Re>=65281&&Re<=65374}function Le(Re){return Re>=127462&&Re<=127487||Re===8986||Re===8987||Re===9200||Re===9203||Re>=9728&&Re<=10175||Re===11088||Re===11093||Re>=127744&&Re<=128591||Re>=128640&&Re<=128764||Re>=128992&&Re<=129003||Re>=129280&&Re<=129535||Re>=129648&&Re<=129750}const we=String.fromCharCode(65279);function Ae(Re){return!!(Re&&Re.length>0&&Re.charCodeAt(0)===65279)}function pe(Re,Be=!1){return Re?(Be&&(Re=Re.replace(/\\./g,"")),Re.toLowerCase()!==Re):!1}function be(Re){const Be=90-65+1;return Re=Re%(2*Be),Re<Be?String.fromCharCode(97+Re):String.fromCharCode(65+Re-Be)}function ne(Re){const Be=_e.getInstance();return Be.getGraphemeBreakType(Re)}function fe(Re,Be){return Re===0?Be!==5&&Be!==7:Re===2&&Be===3?!1:Re===4||Re===2||Re===3||(Be===4||Be===2||Be===3)?!0:Re===8&&(Be===8||Be===9||Be===11||Be===12)||((Re===11||Re===9)&&(Be===9||Be===10)||((Re===12||Re===10)&&Be===10||(Be===5||Be===13||(Be===7||(Re===1||Re===13&&Be===14)))))?!1:!(Re===6&&Be===6)}class _e{constructor(){this._data=ke()}static getInstance(){return _e._INSTANCE||(_e._INSTANCE=new _e),_e._INSTANCE}getGraphemeBreakType(Re){if(Re<32)return Re===10?3:Re===13?2:4;if(Re<127)return 0;const Be=this._data,Qe=Be.length/3;let Ve=1;for(;Ve<=Qe;)if(Re<Be[3*Ve])Ve=2*Ve;else if(Re>Be[3*Ve+1])Ve=2*Ve+1;else return Be[3*Ve+2];return 0}}_e._INSTANCE=null;function ke(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function et(Re,Be){if(Re===0)return 0;const Qe=je(Re,Be);if(Qe!==void 0)return Qe;const Ve=_(Be,Re);return Re-=ot(Ve),Re}function je(Re,Be){let Qe=_(Be,Re);for(Re-=ot(Qe);_t(Qe)||Qe===65039||Qe===8419;){if(Re===0)return;Qe=_(Be,Re),Re-=ot(Qe)}if(!Le(Qe))return;if(Re>=0){const Ve=_(Be,Re);Ve===8205&&(Re-=ot(Ve))}return Re}function ot(Re){return Re>=65536?2:1}function _t(Re){return 127995<=Re&&Re<=127999}},NLgs:function(It,Oe,U){"use strict";U.d(Oe,"e",function(){return o}),U.d(Oe,"f",function(){return R}),U.d(Oe,"d",function(){return S}),U.d(Oe,"c",function(){return A}),U.d(Oe,"a",function(){return I}),U.d(Oe,"b",function(){return x});var te=U("miYZ"),Q=U("tsqr"),B=U("9og8"),J=U("2qtc"),K=U("kLXV"),N=U("WmNS"),$=U.n(N),z=U("q1tI"),r=U.n(z),D=U("9kvl"),m=U("xKgJ"),g=U("1vsH"),p=U("RCxd"),a=U("yTi+"),c=U.n(a),s=U("1ZF9"),i=U.n(s),t=U("NoGO"),u=U.n(t),o=function(h){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!!(R(h)&&T(f))},R=function(h){return Object(m.p)()?!0:(h({type:"user/showPopLogin",payload:{showPopLogin:!0,showClosable:!0}}),!1)},T=function(){var h,f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,C=Object(D.c)()._store.getState(),E=C.user;return(h=E.userInfo)!==null&&h!==void 0&&h.profile_completed?!0:(K.a.confirm({title:"\u63D0\u793A",width:530,centered:!0,content:f?"\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)},S=function(){var h,f=Object(D.c)()._store.getState(),C=f.user;return(h=C.userInfo)!==null&&h!==void 0&&h.professional_certification?!0:(K.a.confirm({title:"\u63D0\u793A",centered:!0,content:r.a.createElement("div",{className:"tc"},"\u60A8\u9700\u8981\u53BB\u5B8C\u6210\u60A8\u7684\u804C\u4E1A\u8BA4\u8BC1\uFF0C\u624D\u80FD\u4F7F\u7528\u6B64\u529F\u80FD"),okText:"\u7ACB\u5373\u5B8C\u5584",cancelText:"\u7A0D\u540E\u5B8C\u5584",onOk:function(){Object(g.S)("/account/certification")}}),!1)},A=function(){return Object(m.a)()?!0:(K.a.warning({centered:!0,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("p",null,"\u626B\u7801\u52A0\u5934\u6B4C\u52A9\u6559\uFF0C\u7533\u8BF7\u64CD\u4F5C\u6743\u9650"),r.a.createElement("img",{src:u.a,width:200})),okText:"\u6211\u77E5\u9053\u4E86",maskClosable:!0}),!1)},I=function(h,f){return h?!0:(K.a.confirm({centered:!0,zIndex:1e4,width:530,title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("p",null,f||"\u8BE5\u5B9E\u8DF5\u8D44\u6E90\u9700\u6388\u6743\u540E\u624D\u53EF\u4F7F\u7528\u3002 \u60A8\u53EF\u4EE5\u5728QQ\u670D\u52A1\u7FA4\u5411\u7BA1\u7406\u5458\u7533\u8BF7\uFF0C\u83B7\u5F97\u7EE7\u7EED\u64CD\u4F5C\u7684\u6743\u9650\u3002"),r.a.createElement("div",{style:{marginLeft:"110px"}},r.a.createElement("img",{src:i.a,width:200}),r.a.createElement("div",{style:{marginLeft:"35px"}},"\u7FA4\u53F7\uFF1A","714336072"))),okText:"\u7ACB\u5373\u8054\u7CFB",cancelText:"\u53D6\u6D88",onOk:function(){Object(g.S)("https://qm.qq.com/cgi-bin/qm/qr?k=tIyDPXUtE0yEk-MOJxhH55lTUJS-nYAM&jump_from=webapi")}}),!1)},x=function(h){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",C=Object(D.c)()._store.getState(),E=C.shixunsDetail.detail;return(E==null?void 0:E.public)===2||(E==null?void 0:E.public)===1||(E==null?void 0:E.shixun_status)===3?(K.a.info({centered:!0,icon:r.a.createElement(p.a,{style:{color:"#faad14"}}),width:460,title:"\u63D0\u793A",content:r.a.createElement("div",{className:"tc",style:{marginLeft:-38}},r.a.createElement("div",{style:{display:"flex",flexDirection:"column",alignItems:"flex-start",paddingLeft:38,margin:"12px 0"}},r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u7684\u72B6\u6001\u4E3A",(E==null?void 0:E.public)===2?"\u5DF2\u516C\u5F00":(E==null?void 0:E.public)===1?"\u5F85\u5BA1\u6838":"\u5DF2\u5173\u95ED","\uFF0C",f,"\u3002"),r.a.createElement("p",null,"\u5982\u6709\u9700\u8981\uFF0C\u8BF7\u8054\u7CFB\u5E73\u53F0\u7BA1\u7406\u5458\u8FDB\u884C\u6280\u672F\u652F\u6301\u3002")),r.a.createElement("img",{style:{border:"4px solid #0152d9",borderRadius:"4px"},src:c.a,alt:"\u4E8C\u7EF4\u7801",width:160})),okText:"\u6211\u77E5\u9053\u4E86"}),!0):(E==null?void 0:E.shixun_status)===2?(K.a.confirm({centered:!0,icon:r.a.createElement(p.a,null),title:"\u63D0\u793A",content:r.a.createElement("div",null,r.a.createElement("span",null,"\u8BE5\u5B9E\u8DF5\u9879\u76EE\u5DF2\u53D1\u5E03\uFF0C",f,"\u3002"),r.a.createElement("br",null),r.a.createElement("span",null,"\u5982\u6709\u9700\u8981\uFF0C\u60A8\u53EF\u4EE5\u64A4\u9500\u53D1\u5E03\u540E\uFF0C\u518D\u8FDB\u884C\u64CD\u4F5C\u3002")),okText:"\u64A4\u9500\u53D1\u5E03",cancelText:"\u53D6\u6D88",onOk:function(){K.a.confirm({width:440,centered:!0,icon:r.a.createElement(p.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 W=Object(B.a)($.a.mark(function w(){var F;return $.a.wrap(function(v){for(;;)switch(v.prev=v.next){case 0:return v.next=2,h({type:"shixunsDetail/cancelRelease",payload:{id:E==null?void 0:E.identifier}});case 2:F=v.sent,F.status!==401&&(Q.b.success("\u64A4\u9500\u53D1\u5E03\u6210\u529F\u3002\u5B9E\u8BAD\u56DE\u5230\u672A\u53D1\u5E03\u7684\u72B6\u6001\u3002"),h({type:"shixunsDetail/getShixunsDetail",payload:{id:E==null?void 0:E.identifier}}),h({type:"practiceSetting/getCommonData",payload:{id:E==null?void 0:E.identifier}}));case 4:case"end":return v.stop()}},w)}));function j(){return W.apply(this,arguments)}return j}()})}}),!0):!1}},NoGO:function(It,Oe,U){It.exports=U.p+"static/newqrcode.d852fdfc.png"},Nog9:function(It,Oe,U){It.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(It,Oe,U){"use strict";U.d(Oe,"a",function(){return N});var te=U("Kwbf");function Q($,z){var r=new Set;return $.forEach(function(D){z.has(D)||r.add(D)}),r}function B($){var z=$||{},r=z.disabled,D=z.disableCheckbox,m=z.checkable;return!!(r||D)||m===!1}function J($,z,r,D){for(var m=new Set($),g=new Set,p=0;p<=r;p+=1){var a=z.get(p)||new Set;a.forEach(function(t){var u=t.key,o=t.node,R=t.children,T=R===void 0?[]:R;m.has(u)&&!D(o)&&T.filter(function(S){return!D(S.node)}).forEach(function(S){m.add(S.key)})})}for(var c=new Set,s=r;s>=0;s-=1){var i=z.get(s)||new Set;i.forEach(function(t){var u=t.parent,o=t.node;if(D(o)||!t.parent||c.has(t.parent.key))return;if(D(t.parent.node)){c.add(u.key);return}var R=!0,T=!1;(u.children||[]).filter(function(S){return!D(S.node)}).forEach(function(S){var A=S.key,I=m.has(A);R&&!I&&(R=!1),!T&&(I||g.has(A))&&(T=!0)}),R&&m.add(u.key),T&&g.add(u.key),c.add(u.key)})}return{checkedKeys:Array.from(m),halfCheckedKeys:Array.from(Q(g,m))}}function K($,z,r,D,m){for(var g=new Set($),p=new Set(z),a=0;a<=D;a+=1){var c=r.get(a)||new Set;c.forEach(function(u){var o=u.key,R=u.node,T=u.children,S=T===void 0?[]:T;!g.has(o)&&!p.has(o)&&!m(R)&&S.filter(function(A){return!m(A.node)}).forEach(function(A){g.delete(A.key)})})}p=new Set;for(var s=new Set,i=D;i>=0;i-=1){var t=r.get(i)||new Set;t.forEach(function(u){var o=u.parent,R=u.node;if(m(R)||!u.parent||s.has(u.parent.key))return;if(m(u.parent.node)){s.add(o.key);return}var T=!0,S=!1;(o.children||[]).filter(function(A){return!m(A.node)}).forEach(function(A){var I=A.key,x=g.has(I);T&&!x&&(T=!1),!S&&(x||p.has(I))&&(S=!0)}),T||g.delete(o.key),S&&p.add(o.key),s.add(o.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(Q(p,g))}}function N($,z,r,D){var m=[],g;D?g=D:g=B;var p=new Set($.filter(function(i){var t=!!r[i];return t||m.push(i),t})),a=new Map,c=0;Object.keys(r).forEach(function(i){var t=r[i],u=t.level,o=a.get(u);o||(o=new Set,a.set(u,o)),o.add(t),c=Math.max(c,u)}),Object(te.a)(!m.length,"Tree missing follow keys: ".concat(m.slice(0,100).map(function(i){return"'".concat(i,"'")}).join(", ")));var s;return z===!0?s=J(p,a,c,g):s=K(p,z.halfCheckedKeys,a,c,g),s}},O2Wb:function(It,Oe,U){It.exports={flex:"flex___2gmSR",flex1:"flex1___3Tu1g",color666:"color666___2uyGL",error:"error___yJ86W",deleteIcon:"deleteIcon___1D2tg",addIcon:"addIcon___2VIYB"}},OZM5:function(It,Oe,U){"use strict";U.d(Oe,"b",function(){return D}),U.d(Oe,"a",function(){return m}),U.d(Oe,"k",function(){return g}),U.d(Oe,"h",function(){return p}),U.d(Oe,"i",function(){return a}),U.d(Oe,"g",function(){return c}),U.d(Oe,"c",function(){return s}),U.d(Oe,"d",function(){return i}),U.d(Oe,"j",function(){return o}),U.d(Oe,"e",function(){return R}),U.d(Oe,"f",function(){return T});var te=U("KQm4"),Q=U("U8pU"),B=U("Ff2n"),J=U("q1tI"),K=U.n(J),N=U("Kwbf"),$=U("WaYH"),z=.25,r=2;function D(S,A){var I=S.slice(),x=I.indexOf(A);return x>=0&&I.splice(x,1),I}function m(S,A){var I=S.slice();return I.indexOf(A)===-1&&I.push(A),I}function g(S){return S.split("-")}function p(S,A){return"".concat(S,"-").concat(A)}function a(S){return S&&S.type&&S.type.isTreeNode}function c(S,A){var I=[S],x=A[S];function b(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];h.forEach(function(f){var C=f.key,E=f.children;I.push(C),b(E)})}return b(x.children),I}function s(S,A){var I=S.clientY,x=A.selectHandle.getBoundingClientRect(),b=x.top,h=x.bottom,f=x.height,C=Math.max(f*z,r);return I<=b+C?-1:I>=h-C?1:0}function i(S,A){if(!S)return;var I=A.multiple;return I?S.slice():S.length?[S[0]]:S}var t=function(A){return A};function u(S,A){if(!S)return[];var I=A||{},x=I.processProps,b=x===void 0?t:x,h=Array.isArray(S)?S:[S];return h.map(function(f){var C=f.children,E=Object(B.a)(f,["children"]),_=u(C,A);return K.a.createElement($.a,Object.assign({},b(E)),_)})}function o(S){if(!S)return null;var A;if(Array.isArray(S))A={checkedKeys:S,halfCheckedKeys:void 0};else if(Object(Q.a)(S)==="object")A={checkedKeys:S.checked||void 0,halfCheckedKeys:S.halfChecked||void 0};else return Object(N.a)(!1,"`checkedKeys` is not an array or an object"),null;return A}function R(S,A){var I=new Set;function x(b){if(I.has(b))return;var h=A[b];if(!h)return;I.add(b);var f=h.parent,C=h.node;if(C.disabled)return;f&&x(f.key)}return(S||[]).forEach(function(b){x(b)}),Object(te.a)(I)}function T(S){var A={};return Object.keys(S).forEach(function(I){(I.startsWith("data-")||I.startsWith("aria-"))&&(A[I]=S[I])}),A}},Ot1p:function(It,Oe,U){"use strict";var te=U("2qtc"),Q=U("kLXV"),B=U("rAM+"),J=U("miYZ"),K=U("tsqr"),N=U("9og8"),$=U("tJVT"),z=U("jrin"),r=U("WmNS"),D=U.n(r),m=U("q1tI"),g=U.n(m),p=U("VrN/"),a=U.n(p),c=U("bdgK"),s=U("p77/"),i=U("Bd2K"),t=U("ELLl"),u=U("19Vz"),o=U("lZu9"),R=U("+NIl"),T=U("kSUc"),S=U("9Bee"),A=function(Fe){var at=Fe.value,xt=at===void 0?"":at,Kt=Fe.className,Xt=Fe.showTextOnly,$t=Fe.showLines,$n=Fe.style,vn=$n===void 0?{}:$n,ln=Object(m.useMemo)(function(){return""},[xt]);return g.a.createElement(g.a.Fragment,null,g.a.createElement("div",{dangerouslySetInnerHTML:{__html:ln}}))},I=U("0Owb"),x=U("dejd"),b=U("C+DQ"),h=U("1vsH"),f=U("m3rI"),C=[{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 E(Fe){var at=Fe.onActionCallback,xt=Fe.title,Kt=Fe.icon,Xt=Fe.actionName,$t=Fe.className,$n=$t===void 0?"":$t,vn=Fe.children;function ln(){at(Xt)}return g.a.createElement("a",{title:xt,className:$n,onClick:ln},g.a.createElement("i",{className:"md-iconfont ".concat(Kt)}),vn)}var _=function(Fe){var at=Fe.watch,xt=Fe.showNullButton,Kt=Fe.onActionCallback,Xt=Fe.fullScreen,$t=Fe.insertTemp,$n=Fe.hidetoolBar,vn=Fe.uuid,ln=Fe.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(h.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(h.F)("_educoder_session"),"&key=").concat(vn,"&api=").concat(encodeURIComponent(f.a.PROXY_SERVER)));var hn=[].concat(C,[{title:"".concat(at?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(at?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return g.a.createElement("ul",{className:"markdown-toolbar-container"},!$n&&hn.map(function(Gn,fr){return g.a.createElement("li",{key:fr},Gn.actionName?g.a.createElement(E,Object(I.a)({},Gn,{onActionCallback:Kt})):g.a.createElement("span",{className:"v-line"}))}),xt?g.a.createElement("li",null,g.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Kt},g.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,$t&&g.a.createElement("li",null,g.a.createElement(E,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat($t),onActionCallback:Kt},g.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),g.a.createElement("li",{className:"btn-full-screen"},g.a.createElement(E,{icon:"".concat(Xt?"icon-shrink":"icon-enlarge"),title:Xt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Kt})))},W=U("M8RZ"),j=U("+L6B"),w=U("2/Rp"),F=U("y8nQ"),P=U("Vl3Y"),v=U("5NDa"),H=U("5rEg"),Y={labelCol:{span:4},wrapperCol:{span:20}},ie=function(Fe){var at=Fe.callback,xt=Fe.onCancel;function Kt(Xt){at(Xt)}return g.a.createElement(P.a,Object(I.a)({},Y,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Kt}),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(H.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(H.a,null)),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(w.a,{type:"ghost",onClick:xt},"\u53D6\u6D88")))},le=U("7ahc"),he=U("HmJG"),xe=U("BjJ7"),Le=P.a.useForm,we={width:280,marginRight:10},Ae={labelCol:{span:5},wrapperCol:{span:19}},pe=function(Fe){var at=Fe.callback,xt=Fe.onCancel,Kt=Le(),Xt=Object($.a)(Kt,1),$t=Xt[0];function $n(hn){at(hn)}function vn(hn,Gn){if(hn.status===-1){K.b.error(hn.message);return}$t.setFieldsValue({src:"/api/attachments/".concat(hn.id),type:Gn.type})}function ln(hn){var Gn=hn.target.files[0];ne(Gn,vn)}return g.a.createElement(P.a,Object(I.a)({form:$t},Ae,{className:"upload-image-panel",onFinish:$n}),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(H.a,{style:we})),g.a.createElement(be,{onFileChange:ln}))),g.a.createElement(P.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},g.a.createElement(H.a,{style:{width:264}})),g.a.createElement(P.a.Item,{style:{textAlign:"right"}},g.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(w.a,{type:"ghost",onClick:xt},"\u53D6\u6D88")))};function be(Fe){var at=Fe.onFileChange;return g.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",g.a.createElement("input",{type:"file",onChange:at}))}function ne(Fe,at){if(!Fe)throw new String("\u6CA1\u6709\u6587\u4EF6");var xt=new FormData;xt.append("editormd-image-file",Fe),xt.append("file_param_name","editormd-image-file"),xt.append("byxhr","true");var Kt=new window.XMLHttpRequest;Kt.withCredentials=!0,Kt.addEventListener("load",function(Xt){at(JSON.parse(Xt.target.responseText),Fe)},!1),Kt.addEventListener("error",function(Xt){console.error(Xt)},!1),Kt.open("POST","".concat(xe.a,"/api/attachments.json")),Kt.send(xt)}var fe=U("giR+"),_e=U("fyUT"),ke=U("7Kak"),et=U("9yH6"),je=et.a.Group,ot={margin:"0 8px"},_t=function(Fe){var at=Fe.callback,xt=Fe.onCancel;function Kt(Xt){at(Xt)}return g.a.createElement(P.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Kt},g.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},g.a.createElement("span",{style:ot},"\u5355\u5143\u683C\u6570\uFF1A"),g.a.createElement("span",{style:ot},"\u884C\u6570"),g.a.createElement(P.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},g.a.createElement(_e.a,null)),g.a.createElement("span",{style:ot},"\u5217\u6570"),g.a.createElement(P.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},g.a.createElement(_e.a,null))),g.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},g.a.createElement("span",{style:ot},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),g.a.createElement(P.a.Item,{name:"align"},g.a.createElement(je,null,g.a.createElement(et.a,{value:"default"},g.a.createElement("i",{className:"fa fa-align-justify"})),g.a.createElement(et.a,{value:"left"},g.a.createElement("i",{className:"fa fa-align-left"})),g.a.createElement(et.a,{value:"center"},g.a.createElement("i",{className:"fa fa-align-center"})),g.a.createElement(et.a,{value:"right"},g.a.createElement("i",{className:"fa fa-align-right"}))))),g.a.createElement("div",{className:"flex-container flex-end"},g.a.createElement(w.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),g.a.createElement(w.a,{type:"ghost",onClick:xt},"\u53D6\u6D88")))},Re=U("ErOA"),Be=U("7Cbv"),Qe="link",Ve="upload-image",Et="code-block",kt="add-table",Vt="------------",Qt={default:Vt,left:":".concat(Vt),center:":".concat(Vt,":"),right:"".concat(Vt,":")},an=U("9VGf"),sn,qe;function Ze(){}var Ct=0,At=1e4,ct="\u2581",ft=`
**\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 He(Fe){return/^\d+$/.test(Fe)?"".concat(Fe,"px"):Fe}var Ne=navigator.platform.toUpperCase().indexOf("MAC")>=0,Ue=Ne?"Cmd":"Ctrl",ge=["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"],Ee=(sn={},Object(z.a)(sn,Ue+"-B","bold"),Object(z.a)(sn,Ue+"-I","italic"),sn),De=(qe={},Object(z.a)(qe,Qe,"\u6DFB\u52A0\u94FE\u63A5"),Object(z.a)(qe,Et,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(z.a)(qe,Ve,"\u6DFB\u52A0\u6587\u4EF6"),Object(z.a)(qe,kt,"\u6DFB\u52A0\u8868\u683C"),qe),ue=Oe.a=function(Fe){var at=Fe.defaultValue,xt=at===void 0?"":at,Kt=Fe.onChange,Xt=Fe.width,$t=Xt===void 0?"100%":Xt,$n=Fe.height,vn=$n===void 0?400:$n,ln=Fe.miniToolbar,hn=ln===void 0?!1:ln,Gn=Fe.isFocus,fr=Gn===void 0?!1:Gn,vr=Fe.watch,ir=Fe.insertTemp,br=Fe.mode,Rr=br===void 0?"markdown":br,Jt=Fe.id,Ar=Jt===void 0?"markdown-editor-id":Jt,Nn=Fe.showResizeBar,Tn=Nn===void 0?!1:Nn,pr=Fe.noStorage,_r=pr===void 0?!1:pr,Pr=Fe.showNullButton,yr=Pr===void 0?!1:Pr,mt=Fe.hidetoolBar,Ke=mt===void 0?!1:mt,Ot=Fe.fullScreen,Me=Ot===void 0?!1:Ot,ye=Fe.onBlur,ve=Fe.onCMBeforeChange,or=Fe.onFullScreen,en=Fe.className,Ie=en===void 0?"":en,gt=Fe.disablePaste,Ce=gt===void 0?!1:gt,dn=Fe.placeholder,hr=dn===void 0?"":dn,mr=Fe.values,q=mr===void 0?"":mr,O=Object(m.useState)(null),M=Object($.a)(O,2),X=M[0],se=M[1],Z=Object(m.useState)(xt),Pe=Object($.a)(Z,2),st=Pe[0],wt=Pe[1],Pt=Object(m.useState)(vr),dt=Object($.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=Object(m.useState)(Me),Yn=Object($.a)(Cn,2),Hn=Yn[0],fn=Yn[1],Wt=Object(m.useState)(""),rn=Object($.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=Object(m.useState)(0),Bn=Object($.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=Object(m.useState)(vn),Sn=Object($.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(m.useState)(!1),nr=Object($.a)(Xn,2),Ln=nr[0],Kn=nr[1],nn=Object(m.useRef)(Object(Be.a)()),_n=Object(m.useRef)(!1),In=Object(m.useRef)(),wn=Object(m.useRef)(),Zn=Object(m.useRef)(),yn=Object(m.useRef)(),Vn=Object(m.useRef)(),qn=function(){var yt=Object(N.a)(D.a.mark(function lt(){var Je,nt;return D.a.wrap(function(pt){for(;;)switch(pt.prev=pt.next){case 0:return pt.next=2,Object(Re.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:nn.current}});case 2:nt=pt.sent,nt!=null&&(Je=nt.attachments)!==null&&Je!==void 0&&Je.length&&(console.log("cm:",X,wn),nt.attachments.map(function(rt){rt.content_type.indexOf("image")>-1?X.replaceSelection("![,](/api/attachments/".concat(rt.id,"?type=").concat(rt.content_type,")")):rt.content_type.indexOf("video")>-1?X.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(data.id,'"></video>')):rt.content_type.indexOf("pdf")>-1?X.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(rt.id,"?type=").concat(rt.content_type,'&disposition=inline" target="_blank">').concat(rt.name,"</a>")):X.replaceSelection("[".concat(rt.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(rt.id,"?type=").concat(rt.content_type,")"))}));case 4:case"end":return pt.stop()}},lt)}));return function(){return yt.apply(this,arguments)}}();Object(m.useEffect)(function(){wt(q),X==null||X.setValue(q)},[q]),Object(m.useEffect)(function(){or==null||or(Hn)},[Hn]),Object(m.useEffect)(function(){if(wn.current){var yt=a.a.fromTextArea(wn.current,{mode:Rr,lineNumbers:!hn,lineWrapping:!0,value:xt,autoCloseTags:!0,autoCloseBrackets:!0});fr&&yt.focus();function lt(Je,nt){if(Ce){nt.preventDefault();return}var Ge=nt.clipboardData;if(Ge){var pt=Ge.types.toString(),rt=Ge.items;if(pt==="Files"||Ge.types.indexOf("Files")>-1){if(nt.preventDefault(),Rr=="stex")return;try{var Tt,Nt=rt[1];((Tt=rt[0])===null||Tt===void 0?void 0:Tt.kind)==="file"&&(Nt=rt[0]);var St=Nt.getAsFile(),Ht=St.name.split(".").pop();ne(St,function(Rt){if(Rt.id){var Lt,En,on;(St==null||((Lt=St.type)===null||Lt===void 0)?void 0:Lt.indexOf("image"))>-1?yt.replaceSelection("![,](/api/attachments/".concat(Rt.id,"?type=").concat(Rt.content_type,")")):(St==null||((En=St.type)===null||En===void 0)?void 0:En.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,'"></video>')):(St==null||((on=St.type)===null||on===void 0)?void 0:on.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(St.type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):ge.includes(Ht)?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,'?type=office&disposition=inline" target="_blank">').concat(St.name,"</a>")):yt.replaceSelection("[".concat(St.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}else(Rt==null?void 0:Rt.status)===401&&(document.location.href="/user/login")})}catch(Rt){K.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",lt),yt.on("dragleave",function(Je,nt){Zn.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(Je,nt){Zn.current.classList.add("mouse-hover-md")}),yt.on("drop",function(Je,nt){Zn.current.classList.add("mouse-hover-md");var Ge;if(Ge=nt.dataTransfer.files,Ge.length>0){nt.preventDefault(),nt.stopPropagation();for(var pt=function(Nt){var St=Ge[Nt],Ht=St.name.split(".").pop();ne(St,function(Rt){if(Rt.id){var Lt,En,on;(St==null||((Lt=St.type)===null||Lt===void 0)?void 0:Lt.indexOf("image"))>-1?yt.replaceSelection("![,](/api/attachments/".concat(Rt.id,"?type=").concat(Rt.content_type,")")):(St==null||((En=St.type)===null||En===void 0)?void 0:En.indexOf("video"))>-1?yt.replaceSelection('<video width="100%" controls src="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,'"></video>')):(St==null||((on=St.type)===null||on===void 0)?void 0:on.indexOf("pdf"))>-1?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(St.type,'&disposition=inline" target="_blank">').concat(St.name,"</a>")):ge.includes(Ht)?yt.replaceSelection('<a href="'.concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,'?type=office&disposition=inline" target="_blank">').concat(St.name,"</a>")):yt.replaceSelection("[".concat(St.name,"](").concat(f.a.API_SERVER,"/api/attachments/").concat(Rt.id,"?type=").concat(Rt.content_type,")"))}else(Rt==null?void 0:Rt.status)===401&&(document.location.href="/user/login")})},rt=0;rt<Ge.length;rt++)pt(rt)}}),se(yt),function(){yt.off("paste",lt)}}},[]);var kn=Object(m.useCallback)(function(){if(Zn.current)try{}catch(yt){console.log(yt,"---- to set md editor body height")}},[un,Zn,Hn]);Object(m.useEffect)(function(){function yt(){var Je=new c.default(function(nt){var Ge=Object(B.a)(nt),pt;try{for(Ge.s();!(pt=Ge.n()).done;){var rt=pt.value;(rt.target.offsetHeight>0||rt.target.offsetWidth>0)&&(kn(),X.setSize("100%","100%"),X.refresh())}}catch(Tt){Ge.e(Tt)}finally{Ge.f()}});return Je.observe(wn.current.parentElement),Je}if(X){var lt=yt();return function(){lt.unobserve(wn.current.parentElement)}}},[X,kn]),Object(m.useEffect)(function(){if(X){for(var yt=[],lt=function(){var rt=nt[Je];Ge=Object($.a)(rt,2);var Tt=Ge[0],Nt=Ge[1],St=Object(z.a)({},Tt,function(){Pn(Nt)});yt.push(St),X.addKeyMap(St)},Je=0,nt=Object.entries(Ee);Je<nt.length;Je++){var Ge;lt()}return In.current=setInterval(function(){_n.current&&qn()},4e3),function(){clearInterval(In.current);var pt=Object(B.a)(yt),rt;try{for(pt.s();!(rt=pt.n()).done;){var Tt=rt.value;X.removeKeyMap(Tt)}}catch(Nt){pt.e(Nt)}finally{pt.f()}}}},[X]),Object(m.useEffect)(function(){Me!==Hn&&fn(Me)},[Me]),Object(an.a)(function(){if(!_r&&xn>0){var yt=new Date().getTime(),lt=window.sessionStorage.getItem(Ar);yt>=xn+At&&(!lt||lt!==st)&&(window.sessionStorage.setItem(Ar,st),Kn(!0))}},At),Object(m.useEffect)(function(){Mt(vr)},[X,vr]),Object(m.useEffect)(function(){X&&(fr&&X.focus())},[X,fr]),Object(m.useEffect)(function(){if(bt&&X){var yt=X.getScrollerElement();function lt(Je){var nt=Je.target;if(Vn.current){var Ge=nt.scrollTop/nt.scrollHeight;Vn.current.scrollTop=Vn.current.scrollHeight*Ge}}return yt.addEventListener("scroll",lt),function(){yt.removeEventListener("scroll",lt)}}},[X,bt]),Object(m.useEffect)(function(){if(X&&ve){function yt(lt,Je){ve(lt,Je)}return X.on("beforeChange",yt),function(){X.off("beforeChange",yt)}}},[X,ve]),Object(m.useEffect)(function(){if(X&&ye){function yt(){ye(X.getValue())}return X.on("blur",yt),function(){X.off("blur",yt)}}},[X,ye]),Object(m.useEffect)(function(){if(X){function yt(lt){var Je=lt.getValue();wt(Je),Jn(new Date().getTime()),lt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Kt&&Kt(Je)}return X.on("change",yt),function(){X.off("change",yt)}}},[X,Kt]),Object(m.useEffect)(function(){X&&(xt==null?(X.setValue(""),wt("")):xt!==X.getValue()&&(X.setValue(xt),wt(xt),X.setCursor(X.lineCount(),0)))},[X,xt]);var Pn=Object(m.useCallback)(function(yt){var lt=X.getCursor(),Je=X.getSelection(),nt=Je.split(`
`);switch(yt){case"bold":return X.replaceSelection("**"+Je+"**"),Je===""&&X.setCursor(lt.line,lt.ch+2),X.focus();case"italic":return X.replaceSelection("*"+Je+"*"),Je===""&&X.setCursor(lt.line,lt.ch+1),X.focus();case"code":return X.replaceSelection("`"+Je+"`"),Je===""&&X.setCursor(lt.line,lt.ch+1),X.focus();case"inline-latex":return X.replaceSelection("`$$"+Je+"$$`"),Je===""&&X.setCursor(lt.line,lt.ch+3),X.focus();case"latex":return X.replaceSelection("```latex\n"+Je+"\n```"),X.setCursor(lt.line+1,Je.length+1),X.focus();case"line-break":return X.replaceSelection(`<br/>
`),X.focus();case"list-ul":return Je===""?X.replaceSelection("- "+Je):X.replaceSelection(nt.map(function(Ge){return Ge===""?"":"- ".concat(Ge)}).join(`
`)),X.focus();case"list-ol":return Je===""?X.replaceSelection("1. "+Je):X.replaceSelection(nt.map(function(Ge,pt){return Ge===""?"":"".concat(pt+1,". ").concat(Ge)}).join(`
`)),X.focus();case"add-null-ch":return Je===""&&X.setCursor(lt.line,lt.ch+1),X.replaceSelection(ct),X.focus();case"inster-template-1":return Je===""&&X.setCursor(lt.line,lt.ch),X.replaceSelection(ft),X.focus();case"eraser":return X.setValue(""),X.focus();case"trigger-watch":return Mt(!bt),X.focus();case"trigger-full-screen":return fn(!Hn),X.focus();case Qe:Ft(Qe);return;case Et:Ft(Et);return;case Ve:Ft(Ve);return;case kt:Ft(kt);return;default:throw new Error}},[X,bt,Hn]),Mn=Object(m.useCallback)(function(yt){Ft("");switch(qt){case Qe:var lt=yt.title,Je=yt.link;return X.replaceSelection("[".concat(lt,"](").concat(Je,")")),X.focus();case Et:var nt=yt.language,Ge=yt.content;return X.replaceSelection(["```"+nt,Ge,"```"].join(`
`)),X.focus();case Ve:var pt=yt.src,rt=yt.alt;return rt?X.replaceSelection("![ ".concat(rt," ]( ").concat(pt,' "').concat(rt,'" )')):X.replaceSelection("![,](".concat(pt,")")),X.focus();case kt:for(var Tt=yt.row,Nt=yt.col,St=yt.align,Ht=`
`,Rt=0;Rt<Tt;Rt++){for(var Lt=[],En=[],on=0;on<Nt;on++)Rt===1&&En.push(Qt[St]),Lt.push(" ");Rt===1&&(Ht+="| ".concat(En.join(" | "),` |
`)),Ht+="| ".concat(Lt.join(Nt===1?"":" | "),` |
`)}return X.replaceSelection(Ht+`
`),X.focus();default:throw new Error}},[X,qt]),Dn=Object(m.useMemo)(function(){switch(qt){case Qe:return g.a.createElement(ie,{callback:Mn,onCancel:cn});case Et:return g.a.createElement(le.b,{callback:Mn,onCancel:cn});case Ve:return g.a.createElement(pe,{callback:Mn,onCancel:cn});case kt:return g.a.createElement(_t,{callback:Mn,onCancel:cn});default:return null}},[qt]);function cn(){Ft("")}Object(m.useEffect)(function(){if(yn.current){var yt=yn.current,lt=!1,Je=0;function nt(rt){lt=!0,Je=rt.pageY}function Ge(){lt=!1}function pt(rt){if(lt){var Tt=rt.pageY-Je;Tt<0&&(Tt=0),Tt>300&&(Tt=300);var Nt=vn+Tt+"px";Un(Nt)}}return yt.addEventListener("mousedown",nt),document.addEventListener("mousemove",pt),document.addEventListener("mouseup",Ge),function(){yt.removeEventListener("mousedown",nt),document.removeEventListener("mousemove",pt),document.removeEventListener("mouseup",Ge)}}},[X,yn]),Object(m.useEffect)(function(){Un(vn)},[vn]);var Ut=He($t),Gt=He(un),zt={width:Ut,height:Gt},jt=Object(m.useMemo)(function(){if(xn){var yt=new Date(xn),lt=yt.getHours(),Je=yt.getMinutes(),nt=yt.getSeconds();return lt=lt<10?"0"+lt:lt,Je=Je<10?"0"+Je:Je,nt=nt<10?"0"+nt:nt,"".concat(lt,":").concat(Je,":").concat(nt)}return 0},[xn]);function tn(){window.sessionStorage.removeItem(Ar),Kn(!1),Jn(0)}function bn(){Kn(!1),Jn(0),X.setValue(window.sessionStorage.getItem(Ar))}function gn(yt,lt){var Je=X.getValue();Je=Je.replace(yt,lt),wt(Je),X==null||X.setValue(Je)}return g.a.createElement(m.Fragment,null,g.a.createElement("div",{className:"markdown-editor-wrapper",ref:Zn},g.a.createElement("div",{className:"markdown-editor-container ".concat(Ie," ").concat(bt?"on-preview":""," ").concat(hn?"mini":""," ").concat(Hn?"full-screen":""),style:zt},g.a.createElement(_,{insertTemp:ir,watch:bt,fullScreen:Hn,showNullButton:yr,onActionCallback:Pn,hidetoolBar:Ke,uuid:nn.current,setOpenPhones:function(){_n.current=!0}}),g.a.createElement("div",{className:"markdown-editor-body"},g.a.createElement("div",{className:"codemirror-container"},g.a.createElement("textarea",{ref:wn,placeholder:hr})),bt?g.a.createElement("div",{ref:Vn,className:"preview-container"},Rr==="stex"&&g.a.createElement(A,{value:st}),Rr!=="stex"&&g.a.createElement(S.a,{edit:!0,value:st,replaces:gn})):null))),Tn?g.a.createElement("a",{ref:yn,className:"editor-resize"}):null,g.a.createElement(W.a,null,De[qt]?g.a.createElement(Q.a,{centered:!0,title:De[qt],visible:!0,onCancel:cn,footer:null,className:"markdown-popup-form"},Dn):null))}},Pxm8:function(It,Oe,U){It.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(It,Oe,U){"use strict";var te=U("q1tI"),Q=U("uciX"),B=U("2W6z"),J=U.n(B),K=U("4IlW"),N=U("uK0f"),$=U.n(N);function z(we,Ae){if(we===Ae)return!0;if(!we||!Ae)return!1;var pe=we.length;if(Ae.length!==pe)return!1;for(var be=0;be<pe;be++)if(we[be]!==Ae[be])return!1;return!0}function r(we){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?r=function(pe){return typeof pe}:r=function(pe){return pe&&typeof Symbol=="function"&&pe.constructor===Symbol&&pe!==Symbol.prototype?"symbol":typeof pe},r(we)}function D(we,Ae){if(!(we instanceof Ae))throw new TypeError("Cannot call a class as a function")}function m(we,Ae){for(var pe=0;pe<Ae.length;pe++){var be=Ae[pe];be.enumerable=be.enumerable||!1,be.configurable=!0,"value"in be&&(be.writable=!0),Object.defineProperty(we,be.key,be)}}function g(we,Ae,pe){return Ae&&m(we.prototype,Ae),pe&&m(we,pe),we}function p(we,Ae){if(typeof Ae!="function"&&Ae!==null)throw new TypeError("Super expression must either be null or a function");we.prototype=Object.create(Ae&&Ae.prototype,{constructor:{value:we,writable:!0,configurable:!0}}),Ae&&a(we,Ae)}function a(we,Ae){return a=Object.setPrototypeOf||function(be,ne){return be.__proto__=ne,be},a(we,Ae)}function c(we){var Ae=t();return function(){var pe=u(we),be;if(Ae){var ne=u(this).constructor;be=Reflect.construct(pe,arguments,ne)}else be=pe.apply(this,arguments);return s(this,be)}}function s(we,Ae){return Ae&&(r(Ae)==="object"||typeof Ae=="function")?Ae:i(we)}function i(we){if(we===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return we}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(we){return!1}}function u(we){return u=Object.setPrototypeOf?Object.getPrototypeOf:function(pe){return pe.__proto__||Object.getPrototypeOf(pe)},u(we)}var o=function(){var we=function(Ae){p(be,Ae);var pe=c(be);function be(){var ne;return D(this,be),ne=pe.apply(this,arguments),ne.menuItems={},ne.saveMenuItem=function(fe){return function(_e){ne.menuItems[fe]=_e}},ne}return g(be,[{key:"componentDidMount",value:function(){this.scrollActiveItemToView()}},{key:"componentDidUpdate",value:function(fe){!fe.visible&&this.props.visible&&this.scrollActiveItemToView()}},{key:"getFieldName",value:function(fe){var _e=this.props,ke=_e.fieldNames,et=_e.defaultFieldNames;return ke[fe]||et[fe]}},{key:"getOption",value:function(fe,_e){var ke=this.props,et=ke.prefixCls,je=ke.expandTrigger,ot=ke.expandIcon,_t=ke.loadingIcon,Re=this.props.onSelect.bind(this,fe,_e),Be=this.props.onItemDoubleClick.bind(this,fe,_e),Qe={onClick:Re,onDoubleClick:Be},Ve="".concat(et,"-menu-item"),Et=null,kt=fe[this.getFieldName("children")]&&fe[this.getFieldName("children")].length>0;(kt||fe.isLeaf===!1)&&(Ve+=" ".concat(et,"-menu-item-expand"),fe.loading||(Et=te.createElement("span",{className:"".concat(et,"-menu-item-expand-icon")},ot))),je==="hover"&&(kt||fe.isLeaf===!1)&&(Qe={onMouseEnter:this.delayOnSelect.bind(this,Re),onMouseLeave:this.delayOnSelect.bind(this),onClick:Re}),this.isActiveOption(fe,_e)&&(Ve+=" ".concat(et,"-menu-item-active"),Qe.ref=this.saveMenuItem(_e)),fe.disabled&&(Ve+=" ".concat(et,"-menu-item-disabled"));var Vt=null;fe.loading&&(Ve+=" ".concat(et,"-menu-item-loading"),Vt=_t||null);var Qt="";return"title"in fe?Qt=fe.title:typeof fe[this.getFieldName("label")]=="string"&&(Qt=fe[this.getFieldName("label")]),te.createElement("li",Object.assign({key:fe[this.getFieldName("value")],className:Ve,title:Qt},Qe,{role:"menuitem",onMouseDown:function(sn){return sn.preventDefault()}}),fe[this.getFieldName("label")],Et,Vt)}},{key:"getActiveOptions",value:function(fe){var _e=this,ke=this.props.options,et=fe||this.props.activeValue;return $()(ke,function(je,ot){return je[_e.getFieldName("value")]===et[ot]},{childrenKeyName:this.getFieldName("children")})}},{key:"getShowOptions",value:function(){var fe=this,_e=this.props.options,ke=this.getActiveOptions().map(function(et){return et[fe.getFieldName("children")]}).filter(function(et){return!!et});return ke.unshift(_e),ke}},{key:"delayOnSelect",value:function(fe){for(var _e=this,ke=arguments.length,et=new Array(ke>1?ke-1:0),je=1;je<ke;je++)et[je-1]=arguments[je];this.delayTimer&&(clearTimeout(this.delayTimer),this.delayTimer=null),typeof fe=="function"&&(this.delayTimer=window.setTimeout(function(){fe(et),_e.delayTimer=null},150))}},{key:"scrollActiveItemToView",value:function(){for(var fe=this.getShowOptions().length,_e=0;_e<fe;_e++){var ke=this.menuItems[_e];ke&&ke.parentElement&&(ke.parentElement.scrollTop=ke.offsetTop)}}},{key:"isActiveOption",value:function(fe,_e){var ke=this.props.activeValue,et=ke===void 0?[]:ke;return et[_e]===fe[this.getFieldName("value")]}},{key:"render",value:function(){var fe=this,_e=this.props,ke=_e.prefixCls,et=_e.dropdownMenuColumnStyle;return te.createElement("div",null,this.getShowOptions().map(function(je,ot){return te.createElement("ul",{className:"".concat(ke,"-menu"),key:ot,style:et},je.map(function(_t){return fe.getOption(_t,ot)}))}))}}]),be}(te.Component);return we.defaultProps={options:[],value:[],activeValue:[],onSelect:function(){},prefixCls:"rc-cascader-menus",visible:!1,expandTrigger:"click"},we}(),R=o,T={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}}},S=T;function A(we){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?A=function(pe){return typeof pe}:A=function(pe){return pe&&typeof Symbol=="function"&&pe.constructor===Symbol&&pe!==Symbol.prototype?"symbol":typeof pe},A(we)}function I(we,Ae){if(we==null)return{};var pe=x(we,Ae),be,ne;if(Object.getOwnPropertySymbols){var fe=Object.getOwnPropertySymbols(we);for(ne=0;ne<fe.length;ne++){if(be=fe[ne],Ae.indexOf(be)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(we,be))continue;pe[be]=we[be]}}return pe}function x(we,Ae){if(we==null)return{};var pe={},be=Object.keys(we),ne,fe;for(fe=0;fe<be.length;fe++){if(ne=be[fe],Ae.indexOf(ne)>=0)continue;pe[ne]=we[ne]}return pe}function b(we){return E(we)||C(we)||f(we)||h()}function h(){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 f(we,Ae){if(!we)return;if(typeof we=="string")return _(we,Ae);var pe=Object.prototype.toString.call(we).slice(8,-1);if(pe==="Object"&&we.constructor&&(pe=we.constructor.name),pe==="Map"||pe==="Set")return Array.from(we);if(pe==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(pe))return _(we,Ae)}function C(we){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(we))return Array.from(we)}function E(we){if(Array.isArray(we))return _(we)}function _(we,Ae){(Ae==null||Ae>we.length)&&(Ae=we.length);for(var pe=0,be=new Array(Ae);pe<Ae;pe++)be[pe]=we[pe];return be}function W(we,Ae){if(!(we instanceof Ae))throw new TypeError("Cannot call a class as a function")}function j(we,Ae){for(var pe=0;pe<Ae.length;pe++){var be=Ae[pe];be.enumerable=be.enumerable||!1,be.configurable=!0,"value"in be&&(be.writable=!0),Object.defineProperty(we,be.key,be)}}function w(we,Ae,pe){return Ae&&j(we.prototype,Ae),pe&&j(we,pe),we}function F(we,Ae){if(typeof Ae!="function"&&Ae!==null)throw new TypeError("Super expression must either be null or a function");we.prototype=Object.create(Ae&&Ae.prototype,{constructor:{value:we,writable:!0,configurable:!0}}),Ae&&P(we,Ae)}function P(we,Ae){return P=Object.setPrototypeOf||function(be,ne){return be.__proto__=ne,be},P(we,Ae)}function v(we){var Ae=ie();return function(){var pe=le(we),be;if(Ae){var ne=le(this).constructor;be=Reflect.construct(pe,arguments,ne)}else be=pe.apply(this,arguments);return H(this,be)}}function H(we,Ae){return Ae&&(A(Ae)==="object"||typeof Ae=="function")?Ae:Y(we)}function Y(we){if(we===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return we}function ie(){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(we){return!1}}function le(we){return le=Object.setPrototypeOf?Object.getPrototypeOf:function(pe){return pe.__proto__||Object.getPrototypeOf(pe)},le(we)}var he=function(){var we=function(Ae){F(be,Ae);var pe=v(be);function be(ne){var fe;W(this,be),fe=pe.call(this,ne),fe.setPopupVisible=function(ke){var et=fe.state.value;"popupVisible"in fe.props||fe.setState({popupVisible:ke}),ke&&!fe.state.popupVisible&&fe.setState({activeValue:et}),fe.props.onPopupVisibleChange(ke)},fe.handleChange=function(ke,et,je){var ot=et.visible;(je.type!=="keydown"||je.keyCode===K.a.ENTER)&&(fe.props.onChange(ke.map(function(_t){return _t[fe.getFieldName("value")]}),ke),fe.setPopupVisible(ot))},fe.handlePopupVisibleChange=function(ke){fe.setPopupVisible(ke)},fe.handleMenuSelect=function(ke,et,je){var ot=fe.trigger.getRootDomNode();ot&&ot.focus&&ot.focus();var _t=fe.props,Re=_t.changeOnSelect,Be=_t.loadData,Qe=_t.expandTrigger;if(!ke||ke.disabled)return;var Ve=fe.state.activeValue;Ve=Ve.slice(0,et+1),Ve[et]=ke[fe.getFieldName("value")];var Et=fe.getActiveOptions(Ve);if(ke.isLeaf===!1&&!ke[fe.getFieldName("children")]&&Be){Re&&fe.handleChange(Et,{visible:!0},je),fe.setState({activeValue:Ve}),Be(Et);return}var kt={};!ke[fe.getFieldName("children")]||!ke[fe.getFieldName("children")].length?(fe.handleChange(Et,{visible:!1},je),kt.value=Ve):Re&&(je.type==="click"||je.type==="keydown")&&(Qe==="hover"?fe.handleChange(Et,{visible:!1},je):fe.handleChange(Et,{visible:!0},je),kt.value=Ve),kt.activeValue=Ve,("value"in fe.props||je.type==="keydown"&&je.keyCode!==K.a.ENTER)&&delete kt.value,fe.setState(kt)},fe.handleItemDoubleClick=function(){var ke=fe.props.changeOnSelect;ke&&fe.setPopupVisible(!1)},fe.handleKeyDown=function(ke){var et=fe.props.children;if(et&&et.props.onKeyDown){et.props.onKeyDown(ke);return}var je=b(fe.state.activeValue),ot=je.length-1<0?0:je.length-1,_t=fe.getCurrentLevelOptions(),Re=_t.map(function(Et){return Et[fe.getFieldName("value")]}).indexOf(je[ot]);if(ke.keyCode!==K.a.DOWN&&ke.keyCode!==K.a.UP&&ke.keyCode!==K.a.LEFT&&ke.keyCode!==K.a.RIGHT&&ke.keyCode!==K.a.ENTER&&ke.keyCode!==K.a.SPACE&&ke.keyCode!==K.a.BACKSPACE&&ke.keyCode!==K.a.ESC&&ke.keyCode!==K.a.TAB)return;if(!fe.state.popupVisible&&ke.keyCode!==K.a.BACKSPACE&&ke.keyCode!==K.a.LEFT&&ke.keyCode!==K.a.RIGHT&&ke.keyCode!==K.a.ESC&&ke.keyCode!==K.a.TAB){fe.setPopupVisible(!0);return}if(ke.keyCode===K.a.DOWN||ke.keyCode===K.a.UP){ke.preventDefault();var Be=Re;Be!==-1?ke.keyCode===K.a.DOWN?(Be+=1,Be=Be>=_t.length?0:Be):(Be-=1,Be=Be<0?_t.length-1:Be):Be=0,je[ot]=_t[Be][fe.getFieldName("value")]}else if(ke.keyCode===K.a.LEFT||ke.keyCode===K.a.BACKSPACE)ke.preventDefault(),je.splice(je.length-1,1);else if(ke.keyCode===K.a.RIGHT)ke.preventDefault(),_t[Re]&&_t[Re][fe.getFieldName("children")]&&je.push(_t[Re][fe.getFieldName("children")][0][fe.getFieldName("value")]);else if(ke.keyCode===K.a.ESC||ke.keyCode===K.a.TAB){fe.setPopupVisible(!1);return}(!je||je.length===0)&&fe.setPopupVisible(!1);var Qe=fe.getActiveOptions(je),Ve=Qe[Qe.length-1];fe.handleMenuSelect(Ve,Qe.length-1,ke),fe.props.onKeyDown&&fe.props.onKeyDown(ke)},fe.saveTrigger=function(ke){fe.trigger=ke};var _e=[];return"value"in ne?_e=ne.value||[]:"defaultValue"in ne&&(_e=ne.defaultValue||[]),J()(!("filedNames"in ne),"`filedNames` of Cascader is a typo usage and deprecated, please use `fieldNames` instead."),fe.state={popupVisible:ne.popupVisible,activeValue:_e,value:_e,prevProps:ne},fe.defaultFieldNames={label:"label",value:"value",children:"children"},fe}return w(be,[{key:"getPopupDOMNode",value:function(){return this.trigger.getPopupDomNode()}},{key:"getFieldName",value:function(fe){var _e=this.defaultFieldNames,ke=this.props,et=ke.fieldNames,je=ke.filedNames;return"filedNames"in this.props?je[fe]||_e[fe]:et[fe]||_e[fe]}},{key:"getFieldNames",value:function(){var fe=this.props,_e=fe.fieldNames,ke=fe.filedNames;return"filedNames"in this.props?ke:_e}},{key:"getCurrentLevelOptions",value:function(){var fe=this,_e=this.props.options,ke=_e===void 0?[]:_e,et=this.state.activeValue,je=et===void 0?[]:et,ot=$()(ke,function(_t,Re){return _t[fe.getFieldName("value")]===je[Re]},{childrenKeyName:this.getFieldName("children")});return ot[ot.length-2]?ot[ot.length-2][this.getFieldName("children")]:b(ke).filter(function(_t){return!_t.disabled})}},{key:"getActiveOptions",value:function(fe){var _e=this;return $()(this.props.options||[],function(ke,et){return ke[_e.getFieldName("value")]===fe[et]},{childrenKeyName:this.getFieldName("children")})}},{key:"render",value:function(){var fe=this.props,_e=fe.prefixCls,ke=fe.transitionName,et=fe.popupClassName,je=fe.options,ot=je===void 0?[]:je,_t=fe.disabled,Re=fe.builtinPlacements,Be=fe.popupPlacement,Qe=fe.children,Ve=fe.dropdownRender,Et=I(fe,["prefixCls","transitionName","popupClassName","options","disabled","builtinPlacements","popupPlacement","children","dropdownRender"]),kt=te.createElement("div",null),Vt="";ot&&ot.length>0?kt=te.createElement(R,Object.assign({},this.props,{fieldNames:this.getFieldNames(),defaultFieldNames:this.defaultFieldNames,activeValue:this.state.activeValue,onSelect:this.handleMenuSelect,onItemDoubleClick:this.handleItemDoubleClick,visible:this.state.popupVisible})):Vt=" ".concat(_e,"-menus-empty");var Qt=kt;return Ve&&(Qt=Ve(kt)),te.createElement(Q.a,Object.assign({ref:this.saveTrigger},Et,{popupPlacement:Be,builtinPlacements:Re,popupTransitionName:ke,action:_t?[]:["click"],popupVisible:_t?!1:this.state.popupVisible,onPopupVisibleChange:this.handlePopupVisibleChange,prefixCls:"".concat(_e,"-menus"),popupClassName:et+Vt,popup:Qt}),te.cloneElement(Qe,{onKeyDown:this.handleKeyDown,tabIndex:_t?void 0:0}))}}],[{key:"getDerivedStateFromProps",value:function(fe,_e){var ke=_e.prevProps,et=ke===void 0?{}:ke,je={prevProps:fe};return"value"in fe&&!z(et.value,fe.value)&&(je.value=fe.value||[],"loadData"in fe||(je.activeValue=fe.value||[])),"popupVisible"in fe&&(je.popupVisible=fe.popupVisible),je}}]),be}(te.Component);return we.defaultProps={onChange:function(){},onPopupVisibleChange:function(){},disabled:!1,transitionName:"",prefixCls:"rc-cascader",popupClassName:"",popupPlacement:"bottomLeft",builtinPlacements:S,expandTrigger:"click",fieldNames:{label:"label",value:"value",children:"children"},expandIcon:">"},we}(),xe=he,Le=Oe.a=xe},"SA+Z":function(It,Oe,U){var te=U("wTVA"),Q=U("EbDI"),B=U("ZhPi"),J=U("wkBT");function K(N){return te(N)||Q(N)||B(N)||J()}It.exports=K,It.exports.__esModule=!0,It.exports.default=It.exports},SJMd:function(It,Oe){/**
* @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 U,te,Q,B=!1,J,K;window.PR_SHOULD_USE_CONTINUATION=!0;var N,$;(function(){var z=window,r=["break,continue,do,else,for,if,return,while"],D=[r,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],m=[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"],p=[m,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[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"],c="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",s=[m,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",t=[r,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],u=[r,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],o=[r,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],R=[g,a,p,s,i,t,u,o],T=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",A="kwd",I="com",x="typ",b="lit",h="pun",f="pln",C="tag",E="dec",_="src",W="atn",j="atv",w="nocode",F="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function P(je){for(var ot=0,_t=!1,Re=!1,Be=0,Qe=je.length;Be<Qe;++Be){var Ve=je[Be];if(Ve.ignoreCase)Re=!0;else if(/[a-z]/i.test(Ve.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){_t=!0,Re=!1;break}}var Et={b:8,t:9,n:10,v:11,f:12,r:13};function kt(qe){var Ze=qe.charCodeAt(0);if(Ze!==92)return Ze;var Ct=qe.charAt(1);return Ze=Et[Ct],Ze||("0"<=Ct&&Ct<="7"?parseInt(qe.substring(1),8):Ct==="u"||Ct==="x"?parseInt(qe.substring(2),16):qe.charCodeAt(1))}function Vt(qe){if(qe<32)return(qe<16?"\\x0":"\\x")+qe.toString(16);var Ze=String.fromCharCode(qe);return Ze==="\\"||Ze==="-"||Ze==="]"||Ze==="^"?"\\"+Ze:Ze}function Qt(qe){var Ze=qe.substring(1,qe.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")),Ct=[],At=Ze[0]==="^",ct=["["];At&&ct.push("^");for(var ft=At?1:0,He=Ze.length;ft<He;++ft){var Ne=Ze[ft];if(/\\[bdsw]/i.test(Ne))ct.push(Ne);else{var Ue=kt(Ne),ge;ft+2<He&&Ze[ft+1]==="-"?(ge=kt(Ze[ft+2]),ft+=2):ge=Ue,Ct.push([Ue,ge]),ge<65||Ue>122||(ge<65||Ue>90||Ct.push([Math.max(65,Ue)|32,Math.min(ge,90)|32]),ge<97||Ue>122||Ct.push([Math.max(97,Ue)&~32,Math.min(ge,122)&~32]))}}Ct.sort(function(Fe,at){return Fe[0]-at[0]||at[1]-Fe[1]});for(var Ee=[],De=[],ft=0;ft<Ct.length;++ft){var ue=Ct[ft];ue[0]<=De[1]+1?De[1]=Math.max(De[1],ue[1]):Ee.push(De=ue)}for(var ft=0;ft<Ee.length;++ft){var ue=Ee[ft];ct.push(Vt(ue[0])),ue[1]>ue[0]&&(ue[1]+1>ue[0]&&ct.push("-"),ct.push(Vt(ue[1])))}return ct.push("]"),ct.join("")}function an(qe){for(var Ze=qe.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")),Ct=Ze.length,At=[],ct=0,ft=0;ct<Ct;++ct){var He=Ze[ct];if(He==="(")++ft;else if(He.charAt(0)==="\\"){var Ne=+He.substring(1);Ne&&(Ne<=ft?At[Ne]=-1:Ze[ct]=Vt(Ne))}}for(var ct=1;ct<At.length;++ct)At[ct]===-1&&(At[ct]=++ot);for(var ct=0,ft=0;ct<Ct;++ct){var He=Ze[ct];if(He==="(")++ft,At[ft]||(Ze[ct]="(?:");else if(He.charAt(0)==="\\"){var Ne=+He.substring(1);Ne&&Ne<=ft&&(Ze[ct]="\\"+At[Ne])}}for(var ct=0;ct<Ct;++ct)Ze[ct]==="^"&&Ze[ct+1]!=="^"&&(Ze[ct]="");if(qe.ignoreCase&&_t)for(var ct=0;ct<Ct;++ct){var He=Ze[ct],Ue=He.charAt(0);He.length>=2&&Ue==="["?Ze[ct]=Qt(He):Ue!=="\\"&&(Ze[ct]=He.replace(/[a-zA-Z]/g,function(De){var ue=De.charCodeAt(0);return"["+String.fromCharCode(ue&~32,ue|32)+"]"}))}return Ze.join("")}for(var sn=[],Be=0,Qe=je.length;Be<Qe;++Be){var Ve=je[Be];if(Ve.global||Ve.multiline)throw new Error(""+Ve);sn.push("(?:"+an(Ve)+")")}return new RegExp(sn.join("|"),Re?"gi":"g")}function v(je,ot){var _t=/(?:^|\s)nocode(?:\s|$)/,Re=[],Be=0,Qe=[],Ve=0;function Et(kt){var Vt=kt.nodeType;if(Vt==1){if(_t.test(kt.className))return;for(var Qt=kt.firstChild;Qt;Qt=Qt.nextSibling)Et(Qt);var an=kt.nodeName.toLowerCase();(an==="br"||an==="li")&&(Re[Ve]=`
`,Qe[Ve<<1]=Be++,Qe[Ve++<<1|1]=kt)}else if(Vt==3||Vt==4){var sn=kt.nodeValue;sn.length&&(ot?sn=sn.replace(/\r\n?/g,`
`):sn=sn.replace(/[ \t\r\n]+/g," "),Re[Ve]=sn,Qe[Ve<<1]=Be,Be+=sn.length,Qe[Ve++<<1|1]=kt)}}return Et(je),{sourceCode:Re.join("").replace(/\n$/,""),spans:Qe}}function H(je,ot,_t,Re,Be){if(!_t)return;var Qe={sourceNode:je,pre:1,langExtension:null,numberLines:null,sourceCode:_t,spans:null,basePos:ot,decorations:null};Re(Qe),Be.push.apply(Be,Qe.decorations)}var Y=/\S/;function ie(je){for(var ot=void 0,_t=je.firstChild;_t;_t=_t.nextSibling){var Re=_t.nodeType;ot=Re===1?ot?je:_t:Re===3&&Y.test(_t.nodeValue)?je:ot}return ot===je?void 0:ot}function le(je,ot){var _t={},Re;(function(){for(var Ve=je.concat(ot),Et=[],kt={},Vt=0,Qt=Ve.length;Vt<Qt;++Vt){var an=Ve[Vt],sn=an[3];if(sn)for(var qe=sn.length;--qe>=0;)_t[sn.charAt(qe)]=an;var Ze=an[1],Ct=""+Ze;kt.hasOwnProperty(Ct)||(Et.push(Ze),kt[Ct]=null)}Et.push(/[\0-\uffff]/),Re=P(Et)})();var Be=ot.length,Qe=function(Ve){for(var Et=Ve.sourceCode,kt=Ve.basePos,Vt=Ve.sourceNode,Qt=[kt,f],an=0,sn=Et.match(Re)||[],qe={},Ze=0,Ct=sn.length;Ze<Ct;++Ze){var At=sn[Ze],ct=qe[At],ft=void 0,He;if(typeof ct=="string")He=!1;else{var Ne=_t[At.charAt(0)];if(Ne)ft=At.match(Ne[1]),ct=Ne[0];else{for(var Ue=0;Ue<Be;++Ue)if(Ne=ot[Ue],ft=At.match(Ne[1]),ft){ct=Ne[0];break}ft||(ct=f)}He=ct.length>=5&&ct.substring(0,5)==="lang-",He&&!(ft&&typeof ft[1]=="string")&&(He=!1,ct=_),He||(qe[At]=ct)}var ge=an;if(an+=At.length,!He)Qt.push(kt+ge,ct);else{var Ee=ft[1],De=At.indexOf(Ee),ue=De+Ee.length;ft[2]&&(ue=At.length-ft[2].length,De=ue-Ee.length);var Fe=ct.substring(5);H(Vt,kt+ge,At.substring(0,De),Qe,Qt),H(Vt,kt+ge+De,Ee,be(Fe,Ee),Qt),H(Vt,kt+ge+ue,At.substring(ue),Qe,Qt)}}Ve.decorations=Qt};return Qe}function he(je){var ot=[],_t=[];je.tripleQuotedStrings?ot.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):je.multiLineStrings?ot.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):ot.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),je.verbatimStrings&&_t.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Re=je.hashComments;Re&&(je.cStyleComments?(Re>1?ot.push([I,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):ot.push([I,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),_t.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):ot.push([I,/^#[^\r\n]*/,null,"#"])),je.cStyleComments&&(_t.push([I,/^\/\/[^\r\n]*/,null]),_t.push([I,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var Be=je.regexLiterals;if(Be){var Qe=Be>1?"":`
\r`,Ve=Qe?".":"[\\S\\s]",Et="/(?=[^/*"+Qe+"])(?:[^/\\x5B\\x5C"+Qe+"]|\\x5C"+Ve+"|\\x5B(?:[^\\x5C\\x5D"+Qe+"]|\\x5C"+Ve+")*(?:\\x5D|$))+/";_t.push(["lang-regex",RegExp("^"+F+"("+Et+")")])}var kt=je.types;kt&&_t.push([x,kt]);var Vt=(""+je.keywords).replace(/^ | $/g,"");Vt.length&&_t.push([A,new RegExp("^(?:"+Vt.replace(/[\s,]+/g,"|")+")\\b"),null]),ot.push([f,/^\s+/,null,` \r
\xA0`]);var Qt="^.[^\\s\\w.$@'\"`/\\\\]*";return je.regexLiterals&&(Qt+="(?!s*/)"),_t.push([b,/^@[a-z_$][a-z_$@0-9]*/i,null],[x,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[f,/^[a-z_$][a-z_$@0-9]*/i,null],[b,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[f,/^\\[\s\S]?/,null],[h,new RegExp(Qt),null]),le(ot,_t)}var xe=he({keywords:R,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function Le(je,ot,_t){for(var Re=/(?:^|\s)nocode(?:\s|$)/,Be=/\r\n?|\n/,Qe=je.ownerDocument,Ve=Qe.createElement("li");je.firstChild;)Ve.appendChild(je.firstChild);var Et=[Ve];function kt(Ze){var Ct=Ze.nodeType;if(Ct==1&&!Re.test(Ze.className))if(Ze.nodeName==="br")Vt(Ze),Ze.parentNode&&Ze.parentNode.removeChild(Ze);else for(var At=Ze.firstChild;At;At=At.nextSibling)kt(At);else if((Ct==3||Ct==4)&&_t){var ct=Ze.nodeValue,ft=ct.match(Be);if(ft){var He=ct.substring(0,ft.index);Ze.nodeValue=He;var Ne=ct.substring(ft.index+ft[0].length);if(Ne){var Ue=Ze.parentNode;Ue.insertBefore(Qe.createTextNode(Ne),Ze.nextSibling)}Vt(Ze),He||Ze.parentNode.removeChild(Ze)}}}function Vt(Ze){for(;!Ze.nextSibling;)if(Ze=Ze.parentNode,!Ze)return;function Ct(ft,He){var Ne=He?ft.cloneNode(!1):ft,Ue=ft.parentNode;if(Ue){var ge=Ct(Ue,1),Ee=ft.nextSibling;ge.appendChild(Ne);for(var De=Ee;De;De=Ee)Ee=De.nextSibling,ge.appendChild(De)}return Ne}for(var At=Ct(Ze.nextSibling,0),ct;(ct=At.parentNode)&&ct.nodeType===1;)At=ct;Et.push(At)}for(var Qt=0;Qt<Et.length;++Qt)kt(Et[Qt]);ot===(ot|0)&&Et[0].setAttribute("value",ot);var an=Qe.createElement("ol");an.className="linenums";for(var sn=Math.max(0,ot-1|0)||0,Qt=0,qe=Et.length;Qt<qe;++Qt)Ve=Et[Qt],Ve.className="L"+(Qt+sn)%10,Ve.firstChild||Ve.appendChild(Qe.createTextNode("\xA0")),an.appendChild(Ve);je.appendChild(an)}function we(je){var ot=/\bMSIE\s(\d+)/.exec(navigator.userAgent);ot=ot&&+ot[1]<=8;var _t=/\n/g,Re=je.sourceCode,Be=Re.length,Qe=0,Ve=je.spans,Et=Ve.length,kt=0,Vt=je.decorations,Qt=Vt.length,an=0;Vt[Qt]=Be;var sn,qe;for(qe=sn=0;qe<Qt;)Vt[qe]!==Vt[qe+2]?(Vt[sn++]=Vt[qe++],Vt[sn++]=Vt[qe++]):qe+=2;for(Qt=sn,qe=sn=0;qe<Qt;){for(var Ze=Vt[qe],Ct=Vt[qe+1],At=qe+2;At+2<=Qt&&Vt[At+1]===Ct;)At+=2;Vt[sn++]=Ze,Vt[sn++]=Ct,qe=At}Qt=Vt.length=sn;var ct=je.sourceNode,ft="";ct&&(ft=ct.style.display,ct.style.display="none");try{for(var He=null;kt<Et;){var Ne=Ve[kt],Ue=Ve[kt+2]||Be,ge=Vt[an+2]||Be,At=Math.min(Ue,ge),Ee=Ve[kt+1],De;if(Ee.nodeType!==1&&(De=Re.substring(Qe,At))){ot&&(De=De.replace(_t,"\r")),Ee.nodeValue=De;var ue=Ee.ownerDocument,Fe=ue.createElement("span");Fe.className=Vt[an+1];var at=Ee.parentNode;at.replaceChild(Fe,Ee),Fe.appendChild(Ee),Qe<Ue&&(Ve[kt+1]=Ee=ue.createTextNode(Re.substring(At,Ue)),at.insertBefore(Ee,Fe.nextSibling))}Qe=At,Qe>=Ue&&(kt+=2),Qe>=ge&&(an+=2)}}finally{ct&&(ct.style.display=ft)}}var Ae={};function pe(je,ot){for(var _t=ot.length;--_t>=0;){var Re=ot[_t];Ae.hasOwnProperty(Re)?z.console&&console.warn("cannot override language handler %s",Re):Ae[Re]=je}}function be(je,ot){return je&&Ae.hasOwnProperty(je)||(je=/^\s*</.test(ot)?"default-markup":"default-code"),Ae[je]}pe(xe,["default-code"]),pe(le([],[[f,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[I,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[h,/^(?:<[%?]|[%?]>)/],["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"]),pe(le([[f,/^[\s]+/,null,` \r
`],[j,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[C,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[W,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[h,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),pe(le([],[[j,/^[\s\S]+/]]),["uq.val"]),pe(he({keywords:g,hashComments:!0,cStyleComments:!0,types:T}),["c","cc","cpp","cxx","cyc","m"]),pe(he({keywords:"null,true,false"}),["json"]),pe(he({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:T}),["cs"]),pe(he({keywords:p,cStyleComments:!0}),["java"]),pe(he({keywords:o,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),pe(he({keywords:t,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),pe(he({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),pe(he({keywords:u,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),pe(he({keywords:s,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),pe(he({keywords:c,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),pe(le([],[[S,/^[\s\S]+/]]),["regex"]);function ne(je){var ot=je.langExtension;try{var _t=v(je.sourceNode,je.pre),Re=_t.sourceCode;je.sourceCode=Re,je.spans=_t.spans,je.basePos=0,be(ot,Re)(je),we(je)}catch(Be){z.console&&console.log(Be&&Be.stack||Be)}}function fe(je,ot,_t){var Re=_t||!1,Be=ot||null,Qe=document.createElement("div");Qe.innerHTML="<pre>"+je+"</pre>",Qe=Qe.firstChild,Re&&Le(Qe,Re,!0);var Ve={langExtension:Be,numberLines:Re,sourceNode:Qe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ne(Ve),Qe.innerHTML}function _e(je,ot){var _t=ot||document.body,Re=_t.ownerDocument||document;function Be(Ne){return _t.getElementsByTagName(Ne)}for(var Qe=[Be("pre"),Be("code"),Be("xmp")],Ve=[],Et=0;Et<Qe.length;++Et)for(var kt=0,Vt=Qe[Et].length;kt<Vt;++kt)Ve.push(Qe[Et][kt]);Qe=null;var Qt=Date;Qt.now||(Qt={now:function(){return+new Date}});var an=0,sn=/\blang(?:uage)?-([\w.]+)(?!\S)/,qe=/\bprettyprint\b/,Ze=/\bprettyprinted\b/,Ct=/pre|xmp/i,At=/^code$/i,ct=/^(?:pre|code|xmp)$/i,ft={};function He(){for(var Ne=z.PR_SHOULD_USE_CONTINUATION?Qt.now()+250:Infinity;an<Ve.length&&Qt.now()<Ne;an++){for(var Ue=Ve[an],ge=ft,Ee=Ue;Ee=Ee.previousSibling;){var De=Ee.nodeType,ue=(De===7||De===8)&&Ee.nodeValue;if(ue?!/^\??prettify\b/.test(ue):De!==3||/\S/.test(Ee.nodeValue))break;if(ue){ge={},ue.replace(/\b(\w+)=([\w:.%+-]+)/g,function(vr,ir,br){ge[ir]=br});break}}var Fe=Ue.className;if((ge!==ft||qe.test(Fe))&&!Ze.test(Fe)){for(var at=!1,xt=Ue.parentNode;xt;xt=xt.parentNode){var Kt=xt.tagName;if(ct.test(Kt)&&xt.className&&qe.test(xt.className)){at=!0;break}}if(!at){Ue.className+=" prettyprinted";var Xt=ge.lang;if(!Xt){Xt=Fe.match(sn);var $t;!Xt&&($t=ie(Ue))&&At.test($t.tagName)&&(Xt=$t.className.match(sn)),Xt&&(Xt=Xt[1])}var $n;if(Ct.test(Ue.tagName))$n=1;else{var vn=Ue.currentStyle,ln=Re.defaultView,hn=vn?vn.whiteSpace:ln&&ln.getComputedStyle?ln.getComputedStyle(Ue,null).getPropertyValue("white-space"):0;$n=hn&&hn.substring(0,3)==="pre"}var Gn=ge.linenums;(Gn=Gn==="true"||+Gn)||(Gn=Fe.match(/\blinenums\b(?::(\d+))?/),Gn=Gn?Gn[1]&&Gn[1].length?+Gn[1]:!0:!1),Gn&&Le(Ue,Gn,$n);var fr={langExtension:Xt,sourceNode:Ue,numberLines:Gn,pre:$n,sourceCode:null,basePos:null,spans:null,decorations:null};ne(fr)}}}an<Ve.length?z.setTimeout(He,250):typeof je=="function"&&je()}He()}var ke=z.PR={createSimpleLexer:le,registerLangHandler:pe,sourceDecorator:he,PR_ATTRIB_NAME:W,PR_ATTRIB_VALUE:j,PR_COMMENT:I,PR_DECLARATION:E,PR_KEYWORD:A,PR_LITERAL:b,PR_NOCODE:w,PR_PLAIN:f,PR_PUNCTUATION:h,PR_SOURCE:_,PR_STRING:S,PR_TAG:C,PR_TYPE:x,prettyPrintOne:B?z.prettyPrintOne=fe:N=fe,prettyPrint:$=B?z.prettyPrint=_e:$=_e},et=z.define;typeof et=="function"&&et.amd&&et("google-code-prettify",[],function(){return ke})})()},T1X5:function(It,Oe){It.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"},T8No:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return $}),U.d(Oe,"e",function(){return z}),U.d(Oe,"c",function(){return h}),U.d(Oe,"b",function(){return f}),U.d(Oe,"d",function(){return C}),U.d(Oe,"f",function(){return W});var te=U("MNsG"),Q=U("N0LK"),B=U("Cg/j");let J=te.k||"";const K=new Map;K.set("false",!1),K.set("true",!0),K.set("isMac",te.f),K.set("isLinux",te.d),K.set("isWindows",te.i),K.set("isWeb",te.h),K.set("isMacNative",te.f&&!te.h),K.set("isEdge",J.indexOf("Edg/")>=0),K.set("isFirefox",J.indexOf("Firefox")>=0),K.set("isChrome",J.indexOf("Chrome")>=0),K.set("isSafari",J.indexOf("Safari")>=0);const N=Object.prototype.hasOwnProperty;class ${static has(w){return g.create(w)}static equals(w,F){return p.create(w,F)}static regex(w,F){return S.create(w,F)}static not(w){return i.create(w)}static and(...w){return x.create(w,null)}static or(...w){return b.create(w,null,!0)}static deserialize(w,F=!1){return w?this._deserializeOrExpression(w,F):void 0}static _deserializeOrExpression(w,F){let P=w.split("||");return b.create(P.map(v=>this._deserializeAndExpression(v,F)),null,!0)}static _deserializeAndExpression(w,F){let P=w.split("&&");return x.create(P.map(v=>this._deserializeOne(v,F)),null)}static _deserializeOne(w,F){if(w=w.trim(),w.indexOf("!=")>=0){let P=w.split("!=");return s.create(P[0].trim(),this._deserializeValue(P[1],F))}if(w.indexOf("==")>=0){let P=w.split("==");return p.create(P[0].trim(),this._deserializeValue(P[1],F))}if(w.indexOf("=~")>=0){let P=w.split("=~");return S.create(P[0].trim(),this._deserializeRegexValue(P[1],F))}if(w.indexOf(" in ")>=0){let P=w.split(" in ");return a.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(w)){const P=w.split(">=");return o.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(w)){const P=w.split(">");return u.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(w)){const P=w.split("<=");return T.create(P[0].trim(),P[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(w)){const P=w.split("<");return R.create(P[0].trim(),P[1].trim())}return/^\!\s*/.test(w)?i.create(w.substr(1).trim()):g.create(w)}static _deserializeValue(w,F){if(w=w.trim(),w==="true")return!0;if(w==="false")return!1;let P=/^'([^']*)'$/.exec(w);return P?P[1].trim():w}static _deserializeRegexValue(w,F){if(Object(Q.C)(w)){if(F)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let P=w.indexOf("/"),v=w.lastIndexOf("/");if(P===v||P<0){if(F)throw new Error(`bad regexp-value '${w}', missing /-enclosure`);return console.warn(`bad regexp-value '${w}', missing /-enclosure`),null}let H=w.slice(P+1,v),Y=w[v+1]==="i"?"i":"";try{return new RegExp(H,Y)}catch(ie){if(F)throw new Error(`bad regexp-value '${w}', parse error: ${ie}`);return console.warn(`bad regexp-value '${w}', parse error: ${ie}`),null}}}function z(w,F){const P=w?w.substituteConstants():void 0,v=F?F.substituteConstants():void 0;return!P&&!v?!0:!P||!v?!1:P.equals(v)}function r(w,F){return w.cmp(F)}class D{constructor(){this.type=0}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!1}serialize(){return"false"}keys(){return[]}negate(){return m.INSTANCE}}D.INSTANCE=new D;class m{constructor(){this.type=1}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}m.INSTANCE=new m;class g{constructor(w,F){this.key=w,this.negated=F,this.type=2}static create(w,F=null){const P=K.get(w);return typeof P=="boolean"?P?m.INSTANCE:D.INSTANCE:new g(w,F)}cmp(w){return w.type!==this.type?this.type-w.type:E(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=K.get(this.key);return typeof w=="boolean"?w?m.INSTANCE:D.INSTANCE:this}evaluate(w){return!!w.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this)),this.negated}}class p{constructor(w,F,P){this.key=w,this.value=F,this.negated=P,this.type=4}static create(w,F,P=null){if(typeof F=="boolean")return F?g.create(w,P):i.create(w,P);const v=K.get(w);if(typeof v=="boolean"){const H=v?"true":"false";return F===H?m.INSTANCE:D.INSTANCE}return new p(w,F,P)}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=K.get(this.key);if(typeof w=="boolean"){const F=w?"true":"false";return this.value===F?m.INSTANCE:D.INSTANCE}return this}evaluate(w){return w.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this.value,this)),this.negated}}class a{constructor(w,F){this.key=w,this.valueKey=F,this.type=10,this.negated=null}static create(w,F){return new a(w,F)}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.valueKey,w.key,w.valueKey)}equals(w){return w.type===this.type?this.key===w.key&&this.valueKey===w.valueKey:!1}substituteConstants(){return this}evaluate(w){const F=w.getValue(this.valueKey),P=w.getValue(this.key);return Array.isArray(F)?F.indexOf(P)>=0:typeof P=="string"&&typeof F=="object"&&F!==null?N.call(F,P):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=c.create(this)),this.negated}}class c{constructor(w){this._actual=w,this.type=11}static create(w){return new c(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class s{constructor(w,F,P){this.key=w,this.value=F,this.negated=P,this.type=5}static create(w,F,P=null){if(typeof F=="boolean")return F?i.create(w,P):g.create(w,P);const v=K.get(w);if(typeof v=="boolean"){const H=v?"true":"false";return F===H?D.INSTANCE:m.INSTANCE}return new s(w,F,P)}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=K.get(this.key);if(typeof w=="boolean"){const F=w?"true":"false";return this.value===F?D.INSTANCE:m.INSTANCE}return this}evaluate(w){return w.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this.value,this)),this.negated}}class i{constructor(w,F){this.key=w,this.negated=F,this.type=3}static create(w,F=null){const P=K.get(w);return typeof P=="boolean"?P?D.INSTANCE:m.INSTANCE:new i(w,F)}cmp(w){return w.type!==this.type?this.type-w.type:E(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=K.get(this.key);return typeof w=="boolean"?w?D.INSTANCE:m.INSTANCE:this}evaluate(w){return!w.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=g.create(this.key,this)),this.negated}}function t(w,F){if(typeof w=="string"){const P=parseFloat(w);isNaN(P)||(w=P)}return typeof w=="string"||typeof w=="number"?F(w):D.INSTANCE}class u{constructor(w,F,P){this.key=w,this.value=F,this.negated=P,this.type=12}static create(w,F,P=null){return t(F,v=>new u(w,v,P))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=T.create(this.key,this.value,this)),this.negated}}class o{constructor(w,F,P){this.key=w,this.value=F,this.negated=P,this.type=13}static create(w,F,P=null){return t(F,v=>new o(w,v,P))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=R.create(this.key,this.value,this)),this.negated}}class R{constructor(w,F,P){this.key=w,this.value=F,this.negated=P,this.type=14}static create(w,F,P=null){return t(F,v=>new R(w,v,P))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class T{constructor(w,F,P){this.key=w,this.value=F,this.negated=P,this.type=15}static create(w,F,P=null){return t(F,v=>new T(w,v,P))}cmp(w){return w.type!==this.type?this.type-w.type:_(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class S{constructor(w,F){this.key=w,this.regexp=F,this.type=7,this.negated=null}static create(w,F){return new S(w,F)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.key<w.key)return-1;if(this.key>w.key)return 1;const F=this.regexp?this.regexp.source:"",P=w.regexp?w.regexp.source:"";return F<P?-1:F>P?1:0}equals(w){if(w.type===this.type){const F=this.regexp?this.regexp.source:"",P=w.regexp?w.regexp.source:"";return this.key===w.key&&F===P}return!1}substituteConstants(){return this}evaluate(w){let F=w.getValue(this.key);return this.regexp?this.regexp.test(F):!1}serialize(){const w=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${w}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=A.create(this)),this.negated}}class A{constructor(w){this._actual=w,this.type=8}static create(w){return new A(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function I(w){let F=null;for(let P=0,v=w.length;P<v;P++){const H=w[P].substituteConstants();if(w[P]!==H&&F===null){F=[];for(let Y=0;Y<P;Y++)F[Y]=w[Y]}F!==null&&(F[P]=H)}return F===null?w:F}class x{constructor(w,F){this.expr=w,this.negated=F,this.type=6}static create(w,F){return x._normalizeArr(w,F)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let F=0,P=this.expr.length;F<P;F++){const v=r(this.expr[F],w.expr[F]);if(v!==0)return v}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let F=0,P=this.expr.length;F<P;F++)if(!this.expr[F].equals(w.expr[F]))return!1;return!0}return!1}substituteConstants(){const w=I(this.expr);return w===this.expr?this:x.create(w,this.negated)}evaluate(w){for(let F=0,P=this.expr.length;F<P;F++)if(!this.expr[F].evaluate(w))return!1;return!0}static _normalizeArr(w,F){const P=[];let v=!1;for(const H of w){if(!H)continue;if(H.type===1){v=!0;continue}if(H.type===0)return D.INSTANCE;if(H.type===6){P.push(...H.expr);continue}P.push(H)}if(P.length===0&&v)return m.INSTANCE;if(P.length===0)return;if(P.length===1)return P[0];P.sort(r);for(let H=1;H<P.length;H++)P[H-1].equals(P[H])&&(P.splice(H,1),H--);if(P.length===1)return P[0];for(;P.length>1;){const H=P[P.length-1];if(H.type!==9)break;P.pop();const Y=P.pop(),ie=P.length===0,le=b.create(H.expr.map(he=>x.create([he,Y],null)),null,ie);le&&(P.push(le),P.sort(r))}return P.length===1?P[0]:new x(P,F)}serialize(){return this.expr.map(w=>w.serialize()).join(" && ")}keys(){const w=[];for(let F of this.expr)w.push(...F.keys());return w}negate(){if(!this.negated){const w=[];for(let F of this.expr)w.push(F.negate());this.negated=b.create(w,this,!0)}return this.negated}}class b{constructor(w,F){this.expr=w,this.negated=F,this.type=9}static create(w,F,P){return b._normalizeArr(w,F,P)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let F=0,P=this.expr.length;F<P;F++){const v=r(this.expr[F],w.expr[F]);if(v!==0)return v}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let F=0,P=this.expr.length;F<P;F++)if(!this.expr[F].equals(w.expr[F]))return!1;return!0}return!1}substituteConstants(){const w=I(this.expr);return w===this.expr?this:b.create(w,this.negated,!1)}evaluate(w){for(let F=0,P=this.expr.length;F<P;F++)if(this.expr[F].evaluate(w))return!0;return!1}static _normalizeArr(w,F,P){let v=[],H=!1;if(w){for(let Y=0,ie=w.length;Y<ie;Y++){const le=w[Y];if(!le)continue;if(le.type===0){H=!0;continue}if(le.type===1)return m.INSTANCE;if(le.type===9){v=v.concat(le.expr);continue}v.push(le)}if(v.length===0&&H)return D.INSTANCE;v.sort(r)}if(v.length===0)return;if(v.length===1)return v[0];for(let Y=1;Y<v.length;Y++)v[Y-1].equals(v[Y])&&(v.splice(Y,1),Y--);if(v.length===1)return v[0];if(P){for(let Y=0;Y<v.length;Y++)for(let ie=Y+1;ie<v.length;ie++)W(v[Y],v[ie])&&(v.splice(ie,1),ie--);if(v.length===1)return v[0]}return new b(v,F)}serialize(){return this.expr.map(w=>w.serialize()).join(" || ")}keys(){const w=[];for(let F of this.expr)w.push(...F.keys());return w}negate(){if(!this.negated){let w=[];for(let F of this.expr)w.push(F.negate());for(;w.length>1;){const F=w.shift(),P=w.shift(),v=[];for(const Y of j(F))for(const ie of j(P))v.push(x.create([Y,ie],null));const H=w.length===0;w.unshift(b.create(v,null,H))}this.negated=w[0]}return this.negated}}class h extends g{constructor(w,F,P){super(w,null);this._defaultValue=F,typeof P=="object"?h._info.push(Object.assign(Object.assign({},P),{key:w})):P!==!0&&h._info.push({key:w,description:P,type:F!=null?typeof F:void 0})}static all(){return h._info.values()}bindTo(w){return w.createKey(this.key,this._defaultValue)}getValue(w){return w.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(w){return p.create(this.key,w)}}h._info=[];const f=Object(B.c)("contextKeyService"),C="setContext";function E(w,F){return w<F?-1:w>F?1:0}function _(w,F,P,v){return w<P?-1:w>P?1:F<v?-1:F>v?1:0}function W(w,F){if(F.type===6&&w.type!==9&&w.type!==6){for(const H of F.expr)if(w.equals(H))return!0}const P=w.negate(),v=j(P).concat(j(F));v.sort(r);for(let H=0;H<v.length;H++){const Y=v[H],ie=Y.negate();for(let le=H+1;le<v.length;le++){const he=v[le];if(ie.equals(he))return!0}}return!1}function j(w){return w.type===9?w.expr:[w]}},TXwP:function(It,Oe,U){var te,Q;(function(){var B;(function(){"use strict";var K=[,,function(r){function D(p){this.__parent=p,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 p=new D(this.__parent);return p.set_indent(this.__indent_count,this.__alignment_count),p},D.prototype.item=function(p){return p<0?this.__items[this.__items.length+p]:this.__items[p]},D.prototype.has_match=function(p){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(p))return!0;return!1},D.prototype.set_indent=function(p,a){this.is_empty()&&(this.__indent_count=p||0,this.__alignment_count=a||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 p=this.__parent.current_line;return p.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),p.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),p.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,p.__items[0]===" "&&(p.__items.splice(0,1),p.__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(p){this.__items.push(p);var a=p.lastIndexOf(`
`);a!==-1?this.__character_count=p.length-a:this.__character_count+=p.length},D.prototype.pop=function(){var p=null;return this.is_empty()||(p=this.__items.pop(),this.__character_count-=p.length),p},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 p="";return this.is_empty()?this.__parent.indent_empty_lines&&(p=this.__parent.get_indent_string(this.__indent_count)):(p=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),p+=this.__items.join("")),p};function m(p,a){this.__cache=[""],this.__indent_size=p.indent_size,this.__indent_string=p.indent_char,p.indent_with_tabs||(this.__indent_string=new Array(p.indent_size+1).join(p.indent_char)),a=a||"",p.indent_level>0&&(a=new Array(p.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}m.prototype.get_indent_size=function(p,a){var c=this.__base_string_length;return a=a||0,p<0&&(c=0),c+=p*this.__indent_size,c+=a,c},m.prototype.get_indent_string=function(p,a){var c=this.__base_string;return a=a||0,p<0&&(p=0,c=""),a+=p*this.__indent_size,this.__ensure_cache(a),c+=this.__cache[a],c},m.prototype.__ensure_cache=function(p){for(;p>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var p=this.__cache.length,a=0,c="";this.__indent_size&&p>=this.__indent_size&&(a=Math.floor(p/this.__indent_size),p-=a*this.__indent_size,c=new Array(a+1).join(this.__indent_string)),p&&(c+=new Array(p+1).join(" ")),this.__cache.push(c)};function g(p,a){this.__indent_cache=new m(p,a),this.raw=!1,this._end_with_newline=p.end_with_newline,this.indent_size=p.indent_size,this.wrap_line_length=p.wrap_line_length,this.indent_empty_lines=p.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(p,a){return this.__indent_cache.get_indent_string(p,a)},g.prototype.get_indent_size=function(p,a){return this.__indent_cache.get_indent_size(p,a)},g.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},g.prototype.add_new_line=function(p){return this.is_empty()||!p&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},g.prototype.get_code=function(p){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 c=this.__lines.join(`
`);return p!==`
`&&(c=c.replace(/[\n]/g,p)),c},g.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},g.prototype.set_indent=function(p,a){return p=p||0,a=a||0,this.next_line.set_indent(p,a),this.__lines.length>1?(this.current_line.set_indent(p,a),!0):(this.current_line.set_indent(),!1)},g.prototype.add_raw_token=function(p){for(var a=0;a<p.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(p.whitespace_before),this.current_line.push(p.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},g.prototype.add_token=function(p){this.__add_space_before_token(),this.current_line.push(p),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(p){for(var a=this.__lines.length;p<a;)this.__lines[p]._remove_indent(),p++;this.current_line._remove_wrap_indent()},g.prototype.trim=function(p){for(p=p===void 0?!1:p,this.current_line.trim();p&&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(p,a){for(var c=this.__lines.length-2;c>=0;){var s=this.__lines[c];if(s.is_empty())break;if(s.item(0).indexOf(p)!==0&&s.item(-1)!==a){this.__lines.splice(c+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}c--}},r.exports.Output=g},,,,function(r){function D(p,a){this.raw_options=m(p,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"])}D.prototype._get_array=function(p,a){var c=this.raw_options[p],s=a||[];return typeof c=="object"?c!==null&&typeof c.concat=="function"&&(s=c.concat()):typeof c=="string"&&(s=c.split(/[^a-zA-Z0-9_\/\-]+/)),s},D.prototype._get_boolean=function(p,a){var c=this.raw_options[p],s=c===void 0?!!a:!!c;return s},D.prototype._get_characters=function(p,a){var c=this.raw_options[p],s=a||"";return typeof c=="string"&&(s=c.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),s},D.prototype._get_number=function(p,a){var c=this.raw_options[p];a=parseInt(a,10),isNaN(a)&&(a=0);var s=parseInt(c,10);return isNaN(s)&&(s=a),s},D.prototype._get_selection=function(p,a,c){var s=this._get_selection_list(p,a,c);if(s.length!==1)throw new Error("Invalid Option Value: The option '"+p+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[p]+"'");return s[0]},D.prototype._get_selection_list=function(p,a,c){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(c=c||[a[0]],!this._is_valid_selection(c,a))throw new Error("Invalid Default Value!");var s=this._get_array(p,c);if(!this._is_valid_selection(s,a))throw new Error("Invalid Option Value: The option '"+p+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[p]+"'");return s},D.prototype._is_valid_selection=function(p,a){return p.length&&a.length&&!p.some(function(c){return a.indexOf(c)===-1})};function m(p,a){var c={};p=g(p);var s;for(s in p)s!==a&&(c[s]=p[s]);if(a&&p[a])for(s in p[a])c[s]=p[a][s];return c}function g(p){var a={},c;for(c in p){var s=c.replace(/-/g,"_");a[s]=p[c]}return a}r.exports.Options=D,r.exports.normalizeOpts=g,r.exports.mergeOpts=m},,function(r){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 p=null;return g=g||0,g+=this.__position,g>=0&&g<this.__input_length&&(p=this.__input.charAt(g)),p},m.prototype.__match=function(g,p){g.lastIndex=p;var a=g.exec(this.__input);return a&&!(D&&g.sticky)&&(a.index!==p&&(a=null)),a},m.prototype.test=function(g,p){return p=p||0,p+=this.__position,p>=0&&p<this.__input_length?!!this.__match(g,p):!1},m.prototype.testChar=function(g,p){var a=this.peek(p);return g.lastIndex=0,a!==null&&g.test(a)},m.prototype.match=function(g){var p=this.__match(g,this.__position);return p?this.__position+=p[0].length:p=null,p},m.prototype.read=function(g,p,a){var c="",s;return g&&(s=this.match(g),s&&(c+=s[0])),p&&(s||!g)&&(c+=this.readUntil(p,a)),c},m.prototype.readUntil=function(g,p){var a="",c=this.__position;g.lastIndex=this.__position;var s=g.exec(this.__input);return s?(c=s.index,p&&(c+=s[0].length)):c=this.__input_length,a=this.__input.substring(this.__position,c),this.__position=c,a},m.prototype.readUntilAfter=function(g){return this.readUntil(g,!0)},m.prototype.get_regexp=function(g,p){var a=null,c="g";return p&&D&&(c="y"),typeof g=="string"&&g!==""?a=new RegExp(g,c):g&&(a=new RegExp(g.source,c)),a},m.prototype.get_literal_regexp=function(g){return RegExp(g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},m.prototype.peekUntilAfter=function(g){var p=this.__position,a=this.readUntilAfter(g);return this.__position=p,a},m.prototype.lookBack=function(g){var p=this.__position-1;return p>=g.length&&this.__input.substring(p-g.length,p).toLowerCase()===g},r.exports.InputScanner=m},,,,,function(r){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 p=this.__directive_pattern.exec(m);p;)g[p[1]]=p[2],p=this.__directive_pattern.exec(m);return g},D.prototype.readIgnored=function(m){return m.readUntilAfter(this.__directives_end_ignore_pattern)},r.exports.Directives=D},,function(r,D,m){var g=m(16).Beautifier,p=m(17).Options;function a(c,s){var i=new g(c,s);return i.beautify()}r.exports=a,r.exports.defaultOptions=function(){return new p}},function(r,D,m){var g=m(17).Options,p=m(2).Output,a=m(8).InputScanner,c=m(13).Directives,s=new c(/\/\*/,/\*\//),i=/\r\n|[\r\n]/,t=/\r\n|[\r\n]/g,u=/\s/,o=/(?:\s|\n)+/g,R=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,T=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(A,I){this._source_text=A||"",this._options=new g(I),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"]}S.prototype.eatString=function(A){var I="";for(this._ch=this._input.next();this._ch;){if(I+=this._ch,this._ch==="\\")I+=this._input.next();else if(A.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return I},S.prototype.eatWhitespace=function(A){for(var I=u.test(this._input.peek()),x=0;u.test(this._input.peek());)this._ch=this._input.next(),A&&this._ch===`
`&&((x===0||x<this._options.max_preserve_newlines)&&(x++,this._output.add_new_line(!0)));return I},S.prototype.foundNestedPseudoClass=function(){for(var A=0,I=1,x=this._input.peek(I);x;){if(x==="{")return!0;if(x==="(")A+=1;else if(x===")"){if(A===0)return!1;A-=1}else if(x===";"||x==="}")return!1;I++,x=this._input.peek(I)}return!1},S.prototype.print_string=function(A){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(A)},S.prototype.preserveSingleSpace=function(A){A&&(this._output.space_before_token=!0)},S.prototype.indent=function(){this._indentLevel++},S.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var A=this._source_text,I=this._options.eol;I==="auto"&&(I=`
`,A&&i.test(A||"")&&(I=A.match(i)[0])),A=A.replace(t,`
`);var x=A.match(/^[\t ]*/)[0];this._output=new p(this._options,x),this._input=new a(A),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var b=0,h=!1,f=!1,C=!1,E=!1,_=!1,W=!1,j=this._ch,w=!1,F,P,v;F=this._input.read(o),P=F!=="",v=j,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),j=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var H=this._input.read(R),Y=s.get_directives(H);Y&&Y.ignore==="start"&&(H+=s.readIgnored(this._input)),this.print_string(H),this.eatWhitespace(!0),this._output.add_new_line()}else if(this._ch==="/"&&this._input.peek()==="/")this._output.space_before_token=!0,this._input.back(),this.print_string(this._input.read(T)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(P),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ie=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ie.match(/[ :]$/)&&(ie=this.eatString(": ").replace(/\s$/,""),this.print_string(ie),this._output.space_before_token=!0),ie=ie.replace(/\s$/,""),ie==="extend"?E=!0:ie==="import"&&(_=!0),ie in this.NESTED_AT_RULE?(this._nestedLevel+=1,ie in this.CONDITIONAL_GROUP_RULE&&(C=!0)):!h&&b===0&&ie.indexOf(":")!==-1&&(f=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(P),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")f&&(f=!1,this.outdent()),C?(C=!1,h=this._indentLevel>=this._nestedLevel):h=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&h&&(this._output.previous_line&&this._output.previous_line.item(-1)!=="{"&&this._output.ensure_empty_line_above("/",",")),this._output.space_before_token=!0,this._options.brace_style==="expand"?(this._output.add_new_line(),this.print_string(this._ch),this.indent(),this._output.set_indent(this._indentLevel)):(v==="("?this._output.space_before_token=!1:v!==","&&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(),v==="{"&&this._output.trim(!0),_=!1,E=!1,f&&(this.outdent(),f=!1),this.print_string(this._ch),h=!1,this._nestedLevel&&this._nestedLevel--,this.eatWhitespace(!0),this._output.add_new_line(),this._options.newline_between_rules&&!this._output.just_added_blankline()&&(this._input.peek()!=="}"&&this._output.add_new_line(!0)),this._input.peek()===")"&&(this._output.trim(!0),this._options.brace_style==="expand"&&this._output.add_new_line(!0));else if(this._ch===":"){for(var le=0;le<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;le++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[le])){w=!0;break}(h||C)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!E&&b===0?(this.print_string(":"),f||(f=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var he=v==='"'||v==="'";this.preserveSingleSpace(he||P),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")w=!1,b===0?(f&&(this.outdent(),f=!1),E=!1,_=!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(),b++,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(")")),b&&(b--,this.outdent()));else{var xe=!1;this._input.lookBack("with")&&(xe=!0),this.preserveSingleSpace(P||xe),this.print_string(this._ch),f&&v==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),W=!0):(this.eatWhitespace(),b++,this.indent())}else if(this._ch===")")b&&(b--,this.outdent()),W&&this._input.peek()===";"&&this._options.selector_separator_newline&&(W=!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&&(!f||W)&&b===0&&!_&&!E?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!f&&b===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&&u.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("="),u.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 Le=v==='"'||v==="'";this.preserveSingleSpace(Le||P),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&w&&this._output.add_new_line()}var we=this._output.get_code(I);return we},r.exports.Beautifier=S},function(r,D,m){var g=m(6).Options;function p(a){g.call(this,a,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var c=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||c;var s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var i=0;i<s.length;i++)s[i]!=="expand"?this.brace_style="collapse":this.brace_style=s[i]}p.prototype=new g,r.exports.Options=p}],N={};function $(r){var D=N[r];if(D!==void 0)return D.exports;var m=N[r]={exports:{}};return K[r](m,m.exports,$),m.exports}var z=$(15);B=z})();var J=B;!(te=[],Q=function(){return{css_beautify:J}}.apply(Oe,te),Q!==void 0&&(It.exports=Q))})()},VYcG:function(It,Oe,U){"use strict";U.r(Oe),U.d(Oe,"useCourseOptions",function(){return P});var te=U("T2oS"),Q=U("W9HT"),B=U("+L6B"),J=U("2/Rp"),K=U("7Kak"),N=U("9yH6"),$=U("giR+"),z=U("fyUT"),r=U("5NDa"),D=U("5rEg"),m=U("6UJt"),g=U("DFOY"),p=U("14J3"),a=U("BMrR"),c=U("jCWc"),s=U("kPKH"),i=U("sPJy"),t=U("bE4q"),u=U("k1fw"),o=U("rAM+"),R=U("y8nQ"),T=U("Vl3Y"),S=U("9og8"),A=U("tJVT"),I=U("WmNS"),x=U.n(I),b=U("q1tI"),h=U.n(b),f=U("Ty5D"),C=U("55Ip"),E=U("9kvl"),_=U("Pxm8"),W=U.n(_),j=U("vCeJ"),w=U("6fQ5"),F=U("ZWs3"),P=function(){var Y=Object(b.useState)([]),ie=Object(A.a)(Y,2),le=ie[0],he=ie[1];return Object(b.useEffect)(function(){var xe=function(){var Le=Object(S.a)(x.a.mark(function we(){var Ae;return x.a.wrap(function(be){for(;;)switch(be.prev=be.next){case 0:return be.next=2,Object(j.k)({source:"new_question"});case 2:Ae=be.sent,Ae!=null&&Ae.disciplines&&he(Object(w.a)(Ae==null?void 0:Ae.disciplines));case 4:case"end":return be.stop()}},we)}));return function(){return Le.apply(this,arguments)}}();xe()},[]),le},v=function(Y){var ie=Y.user,le=Object(f.i)(),he=P(),xe=T.a.useForm(),Le=Object(A.a)(xe,1),we=Le[0],Ae=Object(b.useState)(),pe=Object(A.a)(Ae,2),be=pe[0],ne=pe[1],fe=Object(b.useState)(!1),_e=Object(A.a)(fe,2),ke=_e[0],et=_e[1];return Object(b.useEffect)(function(){if(le.id){var je=function(){var ot=Object(S.a)(x.a.mark(function _t(){var Re,Be,Qe,Ve,Et,kt,Vt,Qt,an,sn,qe,Ze,Ct;return x.a.wrap(function(ct){for(;;)switch(ct.prev=ct.next){case 0:return et(!0),ct.next=3,Object(j.l)({id:le.id});case 3:Qe=ct.sent,et(!1),Ve=Qe==null||((Re=Qe.exercise)===null||Re===void 0)?void 0:Re.sub_discipline_id,Et=[],kt=Object(o.a)(he);try{for(kt.s();!(Vt=kt.n()).done;){Qt=Vt.value,an=Object(o.a)(Qt.children);try{for(an.s();!(sn=an.n()).done;)qe=sn.value,qe.value===Ve&&(Et=[Qt.value,qe.value])}catch(ft){an.e(ft)}finally{an.f()}}}catch(ft){kt.e(ft)}finally{kt.f()}Ze=Qe==null||((Be=Qe.exercise)===null||Be===void 0)?void 0:Be.time,Ct=Object(u.a)(Object(u.a)({},Qe.exercise),{},{sub_discipline_id:Et,time:Ze===-1?null:Ze}),ne(Ct);case 12:case"end":return ct.stop()}},_t)}));return function(){return ot.apply(this,arguments)}}();if(!he.length)return;je()}else ne({})},[he]),h.a.createElement("section",{className:"edu-container"},h.a.createElement("section",{className:"animated fadeIn"},h.a.createElement("aside",{className:"mt10"},h.a.createElement(t.a,{separator:">"},h.a.createElement(t.a.Item,null,h.a.createElement(C.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),h.a.createElement(t.a.Item,null,"\u65B0\u5EFA\u8BD5\u5377"))),h.a.createElement("aside",{className:"".concat(W.a.title," mt20")},h.a.createElement(a.a,null,h.a.createElement(s.a,{flex:"1"},h.a.createElement("strong",{className:"font20 ml5"},"\u65B0\u5EFA\u8BD5\u5377"))))),h.a.createElement(Q.a,{spinning:ke,size:"large",style:{position:"fixed",maxHeight:"100vh"},className:"mt30"},h.a.createElement("section",{className:[W.a.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},be&&h.a.createElement(T.a,{layout:"vertical",form:we,className:W.a.formWrap,initialValues:be},h.a.createElement(T.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"}]},h.a.createElement(g.a,{placeholder:"\u8BF7\u9009\u62E9...",options:he})),h.a.createElement(T.a.Item,{name:"exercise_name",label:"\u8BD5\u5377\u540D\u79F0",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},h.a.createElement(D.a,{maxLength:60,placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),h.a.createElement(T.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F",style:{width:"300px"}},h.a.createElement("div",{style:{display:"flex"}},h.a.createElement(z.a,{min:1,max:9999,maxLength:60,placeholder:"\u8BF7\u586B\u5199\u7B54\u9898\u65F6\u957F"}),h.a.createElement("span",{style:{marginLeft:"10px",width:"40px",lineHeight:"32px"}},"\u5206\u949F"))),h.a.createElement(T.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},h.a.createElement(N.a.Group,null,h.a.createElement(N.a.Button,{value:1},"\u7B80\u5355"),h.a.createElement(N.a.Button,{value:2},"\u9002\u4E2D"),h.a.createElement(N.a.Button,{value:3},"\u56F0\u96BE"))),h.a.createElement(T.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},h.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"})))),h.a.createElement("div",{className:["mt20","pb20","pt20"].join(" ")},h.a.createElement(J.a,{style:{marginRight:"5px"},onClick:function(){E.d.push("/paperlibrary")}},"\u53D6\u6D88"),h.a.createElement(F.a,{onClick:Object(S.a)(x.a.mark(function je(){var ot,_t,Re,Be;return x.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return Ve.next=2,we.validateFields();case 2:if(ot=we.getFieldsValue(),ot.sub_discipline_id=ot.sub_discipline_id[1],!le.id){Ve.next=10;break}return Ve.next=7,Object(j.z)(Object(u.a)({id:le.id},ot));case 7:return _t=Ve.sent,_t.status===0&&E.d.push("/paperlibrary/edit/".concat(le.id,"?fromadd=1")),Ve.abrupt("return");case 10:return Ve.next=12,Object(j.e)(ot);case 12:Re=Ve.sent,Re.status===0&&E.d.push("/paperlibrary/edit/".concat(Re==null||((Be=Re.data)===null||Be===void 0)?void 0:Be.exam_id,"?fromadd=1"));case 14:case"end":return Ve.stop()}},je)})),type:"primary",style:{marginLeft:"5px"}},"\u786E\u5B9A"))))};Oe.default=Object(E.a)(function(H){var Y=H.user;return{user:Y}})(v)},Vhoy:function(It,Oe,U){"use strict";U.d(Oe,"d",function(){return J}),U.d(Oe,"e",function(){return K}),U.d(Oe,"c",function(){return N}),U.d(Oe,"b",function(){return $}),U.d(Oe,"a",function(){return z});var te=U("MI8n");class Q{constructor(){this._icons=new Map,this._onDidRegister=new te.b}add(r){const D=this._icons.get(r.id);D?r.description?D.description=r.description:console.error(`Duplicate registration of codicon ${r.id}`):(this._icons.set(r.id,r),this._onDidRegister.fire(r))}get(r){return this._icons.get(r)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const B=new Q,J=B;function K(r,D){return new $(r,D)}function N(r){return r?r.replace(/\$\((.*?)\)/g,(D,m)=>` ${m} `).trim():""}class ${constructor(r,D,m){this.id=r,this.definition=D,this.description=m,B.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var z;(function(r){r.iconNameSegment="[A-Za-z0-9]+",r.iconNameExpression="[A-Za-z0-9\\-]+",r.iconModifierExpression="~[A-Za-z]+";const D=new RegExp(`^(${r.iconNameExpression})(${r.iconModifierExpression})?$`);function m(a){if(a instanceof $)return["codicon","codicon-"+a.id];const c=D.exec(a.id);if(!c)return m($.error);let[,s,i]=c;const t=["codicon","codicon-"+s];return i&&t.push("codicon-modifier-"+i.substr(1)),t}r.asClassNameArray=m;function g(a){return m(a).join(" ")}r.asClassName=g;function p(a){return"."+m(a).join(".")}r.asCSSSelector=p})(z||(z={})),function(r){r.add=new r("add",{fontCharacter:"\\ea60"}),r.plus=new r("plus",r.add.definition),r.gistNew=new r("gist-new",r.add.definition),r.repoCreate=new r("repo-create",r.add.definition),r.lightbulb=new r("lightbulb",{fontCharacter:"\\ea61"}),r.lightBulb=new r("light-bulb",{fontCharacter:"\\ea61"}),r.repo=new r("repo",{fontCharacter:"\\ea62"}),r.repoDelete=new r("repo-delete",{fontCharacter:"\\ea62"}),r.gistFork=new r("gist-fork",{fontCharacter:"\\ea63"}),r.repoForked=new r("repo-forked",{fontCharacter:"\\ea63"}),r.gitPullRequest=new r("git-pull-request",{fontCharacter:"\\ea64"}),r.gitPullRequestAbandoned=new r("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),r.recordKeys=new r("record-keys",{fontCharacter:"\\ea65"}),r.keyboard=new r("keyboard",{fontCharacter:"\\ea65"}),r.tag=new r("tag",{fontCharacter:"\\ea66"}),r.tagAdd=new r("tag-add",{fontCharacter:"\\ea66"}),r.tagRemove=new r("tag-remove",{fontCharacter:"\\ea66"}),r.person=new r("person",{fontCharacter:"\\ea67"}),r.personFollow=new r("person-follow",{fontCharacter:"\\ea67"}),r.personOutline=new r("person-outline",{fontCharacter:"\\ea67"}),r.personFilled=new r("person-filled",{fontCharacter:"\\ea67"}),r.gitBranch=new r("git-branch",{fontCharacter:"\\ea68"}),r.gitBranchCreate=new r("git-branch-create",{fontCharacter:"\\ea68"}),r.gitBranchDelete=new r("git-branch-delete",{fontCharacter:"\\ea68"}),r.sourceControl=new r("source-control",{fontCharacter:"\\ea68"}),r.mirror=new r("mirror",{fontCharacter:"\\ea69"}),r.mirrorPublic=new r("mirror-public",{fontCharacter:"\\ea69"}),r.star=new r("star",{fontCharacter:"\\ea6a"}),r.starAdd=new r("star-add",{fontCharacter:"\\ea6a"}),r.starDelete=new r("star-delete",{fontCharacter:"\\ea6a"}),r.starEmpty=new r("star-empty",{fontCharacter:"\\ea6a"}),r.comment=new r("comment",{fontCharacter:"\\ea6b"}),r.commentAdd=new r("comment-add",{fontCharacter:"\\ea6b"}),r.alert=new r("alert",{fontCharacter:"\\ea6c"}),r.warning=new r("warning",{fontCharacter:"\\ea6c"}),r.search=new r("search",{fontCharacter:"\\ea6d"}),r.searchSave=new r("search-save",{fontCharacter:"\\ea6d"}),r.logOut=new r("log-out",{fontCharacter:"\\ea6e"}),r.signOut=new r("sign-out",{fontCharacter:"\\ea6e"}),r.logIn=new r("log-in",{fontCharacter:"\\ea6f"}),r.signIn=new r("sign-in",{fontCharacter:"\\ea6f"}),r.eye=new r("eye",{fontCharacter:"\\ea70"}),r.eyeUnwatch=new r("eye-unwatch",{fontCharacter:"\\ea70"}),r.eyeWatch=new r("eye-watch",{fontCharacter:"\\ea70"}),r.circleFilled=new r("circle-filled",{fontCharacter:"\\ea71"}),r.primitiveDot=new r("primitive-dot",{fontCharacter:"\\ea71"}),r.closeDirty=new r("close-dirty",{fontCharacter:"\\ea71"}),r.debugBreakpoint=new r("debug-breakpoint",{fontCharacter:"\\ea71"}),r.debugBreakpointDisabled=new r("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),r.debugHint=new r("debug-hint",{fontCharacter:"\\ea71"}),r.primitiveSquare=new r("primitive-square",{fontCharacter:"\\ea72"}),r.edit=new r("edit",{fontCharacter:"\\ea73"}),r.pencil=new r("pencil",{fontCharacter:"\\ea73"}),r.info=new r("info",{fontCharacter:"\\ea74"}),r.issueOpened=new r("issue-opened",{fontCharacter:"\\ea74"}),r.gistPrivate=new r("gist-private",{fontCharacter:"\\ea75"}),r.gitForkPrivate=new r("git-fork-private",{fontCharacter:"\\ea75"}),r.lock=new r("lock",{fontCharacter:"\\ea75"}),r.mirrorPrivate=new r("mirror-private",{fontCharacter:"\\ea75"}),r.close=new r("close",{fontCharacter:"\\ea76"}),r.removeClose=new r("remove-close",{fontCharacter:"\\ea76"}),r.x=new r("x",{fontCharacter:"\\ea76"}),r.repoSync=new r("repo-sync",{fontCharacter:"\\ea77"}),r.sync=new r("sync",{fontCharacter:"\\ea77"}),r.clone=new r("clone",{fontCharacter:"\\ea78"}),r.desktopDownload=new r("desktop-download",{fontCharacter:"\\ea78"}),r.beaker=new r("beaker",{fontCharacter:"\\ea79"}),r.microscope=new r("microscope",{fontCharacter:"\\ea79"}),r.vm=new r("vm",{fontCharacter:"\\ea7a"}),r.deviceDesktop=new r("device-desktop",{fontCharacter:"\\ea7a"}),r.file=new r("file",{fontCharacter:"\\ea7b"}),r.fileText=new r("file-text",{fontCharacter:"\\ea7b"}),r.more=new r("more",{fontCharacter:"\\ea7c"}),r.ellipsis=new r("ellipsis",{fontCharacter:"\\ea7c"}),r.kebabHorizontal=new r("kebab-horizontal",{fontCharacter:"\\ea7c"}),r.mailReply=new r("mail-reply",{fontCharacter:"\\ea7d"}),r.reply=new r("reply",{fontCharacter:"\\ea7d"}),r.organization=new r("organization",{fontCharacter:"\\ea7e"}),r.organizationFilled=new r("organization-filled",{fontCharacter:"\\ea7e"}),r.organizationOutline=new r("organization-outline",{fontCharacter:"\\ea7e"}),r.newFile=new r("new-file",{fontCharacter:"\\ea7f"}),r.fileAdd=new r("file-add",{fontCharacter:"\\ea7f"}),r.newFolder=new r("new-folder",{fontCharacter:"\\ea80"}),r.fileDirectoryCreate=new r("file-directory-create",{fontCharacter:"\\ea80"}),r.trash=new r("trash",{fontCharacter:"\\ea81"}),r.trashcan=new r("trashcan",{fontCharacter:"\\ea81"}),r.history=new r("history",{fontCharacter:"\\ea82"}),r.clock=new r("clock",{fontCharacter:"\\ea82"}),r.folder=new r("folder",{fontCharacter:"\\ea83"}),r.fileDirectory=new r("file-directory",{fontCharacter:"\\ea83"}),r.symbolFolder=new r("symbol-folder",{fontCharacter:"\\ea83"}),r.logoGithub=new r("logo-github",{fontCharacter:"\\ea84"}),r.markGithub=new r("mark-github",{fontCharacter:"\\ea84"}),r.github=new r("github",{fontCharacter:"\\ea84"}),r.terminal=new r("terminal",{fontCharacter:"\\ea85"}),r.console=new r("console",{fontCharacter:"\\ea85"}),r.repl=new r("repl",{fontCharacter:"\\ea85"}),r.zap=new r("zap",{fontCharacter:"\\ea86"}),r.symbolEvent=new r("symbol-event",{fontCharacter:"\\ea86"}),r.error=new r("error",{fontCharacter:"\\ea87"}),r.stop=new r("stop",{fontCharacter:"\\ea87"}),r.variable=new r("variable",{fontCharacter:"\\ea88"}),r.symbolVariable=new r("symbol-variable",{fontCharacter:"\\ea88"}),r.array=new r("array",{fontCharacter:"\\ea8a"}),r.symbolArray=new r("symbol-array",{fontCharacter:"\\ea8a"}),r.symbolModule=new r("symbol-module",{fontCharacter:"\\ea8b"}),r.symbolPackage=new r("symbol-package",{fontCharacter:"\\ea8b"}),r.symbolNamespace=new r("symbol-namespace",{fontCharacter:"\\ea8b"}),r.symbolObject=new r("symbol-object",{fontCharacter:"\\ea8b"}),r.symbolMethod=new r("symbol-method",{fontCharacter:"\\ea8c"}),r.symbolFunction=new r("symbol-function",{fontCharacter:"\\ea8c"}),r.symbolConstructor=new r("symbol-constructor",{fontCharacter:"\\ea8c"}),r.symbolBoolean=new r("symbol-boolean",{fontCharacter:"\\ea8f"}),r.symbolNull=new r("symbol-null",{fontCharacter:"\\ea8f"}),r.symbolNumeric=new r("symbol-numeric",{fontCharacter:"\\ea90"}),r.symbolNumber=new r("symbol-number",{fontCharacter:"\\ea90"}),r.symbolStructure=new r("symbol-structure",{fontCharacter:"\\ea91"}),r.symbolStruct=new r("symbol-struct",{fontCharacter:"\\ea91"}),r.symbolParameter=new r("symbol-parameter",{fontCharacter:"\\ea92"}),r.symbolTypeParameter=new r("symbol-type-parameter",{fontCharacter:"\\ea92"}),r.symbolKey=new r("symbol-key",{fontCharacter:"\\ea93"}),r.symbolText=new r("symbol-text",{fontCharacter:"\\ea93"}),r.symbolReference=new r("symbol-reference",{fontCharacter:"\\ea94"}),r.goToFile=new r("go-to-file",{fontCharacter:"\\ea94"}),r.symbolEnum=new r("symbol-enum",{fontCharacter:"\\ea95"}),r.symbolValue=new r("symbol-value",{fontCharacter:"\\ea95"}),r.symbolRuler=new r("symbol-ruler",{fontCharacter:"\\ea96"}),r.symbolUnit=new r("symbol-unit",{fontCharacter:"\\ea96"}),r.activateBreakpoints=new r("activate-breakpoints",{fontCharacter:"\\ea97"}),r.archive=new r("archive",{fontCharacter:"\\ea98"}),r.arrowBoth=new r("arrow-both",{fontCharacter:"\\ea99"}),r.arrowDown=new r("arrow-down",{fontCharacter:"\\ea9a"}),r.arrowLeft=new r("arrow-left",{fontCharacter:"\\ea9b"}),r.arrowRight=new r("arrow-right",{fontCharacter:"\\ea9c"}),r.arrowSmallDown=new r("arrow-small-down",{fontCharacter:"\\ea9d"}),r.arrowSmallLeft=new r("arrow-small-left",{fontCharacter:"\\ea9e"}),r.arrowSmallRight=new r("arrow-small-right",{fontCharacter:"\\ea9f"}),r.arrowSmallUp=new r("arrow-small-up",{fontCharacter:"\\eaa0"}),r.arrowUp=new r("arrow-up",{fontCharacter:"\\eaa1"}),r.bell=new r("bell",{fontCharacter:"\\eaa2"}),r.bold=new r("bold",{fontCharacter:"\\eaa3"}),r.book=new r("book",{fontCharacter:"\\eaa4"}),r.bookmark=new r("bookmark",{fontCharacter:"\\eaa5"}),r.debugBreakpointConditionalUnverified=new r("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),r.debugBreakpointConditional=new r("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),r.debugBreakpointConditionalDisabled=new r("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),r.debugBreakpointDataUnverified=new r("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),r.debugBreakpointData=new r("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),r.debugBreakpointDataDisabled=new r("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),r.debugBreakpointLogUnverified=new r("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),r.debugBreakpointLog=new r("debug-breakpoint-log",{fontCharacter:"\\eaab"}),r.debugBreakpointLogDisabled=new r("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),r.briefcase=new r("briefcase",{fontCharacter:"\\eaac"}),r.broadcast=new r("broadcast",{fontCharacter:"\\eaad"}),r.browser=new r("browser",{fontCharacter:"\\eaae"}),r.bug=new r("bug",{fontCharacter:"\\eaaf"}),r.calendar=new r("calendar",{fontCharacter:"\\eab0"}),r.caseSensitive=new r("case-sensitive",{fontCharacter:"\\eab1"}),r.check=new r("check",{fontCharacter:"\\eab2"}),r.checklist=new r("checklist",{fontCharacter:"\\eab3"}),r.chevronDown=new r("chevron-down",{fontCharacter:"\\eab4"}),r.dropDownButton=new r("drop-down-button",r.chevronDown.definition),r.chevronLeft=new r("chevron-left",{fontCharacter:"\\eab5"}),r.chevronRight=new r("chevron-right",{fontCharacter:"\\eab6"}),r.chevronUp=new r("chevron-up",{fontCharacter:"\\eab7"}),r.chromeClose=new r("chrome-close",{fontCharacter:"\\eab8"}),r.chromeMaximize=new r("chrome-maximize",{fontCharacter:"\\eab9"}),r.chromeMinimize=new r("chrome-minimize",{fontCharacter:"\\eaba"}),r.chromeRestore=new r("chrome-restore",{fontCharacter:"\\eabb"}),r.circleOutline=new r("circle-outline",{fontCharacter:"\\eabc"}),r.debugBreakpointUnverified=new r("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),r.circleSlash=new r("circle-slash",{fontCharacter:"\\eabd"}),r.circuitBoard=new r("circuit-board",{fontCharacter:"\\eabe"}),r.clearAll=new r("clear-all",{fontCharacter:"\\eabf"}),r.clippy=new r("clippy",{fontCharacter:"\\eac0"}),r.closeAll=new r("close-all",{fontCharacter:"\\eac1"}),r.cloudDownload=new r("cloud-download",{fontCharacter:"\\eac2"}),r.cloudUpload=new r("cloud-upload",{fontCharacter:"\\eac3"}),r.code=new r("code",{fontCharacter:"\\eac4"}),r.collapseAll=new r("collapse-all",{fontCharacter:"\\eac5"}),r.colorMode=new r("color-mode",{fontCharacter:"\\eac6"}),r.commentDiscussion=new r("comment-discussion",{fontCharacter:"\\eac7"}),r.compareChanges=new r("compare-changes",{fontCharacter:"\\eafd"}),r.creditCard=new r("credit-card",{fontCharacter:"\\eac9"}),r.dash=new r("dash",{fontCharacter:"\\eacc"}),r.dashboard=new r("dashboard",{fontCharacter:"\\eacd"}),r.database=new r("database",{fontCharacter:"\\eace"}),r.debugContinue=new r("debug-continue",{fontCharacter:"\\eacf"}),r.debugDisconnect=new r("debug-disconnect",{fontCharacter:"\\ead0"}),r.debugPause=new r("debug-pause",{fontCharacter:"\\ead1"}),r.debugRestart=new r("debug-restart",{fontCharacter:"\\ead2"}),r.debugStart=new r("debug-start",{fontCharacter:"\\ead3"}),r.debugStepInto=new r("debug-step-into",{fontCharacter:"\\ead4"}),r.debugStepOut=new r("debug-step-out",{fontCharacter:"\\ead5"}),r.debugStepOver=new r("debug-step-over",{fontCharacter:"\\ead6"}),r.debugStop=new r("debug-stop",{fontCharacter:"\\ead7"}),r.debug=new r("debug",{fontCharacter:"\\ead8"}),r.deviceCameraVideo=new r("device-camera-video",{fontCharacter:"\\ead9"}),r.deviceCamera=new r("device-camera",{fontCharacter:"\\eada"}),r.deviceMobile=new r("device-mobile",{fontCharacter:"\\eadb"}),r.diffAdded=new r("diff-added",{fontCharacter:"\\eadc"}),r.diffIgnored=new r("diff-ignored",{fontCharacter:"\\eadd"}),r.diffModified=new r("diff-modified",{fontCharacter:"\\eade"}),r.diffRemoved=new r("diff-removed",{fontCharacter:"\\eadf"}),r.diffRenamed=new r("diff-renamed",{fontCharacter:"\\eae0"}),r.diff=new r("diff",{fontCharacter:"\\eae1"}),r.discard=new r("discard",{fontCharacter:"\\eae2"}),r.editorLayout=new r("editor-layout",{fontCharacter:"\\eae3"}),r.emptyWindow=new r("empty-window",{fontCharacter:"\\eae4"}),r.exclude=new r("exclude",{fontCharacter:"\\eae5"}),r.extensions=new r("extensions",{fontCharacter:"\\eae6"}),r.eyeClosed=new r("eye-closed",{fontCharacter:"\\eae7"}),r.fileBinary=new r("file-binary",{fontCharacter:"\\eae8"}),r.fileCode=new r("file-code",{fontCharacter:"\\eae9"}),r.fileMedia=new r("file-media",{fontCharacter:"\\eaea"}),r.filePdf=new r("file-pdf",{fontCharacter:"\\eaeb"}),r.fileSubmodule=new r("file-submodule",{fontCharacter:"\\eaec"}),r.fileSymlinkDirectory=new r("file-symlink-directory",{fontCharacter:"\\eaed"}),r.fileSymlinkFile=new r("file-symlink-file",{fontCharacter:"\\eaee"}),r.fileZip=new r("file-zip",{fontCharacter:"\\eaef"}),r.files=new r("files",{fontCharacter:"\\eaf0"}),r.filter=new r("filter",{fontCharacter:"\\eaf1"}),r.flame=new r("flame",{fontCharacter:"\\eaf2"}),r.foldDown=new r("fold-down",{fontCharacter:"\\eaf3"}),r.foldUp=new r("fold-up",{fontCharacter:"\\eaf4"}),r.fold=new r("fold",{fontCharacter:"\\eaf5"}),r.folderActive=new r("folder-active",{fontCharacter:"\\eaf6"}),r.folderOpened=new r("folder-opened",{fontCharacter:"\\eaf7"}),r.gear=new r("gear",{fontCharacter:"\\eaf8"}),r.gift=new r("gift",{fontCharacter:"\\eaf9"}),r.gistSecret=new r("gist-secret",{fontCharacter:"\\eafa"}),r.gist=new r("gist",{fontCharacter:"\\eafb"}),r.gitCommit=new r("git-commit",{fontCharacter:"\\eafc"}),r.gitCompare=new r("git-compare",{fontCharacter:"\\eafd"}),r.gitMerge=new r("git-merge",{fontCharacter:"\\eafe"}),r.githubAction=new r("github-action",{fontCharacter:"\\eaff"}),r.githubAlt=new r("github-alt",{fontCharacter:"\\eb00"}),r.globe=new r("globe",{fontCharacter:"\\eb01"}),r.grabber=new r("grabber",{fontCharacter:"\\eb02"}),r.graph=new r("graph",{fontCharacter:"\\eb03"}),r.gripper=new r("gripper",{fontCharacter:"\\eb04"}),r.heart=new r("heart",{fontCharacter:"\\eb05"}),r.home=new r("home",{fontCharacter:"\\eb06"}),r.horizontalRule=new r("horizontal-rule",{fontCharacter:"\\eb07"}),r.hubot=new r("hubot",{fontCharacter:"\\eb08"}),r.inbox=new r("inbox",{fontCharacter:"\\eb09"}),r.issueClosed=new r("issue-closed",{fontCharacter:"\\eba4"}),r.issueReopened=new r("issue-reopened",{fontCharacter:"\\eb0b"}),r.issues=new r("issues",{fontCharacter:"\\eb0c"}),r.italic=new r("italic",{fontCharacter:"\\eb0d"}),r.jersey=new r("jersey",{fontCharacter:"\\eb0e"}),r.json=new r("json",{fontCharacter:"\\eb0f"}),r.kebabVertical=new r("kebab-vertical",{fontCharacter:"\\eb10"}),r.key=new r("key",{fontCharacter:"\\eb11"}),r.law=new r("law",{fontCharacter:"\\eb12"}),r.lightbulbAutofix=new r("lightbulb-autofix",{fontCharacter:"\\eb13"}),r.linkExternal=new r("link-external",{fontCharacter:"\\eb14"}),r.link=new r("link",{fontCharacter:"\\eb15"}),r.listOrdered=new r("list-ordered",{fontCharacter:"\\eb16"}),r.listUnordered=new r("list-unordered",{fontCharacter:"\\eb17"}),r.liveShare=new r("live-share",{fontCharacter:"\\eb18"}),r.loading=new r("loading",{fontCharacter:"\\eb19"}),r.location=new r("location",{fontCharacter:"\\eb1a"}),r.mailRead=new r("mail-read",{fontCharacter:"\\eb1b"}),r.mail=new r("mail",{fontCharacter:"\\eb1c"}),r.markdown=new r("markdown",{fontCharacter:"\\eb1d"}),r.megaphone=new r("megaphone",{fontCharacter:"\\eb1e"}),r.mention=new r("mention",{fontCharacter:"\\eb1f"}),r.milestone=new r("milestone",{fontCharacter:"\\eb20"}),r.mortarBoard=new r("mortar-board",{fontCharacter:"\\eb21"}),r.move=new r("move",{fontCharacter:"\\eb22"}),r.multipleWindows=new r("multiple-windows",{fontCharacter:"\\eb23"}),r.mute=new r("mute",{fontCharacter:"\\eb24"}),r.noNewline=new r("no-newline",{fontCharacter:"\\eb25"}),r.note=new r("note",{fontCharacter:"\\eb26"}),r.octoface=new r("octoface",{fontCharacter:"\\eb27"}),r.openPreview=new r("open-preview",{fontCharacter:"\\eb28"}),r.package_=new r("package",{fontCharacter:"\\eb29"}),r.paintcan=new r("paintcan",{fontCharacter:"\\eb2a"}),r.pin=new r("pin",{fontCharacter:"\\eb2b"}),r.play=new r("play",{fontCharacter:"\\eb2c"}),r.run=new r("run",{fontCharacter:"\\eb2c"}),r.plug=new r("plug",{fontCharacter:"\\eb2d"}),r.preserveCase=new r("preserve-case",{fontCharacter:"\\eb2e"}),r.preview=new r("preview",{fontCharacter:"\\eb2f"}),r.project=new r("project",{fontCharacter:"\\eb30"}),r.pulse=new r("pulse",{fontCharacter:"\\eb31"}),r.question=new r("question",{fontCharacter:"\\eb32"}),r.quote=new r("quote",{fontCharacter:"\\eb33"}),r.radioTower=new r("radio-tower",{fontCharacter:"\\eb34"}),r.reactions=new r("reactions",{fontCharacter:"\\eb35"}),r.references=new r("references",{fontCharacter:"\\eb36"}),r.refresh=new r("refresh",{fontCharacter:"\\eb37"}),r.regex=new r("regex",{fontCharacter:"\\eb38"}),r.remoteExplorer=new r("remote-explorer",{fontCharacter:"\\eb39"}),r.remote=new r("remote",{fontCharacter:"\\eb3a"}),r.remove=new r("remove",{fontCharacter:"\\eb3b"}),r.replaceAll=new r("replace-all",{fontCharacter:"\\eb3c"}),r.replace=new r("replace",{fontCharacter:"\\eb3d"}),r.repoClone=new r("repo-clone",{fontCharacter:"\\eb3e"}),r.repoForcePush=new r("repo-force-push",{fontCharacter:"\\eb3f"}),r.repoPull=new r("repo-pull",{fontCharacter:"\\eb40"}),r.repoPush=new r("repo-push",{fontCharacter:"\\eb41"}),r.report=new r("report",{fontCharacter:"\\eb42"}),r.requestChanges=new r("request-changes",{fontCharacter:"\\eb43"}),r.rocket=new r("rocket",{fontCharacter:"\\eb44"}),r.rootFolderOpened=new r("root-folder-opened",{fontCharacter:"\\eb45"}),r.rootFolder=new r("root-folder",{fontCharacter:"\\eb46"}),r.rss=new r("rss",{fontCharacter:"\\eb47"}),r.ruby=new r("ruby",{fontCharacter:"\\eb48"}),r.saveAll=new r("save-all",{fontCharacter:"\\eb49"}),r.saveAs=new r("save-as",{fontCharacter:"\\eb4a"}),r.save=new r("save",{fontCharacter:"\\eb4b"}),r.screenFull=new r("screen-full",{fontCharacter:"\\eb4c"}),r.screenNormal=new r("screen-normal",{fontCharacter:"\\eb4d"}),r.searchStop=new r("search-stop",{fontCharacter:"\\eb4e"}),r.server=new r("server",{fontCharacter:"\\eb50"}),r.settingsGear=new r("settings-gear",{fontCharacter:"\\eb51"}),r.settings=new r("settings",{fontCharacter:"\\eb52"}),r.shield=new r("shield",{fontCharacter:"\\eb53"}),r.smiley=new r("smiley",{fontCharacter:"\\eb54"}),r.sortPrecedence=new r("sort-precedence",{fontCharacter:"\\eb55"}),r.splitHorizontal=new r("split-horizontal",{fontCharacter:"\\eb56"}),r.splitVertical=new r("split-vertical",{fontCharacter:"\\eb57"}),r.squirrel=new r("squirrel",{fontCharacter:"\\eb58"}),r.starFull=new r("star-full",{fontCharacter:"\\eb59"}),r.starHalf=new r("star-half",{fontCharacter:"\\eb5a"}),r.symbolClass=new r("symbol-class",{fontCharacter:"\\eb5b"}),r.symbolColor=new r("symbol-color",{fontCharacter:"\\eb5c"}),r.symbolConstant=new r("symbol-constant",{fontCharacter:"\\eb5d"}),r.symbolEnumMember=new r("symbol-enum-member",{fontCharacter:"\\eb5e"}),r.symbolField=new r("symbol-field",{fontCharacter:"\\eb5f"}),r.symbolFile=new r("symbol-file",{fontCharacter:"\\eb60"}),r.symbolInterface=new r("symbol-interface",{fontCharacter:"\\eb61"}),r.symbolKeyword=new r("symbol-keyword",{fontCharacter:"\\eb62"}),r.symbolMisc=new r("symbol-misc",{fontCharacter:"\\eb63"}),r.symbolOperator=new r("symbol-operator",{fontCharacter:"\\eb64"}),r.symbolProperty=new r("symbol-property",{fontCharacter:"\\eb65"}),r.wrench=new r("wrench",{fontCharacter:"\\eb65"}),r.wrenchSubaction=new r("wrench-subaction",{fontCharacter:"\\eb65"}),r.symbolSnippet=new r("symbol-snippet",{fontCharacter:"\\eb66"}),r.tasklist=new r("tasklist",{fontCharacter:"\\eb67"}),r.telescope=new r("telescope",{fontCharacter:"\\eb68"}),r.textSize=new r("text-size",{fontCharacter:"\\eb69"}),r.threeBars=new r("three-bars",{fontCharacter:"\\eb6a"}),r.thumbsdown=new r("thumbsdown",{fontCharacter:"\\eb6b"}),r.thumbsup=new r("thumbsup",{fontCharacter:"\\eb6c"}),r.tools=new r("tools",{fontCharacter:"\\eb6d"}),r.triangleDown=new r("triangle-down",{fontCharacter:"\\eb6e"}),r.triangleLeft=new r("triangle-left",{fontCharacter:"\\eb6f"}),r.triangleRight=new r("triangle-right",{fontCharacter:"\\eb70"}),r.triangleUp=new r("triangle-up",{fontCharacter:"\\eb71"}),r.twitter=new r("twitter",{fontCharacter:"\\eb72"}),r.unfold=new r("unfold",{fontCharacter:"\\eb73"}),r.unlock=new r("unlock",{fontCharacter:"\\eb74"}),r.unmute=new r("unmute",{fontCharacter:"\\eb75"}),r.unverified=new r("unverified",{fontCharacter:"\\eb76"}),r.verified=new r("verified",{fontCharacter:"\\eb77"}),r.versions=new r("versions",{fontCharacter:"\\eb78"}),r.vmActive=new r("vm-active",{fontCharacter:"\\eb79"}),r.vmOutline=new r("vm-outline",{fontCharacter:"\\eb7a"}),r.vmRunning=new r("vm-running",{fontCharacter:"\\eb7b"}),r.watch=new r("watch",{fontCharacter:"\\eb7c"}),r.whitespace=new r("whitespace",{fontCharacter:"\\eb7d"}),r.wholeWord=new r("whole-word",{fontCharacter:"\\eb7e"}),r.window=new r("window",{fontCharacter:"\\eb7f"}),r.wordWrap=new r("word-wrap",{fontCharacter:"\\eb80"}),r.zoomIn=new r("zoom-in",{fontCharacter:"\\eb81"}),r.zoomOut=new r("zoom-out",{fontCharacter:"\\eb82"}),r.listFilter=new r("list-filter",{fontCharacter:"\\eb83"}),r.listFlat=new r("list-flat",{fontCharacter:"\\eb84"}),r.listSelection=new r("list-selection",{fontCharacter:"\\eb85"}),r.selection=new r("selection",{fontCharacter:"\\eb85"}),r.listTree=new r("list-tree",{fontCharacter:"\\eb86"}),r.debugBreakpointFunctionUnverified=new r("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),r.debugBreakpointFunction=new r("debug-breakpoint-function",{fontCharacter:"\\eb88"}),r.debugBreakpointFunctionDisabled=new r("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),r.debugStackframeActive=new r("debug-stackframe-active",{fontCharacter:"\\eb89"}),r.debugStackframeDot=new r("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),r.debugStackframe=new r("debug-stackframe",{fontCharacter:"\\eb8b"}),r.debugStackframeFocused=new r("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),r.debugBreakpointUnsupported=new r("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),r.symbolString=new r("symbol-string",{fontCharacter:"\\eb8d"}),r.debugReverseContinue=new r("debug-reverse-continue",{fontCharacter:"\\eb8e"}),r.debugStepBack=new r("debug-step-back",{fontCharacter:"\\eb8f"}),r.debugRestartFrame=new r("debug-restart-frame",{fontCharacter:"\\eb90"}),r.callIncoming=new r("call-incoming",{fontCharacter:"\\eb92"}),r.callOutgoing=new r("call-outgoing",{fontCharacter:"\\eb93"}),r.menu=new r("menu",{fontCharacter:"\\eb94"}),r.expandAll=new r("expand-all",{fontCharacter:"\\eb95"}),r.feedback=new r("feedback",{fontCharacter:"\\eb96"}),r.groupByRefType=new r("group-by-ref-type",{fontCharacter:"\\eb97"}),r.ungroupByRefType=new r("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),r.account=new r("account",{fontCharacter:"\\eb99"}),r.bellDot=new r("bell-dot",{fontCharacter:"\\eb9a"}),r.debugConsole=new r("debug-console",{fontCharacter:"\\eb9b"}),r.library=new r("library",{fontCharacter:"\\eb9c"}),r.output=new r("output",{fontCharacter:"\\eb9d"}),r.runAll=new r("run-all",{fontCharacter:"\\eb9e"}),r.syncIgnored=new r("sync-ignored",{fontCharacter:"\\eb9f"}),r.pinned=new r("pinned",{fontCharacter:"\\eba0"}),r.githubInverted=new r("github-inverted",{fontCharacter:"\\eba1"}),r.debugAlt=new r("debug-alt",{fontCharacter:"\\eb91"}),r.serverProcess=new r("server-process",{fontCharacter:"\\eba2"}),r.serverEnvironment=new r("server-environment",{fontCharacter:"\\eba3"}),r.pass=new r("pass",{fontCharacter:"\\eba4"}),r.stopCircle=new r("stop-circle",{fontCharacter:"\\eba5"}),r.playCircle=new r("play-circle",{fontCharacter:"\\eba6"}),r.record=new r("record",{fontCharacter:"\\eba7"}),r.debugAltSmall=new r("debug-alt-small",{fontCharacter:"\\eba8"}),r.vmConnect=new r("vm-connect",{fontCharacter:"\\eba9"}),r.cloud=new r("cloud",{fontCharacter:"\\ebaa"}),r.merge=new r("merge",{fontCharacter:"\\ebab"}),r.exportIcon=new r("export",{fontCharacter:"\\ebac"}),r.graphLeft=new r("graph-left",{fontCharacter:"\\ebad"}),r.magnet=new r("magnet",{fontCharacter:"\\ebae"}),r.notebook=new r("notebook",{fontCharacter:"\\ebaf"}),r.redo=new r("redo",{fontCharacter:"\\ebb0"}),r.checkAll=new r("check-all",{fontCharacter:"\\ebb1"}),r.pinnedDirty=new r("pinned-dirty",{fontCharacter:"\\ebb2"}),r.passFilled=new r("pass-filled",{fontCharacter:"\\ebb3"}),r.circleLargeFilled=new r("circle-large-filled",{fontCharacter:"\\ebb4"}),r.circleLargeOutline=new r("circle-large-outline",{fontCharacter:"\\ebb5"}),r.combine=new r("combine",{fontCharacter:"\\ebb6"}),r.gather=new r("gather",{fontCharacter:"\\ebb6"}),r.table=new r("table",{fontCharacter:"\\ebb7"}),r.variableGroup=new r("variable-group",{fontCharacter:"\\ebb8"}),r.typeHierarchy=new r("type-hierarchy",{fontCharacter:"\\ebb9"}),r.typeHierarchySub=new r("type-hierarchy-sub",{fontCharacter:"\\ebba"}),r.typeHierarchySuper=new r("type-hierarchy-super",{fontCharacter:"\\ebbb"}),r.gitPullRequestCreate=new r("git-pull-request-create",{fontCharacter:"\\ebbc"}),r.runAbove=new r("run-above",{fontCharacter:"\\ebbd"}),r.runBelow=new r("run-below",{fontCharacter:"\\ebbe"}),r.notebookTemplate=new r("notebook-template",{fontCharacter:"\\ebbf"}),r.debugRerun=new r("debug-rerun",{fontCharacter:"\\ebc0"}),r.workspaceTrusted=new r("workspace-trusted",{fontCharacter:"\\ebc1"}),r.workspaceUntrusted=new r("workspace-untrusted",{fontCharacter:"\\ebc2"}),r.workspaceUnspecified=new r("workspace-unspecified",{fontCharacter:"\\ebc3"}),r.terminalCmd=new r("terminal-cmd",{fontCharacter:"\\ebc4"}),r.terminalDebian=new r("terminal-debian",{fontCharacter:"\\ebc5"}),r.terminalLinux=new r("terminal-linux",{fontCharacter:"\\ebc6"}),r.terminalPowershell=new r("terminal-powershell",{fontCharacter:"\\ebc7"}),r.terminalTmux=new r("terminal-tmux",{fontCharacter:"\\ebc8"}),r.terminalUbuntu=new r("terminal-ubuntu",{fontCharacter:"\\ebc9"}),r.terminalBash=new r("terminal-bash",{fontCharacter:"\\ebca"}),r.arrowSwap=new r("arrow-swap",{fontCharacter:"\\ebcb"}),r.copy=new r("copy",{fontCharacter:"\\ebcc"}),r.personAdd=new r("person-add",{fontCharacter:"\\ebcd"}),r.filterFilled=new r("filter-filled",{fontCharacter:"\\ebce"}),r.wand=new r("wand",{fontCharacter:"\\ebcf"}),r.debugLineByLine=new r("debug-line-by-line",{fontCharacter:"\\ebd0"}),r.inspect=new r("inspect",{fontCharacter:"\\ebd1"}),r.layers=new r("layers",{fontCharacter:"\\ebd2"}),r.layersDot=new r("layers-dot",{fontCharacter:"\\ebd3"}),r.layersActive=new r("layers-active",{fontCharacter:"\\ebd4"}),r.compass=new r("compass",{fontCharacter:"\\ebd5"}),r.compassDot=new r("compass-dot",{fontCharacter:"\\ebd6"}),r.compassActive=new r("compass-active",{fontCharacter:"\\ebd7"}),r.azure=new r("azure",{fontCharacter:"\\ebd8"}),r.issueDraft=new r("issue-draft",{fontCharacter:"\\ebd9"}),r.gitPullRequestClosed=new r("git-pull-request-closed",{fontCharacter:"\\ebda"}),r.gitPullRequestDraft=new r("git-pull-request-draft",{fontCharacter:"\\ebdb"}),r.debugAll=new r("debug-all",{fontCharacter:"\\ebdc"}),r.debugCoverage=new r("debug-coverage",{fontCharacter:"\\ebdd"}),r.runErrors=new r("run-errors",{fontCharacter:"\\ebde"}),r.folderLibrary=new r("folder-library",{fontCharacter:"\\ebdf"}),r.debugContinueSmall=new r("debug-continue-small",{fontCharacter:"\\ebe0"}),r.beakerStop=new r("beaker-stop",{fontCharacter:"\\ebe1"}),r.graphLine=new r("graph-line",{fontCharacter:"\\ebe2"}),r.graphScatter=new r("graph-scatter",{fontCharacter:"\\ebe3"}),r.pieChart=new r("pie-chart",{fontCharacter:"\\ebe4"}),r.bracket=new r("bracket",r.json.definition),r.bracketDot=new r("bracket-dot",{fontCharacter:"\\ebe5"}),r.bracketError=new r("bracket-error",{fontCharacter:"\\ebe6"}),r.lockSmall=new r("lock-small",{fontCharacter:"\\ebe7"}),r.azureDevops=new r("azure-devops",{fontCharacter:"\\ebe8"}),r.verifiedFilled=new r("verified-filled",{fontCharacter:"\\ebe9"})}($||($={}))},"VrN/":function(It,Oe,U){(function(te,Q){It.exports=Q()})(this,function(){"use strict";var te=navigator.userAgent,Q=navigator.platform,B=/gecko\/\d/i.test(te),J=/MSIE \d/.test(te),K=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(te),N=/Edge\/(\d+)/.exec(te),$=J||K||N,z=$&&(J?document.documentMode||6:+(N||K)[1]),r=!N&&/WebKit\//.test(te),D=r&&/Qt\/\d+\.\d+/.test(te),m=!N&&/Chrome\//.test(te),g=/Opera\//.test(te),p=/Apple Computer/.test(navigator.vendor),a=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(te),c=/PhantomJS/.test(te),s=!N&&/AppleWebKit/.test(te)&&/Mobile\/\w+/.test(te),i=/Android/.test(te),t=s||i||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(te),u=s||/Mac/.test(Q),o=/\bCrOS\b/.test(te),R=/win/i.test(Q),T=g&&te.match(/Version\/(\d*\.\d*)/);T&&(T=Number(T[1])),T&&T>=15&&(g=!1,r=!0);var S=u&&(D||g&&(T==null||T<12.11)),A=B||$&&z>=9;function I(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var x=function(e,n){var d=e.className,l=I(n).exec(d);if(l){var y=d.slice(l.index+l[0].length);e.className=d.slice(0,l.index)+(y?l[1]+y:"")}};function b(e){for(var n=e.childNodes.length;n>0;--n)e.removeChild(e.firstChild);return e}function h(e,n){return b(e).appendChild(n)}function f(e,n,d,l){var y=document.createElement(e);if(d&&(y.className=d),l&&(y.style.cssText=l),typeof n=="string")y.appendChild(document.createTextNode(n));else if(n)for(var G=0;G<n.length;++G)y.appendChild(n[G]);return y}function C(e,n,d,l){var y=f(e,n,d,l);return y.setAttribute("role","presentation"),y}var E;document.createRange?E=function(e,n,d,l){var y=document.createRange();return y.setEnd(l||e,d),y.setStart(e,n),y}:E=function(e,n,d){var l=document.body.createTextRange();try{l.moveToElementText(e.parentNode)}catch(y){return l}return l.collapse(!0),l.moveEnd("character",d),l.moveStart("character",n),l};function _(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 W(){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 j(e,n){var d=e.className;I(n).test(d)||(e.className+=(d?" ":"")+n)}function w(e,n){for(var d=e.split(" "),l=0;l<d.length;l++)d[l]&&!I(d[l]).test(n)&&(n+=" "+d[l]);return n}var F=function(e){e.select()};s?F=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:$&&(F=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 v(e,n,d){n||(n={});for(var l in e)e.hasOwnProperty(l)&&(d!==!1||!n.hasOwnProperty(l))&&(n[l]=e[l]);return n}function H(e,n,d,l,y){n==null&&(n=e.search(/[^\s\u00a0]/),n==-1&&(n=e.length));for(var G=l||0,ee=y||0;;){var ae=e.indexOf(" ",G);if(ae<0||ae>=n)return ee+(n-G);ee+=ae-G,ee+=d-ee%d,G=ae+1}}var Y=function(){this.id=null,this.f=null,this.time=0,this.handler=P(this.onTimeout,this)};Y.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},Y.prototype.set=function(e,n){this.f=n;var d=+new Date+e;(!this.id||d<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,e),this.time=d)};function ie(e,n){for(var d=0;d<e.length;++d)if(e[d]==n)return d;return-1}var le=50,he={toString:function(){return"CodeMirror.Pass"}},xe={scroll:!1},Le={origin:"*mouse"},we={origin:"+move"};function Ae(e,n,d){for(var l=0,y=0;;){var G=e.indexOf(" ",l);G==-1&&(G=e.length);var ee=G-l;if(G==e.length||y+ee>=n)return l+Math.min(ee,n-y);if(y+=G-l,y+=d-y%d,l=G+1,y>=n)return l}}var pe=[""];function be(e){for(;pe.length<=e;)pe.push(ne(pe)+" ");return pe[e]}function ne(e){return e[e.length-1]}function fe(e,n){for(var d=[],l=0;l<e.length;l++)d[l]=n(e[l],l);return d}function _e(e,n,d){for(var l=0,y=d(n);l<e.length&&d(e[l])<=y;)l++;e.splice(l,0,n)}function ke(){}function et(e,n){var d;return Object.create?d=Object.create(e):(ke.prototype=e,d=new ke),n&&v(n,d),d}var je=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function ot(e){return/\w/.test(e)||e>"\x80"&&(e.toUpperCase()!=e.toLowerCase()||je.test(e))}function _t(e,n){return n?n.source.indexOf("\\w")>-1&&ot(e)?!0:n.test(e):ot(e)}function Re(e){for(var n in e)if(e.hasOwnProperty(n)&&e[n])return!1;return!0}var Be=/[\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 Qe(e){return e.charCodeAt(0)>=768&&Be.test(e)}function Ve(e,n,d){for(;(d<0?n>0:n<e.length)&&Qe(e.charAt(n));)n+=d;return n}function Et(e,n,d){for(var l=n>d?-1:1;;){if(n==d)return n;var y=(n+d)/2,G=l<0?Math.ceil(y):Math.floor(y);if(G==n)return e(G)?n:d;e(G)?d=G:n=G+l}}function kt(e,n,d,l){if(!e)return l(n,d,"ltr",0);for(var y=!1,G=0;G<e.length;++G){var ee=e[G];(ee.from<d&&ee.to>n||n==d&&ee.to==n)&&(l(Math.max(ee.from,n),Math.min(ee.to,d),ee.level==1?"rtl":"ltr",G),y=!0)}y||l(n,d,"ltr")}var Vt=null;function Qt(e,n,d){var l;Vt=null;for(var y=0;y<e.length;++y){var G=e[y];if(G.from<n&&G.to>n)return y;G.to==n&&(G.from!=G.to&&d=="before"?l=y:Vt=y),G.from==n&&(G.from!=G.to&&d!="before"?l=y:Vt=y)}return l!=null?l:Vt}var an=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",n="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function d(me){return me<=247?e.charAt(me):1424<=me&&me<=1524?"R":1536<=me&&me<=1785?n.charAt(me-1536):1774<=me&&me<=2220?"r":8192<=me&&me<=8203?"w":me==8204?"b":"L"}var l=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,y=/[stwN]/,G=/[LRr]/,ee=/[Lb1n]/,ae=/[1n]/;function oe(me,We,Ye){this.level=me,this.from=We,this.to=Ye}return function(me,We){var Ye=We=="ltr"?"L":"R";if(me.length==0||We=="ltr"&&!l.test(me))return!1;for(var vt=me.length,ht=[],Bt=0;Bt<vt;++Bt)ht.push(d(me.charCodeAt(Bt)));for(var Zt=0,mn=Ye;Zt<vt;++Zt){var jn=ht[Zt];jn=="m"?ht[Zt]=mn:mn=jn}for(var sr=0,Wn=Ye;sr<vt;++sr){var dr=ht[sr];dr=="1"&&Wn=="r"?ht[sr]="n":G.test(dr)&&(Wn=dr,dr=="r"&&(ht[sr]="R"))}for(var Or=1,Tr=ht[0];Or<vt-1;++Or){var Dr=ht[Or];Dr=="+"&&Tr=="1"&&ht[Or+1]=="1"?ht[Or]="1":Dr==","&&Tr==ht[Or+1]&&(Tr=="1"||Tr=="n")&&(ht[Or]=Tr),Tr=Dr}for(var Wr=0;Wr<vt;++Wr){var ri=ht[Wr];if(ri==",")ht[Wr]="N";else if(ri=="%"){var zr=void 0;for(zr=Wr+1;zr<vt&&ht[zr]=="%";++zr);for(var Ei=Wr&&ht[Wr-1]=="!"||zr<vt&&ht[zr]=="1"?"1":"N",gi=Wr;gi<zr;++gi)ht[gi]=Ei;Wr=zr-1}}for(var Qr=0,vi=Ye;Qr<vt;++Qr){var oi=ht[Qr];vi=="L"&&oi=="1"?ht[Qr]="L":G.test(oi)&&(vi=oi)}for(var qr=0;qr<vt;++qr)if(y.test(ht[qr])){var Jr=void 0;for(Jr=qr+1;Jr<vt&&y.test(ht[Jr]);++Jr);for(var Xr=(qr?ht[qr-1]:Ye)=="L",_i=(Jr<vt?ht[Jr]:Ye)=="L",vs=Xr==_i?Xr?"L":"R":Ye,wa=qr;wa<Jr;++wa)ht[wa]=vs;qr=Jr-1}for(var ci=[],Hi,ii=0;ii<vt;)if(ee.test(ht[ii])){var nu=ii;for(++ii;ii<vt&&ee.test(ht[ii]);++ii);ci.push(new oe(0,nu,ii))}else{var Qi=ii,Ga=ci.length,za=We=="rtl"?1:0;for(++ii;ii<vt&&ht[ii]!="L";++ii);for(var hi=Qi;hi<ii;)if(ae.test(ht[hi])){Qi<hi&&(ci.splice(Ga,0,new oe(1,Qi,hi)),Ga+=za);var _s=hi;for(++hi;hi<ii&&ae.test(ht[hi]);++hi);ci.splice(Ga,0,new oe(2,_s,hi)),Ga+=za,Qi=hi}else++hi;Qi<ii&&ci.splice(Ga,0,new oe(1,Qi,ii))}return We=="ltr"&&(ci[0].level==1&&(Hi=me.match(/^\s+/))&&(ci[0].from=Hi[0].length,ci.unshift(new oe(0,0,Hi[0].length))),ne(ci).level==1&&(Hi=me.match(/\s+$/))&&(ne(ci).to-=Hi[0].length,ci.push(new oe(0,vt-Hi[0].length,vt)))),We=="rtl"?ci.reverse():ci}}();function sn(e,n){var d=e.order;return d==null&&(d=e.order=an(e.text,n)),d}var qe=[],Ze=function(e,n,d){if(e.addEventListener)e.addEventListener(n,d,!1);else if(e.attachEvent)e.attachEvent("on"+n,d);else{var l=e._handlers||(e._handlers={});l[n]=(l[n]||qe).concat(d)}};function Ct(e,n){return e._handlers&&e._handlers[n]||qe}function At(e,n,d){if(e.removeEventListener)e.removeEventListener(n,d,!1);else if(e.detachEvent)e.detachEvent("on"+n,d);else{var l=e._handlers,y=l&&l[n];if(y){var G=ie(y,d);G>-1&&(l[n]=y.slice(0,G).concat(y.slice(G+1)))}}}function ct(e,n){var d=Ct(e,n);if(!d.length)return;for(var l=Array.prototype.slice.call(arguments,2),y=0;y<d.length;++y)d[y].apply(null,l)}function ft(e,n,d){return typeof n=="string"&&(n={type:n,preventDefault:function(){this.defaultPrevented=!0}}),ct(e,d||n.type,e,n),De(n)||n.codemirrorIgnore}function He(e){var n=e._handlers&&e._handlers.cursorActivity;if(!n)return;for(var d=e.curOp.cursorActivityHandlers||(e.curOp.cursorActivityHandlers=[]),l=0;l<n.length;++l)ie(d,n[l])==-1&&d.push(n[l])}function Ne(e,n){return Ct(e,n).length>0}function Ue(e){e.prototype.on=function(n,d){Ze(this,n,d)},e.prototype.off=function(n,d){At(this,n,d)}}function ge(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function Ee(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function De(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function ue(e){ge(e),Ee(e)}function Fe(e){return e.target||e.srcElement}function at(e){var n=e.which;return n==null&&(e.button&1?n=1:e.button&2?n=3:e.button&4&&(n=2)),u&&e.ctrlKey&&n==1&&(n=3),n}var xt=function(){if($&&z<9)return!1;var e=f("div");return"draggable"in e||"dragDrop"in e}(),Kt;function Xt(e){if(Kt==null){var n=f("span","\u200B");h(e,f("span",[n,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Kt=n.offsetWidth<=1&&n.offsetHeight>2&&!($&&z<8))}var d=Kt?f("span","\u200B"):f("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return d.setAttribute("cm-text",""),d}var $t;function $n(e){if($t!=null)return $t;var n=h(e,document.createTextNode("A\u062EA")),d=E(n,0,1).getBoundingClientRect(),l=E(n,1,2).getBoundingClientRect();return b(e),!d||d.left==d.right?!1:$t=l.right-d.right<3}var vn=`
b`.split(/\n/).length!=3?function(e){for(var n=0,d=[],l=e.length;n<=l;){var y=e.indexOf(`
`,n);y==-1&&(y=e.length);var G=e.slice(n,e.charAt(y-1)=="\r"?y-1:y),ee=G.indexOf("\r");ee!=-1?(d.push(G.slice(0,ee)),n+=ee+1):(d.push(G),n=y+1)}return d}:function(e){return e.split(/\r\n?|\n/)},ln=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(d){}return!n||n.parentElement()!=e?!1:n.compareEndPoints("StartToEnd",n)!=0},hn=function(){var e=f("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),Gn=null;function fr(e){if(Gn!=null)return Gn;var n=h(e,f("span","x")),d=n.getBoundingClientRect(),l=E(n,0,1).getBoundingClientRect();return Gn=Math.abs(d.left-l.left)>1}var vr={},ir={};function br(e,n){arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),vr[e]=n}function Rr(e,n){ir[e]=n}function Jt(e){if(typeof e=="string"&&ir.hasOwnProperty(e))e=ir[e];else if(e&&typeof e.name=="string"&&ir.hasOwnProperty(e.name)){var n=ir[e.name];typeof n=="string"&&(n={name:n}),e=et(n,e),e.name=n.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return Jt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return Jt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function Ar(e,n){n=Jt(n);var d=vr[n.name];if(!d)return Ar(e,"text/plain");var l=d(e,n);if(Nn.hasOwnProperty(n.name)){var y=Nn[n.name];for(var G in y){if(!y.hasOwnProperty(G))continue;l.hasOwnProperty(G)&&(l["_"+G]=l[G]),l[G]=y[G]}}if(l.name=n.name,n.helperType&&(l.helperType=n.helperType),n.modeProps)for(var ee in n.modeProps)l[ee]=n.modeProps[ee];return l}var Nn={};function Tn(e,n){var d=Nn.hasOwnProperty(e)?Nn[e]:Nn[e]={};v(n,d)}function pr(e,n){if(n===!0)return n;if(e.copyState)return e.copyState(n);var d={};for(var l in n){var y=n[l];y instanceof Array&&(y=y.concat([])),d[l]=y}return d}function _r(e,n){for(var d;e.innerMode&&!(d=e.innerMode(n),!d||d.mode==e);)n=d.state,e=d.mode;return d||{mode:e,state:n}}function Pr(e,n,d){return e.startState?e.startState(n,d):!0}var yr=function(e,n,d){this.pos=this.start=0,this.string=e,this.tabSize=n||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=d};yr.prototype.eol=function(){return this.pos>=this.string.length},yr.prototype.sol=function(){return this.pos==this.lineStart},yr.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},yr.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},yr.prototype.eat=function(e){var n=this.string.charAt(this.pos),d;if(typeof e=="string"?d=n==e:d=n&&(e.test?e.test(n):e(n)),d)return++this.pos,n},yr.prototype.eatWhile=function(e){for(var n=this.pos;this.eat(e););return this.pos>n},yr.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},yr.prototype.skipToEnd=function(){this.pos=this.string.length},yr.prototype.skipTo=function(e){var n=this.string.indexOf(e,this.pos);if(n>-1)return this.pos=n,!0},yr.prototype.backUp=function(e){this.pos-=e},yr.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=H(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},yr.prototype.indentation=function(){return H(this.string,null,this.tabSize)-(this.lineStart?H(this.string,this.lineStart,this.tabSize):0)},yr.prototype.match=function(e,n,d){if(typeof e=="string"){var l=function(ee){return d?ee.toLowerCase():ee},y=this.string.substr(this.pos,e.length);if(l(y)==l(e))return n!==!1&&(this.pos+=e.length),!0}else{var G=this.string.slice(this.pos).match(e);return G&&G.index>0?null:(G&&n!==!1&&(this.pos+=G[0].length),G)}},yr.prototype.current=function(){return this.string.slice(this.start,this.pos)},yr.prototype.hideFirstChars=function(e,n){this.lineStart+=e;try{return n()}finally{this.lineStart-=e}},yr.prototype.lookAhead=function(e){var n=this.lineOracle;return n&&n.lookAhead(e)},yr.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function mt(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 d=e;!d.lines;)for(var l=0;;++l){var y=d.children[l],G=y.chunkSize();if(n<G){d=y;break}n-=G}return d.lines[n]}function Ke(e,n,d){var l=[],y=n.line;return e.iter(n.line,d.line+1,function(G){var ee=G.text;y==d.line&&(ee=ee.slice(0,d.ch)),y==n.line&&(ee=ee.slice(n.ch)),l.push(ee),++y}),l}function Ot(e,n,d){var l=[];return e.iter(n,d,function(y){l.push(y.text)}),l}function Me(e,n){var d=n-e.height;if(d)for(var l=e;l;l=l.parent)l.height+=d}function ye(e){if(e.parent==null)return null;for(var n=e.parent,d=ie(n.lines,e),l=n.parent;l;n=l,l=l.parent)for(var y=0;!(l.children[y]==n);++y)d+=l.children[y].chunkSize();return d+n.first}function ve(e,n){var d=e.first;e:do{for(var l=0;l<e.children.length;++l){var y=e.children[l],G=y.height;if(n<G){e=y;continue e}n-=G,d+=y.chunkSize()}return d}while(!e.lines);for(var ee=0;ee<e.lines.length;++ee){var ae=e.lines[ee],oe=ae.height;if(n<oe)break;n-=oe}return d+ee}function or(e,n){return n>=e.first&&n<e.first+e.size}function en(e,n){return String(e.lineNumberFormatter(n+e.firstLineNumber))}function Ie(e,n,d){if(d===void 0&&(d=null),!(this instanceof Ie))return new Ie(e,n,d);this.line=e,this.ch=n,this.sticky=d}function gt(e,n){return e.line-n.line||e.ch-n.ch}function Ce(e,n){return e.sticky==n.sticky&&gt(e,n)==0}function dn(e){return Ie(e.line,e.ch)}function hr(e,n){return gt(e,n)<0?n:e}function mr(e,n){return gt(e,n)<0?e:n}function q(e,n){return Math.max(e.first,Math.min(n,e.first+e.size-1))}function O(e,n){if(n.line<e.first)return Ie(e.first,0);var d=e.first+e.size-1;return n.line>d?Ie(d,mt(e,d).text.length):M(n,mt(e,n.line).text.length)}function M(e,n){var d=e.ch;return d==null||d>n?Ie(e.line,n):d<0?Ie(e.line,0):e}function X(e,n){for(var d=[],l=0;l<n.length;l++)d[l]=O(e,n[l]);return d}var se=function(e,n){this.state=e,this.lookAhead=n},Z=function(e,n,d,l){this.state=n,this.doc=e,this.line=d,this.maxLookAhead=l||0,this.baseTokens=null,this.baseTokenPos=1};Z.prototype.lookAhead=function(e){var n=this.doc.getLine(this.line+e);return n!=null&&e>this.maxLookAhead&&(this.maxLookAhead=e),n},Z.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}},Z.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},Z.fromSaved=function(e,n,d){return n instanceof se?new Z(e,pr(e.mode,n.state),d,n.lookAhead):new Z(e,pr(e.mode,n),d)},Z.prototype.save=function(e){var n=e!==!1?pr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new se(n,this.maxLookAhead):n};function Pe(e,n,d,l){var y=[e.state.modeGen],G={};Hn(e,n.text,e.doc.mode,d,function(me,We){return y.push(me,We)},G,l);for(var ee=d.state,ae=function(me){d.baseTokens=y;var We=e.state.overlays[me],Ye=1,vt=0;d.state=!0,Hn(e,n.text,We.mode,d,function(ht,Bt){for(var Zt=Ye;vt<ht;){var mn=y[Ye];mn>ht&&y.splice(Ye,1,ht,y[Ye+1],mn),Ye+=2,vt=Math.min(ht,mn)}if(!Bt)return;if(We.opaque)y.splice(Zt,Ye-Zt,ht,"overlay "+Bt),Ye=Zt+2;else for(;Zt<Ye;Zt+=2){var jn=y[Zt+1];y[Zt+1]=(jn?jn+" ":"")+"overlay "+Bt}},G),d.state=ee,d.baseTokens=null,d.baseTokenPos=1},oe=0;oe<e.state.overlays.length;++oe)ae(oe);return{styles:y,classes:G.bgClass||G.textClass?G:null}}function st(e,n,d){if(!n.styles||n.styles[0]!=e.state.modeGen){var l=wt(e,ye(n)),y=n.text.length>e.options.maxHighlightLength&&pr(e.doc.mode,l.state),G=Pe(e,n,l);y&&(l.state=y),n.stateAfter=l.save(!y),n.styles=G.styles,G.classes?n.styleClasses=G.classes:n.styleClasses&&(n.styleClasses=null),d===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return n.styles}function wt(e,n,d){var l=e.doc,y=e.display;if(!l.mode.startState)return new Z(l,!0,n);var G=fn(e,n,d),ee=G>l.first&&mt(l,G-1).stateAfter,ae=ee?Z.fromSaved(l,ee,G):new Z(l,Pr(l.mode),G);return l.iter(G,n,function(oe){Pt(e,oe.text,ae);var me=ae.line;oe.stateAfter=me==n-1||me%5==0||me>=y.viewFrom&&me<y.viewTo?ae.save():null,ae.nextLine()}),d&&(l.modeFrontier=ae.line),ae}function Pt(e,n,d,l){var y=e.doc.mode,G=new yr(n,e.options.tabSize,d);for(G.start=G.pos=l||0,n==""&&dt(y,d.state);!G.eol();)bt(y,G,d.state),G.start=G.pos}function dt(e,n){if(e.blankLine)return e.blankLine(n);if(!e.innerMode)return;var d=_r(e,n);if(d.mode.blankLine)return d.mode.blankLine(d.state)}function bt(e,n,d,l){for(var y=0;y<10;y++){l&&(l[0]=_r(e,d).mode);var G=e.token(n,d);if(n.pos>n.start)return G}throw new Error("Mode "+e.name+" failed to advance stream.")}var Mt=function(e,n,d){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=n||null,this.state=d};function Cn(e,n,d,l){var y=e.doc,G=y.mode,ee;n=O(y,n);var ae=mt(y,n.line),oe=wt(e,n.line,d),me=new yr(ae.text,e.options.tabSize,oe),We;for(l&&(We=[]);(l||me.pos<n.ch)&&!me.eol();)me.start=me.pos,ee=bt(G,me,oe.state),l&&We.push(new Mt(me,ee,pr(y.mode,oe.state)));return l?We:new Mt(me,ee,oe.state)}function Yn(e,n){if(e)for(;;){var d=e.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!d)break;e=e.slice(0,d.index)+e.slice(d.index+d[0].length);var l=d[1]?"bgClass":"textClass";n[l]==null?n[l]=d[2]:new RegExp("(?:^|\\s)"+d[2]+"(?:$|\\s)").test(n[l])||(n[l]+=" "+d[2])}return e}function Hn(e,n,d,l,y,G,ee){var ae=d.flattenSpans;ae==null&&(ae=e.options.flattenSpans);var oe=0,me=null,We=new yr(n,e.options.tabSize,l),Ye,vt=e.options.addModeClass&&[null];for(n==""&&Yn(dt(d,l.state),G);!We.eol();){if(We.pos>e.options.maxHighlightLength?(ae=!1,ee&&Pt(e,n,l,We.pos),We.pos=n.length,Ye=null):Ye=Yn(bt(d,We,l.state,vt),G),vt){var ht=vt[0].name;ht&&(Ye="m-"+(Ye?ht+" "+Ye:ht))}if(!ae||me!=Ye){for(;oe<We.start;)oe=Math.min(We.start,oe+5e3),y(oe,me);me=Ye}We.start=We.pos}for(;oe<We.pos;){var Bt=Math.min(We.pos,oe+5e3);y(Bt,me),oe=Bt}}function fn(e,n,d){for(var l,y,G=e.doc,ee=d?-1:n-(e.doc.mode.innerMode?1e3:100),ae=n;ae>ee;--ae){if(ae<=G.first)return G.first;var oe=mt(G,ae-1),me=oe.stateAfter;if(me&&(!d||ae+(me instanceof se?me.lookAhead:0)<=G.modeFrontier))return ae;var We=H(oe.text,null,e.options.tabSize);(y==null||l>We)&&(y=ae-1,l=We)}return y}function Wt(e,n){if(e.modeFrontier=Math.min(e.modeFrontier,n),e.highlightFrontier<n-10)return;for(var d=e.first,l=n-1;l>d;l--){var y=mt(e,l).stateAfter;if(y&&(!(y instanceof se)||l+y.lookAhead<n)){d=l+1;break}}e.highlightFrontier=Math.min(e.highlightFrontier,d)}var rn=!1,qt=!1;function Ft(){rn=!0}function Qn(){qt=!0}function Bn(e,n,d){this.marker=e,this.from=n,this.to=d}function xn(e,n){if(e)for(var d=0;d<e.length;++d){var l=e[d];if(l.marker==n)return l}}function Jn(e,n){for(var d,l=0;l<e.length;++l)e[l]!=n&&(d||(d=[])).push(e[l]);return d}function pn(e,n){e.markedSpans=e.markedSpans?e.markedSpans.concat([n]):[n],n.marker.attachLine(e)}function Sn(e,n,d){var l;if(e)for(var y=0;y<e.length;++y){var G=e[y],ee=G.marker,ae=G.from==null||(ee.inclusiveLeft?G.from<=n:G.from<n);if(ae||G.from==n&&ee.type=="bookmark"&&(!d||!G.marker.insertLeft)){var oe=G.to==null||(ee.inclusiveRight?G.to>=n:G.to>n);(l||(l=[])).push(new Bn(ee,G.from,oe?null:G.to))}}return l}function un(e,n,d){var l;if(e)for(var y=0;y<e.length;++y){var G=e[y],ee=G.marker,ae=G.to==null||(ee.inclusiveRight?G.to>=n:G.to>n);if(ae||G.from==n&&ee.type=="bookmark"&&(!d||G.marker.insertLeft)){var oe=G.from==null||(ee.inclusiveLeft?G.from<=n:G.from<n);(l||(l=[])).push(new Bn(ee,oe?null:G.from-n,G.to==null?null:G.to-n))}}return l}function Un(e,n){if(n.full)return null;var d=or(e,n.from.line)&&mt(e,n.from.line).markedSpans,l=or(e,n.to.line)&&mt(e,n.to.line).markedSpans;if(!d&&!l)return null;var y=n.from.ch,G=n.to.ch,ee=gt(n.from,n.to)==0,ae=Sn(d,y,ee),oe=un(l,G,ee),me=n.text.length==1,We=ne(n.text).length+(me?y:0);if(ae)for(var Ye=0;Ye<ae.length;++Ye){var vt=ae[Ye];if(vt.to==null){var ht=xn(oe,vt.marker);ht?me&&(vt.to=ht.to==null?null:ht.to+We):vt.to=y}}if(oe)for(var Bt=0;Bt<oe.length;++Bt){var Zt=oe[Bt];if(Zt.to!=null&&(Zt.to+=We),Zt.from==null){var mn=xn(ae,Zt.marker);mn||(Zt.from=We,me&&(ae||(ae=[])).push(Zt))}else Zt.from+=We,me&&(ae||(ae=[])).push(Zt)}ae&&(ae=Xn(ae)),oe&&oe!=ae&&(oe=Xn(oe));var jn=[ae];if(!me){var sr=n.text.length-2,Wn;if(sr>0&&ae)for(var dr=0;dr<ae.length;++dr)ae[dr].to==null&&(Wn||(Wn=[])).push(new Bn(ae[dr].marker,null,null));for(var Or=0;Or<sr;++Or)jn.push(Wn);jn.push(oe)}return jn}function Xn(e){for(var n=0;n<e.length;++n){var d=e[n];d.from!=null&&d.from==d.to&&d.marker.clearWhenEmpty!==!1&&e.splice(n--,1)}return e.length?e:null}function nr(e,n,d){var l=null;if(e.iter(n.line,d.line+1,function(ht){if(ht.markedSpans)for(var Bt=0;Bt<ht.markedSpans.length;++Bt){var Zt=ht.markedSpans[Bt].marker;Zt.readOnly&&(!l||ie(l,Zt)==-1)&&(l||(l=[])).push(Zt)}}),!l)return null;for(var y=[{from:n,to:d}],G=0;G<l.length;++G)for(var ee=l[G],ae=ee.find(0),oe=0;oe<y.length;++oe){var me=y[oe];if(gt(me.to,ae.from)<0||gt(me.from,ae.to)>0)continue;var We=[oe,1],Ye=gt(me.from,ae.from),vt=gt(me.to,ae.to);(Ye<0||!ee.inclusiveLeft&&!Ye)&&We.push({from:me.from,to:ae.from}),(vt>0||!ee.inclusiveRight&&!vt)&&We.push({from:ae.to,to:me.to}),y.splice.apply(y,We),oe+=We.length-3}return y}function Ln(e){var n=e.markedSpans;if(!n)return;for(var d=0;d<n.length;++d)n[d].marker.detachLine(e);e.markedSpans=null}function Kn(e,n){if(!n)return;for(var d=0;d<n.length;++d)n[d].marker.attachLine(e);e.markedSpans=n}function nn(e){return e.inclusiveLeft?-1:0}function _n(e){return e.inclusiveRight?1:0}function In(e,n){var d=e.lines.length-n.lines.length;if(d!=0)return d;var l=e.find(),y=n.find(),G=gt(l.from,y.from)||nn(e)-nn(n);if(G)return-G;var ee=gt(l.to,y.to)||_n(e)-_n(n);return ee||n.id-e.id}function wn(e,n){var d=qt&&e.markedSpans,l;if(d)for(var y=void 0,G=0;G<d.length;++G)y=d[G],y.marker.collapsed&&(n?y.from:y.to)==null&&(!l||In(l,y.marker)<0)&&(l=y.marker);return l}function Zn(e){return wn(e,!0)}function yn(e){return wn(e,!1)}function Vn(e,n){var d=qt&&e.markedSpans,l;if(d)for(var y=0;y<d.length;++y){var G=d[y];G.marker.collapsed&&(G.from==null||G.from<n)&&(G.to==null||G.to>n)&&(!l||In(l,G.marker)<0)&&(l=G.marker)}return l}function qn(e,n,d,l,y){var G=mt(e,n),ee=qt&&G.markedSpans;if(ee)for(var ae=0;ae<ee.length;++ae){var oe=ee[ae];if(!oe.marker.collapsed)continue;var me=oe.marker.find(0),We=gt(me.from,d)||nn(oe.marker)-nn(y),Ye=gt(me.to,l)||_n(oe.marker)-_n(y);if(We>=0&&Ye<=0||We<=0&&Ye>=0)continue;if(We<=0&&(oe.marker.inclusiveRight&&y.inclusiveLeft?gt(me.to,d)>=0:gt(me.to,d)>0)||We>=0&&(oe.marker.inclusiveRight&&y.inclusiveLeft?gt(me.from,l)<=0:gt(me.from,l)<0))return!0}}function kn(e){for(var n;n=Zn(e);)e=n.find(-1,!0).line;return e}function Pn(e){for(var n;n=yn(e);)e=n.find(1,!0).line;return e}function Mn(e){for(var n,d;n=yn(e);)e=n.find(1,!0).line,(d||(d=[])).push(e);return d}function Dn(e,n){var d=mt(e,n),l=kn(d);return d==l?n:ye(l)}function cn(e,n){if(n>e.lastLine())return n;var d=mt(e,n),l;if(!Ut(e,d))return n;for(;l=yn(d);)d=l.find(1,!0).line;return ye(d)+1}function Ut(e,n){var d=qt&&n.markedSpans;if(d)for(var l=void 0,y=0;y<d.length;++y){if(l=d[y],!l.marker.collapsed)continue;if(l.from==null)return!0;if(l.marker.widgetNode)continue;if(l.from==0&&l.marker.inclusiveLeft&&Gt(e,n,l))return!0}}function Gt(e,n,d){if(d.to==null){var l=d.marker.find(1,!0);return Gt(e,l.line,xn(l.line.markedSpans,d.marker))}if(d.marker.inclusiveRight&&d.to==n.text.length)return!0;for(var y=void 0,G=0;G<n.markedSpans.length;++G)if(y=n.markedSpans[G],y.marker.collapsed&&!y.marker.widgetNode&&y.from==d.to&&(y.to==null||y.to!=d.from)&&(y.marker.inclusiveLeft||d.marker.inclusiveRight)&&Gt(e,n,y))return!0}function zt(e){e=kn(e);for(var n=0,d=e.parent,l=0;l<d.lines.length;++l){var y=d.lines[l];if(y==e)break;n+=y.height}for(var G=d.parent;G;d=G,G=d.parent)for(var ee=0;ee<G.children.length;++ee){var ae=G.children[ee];if(ae==d)break;n+=ae.height}return n}function jt(e){if(e.height==0)return 0;for(var n=e.text.length,d,l=e;d=Zn(l);){var y=d.find(0,!0);l=y.from.line,n+=y.from.ch-y.to.ch}for(l=e;d=yn(l);){var G=d.find(0,!0);n-=l.text.length-G.from.ch,l=G.to.line,n+=l.text.length-G.to.ch}return n}function tn(e){var n=e.display,d=e.doc;n.maxLine=mt(d,d.first),n.maxLineLength=jt(n.maxLine),n.maxLineChanged=!0,d.iter(function(l){var y=jt(l);y>n.maxLineLength&&(n.maxLineLength=y,n.maxLine=l)})}var bn=function(e,n,d){this.text=e,Kn(this,n),this.height=d?d(this):1};bn.prototype.lineNo=function(){return ye(this)},Ue(bn);function gn(e,n,d,l){e.text=n,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),Ln(e),Kn(e,d);var y=l?l(e):1;y!=e.height&&Me(e,y)}function yt(e){e.parent=null,Ln(e)}var lt={},Je={};function nt(e,n){if(!e||/^\s*$/.test(e))return null;var d=n.addModeClass?Je:lt;return d[e]||(d[e]=e.replace(/\S+/g,"cm-$&"))}function Ge(e,n){var d=C("span",null,null,r?"padding-right: .1px":null),l={pre:C("pre",[d],"CodeMirror-line"),content:d,col:0,pos:0,cm:e,trailingSpace:!1,splitSpaces:e.getOption("lineWrapping")};n.measure={};for(var y=0;y<=(n.rest?n.rest.length:0);y++){var G=y?n.rest[y-1]:n.line,ee=void 0;l.pos=0,l.addToken=rt,$n(e.display.measure)&&(ee=sn(G,e.doc.direction))&&(l.addToken=Nt(l.addToken,ee)),l.map=[];var ae=n!=e.display.externalMeasured&&ye(G);Ht(G,l,st(e,G,ae)),G.styleClasses&&(G.styleClasses.bgClass&&(l.bgClass=w(G.styleClasses.bgClass,l.bgClass||"")),G.styleClasses.textClass&&(l.textClass=w(G.styleClasses.textClass,l.textClass||""))),l.map.length==0&&l.map.push(0,0,l.content.appendChild(Xt(e.display.measure))),y==0?(n.measure.map=l.map,n.measure.cache={}):((n.measure.maps||(n.measure.maps=[])).push(l.map),(n.measure.caches||(n.measure.caches=[])).push({}))}if(r){var oe=l.content.lastChild;(/\bcm-tab\b/.test(oe.className)||oe.querySelector&&oe.querySelector(".cm-tab"))&&(l.content.className="cm-tab-wrap-hack")}return ct(e,"renderLine",e,n.line,l.pre),l.pre.className&&(l.textClass=w(l.pre.className,l.textClass||"")),l}function pt(e){var n=f("span","\u2022","cm-invalidchar");return n.title="\\u"+e.charCodeAt(0).toString(16),n.setAttribute("aria-label",n.title),n}function rt(e,n,d,l,y,G,ee){if(!n)return;var ae=e.splitSpaces?Tt(n,e.trailingSpace):n,oe=e.cm.state.specialChars,me=!1,We;if(!oe.test(n))e.col+=n.length,We=document.createTextNode(ae),e.map.push(e.pos,e.pos+n.length,We),$&&z<9&&(me=!0),e.pos+=n.length;else{We=document.createDocumentFragment();for(var Ye=0;;){oe.lastIndex=Ye;var vt=oe.exec(n),ht=vt?vt.index-Ye:n.length-Ye;if(ht){var Bt=document.createTextNode(ae.slice(Ye,Ye+ht));$&&z<9?We.appendChild(f("span",[Bt])):We.appendChild(Bt),e.map.push(e.pos,e.pos+ht,Bt),e.col+=ht,e.pos+=ht}if(!vt)break;Ye+=ht+1;var Zt=void 0;if(vt[0]==" "){var mn=e.cm.options.tabSize,jn=mn-e.col%mn;Zt=We.appendChild(f("span",be(jn),"cm-tab")),Zt.setAttribute("role","presentation"),Zt.setAttribute("cm-text"," "),e.col+=jn}else vt[0]=="\r"||vt[0]==`
`?(Zt=We.appendChild(f("span",vt[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Zt.setAttribute("cm-text",vt[0]),e.col+=1):(Zt=e.cm.options.specialCharPlaceholder(vt[0]),Zt.setAttribute("cm-text",vt[0]),$&&z<9?We.appendChild(f("span",[Zt])):We.appendChild(Zt),e.col+=1);e.map.push(e.pos,e.pos+1,Zt),e.pos++}}if(e.trailingSpace=ae.charCodeAt(n.length-1)==32,d||l||y||me||G||ee){var sr=d||"";l&&(sr+=l),y&&(sr+=y);var Wn=f("span",[We],sr,G);if(ee)for(var dr in ee)ee.hasOwnProperty(dr)&&dr!="style"&&dr!="class"&&Wn.setAttribute(dr,ee[dr]);return e.content.appendChild(Wn)}e.content.appendChild(We)}function Tt(e,n){if(e.length>1&&!/ /.test(e))return e;for(var d=n,l="",y=0;y<e.length;y++){var G=e.charAt(y);G==" "&&d&&(y==e.length-1||e.charCodeAt(y+1)==32)&&(G="\xA0"),l+=G,d=G==" "}return l}function Nt(e,n){return function(d,l,y,G,ee,ae,oe){y=y?y+" cm-force-border":"cm-force-border";for(var me=d.pos,We=me+l.length;;){for(var Ye=void 0,vt=0;vt<n.length&&!(Ye=n[vt],Ye.to>me&&Ye.from<=me);vt++);if(Ye.to>=We)return e(d,l,y,G,ee,ae,oe);e(d,l.slice(0,Ye.to-me),y,G,null,ae,oe),G=null,l=l.slice(Ye.to-me),me=Ye.to}}}function St(e,n,d,l){var y=!l&&d.widgetNode;y&&e.map.push(e.pos,e.pos+n,y),!l&&e.cm.display.input.needsContentAttribute&&(y||(y=e.content.appendChild(document.createElement("span"))),y.setAttribute("cm-marker",d.id)),y&&(e.cm.display.input.setUneditable(y),e.content.appendChild(y)),e.pos+=n,e.trailingSpace=!1}function Ht(e,n,d){var l=e.markedSpans,y=e.text,G=0;if(!l){for(var ee=1;ee<d.length;ee+=2)n.addToken(n,y.slice(G,G=d[ee]),nt(d[ee+1],n.cm.options));return}for(var ae=y.length,oe=0,me=1,We="",Ye,vt,ht=0,Bt,Zt,mn,jn,sr;;){if(ht==oe){Bt=Zt=mn=vt="",sr=null,jn=null,ht=Infinity;for(var Wn=[],dr=void 0,Or=0;Or<l.length;++Or){var Tr=l[Or],Dr=Tr.marker;if(Dr.type=="bookmark"&&Tr.from==oe&&Dr.widgetNode)Wn.push(Dr);else if(Tr.from<=oe&&(Tr.to==null||Tr.to>oe||Dr.collapsed&&Tr.to==oe&&Tr.from==oe)){if(Tr.to!=null&&Tr.to!=oe&&ht>Tr.to&&(ht=Tr.to,Zt=""),Dr.className&&(Bt+=" "+Dr.className),Dr.css&&(vt=(vt?vt+";":"")+Dr.css),Dr.startStyle&&Tr.from==oe&&(mn+=" "+Dr.startStyle),Dr.endStyle&&Tr.to==ht&&(dr||(dr=[])).push(Dr.endStyle,Tr.to),Dr.title&&((sr||(sr={})).title=Dr.title),Dr.attributes)for(var Wr in Dr.attributes)(sr||(sr={}))[Wr]=Dr.attributes[Wr];Dr.collapsed&&(!jn||In(jn.marker,Dr)<0)&&(jn=Tr)}else Tr.from>oe&&ht>Tr.from&&(ht=Tr.from)}if(dr)for(var ri=0;ri<dr.length;ri+=2)dr[ri+1]==ht&&(Zt+=" "+dr[ri]);if(!jn||jn.from==oe)for(var zr=0;zr<Wn.length;++zr)St(n,0,Wn[zr]);if(jn&&(jn.from||0)==oe){if(St(n,(jn.to==null?ae+1:jn.to)-oe,jn.marker,jn.from==null),jn.to==null)return;jn.to==oe&&(jn=!1)}}if(oe>=ae)break;for(var Ei=Math.min(ae,ht);;){if(We){var gi=oe+We.length;if(!jn){var Qr=gi>Ei?We.slice(0,Ei-oe):We;n.addToken(n,Qr,Ye?Ye+Bt:Bt,mn,oe+Qr.length==ht?Zt:"",vt,sr)}if(gi>=Ei){We=We.slice(Ei-oe),oe=Ei;break}oe=gi,mn=""}We=y.slice(G,G=d[me++]),Ye=nt(d[me++],n.cm.options)}}}function Rt(e,n,d){this.line=n,this.rest=Mn(n),this.size=this.rest?ye(ne(this.rest))-d+1:1,this.node=this.text=null,this.hidden=Ut(e,n)}function Lt(e,n,d){for(var l=[],y,G=n;G<d;G=y){var ee=new Rt(e.doc,mt(e.doc,G),G);y=G+ee.size,l.push(ee)}return l}var En=null;function on(e){En?En.ops.push(e):e.ownsGroup=En={ops:[e],delayedCallbacks:[]}}function gr(e){var n=e.delayedCallbacks,d=0;do{for(;d<n.length;d++)n[d].call(null);for(var l=0;l<e.ops.length;l++){var y=e.ops[l];if(y.cursorActivityHandlers)for(;y.cursorActivityCalled<y.cursorActivityHandlers.length;)y.cursorActivityHandlers[y.cursorActivityCalled++].call(null,y.cm)}}while(d<n.length)}function er(e,n){var d=e.ownsGroup;if(!d)return;try{gr(d)}finally{En=null,n(d)}}var tr=null;function Yt(e,n){var d=Ct(e,n);if(!d.length)return;var l=Array.prototype.slice.call(arguments,2),y;En?y=En.delayedCallbacks:tr?y=tr:(y=tr=[],setTimeout(Rn,0));for(var G=function(ae){y.push(function(){return d[ae].apply(null,l)})},ee=0;ee<d.length;++ee)G(ee)}function Rn(){var e=tr;tr=null;for(var n=0;n<e.length;++n)e[n]()}function zn(e,n,d,l){for(var y=0;y<n.changes.length;y++){var G=n.changes[y];G=="text"?jr(e,n):G=="gutter"?lr(e,n,d,l):G=="class"?xr(e,n):G=="widget"&&wr(e,n,l)}n.changes=null}function rr(e){return e.node==e.text&&(e.node=f("div",null,null,"position: relative"),e.text.parentNode&&e.text.parentNode.replaceChild(e.node,e.text),e.node.appendChild(e.text),$&&z<8&&(e.node.style.zIndex=2)),e.node}function On(e,n){var d=n.bgClass?n.bgClass+" "+(n.line.bgClass||""):n.line.bgClass;if(d&&(d+=" CodeMirror-linebackground"),n.background)d?n.background.className=d:(n.background.parentNode.removeChild(n.background),n.background=null);else if(d){var l=rr(n);n.background=l.insertBefore(f("div",null,d),l.firstChild),e.display.input.setUneditable(n.background)}}function Ir(e,n){var d=e.display.externalMeasured;return d&&d.line==n.line?(e.display.externalMeasured=null,n.measure=d.measure,d.built):Ge(e,n)}function jr(e,n){var d=n.text.className,l=Ir(e,n);n.text==n.node&&(n.node=l.pre),n.text.parentNode.replaceChild(l.pre,n.text),n.text=l.pre,l.bgClass!=n.bgClass||l.textClass!=n.textClass?(n.bgClass=l.bgClass,n.textClass=l.textClass,xr(e,n)):d&&(n.text.className=d)}function xr(e,n){On(e,n),n.line.wrapClass?rr(n).className=n.line.wrapClass:n.node!=n.text&&(n.node.className="");var d=n.textClass?n.textClass+" "+(n.line.textClass||""):n.line.textClass;n.text.className=d||""}function lr(e,n,d,l){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 y=rr(n);n.gutterBackground=f("div",null,"CodeMirror-gutter-background "+n.line.gutterClass,"left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px; width: "+l.gutterTotalWidth+"px"),e.display.input.setUneditable(n.gutterBackground),y.insertBefore(n.gutterBackground,n.text)}var G=n.line.gutterMarkers;if(e.options.lineNumbers||G){var ee=rr(n),ae=n.gutter=f("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?l.fixedPos:-l.gutterTotalWidth)+"px");if(e.display.input.setUneditable(ae),ee.insertBefore(ae,n.text),n.line.gutterClass&&(ae.className+=" "+n.line.gutterClass),e.options.lineNumbers&&(!G||!G["CodeMirror-linenumbers"])&&(n.lineNumber=ae.appendChild(f("div",en(e.options,d),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+l.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),G)for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var me=e.display.gutterSpecs[oe].className,We=G.hasOwnProperty(me)&&G[me];We&&ae.appendChild(f("div",[We],"CodeMirror-gutter-elt","left: "+l.gutterLeft[me]+"px; width: "+l.gutterWidth[me]+"px"))}}}function wr(e,n,d){n.alignable&&(n.alignable=null);for(var l=I("CodeMirror-linewidget"),y=n.node.firstChild,G=void 0;y;y=G)G=y.nextSibling,l.test(y.className)&&n.node.removeChild(y);Cr(e,n,d)}function Er(e,n,d,l){var y=Ir(e,n);return n.text=n.node=y.pre,y.bgClass&&(n.bgClass=y.bgClass),y.textClass&&(n.textClass=y.textClass),xr(e,n),lr(e,n,d,l),Cr(e,n,l),n.node}function Cr(e,n,d){if(Ur(e,n.line,n,d,!0),n.rest)for(var l=0;l<n.rest.length;l++)Ur(e,n.rest[l],n,d,!1)}function Ur(e,n,d,l,y){if(!n.widgets)return;for(var G=rr(d),ee=0,ae=n.widgets;ee<ae.length;++ee){var oe=ae[ee],me=f("div",[oe.node],"CodeMirror-linewidget"+(oe.className?" "+oe.className:""));oe.handleMouseEvents||me.setAttribute("cm-ignore-events","true"),Vr(oe,me,d,l),e.display.input.setUneditable(me),y&&oe.above?G.insertBefore(me,d.gutter||d.text):G.appendChild(me),Yt(oe,"redraw")}}function Vr(e,n,d,l){if(e.noHScroll){(d.alignable||(d.alignable=[])).push(n);var y=l.wrapperWidth;n.style.left=l.fixedPos+"px",e.coverGutter||(y-=l.gutterTotalWidth,n.style.paddingLeft=l.gutterTotalWidth+"px"),n.style.width=y+"px"}e.coverGutter&&(n.style.zIndex=5,n.style.position="relative",e.noHScroll||(n.style.marginLeft=-l.gutterTotalWidth+"px"))}function Fr(e){if(e.height!=null)return e.height;var n=e.doc.cm;if(!n)return 0;if(!_(document.body,e.node)){var d="position: relative;";e.coverGutter&&(d+="margin-left: -"+n.display.gutters.offsetWidth+"px;"),e.noHScroll&&(d+="width: "+n.display.wrapper.clientWidth+"px;"),h(n.display.measure,f("div",[e.node],null,d))}return e.height=e.node.parentNode.offsetHeight}function kr(e,n){for(var d=Fe(n);d!=e.wrapper;d=d.parentNode)if(!d||d.nodeType==1&&d.getAttribute("cm-ignore-events")=="true"||d.parentNode==e.sizer&&d!=e.mover)return!0}function Ti(e){return e.lineSpace.offsetTop}function Kr(e){return e.mover.offsetHeight-e.lineSpace.offsetHeight}function Si(e){if(e.cachedPaddingH)return e.cachedPaddingH;var n=h(e.measure,f("pre","x","CodeMirror-line-like")),d=window.getComputedStyle?window.getComputedStyle(n):n.currentStyle,l={left:parseInt(d.paddingLeft),right:parseInt(d.paddingRight)};return!isNaN(l.left)&&!isNaN(l.right)&&(e.cachedPaddingH=l),l}function Zr(e){return le-e.display.nativeBarWidth}function ei(e){return e.display.scroller.clientWidth-Zr(e)-e.display.barWidth}function yi(e){return e.display.scroller.clientHeight-Zr(e)-e.display.barHeight}function Ri(e,n,d){var l=e.options.lineWrapping,y=l&&ei(e);if(!n.measure.heights||l&&n.measure.width!=y){var G=n.measure.heights=[];if(l){n.measure.width=y;for(var ee=n.text.firstChild.getClientRects(),ae=0;ae<ee.length-1;ae++){var oe=ee[ae],me=ee[ae+1];Math.abs(oe.bottom-me.bottom)>2&&G.push((oe.bottom+me.top)/2-d.top)}}G.push(d.bottom-d.top)}}function Va(e,n,d){if(e.line==n)return{map:e.measure.map,cache:e.measure.cache};for(var l=0;l<e.rest.length;l++)if(e.rest[l]==n)return{map:e.measure.maps[l],cache:e.measure.caches[l]};for(var y=0;y<e.rest.length;y++)if(ye(e.rest[y])>d)return{map:e.measure.maps[y],cache:e.measure.caches[y],before:!0}}function fi(e,n){n=kn(n);var d=ye(n),l=e.display.externalMeasured=new Rt(e.doc,n,d);l.lineN=d;var y=l.built=Ge(e,l);return l.text=y.pre,h(e.display.lineMeasure,y.pre),l}function Xa(e,n,d,l){return ai(e,ki(e,n),d,l)}function Ki(e,n){if(n>=e.display.viewFrom&&n<e.display.viewTo)return e.display.view[zi(e,n)];var d=e.display.externalMeasured;if(d&&n>=d.lineN&&n<d.lineN+d.size)return d}function ki(e,n){var d=ye(n),l=Ki(e,d);l&&!l.text?l=null:l&&l.changes&&(zn(e,l,d,As(e)),e.curOp.forceUpdate=!0),l||(l=fi(e,n));var y=Va(l,n,d);return{line:n,view:l,rect:null,map:y.map,cache:y.cache,before:y.before,hasHeights:!1}}function ai(e,n,d,l,y){n.before&&(d=-1);var G=d+(l||""),ee;return n.cache.hasOwnProperty(G)?ee=n.cache[G]:(n.rect||(n.rect=n.view.text.getBoundingClientRect()),n.hasHeights||(Ri(e,n.view,n.rect),n.hasHeights=!0),ee=Es(e,n,d,l),ee.bogus||(n.cache[G]=ee)),{left:ee.left,right:ee.right,top:y?ee.rtop:ee.top,bottom:y?ee.rbottom:ee.bottom}}var Ji={left:0,right:0,top:0,bottom:0};function ys(e,n,d){for(var l,y,G,ee,ae,oe,me=0;me<e.length;me+=3)if(ae=e[me],oe=e[me+1],n<ae?(y=0,G=1,ee="left"):n<oe?(y=n-ae,G=y+1):(me==e.length-3||n==oe&&e[me+3]>n)&&(G=oe-ae,y=G-1,n>=oe&&(ee="right")),y!=null){if(l=e[me+2],ae==oe&&d==(l.insertLeft?"left":"right")&&(ee=d),d=="left"&&y==0)for(;me&&e[me-2]==e[me-3]&&e[me-1].insertLeft;)l=e[(me-=3)+2],ee="left";if(d=="right"&&y==oe-ae)for(;me<e.length-3&&e[me+3]==e[me+4]&&!e[me+5].insertLeft;)l=e[(me+=3)+2],ee="right";break}return{node:l,start:y,end:G,collapse:ee,coverStart:ae,coverEnd:oe}}function bs(e,n){var d=Ji;if(n=="left")for(var l=0;l<e.length&&!((d=e[l]).left!=d.right);l++);else for(var y=e.length-1;y>=0&&!((d=e[y]).left!=d.right);y--);return d}function Es(e,n,d,l){var y=ys(n.map,d,l),G=y.node,ee=y.start,ae=y.end,oe=y.collapse,me;if(G.nodeType==3){for(var We=0;We<4;We++){for(;ee&&Qe(n.line.text.charAt(y.coverStart+ee));)--ee;for(;y.coverStart+ae<y.coverEnd&&Qe(n.line.text.charAt(y.coverStart+ae));)++ae;if($&&z<9&&ee==0&&ae==y.coverEnd-y.coverStart?me=G.parentNode.getBoundingClientRect():me=bs(E(G,ee,ae).getClientRects(),l),me.left||me.right||ee==0)break;ae=ee,ee=ee-1,oe="right"}$&&z<11&&(me=co(e.display.measure,me))}else{ee>0&&(oe=l="right");var Ye;e.options.lineWrapping&&(Ye=G.getClientRects()).length>1?me=Ye[l=="right"?Ye.length-1:0]:me=G.getBoundingClientRect()}if($&&z<9&&!ee&&(!me||!me.left&&!me.right)){var vt=G.parentNode.getClientRects()[0];vt?me={left:vt.left,right:vt.left+qi(e.display),top:vt.top,bottom:vt.bottom}:me=Ji}for(var ht=me.top-n.rect.top,Bt=me.bottom-n.rect.top,Zt=(ht+Bt)/2,mn=n.view.measure.heights,jn=0;jn<mn.length-1&&!(Zt<mn[jn]);jn++);var sr=jn?mn[jn-1]:0,Wn=mn[jn],dr={left:(oe=="right"?me.right:me.left)-n.rect.left,right:(oe=="left"?me.left:me.right)-n.rect.left,top:sr,bottom:Wn};return!me.left&&!me.right&&(dr.bogus=!0),e.options.singleCursorHeightPerLine||(dr.rtop=ht,dr.rbottom=Bt),dr}function co(e,n){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!fr(e))return n;var d=screen.logicalXDPI/screen.deviceXDPI,l=screen.logicalYDPI/screen.deviceYDPI;return{left:n.left*d,right:n.right*d,top:n.top*l,bottom:n.bottom*l}}function ho(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 xs(e){e.display.externalMeasure=null,b(e.display.lineMeasure);for(var n=0;n<e.display.view.length;n++)ho(e.display.view[n])}function Ca(e){xs(e),e.display.cachedCharWidth=e.display.cachedTextHeight=e.display.cachedPaddingH=null,e.options.lineWrapping||(e.display.maxLineChanged=!0),e.display.lineNumChars=null}function fo(){return m&&i?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function po(){return m&&i?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function ws(e){var n=0;if(e.widgets)for(var d=0;d<e.widgets.length;++d)e.widgets[d].above&&(n+=Fr(e.widgets[d]));return n}function $a(e,n,d,l,y){if(!y){var G=ws(n);d.top+=G,d.bottom+=G}if(l=="line")return d;l||(l="local");var ee=zt(n);if(l=="local"?ee+=Ti(e.display):ee-=e.display.viewOffset,l=="page"||l=="window"){var ae=e.display.lineSpace.getBoundingClientRect();ee+=ae.top+(l=="window"?0:po());var oe=ae.left+(l=="window"?0:fo());d.left+=oe,d.right+=oe}return d.top+=ee,d.bottom+=ee,d}function Cs(e,n,d){if(d=="div")return n;var l=n.left,y=n.top;if(d=="page")l-=fo(),y-=po();else if(d=="local"||!d){var G=e.display.sizer.getBoundingClientRect();l+=G.left,y+=G.top}var ee=e.display.lineSpace.getBoundingClientRect();return{left:l-ee.left,top:y-ee.top}}function Ts(e,n,d,l,y){return l||(l=mt(e.doc,n.line)),$a(e,l,Xa(e,l,n.ch,y),d)}function xi(e,n,d,l,y,G){l=l||mt(e.doc,n.line),y||(y=ki(e,l));function ee(Bt,Zt){var mn=ai(e,y,Bt,Zt?"right":"left",G);return Zt?mn.left=mn.right:mn.right=mn.left,$a(e,l,mn,d)}var ae=sn(l,e.doc.direction),oe=n.ch,me=n.sticky;if(oe>=l.text.length?(oe=l.text.length,me="before"):oe<=0&&(oe=0,me="after"),!ae)return ee(me=="before"?oe-1:oe,me=="before");function We(Bt,Zt,mn){var jn=ae[Zt],sr=jn.level==1;return ee(mn?Bt-1:Bt,sr!=mn)}var Ye=Qt(ae,oe,me),vt=Vt,ht=We(oe,Ye,me=="before");return vt!=null&&(ht.other=We(oe,vt,me!="before")),ht}function mo(e,n){var d=0;n=O(e.doc,n),e.options.lineWrapping||(d=qi(e.display)*n.ch);var l=mt(e.doc,n.line),y=zt(l)+Ti(e.display);return{left:d,right:d,top:y,bottom:y+l.height}}function Ss(e,n,d,l,y){var G=Ie(e,n,d);return G.xRel=y,l&&(G.outside=l),G}function Rs(e,n,d){var l=e.doc;if(d+=e.display.viewOffset,d<0)return Ss(l.first,0,null,-1,-1);var y=ve(l,d),G=l.first+l.size-1;if(y>G)return Ss(l.first+l.size-1,mt(l,G).text.length,null,1,1);n<0&&(n=0);for(var ee=mt(l,y);;){var ae=El(e,ee,y,n,d),oe=Vn(ee,ae.ch+(ae.xRel>0||ae.outside>0?1:0));if(!oe)return ae;var me=oe.find(1);if(me.line==y)return me;ee=mt(l,y=me.line)}}function go(e,n,d,l){l-=ws(n);var y=n.text.length,G=Et(function(ee){return ai(e,d,ee-1).bottom<=l},y,0);return y=Et(function(ee){return ai(e,d,ee).top>l},G,y),{begin:G,end:y}}function vo(e,n,d,l){d||(d=ki(e,n));var y=$a(e,n,ai(e,d,l),"line").top;return go(e,n,d,y)}function Os(e,n,d,l){return e.bottom<=d?!1:e.top>d?!0:(l?e.left:e.right)>n}function El(e,n,d,l,y){y-=zt(n);var G=ki(e,n),ee=ws(n),ae=0,oe=n.text.length,me=!0,We=sn(n,e.doc.direction);if(We){var Ye=(e.options.lineWrapping?Ya:Ta)(e,n,d,G,We,l,y);me=Ye.level!=1,ae=me?Ye.from:Ye.to-1,oe=me?Ye.to:Ye.from-1}var vt=null,ht=null,Bt=Et(function(Or){var Tr=ai(e,G,Or);return Tr.top+=ee,Tr.bottom+=ee,Os(Tr,l,y,!1)?(Tr.top<=y&&Tr.left<=l&&(vt=Or,ht=Tr),!0):!1},ae,oe),Zt,mn,jn=!1;if(ht){var sr=l-ht.left<ht.right-l,Wn=sr==me;Bt=vt+(Wn?0:1),mn=Wn?"after":"before",Zt=sr?ht.left:ht.right}else{!me&&(Bt==oe||Bt==ae)&&Bt++,mn=Bt==0?"after":Bt==n.text.length?"before":ai(e,G,Bt-(me?1:0)).bottom+ee<=y==me?"after":"before";var dr=xi(e,Ie(d,Bt,mn),"line",n,G);Zt=dr.left,jn=y<dr.top?-1:y>=dr.bottom?1:0}return Bt=Ve(n.text,Bt,1),Ss(d,Bt,mn,jn,l-Zt)}function Ta(e,n,d,l,y,G,ee){var ae=Et(function(Ye){var vt=y[Ye],ht=vt.level!=1;return Os(xi(e,Ie(d,ht?vt.to:vt.from,ht?"before":"after"),"line",n,l),G,ee,!0)},0,y.length-1),oe=y[ae];if(ae>0){var me=oe.level!=1,We=xi(e,Ie(d,me?oe.from:oe.to,me?"after":"before"),"line",n,l);Os(We,G,ee,!0)&&We.top>ee&&(oe=y[ae-1])}return oe}function Ya(e,n,d,l,y,G,ee){var ae=go(e,n,l,ee),oe=ae.begin,me=ae.end;/\s/.test(n.text.charAt(me-1))&&me--;for(var We=null,Ye=null,vt=0;vt<y.length;vt++){var ht=y[vt];if(ht.from>=me||ht.to<=oe)continue;var Bt=ht.level!=1,Zt=ai(e,l,Bt?Math.min(me,ht.to)-1:Math.max(oe,ht.from)).right,mn=Zt<G?G-Zt+1e9:Zt-G;(!We||Ye>mn)&&(We=ht,Ye=mn)}return We||(We=y[y.length-1]),We.from<oe&&(We={from:oe,to:We.to,level:We.level}),We.to>me&&(We={from:We.from,to:me,level:We.level}),We}var Oi;function Zi(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Oi==null){Oi=f("pre",null,"CodeMirror-line-like");for(var n=0;n<49;++n)Oi.appendChild(document.createTextNode("x")),Oi.appendChild(f("br"));Oi.appendChild(document.createTextNode("x"))}h(e.measure,Oi);var d=Oi.offsetHeight/50;return d>3&&(e.cachedTextHeight=d),b(e.measure),d||1}function qi(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var n=f("span","xxxxxxxxxx"),d=f("pre",[n],"CodeMirror-line-like");h(e.measure,d);var l=n.getBoundingClientRect(),y=(l.right-l.left)/10;return y>2&&(e.cachedCharWidth=y),y||10}function As(e){for(var n=e.display,d={},l={},y=n.gutters.clientLeft,G=n.gutters.firstChild,ee=0;G;G=G.nextSibling,++ee){var ae=e.display.gutterSpecs[ee].className;d[ae]=G.offsetLeft+G.clientLeft+y,l[ae]=G.clientWidth}return{fixedPos:Ds(n),gutterTotalWidth:n.gutters.offsetWidth,gutterLeft:d,gutterWidth:l,wrapperWidth:n.wrapper.clientWidth}}function Ds(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function _o(e){var n=Zi(e.display),d=e.options.lineWrapping,l=d&&Math.max(5,e.display.scroller.clientWidth/qi(e.display)-3);return function(y){if(Ut(e.doc,y))return 0;var G=0;if(y.widgets)for(var ee=0;ee<y.widgets.length;ee++)y.widgets[ee].height&&(G+=y.widgets[ee].height);return d?G+(Math.ceil(y.text.length/l)||1)*n:G+n}}function Ps(e){var n=e.doc,d=_o(e);n.iter(function(l){var y=d(l);y!=l.height&&Me(l,y)})}function Gi(e,n,d,l){var y=e.display;if(!d&&Fe(n).getAttribute("cm-not-content")=="true")return null;var G,ee,ae=y.lineSpace.getBoundingClientRect();try{G=n.clientX-ae.left,ee=n.clientY-ae.top}catch(Ye){return null}var oe=Rs(e,G,ee),me;if(l&&oe.xRel>0&&(me=mt(e.doc,oe.line).text).length==oe.ch){var We=H(me,me.length,e.options.tabSize)-me.length;oe=Ie(oe.line,Math.max(0,Math.round((G-Si(e.display).left)/qi(e.display))-We))}return oe}function zi(e,n){if(n>=e.display.viewTo)return null;if(n-=e.display.viewFrom,n<0)return null;for(var d=e.display.view,l=0;l<d.length;l++)if(n-=d[l].size,n<0)return l}function li(e,n,d,l){n==null&&(n=e.doc.first),d==null&&(d=e.doc.first+e.doc.size),l||(l=0);var y=e.display;if(l&&d<y.viewTo&&(y.updateLineNumbers==null||y.updateLineNumbers>n)&&(y.updateLineNumbers=n),e.curOp.viewChanged=!0,n>=y.viewTo)qt&&Dn(e.doc,n)<y.viewTo&&Ni(e);else if(d<=y.viewFrom)qt&&cn(e.doc,d+l)>y.viewFrom?Ni(e):(y.viewFrom+=l,y.viewTo+=l);else if(n<=y.viewFrom&&d>=y.viewTo)Ni(e);else if(n<=y.viewFrom){var G=ea(e,d,d+l,1);G?(y.view=y.view.slice(G.index),y.viewFrom=G.lineN,y.viewTo+=l):Ni(e)}else if(d>=y.viewTo){var ee=ea(e,n,n,-1);ee?(y.view=y.view.slice(0,ee.index),y.viewTo=ee.lineN):Ni(e)}else{var ae=ea(e,n,n,-1),oe=ea(e,d,d+l,1);ae&&oe?(y.view=y.view.slice(0,ae.index).concat(Lt(e,ae.lineN,oe.lineN)).concat(y.view.slice(oe.index)),y.viewTo+=l):Ni(e)}var me=y.externalMeasured;me&&(d<me.lineN?me.lineN+=l:n<me.lineN+me.size&&(y.externalMeasured=null))}function Mi(e,n,d){e.curOp.viewChanged=!0;var l=e.display,y=e.display.externalMeasured;if(y&&n>=y.lineN&&n<y.lineN+y.size&&(l.externalMeasured=null),n<l.viewFrom||n>=l.viewTo)return;var G=l.view[zi(e,n)];if(G.node==null)return;var ee=G.changes||(G.changes=[]);ie(ee,d)==-1&&ee.push(d)}function Ni(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function ea(e,n,d,l){var y=zi(e,n),G,ee=e.display.view;if(!qt||d==e.doc.first+e.doc.size)return{index:y,lineN:d};for(var ae=e.display.viewFrom,oe=0;oe<y;oe++)ae+=ee[oe].size;if(ae!=n){if(l>0){if(y==ee.length-1)return null;G=ae+ee[y].size-n,y++}else G=ae-n;n+=G,d+=G}for(;Dn(e.doc,d)!=d;){if(y==(l<0?0:ee.length-1))return null;d+=l*ee[y-(l<0?1:0)].size,y+=l}return{index:y,lineN:d}}function xl(e,n,d){var l=e.display,y=l.view;y.length==0||n>=l.viewTo||d<=l.viewFrom?(l.view=Lt(e,n,d),l.viewFrom=n):(l.viewFrom>n?l.view=Lt(e,n,l.viewFrom).concat(l.view):l.viewFrom<n&&(l.view=l.view.slice(zi(e,n))),l.viewFrom=n,l.viewTo<d?l.view=l.view.concat(Lt(e,l.viewTo,d)):l.viewTo>d&&(l.view=l.view.slice(0,zi(e,d)))),l.viewTo=d}function Ls(e){for(var n=e.display.view,d=0,l=0;l<n.length;l++){var y=n[l];!y.hidden&&(!y.node||y.changes)&&++d}return d}function ta(e){e.display.input.showSelection(e.display.input.prepareSelection())}function Is(e,n){n===void 0&&(n=!0);for(var d=e.doc,l={},y=l.cursors=document.createDocumentFragment(),G=l.selection=document.createDocumentFragment(),ee=0;ee<d.sel.ranges.length;ee++){if(!n&&ee==d.sel.primIndex)continue;var ae=d.sel.ranges[ee];if(ae.from().line>=e.display.viewTo||ae.to().line<e.display.viewFrom)continue;var oe=ae.empty();(oe||e.options.showCursorWhenSelecting)&&yo(e,ae.head,y),oe||bo(e,ae,G)}return l}function yo(e,n,d){var l=xi(e,n,"div",null,null,!e.options.singleCursorHeightPerLine),y=d.appendChild(f("div","\xA0","CodeMirror-cursor"));if(y.style.left=l.left+"px",y.style.top=l.top+"px",y.style.height=Math.max(0,l.bottom-l.top)*e.options.cursorHeight+"px",l.other){var G=d.appendChild(f("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));G.style.display="",G.style.left=l.other.left+"px",G.style.top=l.other.top+"px",G.style.height=(l.other.bottom-l.other.top)*.85+"px"}}function Qa(e,n){return e.top-n.top||e.left-n.left}function bo(e,n,d){var l=e.display,y=e.doc,G=document.createDocumentFragment(),ee=Si(e.display),ae=ee.left,oe=Math.max(l.sizerWidth,ei(e)-l.sizer.offsetLeft)-ee.right,me=y.direction=="ltr";function We(Wn,dr,Or,Tr){dr<0&&(dr=0),dr=Math.round(dr),Tr=Math.round(Tr),G.appendChild(f("div",null,"CodeMirror-selected","position: absolute; left: "+Wn+`px;
top: `+dr+"px; width: "+(Or==null?oe-Wn:Or)+`px;
height: `+(Tr-dr)+"px"))}function Ye(Wn,dr,Or){var Tr=mt(y,Wn),Dr=Tr.text.length,Wr,ri;function zr(Qr,vi){return Ts(e,Ie(Wn,Qr),"div",Tr,vi)}function Ei(Qr,vi,oi){var qr=vo(e,Tr,null,Qr),Jr=vi=="ltr"==(oi=="after")?"left":"right",Xr=oi=="after"?qr.begin:qr.end-(/\s/.test(Tr.text.charAt(qr.end-1))?2:1);return zr(Xr,Jr)[Jr]}var gi=sn(Tr,y.direction);return kt(gi,dr||0,Or==null?Dr:Or,function(Qr,vi,oi,qr){var Jr=oi=="ltr",Xr=zr(Qr,Jr?"left":"right"),_i=zr(vi-1,Jr?"right":"left"),vs=dr==null&&Qr==0,wa=Or==null&&vi==Dr,ci=qr==0,Hi=!gi||qr==gi.length-1;if(_i.top-Xr.top<=3){var ii=(me?vs:wa)&&ci,nu=(me?wa:vs)&&Hi,Qi=ii?ae:(Jr?Xr:_i).left,Ga=nu?oe:(Jr?_i:Xr).right;We(Qi,Xr.top,Ga-Qi,Xr.bottom)}else{var za,hi,_s,ru;Jr?(za=me&&vs&&ci?ae:Xr.left,hi=me?oe:Ei(Qr,oi,"before"),_s=me?ae:Ei(vi,oi,"after"),ru=me&&wa&&Hi?oe:_i.right):(za=me?Ei(Qr,oi,"before"):ae,hi=!me&&vs&&ci?oe:Xr.right,_s=!me&&wa&&Hi?ae:_i.left,ru=me?Ei(vi,oi,"after"):oe),We(za,Xr.top,hi-za,Xr.bottom),Xr.bottom<_i.top&&We(ae,Xr.bottom,null,_i.top),We(_s,_i.top,ru-_s,_i.bottom)}(!Wr||Qa(Xr,Wr)<0)&&(Wr=Xr),Qa(_i,Wr)<0&&(Wr=_i),(!ri||Qa(Xr,ri)<0)&&(ri=Xr),Qa(_i,ri)<0&&(ri=_i)}),{start:Wr,end:ri}}var vt=n.from(),ht=n.to();if(vt.line==ht.line)Ye(vt.line,vt.ch,ht.ch);else{var Bt=mt(y,vt.line),Zt=mt(y,ht.line),mn=kn(Bt)==kn(Zt),jn=Ye(vt.line,vt.ch,mn?Bt.text.length+1:null).end,sr=Ye(ht.line,mn?0:null,ht.ch).start;mn&&(jn.top<sr.top-2?(We(jn.right,jn.top,null,jn.bottom),We(ae,sr.top,sr.left,sr.bottom)):We(jn.right,jn.top,sr.left-jn.right,jn.bottom)),jn.bottom<sr.top&&We(ae,jn.bottom,null,sr.top)}d.appendChild(G)}function ks(e){if(!e.state.focused)return;var n=e.display;clearInterval(n.blinker);var d=!0;n.cursorDiv.style.visibility="",e.options.cursorBlinkRate>0?n.blinker=setInterval(function(){e.hasFocus()||na(e),n.cursorDiv.style.visibility=(d=!d)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(n.cursorDiv.style.visibility="hidden")}function Ms(e){e.state.focused||(e.display.input.focus(),Ns(e))}function Eo(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,na(e))},100)}function Ns(e,n){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(ct(e,"focus",e,n),e.state.focused=!0,j(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),r&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),ks(e)}function na(e,n){if(e.state.delayingBlurEvent)return;e.state.focused&&(ct(e,"blur",e,n),e.state.focused=!1,x(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function Ja(e){for(var n=e.display,d=n.lineDiv.offsetTop,l=0;l<n.view.length;l++){var y=n.view[l],G=e.options.lineWrapping,ee=void 0,ae=0;if(y.hidden)continue;if($&&z<8){var oe=y.node.offsetTop+y.node.offsetHeight;ee=oe-d,d=oe}else{var me=y.node.getBoundingClientRect();ee=me.bottom-me.top,!G&&y.text.firstChild&&(ae=y.text.firstChild.getBoundingClientRect().right-me.left-1)}var We=y.line.height-ee;if((We>.005||We<-.005)&&(Me(y.line,ee),Ai(y.line),y.rest))for(var Ye=0;Ye<y.rest.length;Ye++)Ai(y.rest[Ye]);if(ae>e.display.sizerWidth){var vt=Math.ceil(ae/qi(e.display));vt>e.display.maxLineLength&&(e.display.maxLineLength=vt,e.display.maxLine=y.line,e.display.maxLineChanged=!0)}}}function Ai(e){if(e.widgets)for(var n=0;n<e.widgets.length;++n){var d=e.widgets[n],l=d.node.parentNode;l&&(d.height=l.offsetHeight)}}function Za(e,n,d){var l=d&&d.top!=null?Math.max(0,d.top):e.scroller.scrollTop;l=Math.floor(l-Ti(e));var y=d&&d.bottom!=null?d.bottom:l+e.wrapper.clientHeight,G=ve(n,l),ee=ve(n,y);if(d&&d.ensure){var ae=d.ensure.from.line,oe=d.ensure.to.line;ae<G?(G=ae,ee=ve(n,zt(mt(n,ae))+e.wrapper.clientHeight)):Math.min(oe,n.lastLine())>=ee&&(G=ve(n,zt(mt(n,oe))-e.wrapper.clientHeight),ee=oe)}return{from:G,to:Math.max(ee,G+1)}}function xo(e,n){if(ft(e,"scrollCursorIntoView"))return;var d=e.display,l=d.sizer.getBoundingClientRect(),y=null;if(n.top+l.top<0?y=!0:n.bottom+l.top>(window.innerHeight||document.documentElement.clientHeight)&&(y=!1),y!=null&&!c){var G=f("div","\u200B",null,`position: absolute;
top: `+(n.top-d.viewOffset-Ti(e.display))+`px;
height: `+(n.bottom-n.top+Zr(e)+d.barHeight)+`px;
left: `+n.left+"px; width: "+Math.max(2,n.right-n.left)+"px;");e.display.lineSpace.appendChild(G),G.scrollIntoView(y),e.display.lineSpace.removeChild(G)}}function Us(e,n,d,l){l==null&&(l=0);var y;!e.options.lineWrapping&&n==d&&(n=n.ch?Ie(n.line,n.sticky=="before"?n.ch-1:n.ch,"after"):n,d=n.sticky=="before"?Ie(n.line,n.ch+1,"before"):n);for(var G=0;G<5;G++){var ee=!1,ae=xi(e,n),oe=!d||d==n?ae:xi(e,d);y={left:Math.min(ae.left,oe.left),top:Math.min(ae.top,oe.top)-l,right:Math.max(ae.left,oe.left),bottom:Math.max(ae.bottom,oe.bottom)+l};var me=qa(e,y),We=e.doc.scrollTop,Ye=e.doc.scrollLeft;if(me.scrollTop!=null&&(aa(e,me.scrollTop),Math.abs(e.doc.scrollTop-We)>1&&(ee=!0)),me.scrollLeft!=null&&(Di(e,me.scrollLeft),Math.abs(e.doc.scrollLeft-Ye)>1&&(ee=!0)),!ee)break}return y}function wl(e,n){var d=qa(e,n);d.scrollTop!=null&&aa(e,d.scrollTop),d.scrollLeft!=null&&Di(e,d.scrollLeft)}function qa(e,n){var d=e.display,l=Zi(e.display);n.top<0&&(n.top=0);var y=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:d.scroller.scrollTop,G=yi(e),ee={};n.bottom-n.top>G&&(n.bottom=n.top+G);var ae=e.doc.height+Kr(d),oe=n.top<l,me=n.bottom>ae-l;if(n.top<y)ee.scrollTop=oe?0:n.top;else if(n.bottom>y+G){var We=Math.min(n.top,(me?ae:n.bottom)-G);We!=y&&(ee.scrollTop=We)}var Ye=e.options.fixedGutter?0:d.gutters.offsetWidth,vt=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:d.scroller.scrollLeft-Ye,ht=ei(e)-d.gutters.offsetWidth,Bt=n.right-n.left>ht;return Bt&&(n.right=n.left+ht),n.left<10?ee.scrollLeft=0:n.left<vt?ee.scrollLeft=Math.max(0,n.left+Ye-(Bt?0:10)):n.right>ht+vt-3&&(ee.scrollLeft=n.right+(Bt?0:10)-ht),ee}function es(e,n){if(n==null)return;ts(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+n}function ra(e){ts(e);var n=e.getCursor();e.curOp.scrollToPos={from:n,to:n,margin:e.options.cursorScrollMargin}}function ia(e,n,d){(n!=null||d!=null)&&ts(e),n!=null&&(e.curOp.scrollLeft=n),d!=null&&(e.curOp.scrollTop=d)}function wo(e,n){ts(e),e.curOp.scrollToPos=n}function ts(e){var n=e.curOp.scrollToPos;if(n){e.curOp.scrollToPos=null;var d=mo(e,n.from),l=mo(e,n.to);Co(e,d,l,n.margin)}}function Co(e,n,d,l){var y=qa(e,{left:Math.min(n.left,d.left),top:Math.min(n.top,d.top)-l,right:Math.max(n.right,d.right),bottom:Math.max(n.bottom,d.bottom)+l});ia(e,y.scrollLeft,y.scrollTop)}function aa(e,n){if(Math.abs(e.doc.scrollTop-n)<2)return;B||js(e,{top:n}),To(e,n,!0),B&&js(e),ti(e,100)}function To(e,n,d){if(n=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,n)),e.display.scroller.scrollTop==n&&!d)return;e.doc.scrollTop=n,e.display.scrollbars.setScrollTop(n),e.display.scroller.scrollTop!=n&&(e.display.scroller.scrollTop=n)}function Di(e,n,d,l){if(n=Math.max(0,Math.min(n,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(d?n==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-n)<2)&&!l)return;e.doc.scrollLeft=n,Io(e),e.display.scroller.scrollLeft!=n&&(e.display.scroller.scrollLeft=n),e.display.scrollbars.setScrollLeft(n)}function sa(e){var n=e.display,d=n.gutters.offsetWidth,l=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?d:0,docHeight:l,scrollHeight:l+Zr(e)+n.barHeight,nativeBarWidth:n.nativeBarWidth,gutterWidth:d}}var Pi=function(e,n,d){this.cm=d;var l=this.vert=f("div",[f("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),y=this.horiz=f("div",[f("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");l.tabIndex=y.tabIndex=-1,e(l),e(y),Ze(l,"scroll",function(){l.clientHeight&&n(l.scrollTop,"vertical")}),Ze(y,"scroll",function(){y.clientWidth&&n(y.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,$&&z<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Pi.prototype.update=function(e){var n=e.scrollWidth>e.clientWidth+1,d=e.scrollHeight>e.clientHeight+1,l=e.nativeBarWidth;if(d){this.vert.style.display="block",this.vert.style.bottom=n?l+"px":"0";var y=e.viewHeight-(n?l:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+y)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(n){this.horiz.style.display="block",this.horiz.style.right=d?l+"px":"0",this.horiz.style.left=e.barLeft+"px";var G=e.viewWidth-e.barLeft-(d?l:0);this.horiz.firstChild.style.width=Math.max(0,e.scrollWidth-e.clientWidth+G)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&e.clientHeight>0&&(l==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:d?l:0,bottom:n?l:0}},Pi.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Pi.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Pi.prototype.zeroWidthHack=function(){var e=u&&!a?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Y,this.disableVert=new Y},Pi.prototype.enableZeroWidthBar=function(e,n,d){e.style.pointerEvents="auto";function l(){var y=e.getBoundingClientRect(),G=d=="vert"?document.elementFromPoint(y.right-1,(y.top+y.bottom)/2):document.elementFromPoint((y.right+y.left)/2,y.bottom-1);G!=e?e.style.pointerEvents="none":n.set(1e3,l)}n.set(1e3,l)},Pi.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Sa=function(){};Sa.prototype.update=function(){return{bottom:0,right:0}},Sa.prototype.setScrollLeft=function(){},Sa.prototype.setScrollTop=function(){},Sa.prototype.clear=function(){};function Ui(e,n){n||(n=sa(e));var d=e.display.barWidth,l=e.display.barHeight;So(e,n);for(var y=0;y<4&&d!=e.display.barWidth||l!=e.display.barHeight;y++)d!=e.display.barWidth&&e.options.lineWrapping&&Ja(e),So(e,sa(e)),d=e.display.barWidth,l=e.display.barHeight}function So(e,n){var d=e.display,l=d.scrollbars.update(n);d.sizer.style.paddingRight=(d.barWidth=l.right)+"px",d.sizer.style.paddingBottom=(d.barHeight=l.bottom)+"px",d.heightForcer.style.borderBottom=l.bottom+"px solid transparent",l.right&&l.bottom?(d.scrollbarFiller.style.display="block",d.scrollbarFiller.style.height=l.bottom+"px",d.scrollbarFiller.style.width=l.right+"px"):d.scrollbarFiller.style.display="",l.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(d.gutterFiller.style.display="block",d.gutterFiller.style.height=l.bottom+"px",d.gutterFiller.style.width=n.gutterWidth+"px"):d.gutterFiller.style.display=""}var Ro={native:Pi,null:Sa};function Oo(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&x(e.display.wrapper,e.display.scrollbars.addClass)),e.display.scrollbars=new Ro[e.options.scrollbarStyle](function(n){e.display.wrapper.insertBefore(n,e.display.scrollbarFiller),Ze(n,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),n.setAttribute("cm-not-content","true")},function(n,d){d=="horizontal"?Di(e,n):aa(e,n)},e),e.display.scrollbars.addClass&&j(e.display.wrapper,e.display.scrollbars.addClass)}var Ao=0;function Vi(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:++Ao},on(e.curOp)}function Xi(e){var n=e.curOp;n&&er(n,function(d){for(var l=0;l<d.ops.length;l++)d.ops[l].cm.curOp=null;Cl(d)})}function Cl(e){for(var n=e.ops,d=0;d<n.length;d++)oa(n[d]);for(var l=0;l<n.length;l++)la(n[l]);for(var y=0;y<n.length;y++)Fs(n[y]);for(var G=0;G<n.length;G++)Tl(n[G]);for(var ee=0;ee<n.length;ee++)Do(n[ee])}function oa(e){var n=e.cm,d=n.display;Sl(n),e.updateMaxLine&&tn(n),e.mustUpdate=e.viewChanged||e.forceUpdate||e.scrollTop!=null||e.scrollToPos&&(e.scrollToPos.from.line<d.viewFrom||e.scrollToPos.to.line>=d.viewTo)||d.maxLineChanged&&n.options.lineWrapping,e.update=e.mustUpdate&&new Ra(n,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function la(e){e.updatedDisplay=e.mustUpdate&&ns(e.cm,e.update)}function Fs(e){var n=e.cm,d=n.display;e.updatedDisplay&&Ja(n),e.barMeasure=sa(n),d.maxLineChanged&&!n.options.lineWrapping&&(e.adjustWidthTo=Xa(n,d.maxLine,d.maxLine.text.length).left+3,n.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(d.scroller.clientWidth,d.sizer.offsetLeft+e.adjustWidthTo+Zr(n)+n.display.barWidth),e.maxScrollLeft=Math.max(0,d.sizer.offsetLeft+e.adjustWidthTo-ei(n))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=d.input.prepareSelection())}function Tl(e){var n=e.cm;e.adjustWidthTo!=null&&(n.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft<n.doc.scrollLeft&&Di(n,Math.min(n.display.scroller.scrollLeft,e.maxScrollLeft),!0),n.display.maxLineChanged=!1);var d=e.focus&&e.focus==W();e.preparedSelection&&n.display.input.showSelection(e.preparedSelection,d),(e.updatedDisplay||e.startHeight!=n.doc.height)&&Ui(n,e.barMeasure),e.updatedDisplay&&$i(n,e.barMeasure),e.selectionChanged&&ks(n),n.state.focused&&e.updateInput&&n.display.input.reset(e.typing),d&&Ms(e.cm)}function Do(e){var n=e.cm,d=n.display,l=n.doc;if(e.updatedDisplay&&Lo(n,e.update),d.wheelStartX!=null&&(e.scrollTop!=null||e.scrollLeft!=null||e.scrollToPos)&&(d.wheelStartX=d.wheelStartY=null),e.scrollTop!=null&&To(n,e.scrollTop,e.forceScroll),e.scrollLeft!=null&&Di(n,e.scrollLeft,!0,!0),e.scrollToPos){var y=Us(n,O(l,e.scrollToPos.from),O(l,e.scrollToPos.to),e.scrollToPos.margin);xo(n,y)}var G=e.maybeHiddenMarkers,ee=e.maybeUnhiddenMarkers;if(G)for(var ae=0;ae<G.length;++ae)G[ae].lines.length||ct(G[ae],"hide");if(ee)for(var oe=0;oe<ee.length;++oe)ee[oe].lines.length&&ct(ee[oe],"unhide");d.wrapper.offsetHeight&&(l.scrollTop=n.display.scroller.scrollTop),e.changeObjs&&ct(n,"changes",n,e.changeObjs),e.update&&e.update.finish()}function di(e,n){if(e.curOp)return n();Vi(e);try{return n()}finally{Xi(e)}}function Gr(e,n){return function(){if(e.curOp)return n.apply(e,arguments);Vi(e);try{return n.apply(e,arguments)}finally{Xi(e)}}}function si(e){return function(){if(this.curOp)return e.apply(this,arguments);Vi(this);try{return e.apply(this,arguments)}finally{Xi(this)}}}function Yr(e){return function(){var n=this.cm;if(!n||n.curOp)return e.apply(this,arguments);Vi(n);try{return e.apply(this,arguments)}finally{Xi(n)}}}function ti(e,n){e.doc.highlightFrontier<e.display.viewTo&&e.state.highlight.set(n,P(Bs,e))}function Bs(e){var n=e.doc;if(n.highlightFrontier>=e.display.viewTo)return;var d=+new Date+e.options.workTime,l=wt(e,n.highlightFrontier),y=[];n.iter(l.line,Math.min(n.first+n.size,e.display.viewTo+500),function(G){if(l.line>=e.display.viewFrom){var ee=G.styles,ae=G.text.length>e.options.maxHighlightLength?pr(n.mode,l.state):null,oe=Pe(e,G,l,!0);ae&&(l.state=ae),G.styles=oe.styles;var me=G.styleClasses,We=oe.classes;We?G.styleClasses=We:me&&(G.styleClasses=null);for(var Ye=!ee||ee.length!=G.styles.length||me!=We&&(!me||!We||me.bgClass!=We.bgClass||me.textClass!=We.textClass),vt=0;!Ye&&vt<ee.length;++vt)Ye=ee[vt]!=G.styles[vt];Ye&&y.push(l.line),G.stateAfter=l.save(),l.nextLine()}else G.text.length<=e.options.maxHighlightLength&&Pt(e,G.text,l),G.stateAfter=l.line%5==0?l.save():null,l.nextLine();if(+new Date>d)return ti(e,e.options.workDelay),!0}),n.highlightFrontier=l.line,n.modeFrontier=Math.max(n.modeFrontier,l.line),y.length&&di(e,function(){for(var G=0;G<y.length;G++)Mi(e,y[G],"text")})}var Ra=function(e,n,d){var l=e.display;this.viewport=n,this.visible=Za(l,e.doc,n),this.editorIsHidden=!l.wrapper.offsetWidth,this.wrapperHeight=l.wrapper.clientHeight,this.wrapperWidth=l.wrapper.clientWidth,this.oldDisplayWidth=ei(e),this.force=d,this.dims=As(e),this.events=[]};Ra.prototype.signal=function(e,n){Ne(e,n)&&this.events.push(arguments)},Ra.prototype.finish=function(){for(var e=0;e<this.events.length;e++)ct.apply(null,this.events[e])};function Sl(e){var n=e.display;!n.scrollbarsClipped&&n.scroller.offsetWidth&&(n.nativeBarWidth=n.scroller.offsetWidth-n.scroller.clientWidth,n.heightForcer.style.height=Zr(e)+"px",n.sizer.style.marginBottom=-n.nativeBarWidth+"px",n.sizer.style.borderRightWidth=Zr(e)+"px",n.scrollbarsClipped=!0)}function Po(e){if(e.hasFocus())return null;var n=W();if(!n||!_(e.display.lineDiv,n))return null;var d={activeElt:n};if(window.getSelection){var l=window.getSelection();l.anchorNode&&l.extend&&_(e.display.lineDiv,l.anchorNode)&&(d.anchorNode=l.anchorNode,d.anchorOffset=l.anchorOffset,d.focusNode=l.focusNode,d.focusOffset=l.focusOffset)}return d}function Oa(e){if(!e||!e.activeElt||e.activeElt==W())return;if(e.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(e.activeElt.nodeName)&&e.anchorNode&&_(document.body,e.anchorNode)&&_(document.body,e.focusNode)){var n=window.getSelection(),d=document.createRange();d.setEnd(e.anchorNode,e.anchorOffset),d.collapse(!1),n.removeAllRanges(),n.addRange(d),n.extend(e.focusNode,e.focusOffset)}}function ns(e,n){var d=e.display,l=e.doc;if(n.editorIsHidden)return Ni(e),!1;if(!n.force&&n.visible.from>=d.viewFrom&&n.visible.to<=d.viewTo&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo)&&d.renderedView==d.view&&Ls(e)==0)return!1;ko(e)&&(Ni(e),n.dims=As(e));var y=l.first+l.size,G=Math.max(n.visible.from-e.options.viewportMargin,l.first),ee=Math.min(y,n.visible.to+e.options.viewportMargin);d.viewFrom<G&&G-d.viewFrom<20&&(G=Math.max(l.first,d.viewFrom)),d.viewTo>ee&&d.viewTo-ee<20&&(ee=Math.min(y,d.viewTo)),qt&&(G=Dn(e.doc,G),ee=cn(e.doc,ee));var ae=G!=d.viewFrom||ee!=d.viewTo||d.lastWrapHeight!=n.wrapperHeight||d.lastWrapWidth!=n.wrapperWidth;xl(e,G,ee),d.viewOffset=zt(mt(e.doc,d.viewFrom)),e.display.mover.style.top=d.viewOffset+"px";var oe=Ls(e);if(!ae&&oe==0&&!n.force&&d.renderedView==d.view&&(d.updateLineNumbers==null||d.updateLineNumbers>=d.viewTo))return!1;var me=Po(e);return oe>4&&(d.lineDiv.style.display="none"),Rl(e,d.updateLineNumbers,n.dims),oe>4&&(d.lineDiv.style.display=""),d.renderedView=d.view,Oa(me),b(d.cursorDiv),b(d.selectionDiv),d.gutters.style.height=d.sizer.style.minHeight=0,ae&&(d.lastWrapHeight=n.wrapperHeight,d.lastWrapWidth=n.wrapperWidth,ti(e,400)),d.updateLineNumbers=null,!0}function Lo(e,n){for(var d=n.viewport,l=!0;;l=!1){if(!l||!e.options.lineWrapping||n.oldDisplayWidth==ei(e)){if(d&&d.top!=null&&(d={top:Math.min(e.doc.height+Kr(e.display)-yi(e),d.top)}),n.visible=Za(e.display,e.doc,d),n.visible.from>=e.display.viewFrom&&n.visible.to<=e.display.viewTo)break}else l&&(n.visible=Za(e.display,e.doc,d));if(!ns(e,n))break;Ja(e);var y=sa(e);ta(e),Ui(e,y),$i(e,y),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 js(e,n){var d=new Ra(e,n);if(ns(e,d)){Ja(e),Lo(e,d);var l=sa(e);ta(e),Ui(e,l),$i(e,l),d.finish()}}function Rl(e,n,d){var l=e.display,y=e.options.lineNumbers,G=l.lineDiv,ee=G.firstChild;function ae(Bt){var Zt=Bt.nextSibling;return r&&u&&e.display.currentWheelTarget==Bt?Bt.style.display="none":Bt.parentNode.removeChild(Bt),Zt}for(var oe=l.view,me=l.viewFrom,We=0;We<oe.length;We++){var Ye=oe[We];if(!Ye.hidden)if(!Ye.node||Ye.node.parentNode!=G){var vt=Er(e,Ye,me,d);G.insertBefore(vt,ee)}else{for(;ee!=Ye.node;)ee=ae(ee);var ht=y&&n!=null&&n<=me&&Ye.lineNumber;Ye.changes&&(ie(Ye.changes,"gutter")>-1&&(ht=!1),zn(e,Ye,me,d)),ht&&(b(Ye.lineNumber),Ye.lineNumber.appendChild(document.createTextNode(en(e.options,me)))),ee=Ye.node.nextSibling}me+=Ye.size}for(;ee;)ee=ae(ee)}function Aa(e){var n=e.gutters.offsetWidth;e.sizer.style.marginLeft=n+"px"}function $i(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+Zr(e)+"px"}function Io(e){var n=e.display,d=n.view;if(!n.alignWidgets&&(!n.gutters.firstChild||!e.options.fixedGutter))return;for(var l=Ds(n)-n.scroller.scrollLeft+e.doc.scrollLeft,y=n.gutters.offsetWidth,G=l+"px",ee=0;ee<d.length;ee++)if(!d[ee].hidden){e.options.fixedGutter&&(d[ee].gutter&&(d[ee].gutter.style.left=G),d[ee].gutterBackground&&(d[ee].gutterBackground.style.left=G));var ae=d[ee].alignable;if(ae)for(var oe=0;oe<ae.length;oe++)ae[oe].style.left=G}e.options.fixedGutter&&(n.gutters.style.left=l+y+"px")}function ko(e){if(!e.options.lineNumbers)return!1;var n=e.doc,d=en(e.options,n.first+n.size-1),l=e.display;if(d.length!=l.lineNumChars){var y=l.measure.appendChild(f("div",[f("div",d)],"CodeMirror-linenumber CodeMirror-gutter-elt")),G=y.firstChild.offsetWidth,ee=y.offsetWidth-G;return l.lineGutter.style.width="",l.lineNumInnerWidth=Math.max(G,l.lineGutter.offsetWidth-ee)+1,l.lineNumWidth=l.lineNumInnerWidth+ee,l.lineNumChars=l.lineNumInnerWidth?d.length:-1,l.lineGutter.style.width=l.lineNumWidth+"px",Aa(e.display),!0}return!1}function Ws(e,n){for(var d=[],l=!1,y=0;y<e.length;y++){var G=e[y],ee=null;if(typeof G!="string"&&(ee=G.style,G=G.className),G=="CodeMirror-linenumbers")if(n)l=!0;else continue;d.push({className:G,style:ee})}return n&&!l&&d.push({className:"CodeMirror-linenumbers",style:null}),d}function Hs(e){var n=e.gutters,d=e.gutterSpecs;b(n),e.lineGutter=null;for(var l=0;l<d.length;++l){var y=d[l],G=y.className,ee=y.style,ae=n.appendChild(f("div",null,"CodeMirror-gutter "+G));ee&&(ae.style.cssText=ee),G=="CodeMirror-linenumbers"&&(e.lineGutter=ae,ae.style.width=(e.lineNumWidth||1)+"px")}n.style.display=d.length?"":"none",Aa(e)}function Da(e){Hs(e.display),li(e),Io(e)}function Ol(e,n,d,l){var y=this;this.input=d,y.scrollbarFiller=f("div",null,"CodeMirror-scrollbar-filler"),y.scrollbarFiller.setAttribute("cm-not-content","true"),y.gutterFiller=f("div",null,"CodeMirror-gutter-filler"),y.gutterFiller.setAttribute("cm-not-content","true"),y.lineDiv=C("div",null,"CodeMirror-code"),y.selectionDiv=f("div",null,null,"position: relative; z-index: 1"),y.cursorDiv=f("div",null,"CodeMirror-cursors"),y.measure=f("div",null,"CodeMirror-measure"),y.lineMeasure=f("div",null,"CodeMirror-measure"),y.lineSpace=C("div",[y.measure,y.lineMeasure,y.selectionDiv,y.cursorDiv,y.lineDiv],null,"position: relative; outline: none");var G=C("div",[y.lineSpace],"CodeMirror-lines");y.mover=f("div",[G],null,"position: relative"),y.sizer=f("div",[y.mover],"CodeMirror-sizer"),y.sizerWidth=null,y.heightForcer=f("div",null,null,"position: absolute; height: "+le+"px; width: 1px;"),y.gutters=f("div",null,"CodeMirror-gutters"),y.lineGutter=null,y.scroller=f("div",[y.sizer,y.heightForcer,y.gutters],"CodeMirror-scroll"),y.scroller.setAttribute("tabIndex","-1"),y.wrapper=f("div",[y.scrollbarFiller,y.gutterFiller,y.scroller],"CodeMirror"),$&&z<8&&(y.gutters.style.zIndex=-1,y.scroller.style.paddingRight=0),!r&&!(B&&t)&&(y.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(y.wrapper):e(y.wrapper)),y.viewFrom=y.viewTo=n.first,y.reportedViewFrom=y.reportedViewTo=n.first,y.view=[],y.renderedView=null,y.externalMeasured=null,y.viewOffset=0,y.lastWrapHeight=y.lastWrapWidth=0,y.updateLineNumbers=null,y.nativeBarWidth=y.barHeight=y.barWidth=0,y.scrollbarsClipped=!1,y.lineNumWidth=y.lineNumInnerWidth=y.lineNumChars=null,y.alignWidgets=!1,y.cachedCharWidth=y.cachedTextHeight=y.cachedPaddingH=null,y.maxLine=null,y.maxLineLength=0,y.maxLineChanged=!1,y.wheelDX=y.wheelDY=y.wheelStartX=y.wheelStartY=null,y.shift=!1,y.selForContextMenu=null,y.activeTouch=null,y.gutterSpecs=Ws(l.gutters,l.lineNumbers),Hs(y),d.init(y)}var ua=0,pi=null;$?pi=-.53:B?pi=15:m?pi=-.7:p&&(pi=-1/3);function Mo(e){var n=e.wheelDeltaX,d=e.wheelDeltaY;return n==null&&e.detail&&e.axis==e.HORIZONTAL_AXIS&&(n=e.detail),d==null&&e.detail&&e.axis==e.VERTICAL_AXIS?d=e.detail:d==null&&(d=e.wheelDelta),{x:n,y:d}}function rs(e){var n=Mo(e);return n.x*=pi,n.y*=pi,n}function No(e,n){var d=Mo(n),l=d.x,y=d.y,G=e.display,ee=G.scroller,ae=ee.scrollWidth>ee.clientWidth,oe=ee.scrollHeight>ee.clientHeight;if(!(l&&ae||y&&oe))return;if(y&&u&&r){e:for(var me=n.target,We=G.view;me!=ee;me=me.parentNode)for(var Ye=0;Ye<We.length;Ye++)if(We[Ye].node==me){e.display.currentWheelTarget=me;break e}}if(l&&!B&&!g&&pi!=null){y&&oe&&aa(e,Math.max(0,ee.scrollTop+y*pi)),Di(e,Math.max(0,ee.scrollLeft+l*pi)),(!y||y&&oe)&&ge(n),G.wheelStartX=null;return}if(y&&pi!=null){var vt=y*pi,ht=e.doc.scrollTop,Bt=ht+G.wrapper.clientHeight;vt<0?ht=Math.max(0,ht+vt-50):Bt=Math.min(e.doc.height,Bt+vt+50),js(e,{top:ht,bottom:Bt})}ua<20&&(G.wheelStartX==null?(G.wheelStartX=ee.scrollLeft,G.wheelStartY=ee.scrollTop,G.wheelDX=l,G.wheelDY=y,setTimeout(function(){if(G.wheelStartX==null)return;var Zt=ee.scrollLeft-G.wheelStartX,mn=ee.scrollTop-G.wheelStartY,jn=mn&&G.wheelDY&&mn/G.wheelDY||Zt&&G.wheelDX&&Zt/G.wheelDX;if(G.wheelStartX=G.wheelStartY=null,!jn)return;pi=(pi*ua+jn)/(ua+1),++ua},200)):(G.wheelDX+=l,G.wheelDY+=y))}var mi=function(e,n){this.ranges=e,this.primIndex=n};mi.prototype.primary=function(){return this.ranges[this.primIndex]},mi.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 d=this.ranges[n],l=e.ranges[n];if(!Ce(d.anchor,l.anchor)||!Ce(d.head,l.head))return!1}return!0},mi.prototype.deepCopy=function(){for(var e=[],n=0;n<this.ranges.length;n++)e[n]=new Nr(dn(this.ranges[n].anchor),dn(this.ranges[n].head));return new mi(e,this.primIndex)},mi.prototype.somethingSelected=function(){for(var e=0;e<this.ranges.length;e++)if(!this.ranges[e].empty())return!0;return!1},mi.prototype.contains=function(e,n){n||(n=e);for(var d=0;d<this.ranges.length;d++){var l=this.ranges[d];if(gt(n,l.from())>=0&&gt(e,l.to())<=0)return d}return-1};var Nr=function(e,n){this.anchor=e,this.head=n};Nr.prototype.from=function(){return mr(this.anchor,this.head)},Nr.prototype.to=function(){return hr(this.anchor,this.head)},Nr.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function wi(e,n,d){var l=e&&e.options.selectionsMayTouch,y=n[d];n.sort(function(vt,ht){return gt(vt.from(),ht.from())}),d=ie(n,y);for(var G=1;G<n.length;G++){var ee=n[G],ae=n[G-1],oe=gt(ae.to(),ee.from());if(l&&!ee.empty()?oe>0:oe>=0){var me=mr(ae.from(),ee.from()),We=hr(ae.to(),ee.to()),Ye=ae.empty()?ee.from()==ee.head:ae.from()==ae.head;G<=d&&--d,n.splice(--G,2,new Nr(Ye?We:me,Ye?me:We))}}return new mi(n,d)}function Fi(e,n){return new mi([new Nr(e,n||e)],0)}function Yi(e){return e.text?Ie(e.from.line+e.text.length-1,ne(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Uo(e,n){if(gt(e,n.from)<0)return e;if(gt(e,n.to)<=0)return Yi(n);var d=e.line+n.text.length-(n.to.line-n.from.line)-1,l=e.ch;return e.line==n.to.line&&(l+=Yi(n).ch-n.to.ch),Ie(d,l)}function Pa(e,n){for(var d=[],l=0;l<e.sel.ranges.length;l++){var y=e.sel.ranges[l];d.push(new Nr(Uo(y.anchor,n),Uo(y.head,n)))}return wi(e.cm,d,e.sel.primIndex)}function ca(e,n,d){return e.line==n.line?Ie(d.line,e.ch-n.ch+d.ch):Ie(d.line+(e.line-n.line),e.ch)}function Al(e,n,d){for(var l=[],y=Ie(e.first,0),G=y,ee=0;ee<n.length;ee++){var ae=n[ee],oe=ca(ae.from,y,G),me=ca(Yi(ae),y,G);if(y=ae.to,G=me,d=="around"){var We=e.sel.ranges[ee],Ye=gt(We.head,We.anchor)<0;l[ee]=new Nr(Ye?me:oe,Ye?oe:me)}else l[ee]=new Nr(oe,oe)}return new mi(l,e.sel.primIndex)}function La(e){e.doc.mode=Ar(e.options,e.doc.modeOption),Ia(e)}function Ia(e){e.doc.iter(function(n){n.stateAfter&&(n.stateAfter=null),n.styles&&(n.styles=null)}),e.doc.modeFrontier=e.doc.highlightFrontier=e.doc.first,ti(e,100),e.state.modeGen++,e.curOp&&li(e)}function Fo(e,n){return n.from.ch==0&&n.to.ch==0&&ne(n.text)==""&&(!e.cm||e.cm.options.wholeLineUpdateBefore)}function Ks(e,n,d,l){function y(sr){return d?d[sr]:null}function G(sr,Wn,dr){gn(sr,Wn,dr,l),Yt(sr,"change",sr,n)}function ee(sr,Wn){for(var dr=[],Or=sr;Or<Wn;++Or)dr.push(new bn(me[Or],y(Or),l));return dr}var ae=n.from,oe=n.to,me=n.text,We=mt(e,ae.line),Ye=mt(e,oe.line),vt=ne(me),ht=y(me.length-1),Bt=oe.line-ae.line;if(n.full)e.insert(0,ee(0,me.length)),e.remove(me.length,e.size-me.length);else if(Fo(e,n)){var Zt=ee(0,me.length-1);G(Ye,Ye.text,ht),Bt&&e.remove(ae.line,Bt),Zt.length&&e.insert(ae.line,Zt)}else if(We==Ye)if(me.length==1)G(We,We.text.slice(0,ae.ch)+vt+We.text.slice(oe.ch),ht);else{var mn=ee(1,me.length-1);mn.push(new bn(vt+We.text.slice(oe.ch),ht,l)),G(We,We.text.slice(0,ae.ch)+me[0],y(0)),e.insert(ae.line+1,mn)}else if(me.length==1)G(We,We.text.slice(0,ae.ch)+me[0]+Ye.text.slice(oe.ch),y(0)),e.remove(ae.line+1,Bt);else{G(We,We.text.slice(0,ae.ch)+me[0],y(0)),G(Ye,vt+Ye.text.slice(oe.ch),ht);var jn=ee(1,me.length-1);Bt>1&&e.remove(ae.line+1,Bt-1),e.insert(ae.line+1,jn)}Yt(e,"change",e,n)}function Ci(e,n,d){function l(y,G,ee){if(y.linked)for(var ae=0;ae<y.linked.length;++ae){var oe=y.linked[ae];if(oe.doc==G)continue;var me=ee&&oe.sharedHist;if(d&&!me)continue;n(oe.doc,me),l(oe.doc,y,me)}}l(e,null,!0)}function Gs(e,n){if(n.cm)throw new Error("This document is already in use.");e.doc=n,n.cm=e,Ps(e),La(e),Bo(e),e.options.lineWrapping||tn(e),e.options.mode=n.modeOption,li(e)}function Bo(e){(e.doc.direction=="rtl"?j:x)(e.display.lineDiv,"CodeMirror-rtl")}function Dl(e){di(e,function(){Bo(e),li(e)})}function is(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 zs(e,n){var d={from:dn(n.from),to:Yi(n),text:Ke(e,n.from,n.to)};return Vs(e,d,n.from.line,n.to.line+1),Ci(e,function(l){return Vs(l,d,n.from.line,n.to.line+1)},!0),d}function jo(e){for(;e.length;){var n=ne(e);if(n.ranges)e.pop();else break}}function Pl(e,n){if(n)return jo(e.done),ne(e.done);if(e.done.length&&!ne(e.done).ranges)return ne(e.done);if(e.done.length>1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ne(e.done)}function Wo(e,n,d,l){var y=e.history;y.undone.length=0;var G=+new Date,ee,ae;if((y.lastOp==l||y.lastOrigin==n.origin&&n.origin&&(n.origin.charAt(0)=="+"&&y.lastModTime>G-(e.cm?e.cm.options.historyEventDelay:500)||n.origin.charAt(0)=="*"))&&(ee=Pl(y,y.lastOp==l)))ae=ne(ee.changes),gt(n.from,n.to)==0&&gt(n.from,ae.to)==0?ae.to=Yi(n):ee.changes.push(zs(e,n));else{var oe=ne(y.done);for((!oe||!oe.ranges)&&ss(e.sel,y.done),ee={changes:[zs(e,n)],generation:y.generation},y.done.push(ee);y.done.length>y.undoDepth;)y.done.shift(),y.done[0].ranges||y.done.shift()}y.done.push(d),y.generation=++y.maxGeneration,y.lastModTime=y.lastSelTime=G,y.lastOp=y.lastSelOp=l,y.lastOrigin=y.lastSelOrigin=n.origin,ae||ct(e,"historyAdded")}function Ll(e,n,d,l){var y=n.charAt(0);return y=="*"||y=="+"&&d.ranges.length==l.ranges.length&&d.somethingSelected()==l.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function as(e,n,d,l){var y=e.history,G=l&&l.origin;d==y.lastSelOp||G&&y.lastSelOrigin==G&&(y.lastModTime==y.lastSelTime&&y.lastOrigin==G||Ll(e,G,ne(y.done),n))?y.done[y.done.length-1]=n:ss(n,y.done),y.lastSelTime=+new Date,y.lastSelOrigin=G,y.lastSelOp=d,l&&l.clearRedo!==!1&&jo(y.undone)}function ss(e,n){var d=ne(n);d&&d.ranges&&d.equals(e)||n.push(e)}function Vs(e,n,d,l){var y=n["spans_"+e.id],G=0;e.iter(Math.max(e.first,d),Math.min(e.first+e.size,l),function(ee){ee.markedSpans&&((y||(y=n["spans_"+e.id]={}))[G]=ee.markedSpans),++G})}function os(e){if(!e)return null;for(var n,d=0;d<e.length;++d)e[d].marker.explicitlyCleared?n||(n=e.slice(0,d)):n&&n.push(e[d]);return n?n.length?n:null:e}function Ho(e,n){var d=n["spans_"+e.id];if(!d)return null;for(var l=[],y=0;y<n.text.length;++y)l.push(os(d[y]));return l}function Xs(e,n){var d=Ho(e,n),l=Un(e,n);if(!d)return l;if(!l)return d;for(var y=0;y<d.length;++y){var G=d[y],ee=l[y];if(G&&ee){e:for(var ae=0;ae<ee.length;++ae){for(var oe=ee[ae],me=0;me<G.length;++me)if(G[me].marker==oe.marker)continue e;G.push(oe)}}else ee&&(d[y]=ee)}return d}function da(e,n,d){for(var l=[],y=0;y<e.length;++y){var G=e[y];if(G.ranges){l.push(d?mi.prototype.deepCopy.call(G):G);continue}var ee=G.changes,ae=[];l.push({changes:ae});for(var oe=0;oe<ee.length;++oe){var me=ee[oe],We=void 0;if(ae.push({from:me.from,to:me.to,text:me.text}),n)for(var Ye in me)(We=Ye.match(/^spans_(\d+)$/))&&(ie(n,Number(We[1]))>-1&&(ne(ae)[Ye]=me[Ye],delete me[Ye]))}}return l}function ls(e,n,d,l){if(l){var y=e.anchor;if(d){var G=gt(n,y)<0;G!=gt(d,y)<0?(y=n,n=d):G!=gt(n,d)<0&&(n=d)}return new Nr(y,n)}else return new Nr(d||n,n)}function us(e,n,d,l,y){y==null&&(y=e.cm&&(e.cm.display.shift||e.extend)),ni(e,new mi([ls(e.sel.primary(),n,d,y)],0),l)}function Ko(e,n,d){for(var l=[],y=e.cm&&(e.cm.display.shift||e.extend),G=0;G<e.sel.ranges.length;G++)l[G]=ls(e.sel.ranges[G],n[G],null,y);var ee=wi(e.cm,l,e.sel.primIndex);ni(e,ee,d)}function Bi(e,n,d,l){var y=e.sel.ranges.slice(0);y[n]=d,ni(e,wi(e.cm,y,e.sel.primIndex),l)}function Go(e,n,d,l){ni(e,Fi(n,d),l)}function Il(e,n,d){var l={ranges:n.ranges,update:function(y){this.ranges=[];for(var G=0;G<y.length;G++)this.ranges[G]=new Nr(O(e,y[G].anchor),O(e,y[G].head))},origin:d&&d.origin};return ct(e,"beforeSelectionChange",e,l),e.cm&&ct(e.cm,"beforeSelectionChange",e.cm,l),l.ranges!=n.ranges?wi(e.cm,l.ranges,l.ranges.length-1):n}function zo(e,n,d){var l=e.history.done,y=ne(l);y&&y.ranges?(l[l.length-1]=n,ha(e,n,d)):ni(e,n,d)}function ni(e,n,d){ha(e,n,d),as(e,e.sel,e.cm?e.cm.curOp.id:NaN,d)}function ha(e,n,d){(Ne(e,"beforeSelectionChange")||e.cm&&Ne(e.cm,"beforeSelectionChange"))&&(n=Il(e,n,d));var l=d&&d.bias||(gt(n.primary().head,e.sel.primary().head)<0?-1:1);Vo(e,$o(e,n,l,!0)),!(d&&d.scroll===!1)&&e.cm&&ra(e.cm)}function Vo(e,n){if(n.equals(e.sel))return;e.sel=n,e.cm&&(e.cm.curOp.updateInput=1,e.cm.curOp.selectionChanged=!0,He(e.cm)),Yt(e,"cursorActivity",e)}function Xo(e){Vo(e,$o(e,e.sel,null,!1))}function $o(e,n,d,l){for(var y,G=0;G<n.ranges.length;G++){var ee=n.ranges[G],ae=n.ranges.length==e.sel.ranges.length&&e.sel.ranges[G],oe=cs(e,ee.anchor,ae&&ae.anchor,d,l),me=cs(e,ee.head,ae&&ae.head,d,l);(y||oe!=ee.anchor||me!=ee.head)&&(y||(y=n.ranges.slice(0,G)),y[G]=new Nr(oe,me))}return y?wi(e.cm,y,n.primIndex):n}function fa(e,n,d,l,y){var G=mt(e,n.line);if(G.markedSpans)for(var ee=0;ee<G.markedSpans.length;++ee){var ae=G.markedSpans[ee],oe=ae.marker,me="selectLeft"in oe?!oe.selectLeft:oe.inclusiveLeft,We="selectRight"in oe?!oe.selectRight:oe.inclusiveRight;if((ae.from==null||(me?ae.from<=n.ch:ae.from<n.ch))&&(ae.to==null||(We?ae.to>=n.ch:ae.to>n.ch))){if(y&&(ct(oe,"beforeCursorEnter"),oe.explicitlyCleared))if(G.markedSpans){--ee;continue}else break;if(!oe.atomic)continue;if(d){var Ye=oe.find(l<0?1:-1),vt=void 0;if((l<0?We:me)&&(Ye=Yo(e,Ye,-l,Ye&&Ye.line==n.line?G:null)),Ye&&Ye.line==n.line&&(vt=gt(Ye,d))&&(l<0?vt<0:vt>0))return fa(e,Ye,n,l,y)}var ht=oe.find(l<0?-1:1);return(l<0?me:We)&&(ht=Yo(e,ht,l,ht.line==n.line?G:null)),ht?fa(e,ht,n,l,y):null}}return n}function cs(e,n,d,l,y){var G=l||1,ee=fa(e,n,d,G,y)||!y&&fa(e,n,d,G,!0)||fa(e,n,d,-G,y)||!y&&fa(e,n,d,-G,!0);return ee||(e.cantEdit=!0,Ie(e.first,0))}function Yo(e,n,d,l){return d<0&&n.ch==0?n.line>e.first?O(e,Ie(n.line-1)):null:d>0&&n.ch==(l||mt(e,n.line)).text.length?n.line<e.first+e.size-1?Ie(n.line+1,0):null:new Ie(n.line,n.ch+d)}function Qo(e){e.setSelection(Ie(e.firstLine(),0),Ie(e.lastLine()),xe)}function $s(e,n,d){var l={canceled:!1,from:n.from,to:n.to,text:n.text,origin:n.origin,cancel:function(){return l.canceled=!0}};return d&&(l.update=function(y,G,ee,ae){y&&(l.from=O(e,y)),G&&(l.to=O(e,G)),ee&&(l.text=ee),ae!==void 0&&(l.origin=ae)}),ct(e,"beforeChange",e,l),e.cm&&ct(e.cm,"beforeChange",e.cm,l),l.canceled?(e.cm&&(e.cm.curOp.updateInput=2),null):{from:l.from,to:l.to,text:l.text,origin:l.origin}}function pa(e,n,d){if(e.cm){if(!e.cm.curOp)return Gr(e.cm,pa)(e,n,d);if(e.cm.state.suppressEdits)return}if((Ne(e,"beforeChange")||e.cm&&Ne(e.cm,"beforeChange"))&&(n=$s(e,n,!0),!n))return;var l=rn&&!d&&nr(e,n.from,n.to);if(l)for(var y=l.length-1;y>=0;--y)Jo(e,{from:l[y].from,to:l[y].to,text:y?[""]:n.text,origin:n.origin});else Jo(e,n)}function Jo(e,n){if(n.text.length==1&&n.text[0]==""&&gt(n.from,n.to)==0)return;var d=Pa(e,n);Wo(e,n,d,e.cm?e.cm.curOp.id:NaN),ma(e,n,d,Un(e,n));var l=[];Ci(e,function(y,G){!G&&ie(l,y.history)==-1&&(tl(y.history,n),l.push(y.history)),ma(y,n,null,Un(y,n))})}function ds(e,n,d){var l=e.cm&&e.cm.state.suppressEdits;if(l&&!d)return;for(var y=e.history,G,ee=e.sel,ae=n=="undo"?y.done:y.undone,oe=n=="undo"?y.undone:y.done,me=0;me<ae.length&&!(G=ae[me],d?G.ranges&&!G.equals(e.sel):!G.ranges);me++);if(me==ae.length)return;for(y.lastOrigin=y.lastSelOrigin=null;;)if(G=ae.pop(),G.ranges){if(ss(G,oe),d&&!G.equals(e.sel)){ni(e,G,{clearRedo:!1});return}ee=G}else if(l){ae.push(G);return}else break;var We=[];ss(ee,oe),oe.push({changes:We,generation:y.generation}),y.generation=G.generation||++y.maxGeneration;for(var Ye=Ne(e,"beforeChange")||e.cm&&Ne(e.cm,"beforeChange"),vt=function(Zt){var mn=G.changes[Zt];if(mn.origin=n,Ye&&!$s(e,mn,!1))return ae.length=0,{};We.push(zs(e,mn));var jn=Zt?Pa(e,mn):ne(ae);ma(e,mn,jn,Xs(e,mn)),!Zt&&e.cm&&e.cm.scrollIntoView({from:mn.from,to:Yi(mn)});var sr=[];Ci(e,function(Wn,dr){!dr&&ie(sr,Wn.history)==-1&&(tl(Wn.history,mn),sr.push(Wn.history)),ma(Wn,mn,null,Xs(Wn,mn))})},ht=G.changes.length-1;ht>=0;--ht){var Bt=vt(ht);if(Bt)return Bt.v}}function Zo(e,n){if(n==0)return;if(e.first+=n,e.sel=new mi(fe(e.sel.ranges,function(y){return new Nr(Ie(y.anchor.line+n,y.anchor.ch),Ie(y.head.line+n,y.head.ch))}),e.sel.primIndex),e.cm){li(e.cm,e.first,e.first-n,n);for(var d=e.cm.display,l=d.viewFrom;l<d.viewTo;l++)Mi(e.cm,l,"gutter")}}function ma(e,n,d,l){if(e.cm&&!e.cm.curOp)return Gr(e.cm,ma)(e,n,d,l);if(n.to.line<e.first){Zo(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 y=n.text.length-1-(e.first-n.from.line);Zo(e,y),n={from:Ie(e.first,0),to:Ie(n.to.line+y,n.to.ch),text:[ne(n.text)],origin:n.origin}}var G=e.lastLine();n.to.line>G&&(n={from:n.from,to:Ie(G,mt(e,G).text.length),text:[n.text[0]],origin:n.origin}),n.removed=Ke(e,n.from,n.to),d||(d=Pa(e,n)),e.cm?kl(e.cm,n,l):Ks(e,n,l),ha(e,d,xe),e.cantEdit&&cs(e,Ie(e.firstLine(),0))&&(e.cantEdit=!1)}function kl(e,n,d){var l=e.doc,y=e.display,G=n.from,ee=n.to,ae=!1,oe=G.line;e.options.lineWrapping||(oe=ye(kn(mt(l,G.line))),l.iter(oe,ee.line+1,function(ht){if(ht==y.maxLine)return ae=!0,!0})),l.sel.contains(n.from,n.to)>-1&&He(e),Ks(l,n,d,_o(e)),e.options.lineWrapping||(l.iter(oe,G.line+n.text.length,function(ht){var Bt=jt(ht);Bt>y.maxLineLength&&(y.maxLine=ht,y.maxLineLength=Bt,y.maxLineChanged=!0,ae=!1)}),ae&&(e.curOp.updateMaxLine=!0)),Wt(l,G.line),ti(e,400);var me=n.text.length-(ee.line-G.line)-1;n.full?li(e):G.line==ee.line&&n.text.length==1&&!Fo(e.doc,n)?Mi(e,G.line,"text"):li(e,G.line,ee.line+1,me);var We=Ne(e,"changes"),Ye=Ne(e,"change");if(Ye||We){var vt={from:G,to:ee,text:n.text,removed:n.removed,origin:n.origin};Ye&&Yt(e,"change",e,vt),We&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(vt)}e.display.selForContextMenu=null}function ga(e,n,d,l,y){var G;l||(l=d),gt(l,d)<0&&(G=[l,d],d=G[0],l=G[1]),typeof n=="string"&&(n=e.splitLines(n)),pa(e,{from:d,to:l,text:n,origin:y})}function qo(e,n,d,l){d<e.line?e.line+=l:n<e.line&&(e.line=n,e.ch=0)}function el(e,n,d,l){for(var y=0;y<e.length;++y){var G=e[y],ee=!0;if(G.ranges){G.copied||(G=e[y]=G.deepCopy(),G.copied=!0);for(var ae=0;ae<G.ranges.length;ae++)qo(G.ranges[ae].anchor,n,d,l),qo(G.ranges[ae].head,n,d,l);continue}for(var oe=0;oe<G.changes.length;++oe){var me=G.changes[oe];if(d<me.from.line)me.from=Ie(me.from.line+l,me.from.ch),me.to=Ie(me.to.line+l,me.to.ch);else if(n<=me.to.line){ee=!1;break}}ee||(e.splice(0,y+1),y=0)}}function tl(e,n){var d=n.from.line,l=n.to.line,y=n.text.length-(l-d)-1;el(e.done,d,l,y),el(e.undone,d,l,y)}function ka(e,n,d,l){var y=n,G=n;return typeof n=="number"?G=mt(e,q(e,n)):y=ye(n),y==null?null:(l(G,y)&&e.cm&&Mi(e.cm,y,d),G)}function ji(e){this.lines=e,this.parent=null;for(var n=0,d=0;d<e.length;++d)e[d].parent=this,n+=e[d].height;this.height=n}ji.prototype={chunkSize:function(){return this.lines.length},removeInner:function(e,n){for(var d=e,l=e+n;d<l;++d){var y=this.lines[d];this.height-=y.height,yt(y),Yt(y,"delete")}this.lines.splice(e,n)},collapse:function(e){e.push.apply(e,this.lines)},insertInner:function(e,n,d){this.height+=d,this.lines=this.lines.slice(0,e).concat(n).concat(this.lines.slice(e));for(var l=0;l<n.length;++l)n[l].parent=this},iterN:function(e,n,d){for(var l=e+n;e<l;++e)if(d(this.lines[e]))return!0}};function va(e){this.children=e;for(var n=0,d=0,l=0;l<e.length;++l){var y=e[l];n+=y.chunkSize(),d+=y.height,y.parent=this}this.size=n,this.height=d,this.parent=null}va.prototype={chunkSize:function(){return this.size},removeInner:function(e,n){this.size-=n;for(var d=0;d<this.children.length;++d){var l=this.children[d],y=l.chunkSize();if(e<y){var G=Math.min(n,y-e),ee=l.height;if(l.removeInner(e,G),this.height-=ee-l.height,y==G&&(this.children.splice(d--,1),l.parent=null),(n-=G)==0)break;e=0}else e-=y}if(this.size-n<25&&(this.children.length>1||!(this.children[0]instanceof ji))){var ae=[];this.collapse(ae),this.children=[new ji(ae)],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,d){this.size+=n.length,this.height+=d;for(var l=0;l<this.children.length;++l){var y=this.children[l],G=y.chunkSize();if(e<=G){if(y.insertInner(e,n,d),y.lines&&y.lines.length>50){for(var ee=y.lines.length%25+25,ae=ee;ae<y.lines.length;){var oe=new ji(y.lines.slice(ae,ae+=25));y.height-=oe.height,this.children.splice(++l,0,oe),oe.parent=this}y.lines=y.lines.slice(0,ee),this.maybeSpill()}break}e-=G}},maybeSpill:function(){if(this.children.length<=10)return;var e=this;do{var n=e.children.splice(e.children.length-5,5),d=new va(n);if(e.parent){e.size-=d.size,e.height-=d.height;var y=ie(e.parent.children,e);e.parent.children.splice(y+1,0,d)}else{var l=new va(e.children);l.parent=e,e.children=[l,d],e=l}d.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()},iterN:function(e,n,d){for(var l=0;l<this.children.length;++l){var y=this.children[l],G=y.chunkSize();if(e<G){var ee=Math.min(n,G-e);if(y.iterN(e,ee,d))return!0;if((n-=ee)==0)break;e=0}else e-=G}}};var Ma=function(e,n,d){if(d)for(var l in d)d.hasOwnProperty(l)&&(this[l]=d[l]);this.doc=e,this.node=n};Ma.prototype.clear=function(){var e=this.doc.cm,n=this.line.widgets,d=this.line,l=ye(d);if(l==null||!n)return;for(var y=0;y<n.length;++y)n[y]==this&&n.splice(y--,1);n.length||(d.widgets=null);var G=Fr(this);Me(d,Math.max(0,d.height-G)),e&&(di(e,function(){nl(e,d,-G),Mi(e,l,"widget")}),Yt(e,"lineWidgetCleared",e,this,l))},Ma.prototype.changed=function(){var e=this,n=this.height,d=this.doc.cm,l=this.line;this.height=null;var y=Fr(this)-n;if(!y)return;Ut(this.doc,l)||Me(l,l.height+y),d&&di(d,function(){d.curOp.forceUpdate=!0,nl(d,l,y),Yt(d,"lineWidgetChanged",d,e,ye(l))})},Ue(Ma);function nl(e,n,d){zt(n)<(e.curOp&&e.curOp.scrollTop||e.doc.scrollTop)&&es(e,d)}function Ml(e,n,d,l){var y=new Ma(e,d,l),G=e.cm;return G&&y.noHScroll&&(G.display.alignWidgets=!0),ka(e,n,"widget",function(ee){var ae=ee.widgets||(ee.widgets=[]);if(y.insertAt==null?ae.push(y):ae.splice(Math.min(ae.length-1,Math.max(0,y.insertAt)),0,y),y.line=ee,G&&!Ut(e,ee)){var oe=zt(ee)<e.scrollTop;Me(ee,ee.height+Fr(y)),oe&&es(G,y.height),G.curOp.forceUpdate=!0}return!0}),G&&Yt(G,"lineWidgetAdded",G,y,typeof n=="number"?n:ye(n)),y}var rl=0,bi=function(e,n){this.lines=[],this.type=n,this.doc=e,this.id=++rl};bi.prototype.clear=function(){if(this.explicitlyCleared)return;var e=this.doc.cm,n=e&&!e.curOp;if(n&&Vi(e),Ne(this,"clear")){var d=this.find();d&&Yt(this,"clear",d.from,d.to)}for(var l=null,y=null,G=0;G<this.lines.length;++G){var ee=this.lines[G],ae=xn(ee.markedSpans,this);e&&!this.collapsed?Mi(e,ye(ee),"text"):e&&(ae.to!=null&&(y=ye(ee)),ae.from!=null&&(l=ye(ee))),ee.markedSpans=Jn(ee.markedSpans,ae),ae.from==null&&this.collapsed&&!Ut(this.doc,ee)&&e&&Me(ee,Zi(e.display))}if(e&&this.collapsed&&!e.options.lineWrapping)for(var oe=0;oe<this.lines.length;++oe){var me=kn(this.lines[oe]),We=jt(me);We>e.display.maxLineLength&&(e.display.maxLine=me,e.display.maxLineLength=We,e.display.maxLineChanged=!0)}l!=null&&e&&this.collapsed&&li(e,l,y+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Xo(e.doc)),e&&Yt(e,"markerCleared",e,this,l,y),n&&Xi(e),this.parent&&this.parent.clear()},bi.prototype.find=function(e,n){e==null&&this.type=="bookmark"&&(e=1);for(var d,l,y=0;y<this.lines.length;++y){var G=this.lines[y],ee=xn(G.markedSpans,this);if(ee.from!=null&&(d=Ie(n?G:ye(G),ee.from),e==-1))return d;if(ee.to!=null&&(l=Ie(n?G:ye(G),ee.to),e==1))return l}return d&&{from:d,to:l}},bi.prototype.changed=function(){var e=this,n=this.find(-1,!0),d=this,l=this.doc.cm;if(!n||!l)return;di(l,function(){var y=n.line,G=ye(n.line),ee=Ki(l,G);if(ee&&(ho(ee),l.curOp.selectionChanged=l.curOp.forceUpdate=!0),l.curOp.updateMaxLine=!0,!Ut(d.doc,y)&&d.height!=null){var ae=d.height;d.height=null;var oe=Fr(d)-ae;oe&&Me(y,y.height+oe)}Yt(l,"markerChanged",l,e)})},bi.prototype.attachLine=function(e){if(!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(!n.maybeHiddenMarkers||ie(n.maybeHiddenMarkers,this)==-1)&&(n.maybeUnhiddenMarkers||(n.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(e)},bi.prototype.detachLine=function(e){if(this.lines.splice(ie(this.lines,e),1),!this.lines.length&&this.doc.cm){var n=this.doc.cm.curOp;(n.maybeHiddenMarkers||(n.maybeHiddenMarkers=[])).push(this)}},Ue(bi);function _a(e,n,d,l,y){if(l&&l.shared)return Nl(e,n,d,l,y);if(e.cm&&!e.cm.curOp)return Gr(e.cm,_a)(e,n,d,l,y);var G=new bi(e,y),ee=gt(n,d);if(l&&v(l,G,!1),ee>0||ee==0&&G.clearWhenEmpty!==!1)return G;if(G.replacedWith&&(G.collapsed=!0,G.widgetNode=C("span",[G.replacedWith],"CodeMirror-widget"),l.handleMouseEvents||G.widgetNode.setAttribute("cm-ignore-events","true"),l.insertLeft&&(G.widgetNode.insertLeft=!0)),G.collapsed){if(qn(e,n.line,n,d,G)||n.line!=d.line&&qn(e,d.line,n,d,G))throw new Error("Inserting collapsed marker partially overlapping an existing one");Qn()}G.addToHistory&&Wo(e,{from:n,to:d,origin:"markText"},e.sel,NaN);var ae=n.line,oe=e.cm,me;if(e.iter(ae,d.line+1,function(Ye){oe&&G.collapsed&&!oe.options.lineWrapping&&kn(Ye)==oe.display.maxLine&&(me=!0),G.collapsed&&ae!=n.line&&Me(Ye,0),pn(Ye,new Bn(G,ae==n.line?n.ch:null,ae==d.line?d.ch:null)),++ae}),G.collapsed&&e.iter(n.line,d.line+1,function(Ye){Ut(e,Ye)&&Me(Ye,0)}),G.clearOnEnter&&Ze(G,"beforeCursorEnter",function(){return G.clear()}),G.readOnly&&(Ft(),(e.history.done.length||e.history.undone.length)&&e.clearHistory()),G.collapsed&&(G.id=++rl,G.atomic=!0),oe){if(me&&(oe.curOp.updateMaxLine=!0),G.collapsed)li(oe,n.line,d.line+1);else if(G.className||G.startStyle||G.endStyle||G.css||G.attributes||G.title)for(var We=n.line;We<=d.line;We++)Mi(oe,We,"text");G.atomic&&Xo(oe.doc),Yt(oe,"markerAdded",oe,G)}return G}var ya=function(e,n){this.markers=e,this.primary=n;for(var d=0;d<e.length;++d)e[d].parent=this};ya.prototype.clear=function(){if(this.explicitlyCleared)return;this.explicitlyCleared=!0;for(var e=0;e<this.markers.length;++e)this.markers[e].clear();Yt(this,"clear")},ya.prototype.find=function(e,n){return this.primary.find(e,n)},Ue(ya);function Nl(e,n,d,l,y){l=v(l),l.shared=!1;var G=[_a(e,n,d,l,y)],ee=G[0],ae=l.widgetNode;return Ci(e,function(oe){ae&&(l.widgetNode=ae.cloneNode(!0)),G.push(_a(oe,O(oe,n),O(oe,d),l,y));for(var me=0;me<oe.linked.length;++me)if(oe.linked[me].isParent)return;ee=ne(G)}),new ya(G,ee)}function il(e){return e.findMarks(Ie(e.first,0),e.clipPos(Ie(e.lastLine())),function(n){return n.parent})}function iu(e,n){for(var d=0;d<n.length;d++){var l=n[d],y=l.find(),G=e.clipPos(y.from),ee=e.clipPos(y.to);if(gt(G,ee)){var ae=_a(e,G,ee,l.primary,l.primary.type);l.markers.push(ae),ae.parent=l}}}function Ul(e){for(var n=function(l){var y=e[l],G=[y.primary.doc];Ci(y.primary.doc,function(oe){return G.push(oe)});for(var ee=0;ee<y.markers.length;ee++){var ae=y.markers[ee];ie(G,ae.doc)==-1&&(ae.parent=null,y.markers.splice(ee--,1))}},d=0;d<e.length;d++)n(d)}var Ys=0,ui=function(e,n,d,l,y){if(!(this instanceof ui))return new ui(e,n,d,l,y);d==null&&(d=0),va.call(this,[new ji([new bn("",null)])]),this.first=d,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=d;var G=Ie(d,0);this.sel=Fi(G),this.history=new is(null),this.id=++Ys,this.modeOption=n,this.lineSep=l,this.direction=y=="rtl"?"rtl":"ltr",this.extend=!1,typeof e=="string"&&(e=this.splitLines(e)),Ks(this,{from:G,to:G,text:e}),ni(this,Fi(G),xe)};ui.prototype=et(va.prototype,{constructor:ui,iter:function(e,n,d){d?this.iterN(e-this.first,n-e,d):this.iterN(this.first,this.first+this.size,e)},insert:function(e,n){for(var d=0,l=0;l<n.length;++l)d+=n[l].height;this.insertInner(e-this.first,n,d)},remove:function(e,n){this.removeInner(e-this.first,n)},getValue:function(e){var n=Ot(this,this.first,this.first+this.size);return e===!1?n:n.join(e||this.lineSeparator())},setValue:Yr(function(e){var n=Ie(this.first,0),d=this.first+this.size-1;pa(this,{from:n,to:Ie(d,mt(this,d).text.length),text:this.splitLines(e),origin:"setValue",full:!0},!0),this.cm&&ia(this.cm,0,0),ni(this,Fi(n),xe)}),replaceRange:function(e,n,d,l){n=O(this,n),d=d?O(this,d):n,ga(this,e,n,d,l)},getRange:function(e,n,d){var l=Ke(this,O(this,e),O(this,n));return d===!1?l:l.join(d||this.lineSeparator())},getLine:function(e){var n=this.getLineHandle(e);return n&&n.text},getLineHandle:function(e){if(or(this,e))return mt(this,e)},getLineNumber:function(e){return ye(e)},getLineHandleVisualStart:function(e){return typeof e=="number"&&(e=mt(this,e)),kn(e)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(e){return O(this,e)},getCursor:function(e){var n=this.sel.primary(),d;return e==null||e=="head"?d=n.head:e=="anchor"?d=n.anchor:e=="end"||e=="to"||e===!1?d=n.to():d=n.from(),d},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Yr(function(e,n,d){Go(this,O(this,typeof e=="number"?Ie(e,n||0):e),null,d)}),setSelection:Yr(function(e,n,d){Go(this,O(this,e),O(this,n||e),d)}),extendSelection:Yr(function(e,n,d){us(this,O(this,e),n&&O(this,n),d)}),extendSelections:Yr(function(e,n){Ko(this,X(this,e),n)}),extendSelectionsBy:Yr(function(e,n){var d=fe(this.sel.ranges,e);Ko(this,X(this,d),n)}),setSelections:Yr(function(e,n,d){if(!e.length)return;for(var l=[],y=0;y<e.length;y++)l[y]=new Nr(O(this,e[y].anchor),O(this,e[y].head));n==null&&(n=Math.min(e.length-1,this.sel.primIndex)),ni(this,wi(this.cm,l,n),d)}),addSelection:Yr(function(e,n,d){var l=this.sel.ranges.slice(0);l.push(new Nr(O(this,e),O(this,n||e))),ni(this,wi(this.cm,l,l.length-1),d)}),getSelection:function(e){for(var n=this.sel.ranges,d,l=0;l<n.length;l++){var y=Ke(this,n[l].from(),n[l].to());d=d?d.concat(y):y}return e===!1?d:d.join(e||this.lineSeparator())},getSelections:function(e){for(var n=[],d=this.sel.ranges,l=0;l<d.length;l++){var y=Ke(this,d[l].from(),d[l].to());e!==!1&&(y=y.join(e||this.lineSeparator())),n[l]=y}return n},replaceSelection:function(e,n,d){for(var l=[],y=0;y<this.sel.ranges.length;y++)l[y]=e;this.replaceSelections(l,n,d||"+input")},replaceSelections:Yr(function(e,n,d){for(var l=[],y=this.sel,G=0;G<y.ranges.length;G++){var ee=y.ranges[G];l[G]={from:ee.from(),to:ee.to(),text:this.splitLines(e[G]),origin:d}}for(var ae=n&&n!="end"&&Al(this,l,n),oe=l.length-1;oe>=0;oe--)pa(this,l[oe]);ae?zo(this,ae):this.cm&&ra(this.cm)}),undo:Yr(function(){ds(this,"undo")}),redo:Yr(function(){ds(this,"redo")}),undoSelection:Yr(function(){ds(this,"undo",!0)}),redoSelection:Yr(function(){ds(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,n=0,d=0,l=0;l<e.done.length;l++)e.done[l].ranges||++n;for(var y=0;y<e.undone.length;y++)e.undone[y].ranges||++d;return{undo:n,redo:d}},clearHistory:function(){var e=this;this.history=new is(this.history.maxGeneration),Ci(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:da(this.history.done),undone:da(this.history.undone)}},setHistory:function(e){var n=this.history=new is(this.history.maxGeneration);n.done=da(e.done.slice(0),null,!0),n.undone=da(e.undone.slice(0),null,!0)},setGutterMarker:Yr(function(e,n,d){return ka(this,e,"gutter",function(l){var y=l.gutterMarkers||(l.gutterMarkers={});return y[n]=d,!d&&Re(y)&&(l.gutterMarkers=null),!0})}),clearGutter:Yr(function(e){var n=this;this.iter(function(d){d.gutterMarkers&&d.gutterMarkers[e]&&ka(n,d,"gutter",function(){return d.gutterMarkers[e]=null,Re(d.gutterMarkers)&&(d.gutterMarkers=null),!0})})}),lineInfo:function(e){var n;if(typeof e=="number"){if(!or(this,e))return null;if(n=e,e=mt(this,e),!e)return null}else if(n=ye(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,d){return ka(this,e,n=="gutter"?"gutter":"class",function(l){var y=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass";if(!l[y])l[y]=d;else{if(I(d).test(l[y]))return!1;l[y]+=" "+d}return!0})}),removeLineClass:Yr(function(e,n,d){return ka(this,e,n=="gutter"?"gutter":"class",function(l){var y=n=="text"?"textClass":n=="background"?"bgClass":n=="gutter"?"gutterClass":"wrapClass",G=l[y];if(G)if(d==null)l[y]=null;else{var ee=G.match(I(d));if(!ee)return!1;var ae=ee.index+ee[0].length;l[y]=G.slice(0,ee.index)+(!ee.index||ae==G.length?"":" ")+G.slice(ae)||null}else return!1;return!0})}),addLineWidget:Yr(function(e,n,d){return Ml(this,e,n,d)}),removeLineWidget:function(e){e.clear()},markText:function(e,n,d){return _a(this,O(this,e),O(this,n),d,d&&d.type||"range")},setBookmark:function(e,n){var d={replacedWith:n&&(n.nodeType==null?n.widget:n),insertLeft:n&&n.insertLeft,clearWhenEmpty:!1,shared:n&&n.shared,handleMouseEvents:n&&n.handleMouseEvents};return e=O(this,e),_a(this,e,e,d,"bookmark")},findMarksAt:function(e){e=O(this,e);var n=[],d=mt(this,e.line).markedSpans;if(d)for(var l=0;l<d.length;++l){var y=d[l];(y.from==null||y.from<=e.ch)&&(y.to==null||y.to>=e.ch)&&n.push(y.marker.parent||y.marker)}return n},findMarks:function(e,n,d){e=O(this,e),n=O(this,n);var l=[],y=e.line;return this.iter(e.line,n.line+1,function(G){var ee=G.markedSpans;if(ee)for(var ae=0;ae<ee.length;ae++){var oe=ee[ae];!(oe.to!=null&&y==e.line&&e.ch>=oe.to||oe.from==null&&y!=e.line||oe.from!=null&&y==n.line&&oe.from>=n.ch)&&(!d||d(oe.marker))&&l.push(oe.marker.parent||oe.marker)}++y}),l},getAllMarks:function(){var e=[];return this.iter(function(n){var d=n.markedSpans;if(d)for(var l=0;l<d.length;++l)d[l].from!=null&&e.push(d[l].marker)}),e},posFromIndex:function(e){var n,d=this.first,l=this.lineSeparator().length;return this.iter(function(y){var G=y.text.length+l;if(G>e)return n=e,!0;e-=G,++d}),O(this,Ie(d,n))},indexFromPos:function(e){e=O(this,e);var n=e.ch;if(e.line<this.first||e.ch<0)return 0;var d=this.lineSeparator().length;return this.iter(this.first,e.line,function(l){n+=l.text.length+d}),n},copy:function(e){var n=new ui(Ot(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,d=this.first+this.size;e.from!=null&&e.from>n&&(n=e.from),e.to!=null&&e.to<d&&(d=e.to);var l=new ui(Ot(this,n,d),e.mode||this.modeOption,n,this.lineSep,this.direction);return e.sharedHist&&(l.history=this.history),(this.linked||(this.linked=[])).push({doc:l,sharedHist:e.sharedHist}),l.linked=[{doc:this,isParent:!0,sharedHist:e.sharedHist}],iu(l,il(this)),l},unlinkDoc:function(e){if(e instanceof Hr&&(e=e.doc),this.linked)for(var n=0;n<this.linked.length;++n){var d=this.linked[n];if(d.doc!=e)continue;this.linked.splice(n,1),e.unlinkDoc(this),Ul(il(this));break}if(e.history==this.history){var l=[e.id];Ci(e,function(y){return l.push(y.id)},!0),e.history=new is(null),e.history.done=da(this.history.done,l),e.history.undone=da(this.history.undone,l)}},iterLinkedDocs:function(e){Ci(this,e)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(e){return this.lineSep?e.split(this.lineSep):vn(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)})}),ui.prototype.eachLine=ui.prototype.iter;var al=0;function Fl(e){var n=this;if(Qs(n),ft(n,e)||kr(n.display,e))return;ge(e),$&&(al=+new Date);var d=Gi(n,e,!0),l=e.dataTransfer.files;if(!d||n.isReadOnly())return;if(l&&l.length&&window.FileReader&&window.File)for(var y=l.length,G=Array(y),ee=0,ae=function(){++ee==y&&Gr(n,function(){d=O(n.doc,d);var ht={from:d,to:d,text:n.doc.splitLines(G.filter(function(Bt){return Bt!=null}).join(n.doc.lineSeparator())),origin:"paste"};pa(n.doc,ht),zo(n.doc,Fi(O(n.doc,d),O(n.doc,Yi(ht))))})()},oe=function(ht,Bt){if(n.options.allowDropFileTypes&&ie(n.options.allowDropFileTypes,ht.type)==-1){ae();return}var Zt=new FileReader;Zt.onerror=function(){return ae()},Zt.onload=function(){var mn=Zt.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(mn)){ae();return}G[Bt]=mn,ae()},Zt.readAsText(ht)},me=0;me<l.length;me++)oe(l[me],me);else{if(n.state.draggingText&&n.doc.sel.contains(d)>-1){n.state.draggingText(e),setTimeout(function(){return n.display.input.focus()},20);return}try{var We=e.dataTransfer.getData("Text");if(We){var Ye;if(n.state.draggingText&&!n.state.draggingText.copy&&(Ye=n.listSelections()),ha(n.doc,Fi(d,d)),Ye)for(var vt=0;vt<Ye.length;++vt)ga(n.doc,"",Ye[vt].anchor,Ye[vt].head,"drag");n.replaceSelection(We,"around","paste"),n.display.input.focus()}}catch(ht){}}}function sl(e,n){if($&&(!e.state.draggingText||+new Date-al<100)){ue(n);return}if(ft(e,n)||kr(e.display,n))return;if(n.dataTransfer.setData("Text",e.getSelection()),n.dataTransfer.effectAllowed="copyMove",n.dataTransfer.setDragImage&&!p){var d=f("img",null,null,"position: fixed; left: 0; top: 0;");d.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",g&&(d.width=d.height=1,e.display.wrapper.appendChild(d),d._top=d.offsetTop),n.dataTransfer.setDragImage(d,0,0),g&&d.parentNode.removeChild(d)}}function Bl(e,n){var d=Gi(e,n);if(!d)return;var l=document.createDocumentFragment();yo(e,d,l),e.display.dragCursor||(e.display.dragCursor=f("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),e.display.lineSpace.insertBefore(e.display.dragCursor,e.display.cursorDiv)),h(e.display.dragCursor,l)}function Qs(e){e.display.dragCursor&&(e.display.lineSpace.removeChild(e.display.dragCursor),e.display.dragCursor=null)}function ol(e){if(!document.getElementsByClassName)return;for(var n=document.getElementsByClassName("CodeMirror"),d=[],l=0;l<n.length;l++){var y=n[l].CodeMirror;y&&d.push(y)}d.length&&d[0].operation(function(){for(var G=0;G<d.length;G++)e(d[G])})}var Js=!1;function au(){if(Js)return;Zs(),Js=!0}function Zs(){var e;Ze(window,"resize",function(){e==null&&(e=setTimeout(function(){e=null,ol(jl)},100))}),Ze(window,"blur",function(){return ol(na)})}function jl(e){var n=e.display;n.cachedCharWidth=n.cachedTextHeight=n.cachedPaddingH=null,n.scrollbarsClipped=!1,e.setSize()}for(var Wi={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},Na=0;Na<10;Na++)Wi[Na+48]=Wi[Na+96]=String(Na);for(var hs=65;hs<=90;hs++)Wi[hs]=String.fromCharCode(hs);for(var Ua=1;Ua<=12;Ua++)Wi[Ua+111]=Wi[Ua+63235]="F"+Ua;var Li={};Li.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"},Li.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"},Li.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"},Li.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"]},Li.default=u?Li.macDefault:Li.pcDefault;function Wl(e){var n=e.split(/-(?!$)/);e=n[n.length-1];for(var d,l,y,G,ee=0;ee<n.length-1;ee++){var ae=n[ee];if(/^(cmd|meta|m)$/i.test(ae))G=!0;else if(/^a(lt)?$/i.test(ae))d=!0;else if(/^(c|ctrl|control)$/i.test(ae))l=!0;else if(/^s(hift)?$/i.test(ae))y=!0;else throw new Error("Unrecognized modifier name: "+ae)}return d&&(e="Alt-"+e),l&&(e="Ctrl-"+e),G&&(e="Cmd-"+e),y&&(e="Shift-"+e),e}function ll(e){var n={};for(var d in e)if(e.hasOwnProperty(d)){var l=e[d];if(/^(name|fallthrough|(de|at)tach)$/.test(d))continue;if(l=="..."){delete e[d];continue}for(var y=fe(d.split(" "),Wl),G=0;G<y.length;G++){var ee=void 0,ae=void 0;G==y.length-1?(ae=y.join(" "),ee=l):(ae=y.slice(0,G+1).join(" "),ee="...");var oe=n[ae];if(!oe)n[ae]=ee;else if(oe!=ee)throw new Error("Inconsistent bindings for "+ae)}delete e[d]}for(var me in n)e[me]=n[me];return e}function Ii(e,n,d,l){n=Ba(n);var y=n.call?n.call(e,l):n[e];if(y===!1)return"nothing";if(y==="...")return"multi";if(y!=null&&d(y))return"handled";if(n.fallthrough){if(Object.prototype.toString.call(n.fallthrough)!="[object Array]")return Ii(e,n.fallthrough,d,l);for(var G=0;G<n.fallthrough.length;G++){var ee=Ii(e,n.fallthrough[G],d,l);if(ee)return ee}}}function Fa(e){var n=typeof e=="string"?e:Wi[e.keyCode];return n=="Ctrl"||n=="Alt"||n=="Shift"||n=="Mod"}function ul(e,n,d){var l=e;return n.altKey&&l!="Alt"&&(e="Alt-"+e),(S?n.metaKey:n.ctrlKey)&&l!="Ctrl"&&(e="Ctrl-"+e),(S?n.ctrlKey:n.metaKey)&&l!="Mod"&&(e="Cmd-"+e),!d&&n.shiftKey&&l!="Shift"&&(e="Shift-"+e),e}function fs(e,n){if(g&&e.keyCode==34&&e.char)return!1;var d=Wi[e.keyCode];return d==null||e.altGraphKey?!1:(e.keyCode==3&&e.code&&(d=e.code),ul(d,e,n))}function Ba(e){return typeof e=="string"?Li[e]:e}function ba(e,n){for(var d=e.doc.sel.ranges,l=[],y=0;y<d.length;y++){for(var G=n(d[y]);l.length&&gt(G.from,ne(l).to)<=0;){var ee=l.pop();if(gt(ee.from,G.from)<0){G.from=ee.from;break}}l.push(G)}di(e,function(){for(var ae=l.length-1;ae>=0;ae--)ga(e.doc,"",l[ae].from,l[ae].to,"+delete");ra(e)})}function qs(e,n,d){var l=Ve(e.text,n+d,d);return l<0||l>e.text.length?null:l}function eo(e,n,d){var l=qs(e,n.ch,d);return l==null?null:new Ie(n.line,l,d<0?"after":"before")}function to(e,n,d,l,y){if(e){n.doc.direction=="rtl"&&(y=-y);var G=sn(d,n.doc.direction);if(G){var ee=y<0?ne(G):G[0],ae=y<0==(ee.level==1),oe=ae?"after":"before",me;if(ee.level>0||n.doc.direction=="rtl"){var We=ki(n,d);me=y<0?d.text.length-1:0;var Ye=ai(n,We,me).top;me=Et(function(vt){return ai(n,We,vt).top==Ye},y<0==(ee.level==1)?ee.from:ee.to-1,me),oe=="before"&&(me=qs(d,me,1))}else me=y<0?ee.to:ee.from;return new Ie(l,me,oe)}}return new Ie(l,y<0?d.text.length:0,y<0?"before":"after")}function no(e,n,d,l){var y=sn(n,e.doc.direction);if(!y)return eo(n,d,l);d.ch>=n.text.length?(d.ch=n.text.length,d.sticky="before"):d.ch<=0&&(d.ch=0,d.sticky="after");var G=Qt(y,d.ch,d.sticky),ee=y[G];if(e.doc.direction=="ltr"&&ee.level%2==0&&(l>0?ee.to>d.ch:ee.from<d.ch))return eo(n,d,l);var ae=function(jn,sr){return qs(n,jn instanceof Ie?jn.ch:jn,sr)},oe,me=function(jn){return e.options.lineWrapping?(oe=oe||ki(e,n),vo(e,n,oe,jn)):{begin:0,end:n.text.length}},We=me(d.sticky=="before"?ae(d,-1):d.ch);if(e.doc.direction=="rtl"||ee.level==1){var Ye=ee.level==1==l<0,vt=ae(d,Ye?1:-1);if(vt!=null&&(Ye?vt<=ee.to&&vt<=We.end:vt>=ee.from&&vt>=We.begin)){var ht=Ye?"before":"after";return new Ie(d.line,vt,ht)}}var Bt=function(jn,sr,Wn){for(var dr=function(Wr,ri){return ri?new Ie(d.line,ae(Wr,1),"before"):new Ie(d.line,Wr,"after")};jn>=0&&jn<y.length;jn+=sr){var Or=y[jn],Tr=sr>0==(Or.level!=1),Dr=Tr?Wn.begin:ae(Wn.end,-1);if(Or.from<=Dr&&Dr<Or.to)return dr(Dr,Tr);if(Dr=Tr?Or.from:ae(Or.to,-1),Wn.begin<=Dr&&Dr<Wn.end)return dr(Dr,Tr)}},Zt=Bt(G+l,l,We);if(Zt)return Zt;var mn=l>0?We.end:ae(We.begin,-1);return mn!=null&&!(l>0&&mn==n.text.length)&&(Zt=Bt(l>0?0:y.length-1,l,me(mn)),Zt)?Zt:null}var Ea={selectAll:Qo,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),xe)},killLine:function(e){return ba(e,function(n){if(n.empty()){var d=mt(e.doc,n.head.line).text.length;return n.head.ch==d&&n.head.line<e.lastLine()?{from:n.head,to:Ie(n.head.line+1,0)}:{from:n.head,to:Ie(n.head.line,d)}}else return{from:n.from(),to:n.to()}})},deleteLine:function(e){return ba(e,function(n){return{from:Ie(n.from().line,0),to:O(e.doc,Ie(n.to().line+1,0))}})},delLineLeft:function(e){return ba(e,function(n){return{from:Ie(n.from().line,0),to:n.from()}})},delWrappedLineLeft:function(e){return ba(e,function(n){var d=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:d},"div");return{from:l,to:n.from()}})},delWrappedLineRight:function(e){return ba(e,function(n){var d=e.charCoords(n.head,"div").top+5,l=e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div");return{from:n.from(),to:l}})},undo:function(e){return e.undo()},redo:function(e){return e.redo()},undoSelection:function(e){return e.undoSelection()},redoSelection:function(e){return e.redoSelection()},goDocStart:function(e){return e.extendSelection(Ie(e.firstLine(),0))},goDocEnd:function(e){return e.extendSelection(Ie(e.lastLine()))},goLineStart:function(e){return e.extendSelectionsBy(function(n){return ps(e,n.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(e){return e.extendSelectionsBy(function(n){return cl(e,n.head)},{origin:"+move",bias:1})},goLineEnd:function(e){return e.extendSelectionsBy(function(n){return ro(e,n.head.line)},{origin:"+move",bias:-1})},goLineRight:function(e){return e.extendSelectionsBy(function(n){var d=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:e.display.lineDiv.offsetWidth+100,top:d},"div")},we)},goLineLeft:function(e){return e.extendSelectionsBy(function(n){var d=e.cursorCoords(n.head,"div").top+5;return e.coordsChar({left:0,top:d},"div")},we)},goLineLeftSmart:function(e){return e.extendSelectionsBy(function(n){var d=e.cursorCoords(n.head,"div").top+5,l=e.coordsChar({left:0,top:d},"div");return l.ch<e.getLine(l.line).search(/\S/)?cl(e,n.head):l},we)},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=[],d=e.listSelections(),l=e.options.tabSize,y=0;y<d.length;y++){var G=d[y].from(),ee=H(e.getLine(G.line),G.ch,l);n.push(be(l-ee%l))}e.replaceSelections(n)},defaultTab:function(e){e.somethingSelected()?e.indentSelection("add"):e.execCommand("insertTab")},transposeChars:function(e){return di(e,function(){for(var n=e.listSelections(),d=[],l=0;l<n.length;l++){if(!n[l].empty())continue;var y=n[l].head,G=mt(e.doc,y.line).text;if(G){if(y.ch==G.length&&(y=new Ie(y.line,y.ch-1)),y.ch>0)y=new Ie(y.line,y.ch+1),e.replaceRange(G.charAt(y.ch-1)+G.charAt(y.ch-2),Ie(y.line,y.ch-2),y,"+transpose");else if(y.line>e.doc.first){var ee=mt(e.doc,y.line-1).text;ee&&(y=new Ie(y.line,1),e.replaceRange(G.charAt(0)+e.doc.lineSeparator()+ee.charAt(ee.length-1),Ie(y.line-1,ee.length-1),y,"+transpose"))}}d.push(new Nr(y,y))}e.setSelections(d)})},newlineAndIndent:function(e){return di(e,function(){for(var n=e.listSelections(),d=n.length-1;d>=0;d--)e.replaceRange(e.doc.lineSeparator(),n[d].anchor,n[d].head,"+input");n=e.listSelections();for(var l=0;l<n.length;l++)e.indentLine(n[l].from().line,null,!0);ra(e)})},openLine:function(e){return e.replaceSelection(`
`,"start")},toggleOverwrite:function(e){return e.toggleOverwrite()}};function ps(e,n){var d=mt(e.doc,n),l=kn(d);return l!=d&&(n=ye(l)),to(!0,e,l,n,1)}function ro(e,n){var d=mt(e.doc,n),l=Pn(d);return l!=d&&(n=ye(l)),to(!0,e,d,n,-1)}function cl(e,n){var d=ps(e,n.line),l=mt(e.doc,d.line),y=sn(l,e.doc.direction);if(!y||y[0].level==0){var G=Math.max(d.ch,l.text.search(/\S/)),ee=n.line==d.line&&n.ch<=G&&n.ch;return Ie(d.line,ee?0:G,d.sticky)}return d}function ms(e,n,d){if(typeof n=="string"&&(n=Ea[n],!n))return!1;e.display.input.ensurePolled();var l=e.display.shift,y=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),d&&(e.display.shift=!1),y=n(e)!=he}finally{e.display.shift=l,e.state.suppressEdits=!1}return y}function Hl(e,n,d){for(var l=0;l<e.state.keyMaps.length;l++){var y=Ii(n,e.state.keyMaps[l],d,e);if(y)return y}return e.options.extraKeys&&Ii(n,e.options.extraKeys,d,e)||Ii(n,e.options.keyMap,d,e)}var Kl=new Y;function ja(e,n,d,l){var y=e.state.keySeq;if(y){if(Fa(n))return"handled";if(/\'$/.test(n)?e.state.keySeq=null:Kl.set(50,function(){e.state.keySeq==y&&(e.state.keySeq=null,e.display.input.reset())}),io(e,y+" "+n,d,l))return!0}return io(e,n,d,l)}function io(e,n,d,l){var y=Hl(e,n,l);return y=="multi"&&(e.state.keySeq=n),y=="handled"&&Yt(e,"keyHandled",e,n,d),(y=="handled"||y=="multi")&&(ge(d),ks(e)),!!y}function dl(e,n){var d=fs(n,!0);return d?n.shiftKey&&!e.state.keySeq?ja(e,"Shift-"+d,n,function(l){return ms(e,l,!0)})||ja(e,d,n,function(l){if(typeof l=="string"?/^go[A-Z]/.test(l):l.motion)return ms(e,l)}):ja(e,d,n,function(l){return ms(e,l)}):!1}function Gl(e,n,d){return ja(e,"'"+d+"'",n,function(l){return ms(e,l,!0)})}var ao=null;function hl(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(n.curOp.focus=W(),ft(n,e))return;$&&z<11&&e.keyCode==27&&(e.returnValue=!1);var d=e.keyCode;n.display.shift=d==16||e.shiftKey;var l=dl(n,e);g&&(ao=l?d:null,!l&&d==88&&!hn&&(u?e.metaKey:e.ctrlKey)&&n.replaceSelection("",null,"cut")),B&&!u&&!l&&d==46&&e.shiftKey&&!e.ctrlKey&&document.execCommand&&document.execCommand("cut"),d==18&&!/\bCodeMirror-crosshair\b/.test(n.display.lineDiv.className)&&zl(n)}function zl(e){var n=e.display.lineDiv;j(n,"CodeMirror-crosshair");function d(l){(l.keyCode==18||!l.altKey)&&(x(n,"CodeMirror-crosshair"),At(document,"keyup",d),At(document,"mouseover",d))}Ze(document,"keyup",d),Ze(document,"mouseover",d)}function fl(e){e.keyCode==16&&(this.doc.sel.shift=!1),ft(this,e)}function pl(e){var n=this;if(e.target&&e.target!=n.display.input.getField())return;if(kr(n.display,e)||ft(n,e)||e.ctrlKey&&!e.altKey||u&&e.metaKey)return;var d=e.keyCode,l=e.charCode;if(g&&d==ao){ao=null,ge(e);return}if(g&&(!e.which||e.which<10)&&dl(n,e))return;var y=String.fromCharCode(l==null?d:l);if(y=="\b")return;if(Gl(n,e,y))return;n.display.input.onKeyPress(e)}var Vl=400,so=function(e,n,d){this.time=e,this.pos=n,this.button=d};so.prototype.compare=function(e,n,d){return this.time+Vl>e&&gt(n,this.pos)==0&&d==this.button};var Wa,Ha;function Xl(e,n){var d=+new Date;return Ha&&Ha.compare(d,e,n)?(Wa=Ha=null,"triple"):Wa&&Wa.compare(d,e,n)?(Ha=new so(d,e,n),Wa=null,"double"):(Wa=new so(d,e,n),Ha=null,"single")}function oo(e){var n=this,d=n.display;if(ft(n,e)||d.activeTouch&&d.input.supportsTouch())return;if(d.input.ensurePolled(),d.shift=e.shiftKey,kr(d,e)){r||(d.scroller.draggable=!1,setTimeout(function(){return d.scroller.draggable=!0},100));return}if(uo(n,e))return;var l=Gi(n,e),y=at(e),G=l?Xl(l,y):"single";if(window.focus(),y==1&&n.state.selectingText&&n.state.selectingText(e),l&&ml(n,y,l,G,e))return;y==1?l?Yl(n,l,G,e):Fe(e)==d.scroller&&ge(e):y==2?(l&&us(n.doc,l),setTimeout(function(){return d.input.focus()},20)):y==3&&(A?n.display.input.onContextMenu(e):Eo(n))}function ml(e,n,d,l,y){var G="Click";return l=="double"?G="Double"+G:l=="triple"&&(G="Triple"+G),G=(n==1?"Left":n==2?"Middle":"Right")+G,ja(e,ul(G,y),y,function(ee){if(typeof ee=="string"&&(ee=Ea[ee]),!ee)return!1;var ae=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),ae=ee(e,d)!=he}finally{e.state.suppressEdits=!1}return ae})}function $l(e,n,d){var l=e.getOption("configureMouse"),y=l?l(e,n,d):{};if(y.unit==null){var G=o?d.shiftKey&&d.metaKey:d.altKey;y.unit=G?"rectangle":n=="single"?"char":n=="double"?"word":"line"}return(y.extend==null||e.doc.extend)&&(y.extend=e.doc.extend||d.shiftKey),y.addNew==null&&(y.addNew=u?d.metaKey:d.ctrlKey),y.moveOnDrag==null&&(y.moveOnDrag=!(u?d.altKey:d.ctrlKey)),y}function Yl(e,n,d,l){$?setTimeout(P(Ms,e),0):e.curOp.focus=W();var y=$l(e,d,l),G=e.doc.sel,ee;e.options.dragDrop&&xt&&!e.isReadOnly()&&d=="single"&&(ee=G.contains(n))>-1&&(gt((ee=G.ranges[ee]).from(),n)<0||n.xRel>0)&&(gt(ee.to(),n)>0||n.xRel<0)?Ql(e,l,n,y):Jl(e,l,n,y)}function Ql(e,n,d,l){var y=e.display,G=!1,ee=Gr(e,function(me){r&&(y.scroller.draggable=!1),e.state.draggingText=!1,At(y.wrapper.ownerDocument,"mouseup",ee),At(y.wrapper.ownerDocument,"mousemove",ae),At(y.scroller,"dragstart",oe),At(y.scroller,"drop",ee),G||(ge(me),l.addNew||us(e.doc,d,null,null,l.extend),r&&!p||$&&z==9?setTimeout(function(){y.wrapper.ownerDocument.body.focus({preventScroll:!0}),y.input.focus()},20):y.input.focus())}),ae=function(me){G=G||Math.abs(n.clientX-me.clientX)+Math.abs(n.clientY-me.clientY)>=10},oe=function(){return G=!0};r&&(y.scroller.draggable=!0),e.state.draggingText=ee,ee.copy=!l.moveOnDrag,y.scroller.dragDrop&&y.scroller.dragDrop(),Ze(y.wrapper.ownerDocument,"mouseup",ee),Ze(y.wrapper.ownerDocument,"mousemove",ae),Ze(y.scroller,"dragstart",oe),Ze(y.scroller,"drop",ee),Eo(e),setTimeout(function(){return y.input.focus()},20)}function lo(e,n,d){if(d=="char")return new Nr(n,n);if(d=="word")return e.findWordAt(n);if(d=="line")return new Nr(Ie(n.line,0),O(e.doc,Ie(n.line+1,0)));var l=d(e,n);return new Nr(l.from,l.to)}function Jl(e,n,d,l){var y=e.display,G=e.doc;ge(n);var ee,ae,oe=G.sel,me=oe.ranges;if(l.addNew&&!l.extend?(ae=G.sel.contains(d),ae>-1?ee=me[ae]:ee=new Nr(d,d)):(ee=G.sel.primary(),ae=G.sel.primIndex),l.unit=="rectangle")l.addNew||(ee=new Nr(d,d)),d=Gi(e,n,!0,!0),ae=-1;else{var We=lo(e,d,l.unit);l.extend?ee=ls(ee,We.anchor,We.head,l.extend):ee=We}l.addNew?ae==-1?(ae=me.length,ni(G,wi(e,me.concat([ee]),ae),{scroll:!1,origin:"*mouse"})):me.length>1&&me[ae].empty()&&l.unit=="char"&&!l.extend?(ni(G,wi(e,me.slice(0,ae).concat(me.slice(ae+1)),0),{scroll:!1,origin:"*mouse"}),oe=G.sel):Bi(G,ae,ee,Le):(ae=0,ni(G,new mi([ee],0),Le),oe=G.sel);var Ye=d;function vt(Wn){if(gt(Ye,Wn)==0)return;if(Ye=Wn,l.unit=="rectangle"){for(var dr=[],Or=e.options.tabSize,Tr=H(mt(G,d.line).text,d.ch,Or),Dr=H(mt(G,Wn.line).text,Wn.ch,Or),Wr=Math.min(Tr,Dr),ri=Math.max(Tr,Dr),zr=Math.min(d.line,Wn.line),Ei=Math.min(e.lastLine(),Math.max(d.line,Wn.line));zr<=Ei;zr++){var gi=mt(G,zr).text,Qr=Ae(gi,Wr,Or);Wr==ri?dr.push(new Nr(Ie(zr,Qr),Ie(zr,Qr))):gi.length>Qr&&dr.push(new Nr(Ie(zr,Qr),Ie(zr,Ae(gi,ri,Or))))}dr.length||dr.push(new Nr(d,d)),ni(G,wi(e,oe.ranges.slice(0,ae).concat(dr),ae),{origin:"*mouse",scroll:!1}),e.scrollIntoView(Wn)}else{var vi=ee,oi=lo(e,Wn,l.unit),qr=vi.anchor,Jr;gt(oi.anchor,qr)>0?(Jr=oi.head,qr=mr(vi.from(),oi.anchor)):(Jr=oi.anchor,qr=hr(vi.to(),oi.head));var Xr=oe.ranges.slice(0);Xr[ae]=Zl(e,new Nr(O(G,qr),Jr)),ni(G,wi(e,Xr,ae),Le)}}var ht=y.wrapper.getBoundingClientRect(),Bt=0;function Zt(Wn){var dr=++Bt,Or=Gi(e,Wn,!0,l.unit=="rectangle");if(!Or)return;if(gt(Or,Ye)!=0){e.curOp.focus=W(),vt(Or);var Tr=Za(y,G);(Or.line>=Tr.to||Or.line<Tr.from)&&setTimeout(Gr(e,function(){Bt==dr&&Zt(Wn)}),150)}else{var Dr=Wn.clientY<ht.top?-20:Wn.clientY>ht.bottom?20:0;Dr&&setTimeout(Gr(e,function(){if(Bt!=dr)return;y.scroller.scrollTop+=Dr,Zt(Wn)}),50)}}function mn(Wn){e.state.selectingText=!1,Bt=Infinity,Wn&&(ge(Wn),y.input.focus()),At(y.wrapper.ownerDocument,"mousemove",jn),At(y.wrapper.ownerDocument,"mouseup",sr),G.history.lastSelOrigin=null}var jn=Gr(e,function(Wn){Wn.buttons===0||!at(Wn)?mn(Wn):Zt(Wn)}),sr=Gr(e,mn);e.state.selectingText=sr,Ze(y.wrapper.ownerDocument,"mousemove",jn),Ze(y.wrapper.ownerDocument,"mouseup",sr)}function Zl(e,n){var d=n.anchor,l=n.head,y=mt(e.doc,d.line);if(gt(d,l)==0&&d.sticky==l.sticky)return n;var G=sn(y);if(!G)return n;var ee=Qt(G,d.ch,d.sticky),ae=G[ee];if(ae.from!=d.ch&&ae.to!=d.ch)return n;var oe=ee+(ae.from==d.ch==(ae.level!=1)?0:1);if(oe==0||oe==G.length)return n;var me;if(l.line!=d.line)me=(l.line-d.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var We=Qt(G,l.ch,l.sticky),Ye=We-ee||(l.ch-d.ch)*(ae.level==1?-1:1);We==oe-1||We==oe?me=Ye<0:me=Ye>0}var vt=G[oe+(me?-1:0)],ht=me==(vt.level==1),Bt=ht?vt.from:vt.to,Zt=ht?"after":"before";return d.ch==Bt&&d.sticky==Zt?n:new Nr(new Ie(d.line,Bt,Zt),l)}function gl(e,n,d,l){var y,G;if(n.touches)y=n.touches[0].clientX,G=n.touches[0].clientY;else try{y=n.clientX,G=n.clientY}catch(vt){return!1}if(y>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;l&&ge(n);var ee=e.display,ae=ee.lineDiv.getBoundingClientRect();if(G>ae.bottom||!Ne(e,d))return De(n);G-=ae.top-ee.viewOffset;for(var oe=0;oe<e.display.gutterSpecs.length;++oe){var me=ee.gutters.childNodes[oe];if(me&&me.getBoundingClientRect().right>=y){var We=ve(e.doc,G),Ye=e.display.gutterSpecs[oe];return ct(e,d,e,We,Ye.className,n),De(n)}}}function uo(e,n){return gl(e,n,"gutterClick",!0)}function vl(e,n){if(kr(e.display,n)||_l(e,n))return;if(ft(e,n,"contextmenu"))return;A||e.display.input.onContextMenu(n)}function _l(e,n){return Ne(e,"gutterContextMenu")?gl(e,n,"gutterContextMenu",!1):!1}function yl(e){e.display.wrapper.className=e.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+e.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Ca(e)}var xa={toString:function(){return"CodeMirror.Init"}},gs={},Ka={};function ql(e){var n=e.optionHandlers;function d(l,y,G,ee){e.defaults[l]=y,G&&(n[l]=ee?function(ae,oe,me){me!=xa&&G(ae,oe,me)}:G)}e.defineOption=d,e.Init=xa,d("value","",function(l,y){return l.setValue(y)},!0),d("mode",null,function(l,y){l.doc.modeOption=y,La(l)},!0),d("indentUnit",2,La,!0),d("indentWithTabs",!1),d("smartIndent",!0),d("tabSize",4,function(l){Ia(l),Ca(l),li(l)},!0),d("lineSeparator",null,function(l,y){if(l.doc.lineSep=y,!y)return;var G=[],ee=l.doc.first;l.doc.iter(function(oe){for(var me=0;;){var We=oe.text.indexOf(y,me);if(We==-1)break;me=We+y.length,G.push(Ie(ee,We))}ee++});for(var ae=G.length-1;ae>=0;ae--)ga(l.doc,y,G[ae],Ie(G[ae].line,G[ae].ch+y.length))}),d("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(l,y,G){l.state.specialChars=new RegExp(y.source+(y.test(" ")?"":"| "),"g"),G!=xa&&l.refresh()}),d("specialCharPlaceholder",pt,function(l){return l.refresh()},!0),d("electricChars",!0),d("inputStyle",t?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),d("spellcheck",!1,function(l,y){return l.getInputField().spellcheck=y},!0),d("autocorrect",!1,function(l,y){return l.getInputField().autocorrect=y},!0),d("autocapitalize",!1,function(l,y){return l.getInputField().autocapitalize=y},!0),d("rtlMoveVisually",!R),d("wholeLineUpdateBefore",!0),d("theme","default",function(l){yl(l),Da(l)},!0),d("keyMap","default",function(l,y,G){var ee=Ba(y),ae=G!=xa&&Ba(G);ae&&ae.detach&&ae.detach(l,ee),ee.attach&&ee.attach(l,ae||null)}),d("extraKeys",null),d("configureMouse",null),d("lineWrapping",!1,tu,!0),d("gutters",[],function(l,y){l.display.gutterSpecs=Ws(y,l.options.lineNumbers),Da(l)},!0),d("fixedGutter",!0,function(l,y){l.display.gutters.style.left=y?Ds(l.display)+"px":"0",l.refresh()},!0),d("coverGutterNextToScrollbar",!1,function(l){return Ui(l)},!0),d("scrollbarStyle","native",function(l){Oo(l),Ui(l),l.display.scrollbars.setScrollTop(l.doc.scrollTop),l.display.scrollbars.setScrollLeft(l.doc.scrollLeft)},!0),d("lineNumbers",!1,function(l,y){l.display.gutterSpecs=Ws(l.options.gutters,y),Da(l)},!0),d("firstLineNumber",1,Da,!0),d("lineNumberFormatter",function(l){return l},Da,!0),d("showCursorWhenSelecting",!1,ta,!0),d("resetSelectionOnContextMenu",!0),d("lineWiseCopyCut",!0),d("pasteLinesPerSelection",!0),d("selectionsMayTouch",!1),d("readOnly",!1,function(l,y){y=="nocursor"&&(na(l),l.display.input.blur()),l.display.input.readOnlyChanged(y)}),d("screenReaderLabel",null,function(l,y){y=y===""?null:y,l.display.input.screenReaderLabelChanged(y)}),d("disableInput",!1,function(l,y){y||l.display.input.reset()},!0),d("dragDrop",!0,eu),d("allowDropFileTypes",null),d("cursorBlinkRate",530),d("cursorScrollMargin",0),d("cursorHeight",1,ta,!0),d("singleCursorHeightPerLine",!0,ta,!0),d("workTime",100),d("workDelay",100),d("flattenSpans",!0,Ia,!0),d("addModeClass",!1,Ia,!0),d("pollInterval",100),d("undoDepth",200,function(l,y){return l.doc.history.undoDepth=y}),d("historyEventDelay",1250),d("viewportMargin",10,function(l){return l.refresh()},!0),d("maxHighlightLength",1e4,Ia,!0),d("moveInputWithCursor",!0,function(l,y){y||l.display.input.resetPosition()}),d("tabindex",null,function(l,y){return l.display.input.getField().tabIndex=y||""}),d("autofocus",null),d("direction","ltr",function(l,y){return l.doc.setDirection(y)},!0),d("phrases",null)}function eu(e,n,d){var l=d&&d!=xa;if(!n!=!l){var y=e.display.dragFunctions,G=n?Ze:At;G(e.display.scroller,"dragstart",y.start),G(e.display.scroller,"dragenter",y.enter),G(e.display.scroller,"dragover",y.over),G(e.display.scroller,"dragleave",y.leave),G(e.display.scroller,"drop",y.drop)}}function tu(e){e.options.lineWrapping?(j(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(x(e.display.wrapper,"CodeMirror-wrap"),tn(e)),Ps(e),li(e),Ca(e),setTimeout(function(){return Ui(e)},100)}function Hr(e,n){var d=this;if(!(this instanceof Hr))return new Hr(e,n);this.options=n=n?v(n):{},v(gs,n,!1);var l=n.value;typeof l=="string"?l=new ui(l,n.mode,null,n.lineSeparator,n.direction):n.mode&&(l.modeOption=n.mode),this.doc=l;var y=new Hr.inputStyles[n.inputStyle](this),G=this.display=new Ol(e,l,y,n);G.wrapper.CodeMirror=this,yl(this),n.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),Oo(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new Y,keySeq:null,specialChars:null},n.autofocus&&!t&&G.input.focus(),$&&z<11&&setTimeout(function(){return d.display.input.reset(!0)},20),bl(this),au(),Vi(this),this.curOp.forceUpdate=!0,Gs(this,l),n.autofocus&&!t||this.hasFocus()?setTimeout(function(){d.hasFocus()&&!d.state.focused&&Ns(d)},20):na(this);for(var ee in Ka)Ka.hasOwnProperty(ee)&&Ka[ee](this,n[ee],xa);ko(this),n.finishInit&&n.finishInit(this);for(var ae=0;ae<L.length;++ae)L[ae](this);Xi(this),r&&n.lineWrapping&&getComputedStyle(G.lineDiv).textRendering=="optimizelegibility"&&(G.lineDiv.style.textRendering="auto")}Hr.defaults=gs,Hr.optionHandlers=Ka;function bl(e){var n=e.display;Ze(n.scroller,"mousedown",Gr(e,oo)),$&&z<11?Ze(n.scroller,"dblclick",Gr(e,function(oe){if(ft(e,oe))return;var me=Gi(e,oe);if(!me||uo(e,oe)||kr(e.display,oe))return;ge(oe);var We=e.findWordAt(me);us(e.doc,We.anchor,We.head)})):Ze(n.scroller,"dblclick",function(oe){return ft(e,oe)||ge(oe)}),Ze(n.scroller,"contextmenu",function(oe){return vl(e,oe)}),Ze(n.input.getField(),"contextmenu",function(oe){n.scroller.contains(oe.target)||vl(e,oe)});var d,l={end:0};function y(){n.activeTouch&&(d=setTimeout(function(){return n.activeTouch=null},1e3),l=n.activeTouch,l.end=+new Date)}function G(oe){if(oe.touches.length!=1)return!1;var me=oe.touches[0];return me.radiusX<=1&&me.radiusY<=1}function ee(oe,me){if(me.left==null)return!0;var We=me.left-oe.left,Ye=me.top-oe.top;return We*We+Ye*Ye>20*20}Ze(n.scroller,"touchstart",function(oe){if(!ft(e,oe)&&!G(oe)&&!uo(e,oe)){n.input.ensurePolled(),clearTimeout(d);var me=+new Date;n.activeTouch={start:me,moved:!1,prev:me-l.end<=300?l:null},oe.touches.length==1&&(n.activeTouch.left=oe.touches[0].pageX,n.activeTouch.top=oe.touches[0].pageY)}}),Ze(n.scroller,"touchmove",function(){n.activeTouch&&(n.activeTouch.moved=!0)}),Ze(n.scroller,"touchend",function(oe){var me=n.activeTouch;if(me&&!kr(n,oe)&&me.left!=null&&!me.moved&&new Date-me.start<300){var We=e.coordsChar(n.activeTouch,"page"),Ye;!me.prev||ee(me,me.prev)?Ye=new Nr(We,We):!me.prev.prev||ee(me,me.prev.prev)?Ye=e.findWordAt(We):Ye=new Nr(Ie(We.line,0),O(e.doc,Ie(We.line+1,0))),e.setSelection(Ye.anchor,Ye.head),e.focus(),ge(oe)}y()}),Ze(n.scroller,"touchcancel",y),Ze(n.scroller,"scroll",function(){n.scroller.clientHeight&&(aa(e,n.scroller.scrollTop),Di(e,n.scroller.scrollLeft,!0),ct(e,"scroll",e))}),Ze(n.scroller,"mousewheel",function(oe){return No(e,oe)}),Ze(n.scroller,"DOMMouseScroll",function(oe){return No(e,oe)}),Ze(n.wrapper,"scroll",function(){return n.wrapper.scrollTop=n.wrapper.scrollLeft=0}),n.dragFunctions={enter:function(oe){ft(e,oe)||ue(oe)},over:function(oe){ft(e,oe)||(Bl(e,oe),ue(oe))},start:function(oe){return sl(e,oe)},drop:Gr(e,Fl),leave:function(oe){ft(e,oe)||Qs(e)}};var ae=n.input.getField();Ze(ae,"keyup",function(oe){return fl.call(e,oe)}),Ze(ae,"keydown",Gr(e,hl)),Ze(ae,"keypress",Gr(e,pl)),Ze(ae,"focus",function(oe){return Ns(e,oe)}),Ze(ae,"blur",function(oe){return na(e,oe)})}var L=[];Hr.defineInitHook=function(e){return L.push(e)};function k(e,n,d,l){var y=e.doc,G;d==null&&(d="add"),d=="smart"&&(y.mode.indent?G=wt(e,n).state:d="prev");var ee=e.options.tabSize,ae=mt(y,n),oe=H(ae.text,null,ee);ae.stateAfter&&(ae.stateAfter=null);var me=ae.text.match(/^\s*/)[0],We;if(!l&&!/\S/.test(ae.text))We=0,d="not";else if(d=="smart"&&(We=y.mode.indent(G,ae.text.slice(me.length),ae.text),We==he||We>150)){if(!l)return;d="prev"}d=="prev"?n>y.first?We=H(mt(y,n-1).text,null,ee):We=0:d=="add"?We=oe+e.options.indentUnit:d=="subtract"?We=oe-e.options.indentUnit:typeof d=="number"&&(We=oe+d),We=Math.max(0,We);var Ye="",vt=0;if(e.options.indentWithTabs)for(var ht=Math.floor(We/ee);ht;--ht)vt+=ee,Ye+=" ";if(vt<We&&(Ye+=be(We-vt)),Ye!=me)return ga(y,Ye,Ie(n,0),Ie(n,me.length),"+input"),ae.stateAfter=null,!0;for(var Bt=0;Bt<y.sel.ranges.length;Bt++){var Zt=y.sel.ranges[Bt];if(Zt.head.line==n&&Zt.head.ch<me.length){var mn=Ie(n,me.length);Bi(y,Bt,new Nr(mn,mn));break}}}var V=null;function re(e){V=e}function ce(e,n,d,l,y){var G=e.doc;e.display.shift=!1,l||(l=G.sel);var ee=+new Date-200,ae=y=="paste"||e.state.pasteIncoming>ee,oe=vn(n),me=null;if(ae&&l.ranges.length>1)if(V&&V.text.join(`
`)==n){if(l.ranges.length%V.text.length==0){me=[];for(var We=0;We<V.text.length;We++)me.push(G.splitLines(V.text[We]))}}else oe.length==l.ranges.length&&e.options.pasteLinesPerSelection&&(me=fe(oe,function(jn){return[jn]}));for(var Ye=e.curOp.updateInput,vt=l.ranges.length-1;vt>=0;vt--){var ht=l.ranges[vt],Bt=ht.from(),Zt=ht.to();ht.empty()&&(d&&d>0?Bt=Ie(Bt.line,Bt.ch-d):e.state.overwrite&&!ae?Zt=Ie(Zt.line,Math.min(mt(G,Zt.line).text.length,Zt.ch+ne(oe).length)):ae&&V&&V.lineWise&&V.text.join(`
`)==oe.join(`
`)&&(Bt=Zt=Ie(Bt.line,0)));var mn={from:Bt,to:Zt,text:me?me[vt%me.length]:oe,origin:y||(ae?"paste":e.state.cutIncoming>ee?"cut":"+input")};pa(e.doc,mn),Yt(e,"inputRead",e,mn)}n&&!ae&&Te(e,n),ra(e),e.curOp.updateInput<2&&(e.curOp.updateInput=Ye),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function de(e,n){var d=e.clipboardData&&e.clipboardData.getData("Text");if(d)return e.preventDefault(),!n.isReadOnly()&&!n.options.disableInput&&di(n,function(){return ce(n,d,0,null,"paste")}),!0}function Te(e,n){if(!e.options.electricChars||!e.options.smartIndent)return;for(var d=e.doc.sel,l=d.ranges.length-1;l>=0;l--){var y=d.ranges[l];if(y.head.ch>100||l&&d.ranges[l-1].head.line==y.head.line)continue;var G=e.getModeAt(y.head),ee=!1;if(G.electricChars){for(var ae=0;ae<G.electricChars.length;ae++)if(n.indexOf(G.electricChars.charAt(ae))>-1){ee=k(e,y.head.line,"smart");break}}else G.electricInput&&(G.electricInput.test(mt(e.doc,y.head.line).text.slice(0,y.head.ch))&&(ee=k(e,y.head.line,"smart")));ee&&Yt(e,"electricInput",e,y.head.line)}}function Se(e){for(var n=[],d=[],l=0;l<e.doc.sel.ranges.length;l++){var y=e.doc.sel.ranges[l].head.line,G={anchor:Ie(y,0),head:Ie(y+1,0)};d.push(G),n.push(e.getRange(G.anchor,G.head))}return{text:n,ranges:d}}function ze(e,n,d,l){e.setAttribute("autocorrect",d?"":"off"),e.setAttribute("autocapitalize",l?"":"off"),e.setAttribute("spellcheck",!!n)}function it(){var e=f("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),n=f("div",[e],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return r?e.style.width="1000px":e.setAttribute("wrap","off"),s&&(e.style.border="1px solid black"),ze(e),n}function ut(e){var n=e.optionHandlers,d=e.helpers={};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(l,y){var G=this.options,ee=G[l];if(G[l]==y&&l!="mode")return;G[l]=y,n.hasOwnProperty(l)&&Gr(this,n[l])(this,y,ee),ct(this,"optionChange",this,l)},getOption:function(l){return this.options[l]},getDoc:function(){return this.doc},addKeyMap:function(l,y){this.state.keyMaps[y?"push":"unshift"](Ba(l))},removeKeyMap:function(l){for(var y=this.state.keyMaps,G=0;G<y.length;++G)if(y[G]==l||y[G].name==l)return y.splice(G,1),!0},addOverlay:si(function(l,y){var G=l.token?l:e.getMode(this.options,l);if(G.startState)throw new Error("Overlays may not be stateful.");_e(this.state.overlays,{mode:G,modeSpec:l,opaque:y&&y.opaque,priority:y&&y.priority||0},function(ee){return ee.priority}),this.state.modeGen++,li(this)}),removeOverlay:si(function(l){for(var y=this.state.overlays,G=0;G<y.length;++G){var ee=y[G].modeSpec;if(ee==l||typeof l=="string"&&ee.name==l){y.splice(G,1),this.state.modeGen++,li(this);return}}}),indentLine:si(function(l,y,G){typeof y!="string"&&typeof y!="number"&&(y==null?y=this.options.smartIndent?"smart":"prev":y=y?"add":"subtract"),or(this.doc,l)&&k(this,l,y,G)}),indentSelection:si(function(l){for(var y=this.doc.sel.ranges,G=-1,ee=0;ee<y.length;ee++){var ae=y[ee];if(ae.empty())ae.head.line>G&&(k(this,ae.head.line,l,!0),G=ae.head.line,ee==this.doc.sel.primIndex&&ra(this));else{var oe=ae.from(),me=ae.to(),We=Math.max(G,oe.line);G=Math.min(this.lastLine(),me.line-(me.ch?0:1))+1;for(var Ye=We;Ye<G;++Ye)k(this,Ye,l);var vt=this.doc.sel.ranges;oe.ch==0&&y.length==vt.length&&vt[ee].from().ch>0&&Bi(this.doc,ee,new Nr(oe,vt[ee].to()),xe)}}}),getTokenAt:function(l,y){return Cn(this,l,y)},getLineTokens:function(l,y){return Cn(this,Ie(l),y,!0)},getTokenTypeAt:function(l){l=O(this.doc,l);var y=st(this,mt(this.doc,l.line)),G=0,ee=(y.length-1)/2,ae=l.ch,oe;if(ae==0)oe=y[2];else for(;;){var me=G+ee>>1;if((me?y[me*2-1]:0)>=ae)ee=me;else if(y[me*2+1]<ae)G=me+1;else{oe=y[me*2+2];break}}var We=oe?oe.indexOf("overlay "):-1;return We<0?oe:We==0?null:oe.slice(0,We-1)},getModeAt:function(l){var y=this.doc.mode;return y.innerMode?e.innerMode(y,this.getTokenAt(l).state).mode:y},getHelper:function(l,y){return this.getHelpers(l,y)[0]},getHelpers:function(l,y){var G=[];if(!d.hasOwnProperty(y))return G;var ee=d[y],ae=this.getModeAt(l);if(typeof ae[y]=="string")ee[ae[y]]&&G.push(ee[ae[y]]);else if(ae[y])for(var oe=0;oe<ae[y].length;oe++){var me=ee[ae[y][oe]];me&&G.push(me)}else ae.helperType&&ee[ae.helperType]?G.push(ee[ae.helperType]):ee[ae.name]&&G.push(ee[ae.name]);for(var We=0;We<ee._global.length;We++){var Ye=ee._global[We];Ye.pred(ae,this)&&ie(G,Ye.val)==-1&&G.push(Ye.val)}return G},getStateAfter:function(l,y){var G=this.doc;return l=q(G,l==null?G.first+G.size-1:l),wt(this,l+1,y).state},cursorCoords:function(l,y){var G,ee=this.doc.sel.primary();return l==null?G=ee.head:typeof l=="object"?G=O(this.doc,l):G=l?ee.from():ee.to(),xi(this,G,y||"page")},charCoords:function(l,y){return Ts(this,O(this.doc,l),y||"page")},coordsChar:function(l,y){return l=Cs(this,l,y||"page"),Rs(this,l.left,l.top)},lineAtHeight:function(l,y){return l=Cs(this,{top:l,left:0},y||"page").top,ve(this.doc,l+this.display.viewOffset)},heightAtLine:function(l,y,G){var ee=!1,ae;if(typeof l=="number"){var oe=this.doc.first+this.doc.size-1;l<this.doc.first?l=this.doc.first:l>oe&&(l=oe,ee=!0),ae=mt(this.doc,l)}else ae=l;return $a(this,ae,{top:0,left:0},y||"page",G||ee).top+(ee?this.doc.height-zt(ae):0)},defaultTextHeight:function(){return Zi(this.display)},defaultCharWidth:function(){return qi(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(l,y,G,ee,ae){var oe=this.display;l=xi(this,O(this.doc,l));var me=l.bottom,We=l.left;if(y.style.position="absolute",y.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(y),oe.sizer.appendChild(y),ee=="over")me=l.top;else if(ee=="above"||ee=="near"){var Ye=Math.max(oe.wrapper.clientHeight,this.doc.height),vt=Math.max(oe.sizer.clientWidth,oe.lineSpace.clientWidth);(ee=="above"||l.bottom+y.offsetHeight>Ye)&&l.top>y.offsetHeight?me=l.top-y.offsetHeight:l.bottom+y.offsetHeight<=Ye&&(me=l.bottom),We+y.offsetWidth>vt&&(We=vt-y.offsetWidth)}y.style.top=me+"px",y.style.left=y.style.right="",ae=="right"?(We=oe.sizer.clientWidth-y.offsetWidth,y.style.right="0px"):(ae=="left"?We=0:ae=="middle"&&(We=(oe.sizer.clientWidth-y.offsetWidth)/2),y.style.left=We+"px"),G&&wl(this,{left:We,top:me,right:We+y.offsetWidth,bottom:me+y.offsetHeight})},triggerOnKeyDown:si(hl),triggerOnKeyPress:si(pl),triggerOnKeyUp:fl,triggerOnMouseDown:si(oo),execCommand:function(l){if(Ea.hasOwnProperty(l))return Ea[l].call(null,this)},triggerElectric:si(function(l){Te(this,l)}),findPosH:function(l,y,G,ee){var ae=1;y<0&&(ae=-1,y=-y);for(var oe=O(this.doc,l),me=0;me<y&&!(oe=$e(this.doc,oe,ae,G,ee),oe.hitSide);++me);return oe},moveH:si(function(l,y){var G=this;this.extendSelectionsBy(function(ee){return G.display.shift||G.doc.extend||ee.empty()?$e(G.doc,ee.head,l,y,G.options.rtlMoveVisually):l<0?ee.from():ee.to()},we)}),deleteH:si(function(l,y){var G=this.doc.sel,ee=this.doc;G.somethingSelected()?ee.replaceSelection("",null,"+delete"):ba(this,function(ae){var oe=$e(ee,ae.head,l,y,!1);return l<0?{from:oe,to:ae.head}:{from:ae.head,to:oe}})}),findPosV:function(l,y,G,ee){var ae=1,oe=ee;y<0&&(ae=-1,y=-y);for(var me=O(this.doc,l),We=0;We<y;++We){var Ye=xi(this,me,"div");if(oe==null?oe=Ye.left:Ye.left=oe,me=Xe(this,Ye,ae,G),me.hitSide)break}return me},moveV:si(function(l,y){var G=this,ee=this.doc,ae=[],oe=!this.display.shift&&!ee.extend&&ee.sel.somethingSelected();if(ee.extendSelectionsBy(function(We){if(oe)return l<0?We.from():We.to();var Ye=xi(G,We.head,"div");We.goalColumn!=null&&(Ye.left=We.goalColumn),ae.push(Ye.left);var vt=Xe(G,Ye,l,y);return y=="page"&&We==ee.sel.primary()&&es(G,Ts(G,vt,"div").top-Ye.top),vt},we),ae.length)for(var me=0;me<ee.sel.ranges.length;me++)ee.sel.ranges[me].goalColumn=ae[me]}),findWordAt:function(l){var y=this.doc,G=mt(y,l.line).text,ee=l.ch,ae=l.ch;if(G){var oe=this.getHelper(l,"wordChars");(l.sticky=="before"||ae==G.length)&&ee?--ee:++ae;for(var me=G.charAt(ee),We=_t(me,oe)?function(Ye){return _t(Ye,oe)}:/\s/.test(me)?function(Ye){return/\s/.test(Ye)}:function(Ye){return!/\s/.test(Ye)&&!_t(Ye)};ee>0&&We(G.charAt(ee-1));)--ee;for(;ae<G.length&&We(G.charAt(ae));)++ae}return new Nr(Ie(l.line,ee),Ie(l.line,ae))},toggleOverwrite:function(l){if(l!=null&&l==this.state.overwrite)return;(this.state.overwrite=!this.state.overwrite)?j(this.display.cursorDiv,"CodeMirror-overwrite"):x(this.display.cursorDiv,"CodeMirror-overwrite"),ct(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==W()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:si(function(l,y){ia(this,l,y)}),getScrollInfo:function(){var l=this.display.scroller;return{left:l.scrollLeft,top:l.scrollTop,height:l.scrollHeight-Zr(this)-this.display.barHeight,width:l.scrollWidth-Zr(this)-this.display.barWidth,clientHeight:yi(this),clientWidth:ei(this)}},scrollIntoView:si(function(l,y){l==null?(l={from:this.doc.sel.primary().head,to:null},y==null&&(y=this.options.cursorScrollMargin)):typeof l=="number"?l={from:Ie(l,0),to:null}:l.from==null&&(l={from:l,to:null}),l.to||(l.to=l.from),l.margin=y||0,l.from.line!=null?wo(this,l):Co(this,l.from,l.to,l.margin)}),setSize:si(function(l,y){var G=this,ee=function(oe){return typeof oe=="number"||/^\d+$/.test(String(oe))?oe+"px":oe};l!=null&&(this.display.wrapper.style.width=ee(l)),y!=null&&(this.display.wrapper.style.height=ee(y)),this.options.lineWrapping&&xs(this);var ae=this.display.viewFrom;this.doc.iter(ae,this.display.viewTo,function(oe){if(oe.widgets){for(var me=0;me<oe.widgets.length;me++)if(oe.widgets[me].noHScroll){Mi(G,ae,"widget");break}}++ae}),this.curOp.forceUpdate=!0,ct(this,"refresh",this)}),operation:function(l){return di(this,l)},startOperation:function(){return Vi(this)},endOperation:function(){return Xi(this)},refresh:si(function(){var l=this.display.cachedTextHeight;li(this),this.curOp.forceUpdate=!0,Ca(this),ia(this,this.doc.scrollLeft,this.doc.scrollTop),Aa(this.display),(l==null||Math.abs(l-Zi(this.display))>.5||this.options.lineWrapping)&&Ps(this),ct(this,"refresh",this)}),swapDoc:si(function(l){var y=this.doc;return y.cm=null,this.state.selectingText&&this.state.selectingText(),Gs(this,l),Ca(this),this.display.input.reset(),ia(this,l.scrollLeft,l.scrollTop),this.curOp.forceScroll=!0,Yt(this,"swapDoc",this,y),y}),phrase:function(l){var y=this.options.phrases;return y&&Object.prototype.hasOwnProperty.call(y,l)?y[l]:l},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},Ue(e),e.registerHelper=function(l,y,G){d.hasOwnProperty(l)||(d[l]=e[l]={_global:[]}),d[l][y]=G},e.registerGlobalHelper=function(l,y,G,ee){e.registerHelper(l,y,ee),d[l]._global.push({pred:G,val:ee})}}function $e(e,n,d,l,y){var G=n,ee=d,ae=mt(e,n.line),oe=y&&e.direction=="rtl"?-d:d;function me(){var sr=n.line+oe;return sr<e.first||sr>=e.first+e.size?!1:(n=new Ie(sr,n.ch,n.sticky),ae=mt(e,sr))}function We(sr){var Wn;if(l=="codepoint"){var dr=ae.text.charCodeAt(n.ch+(l>0?0:-1));isNaN(dr)?Wn=null:Wn=new Ie(n.line,Math.max(0,Math.min(ae.text.length,n.ch+d*(dr>=55296&&dr<56320?2:1))),-d)}else y?Wn=no(e.cm,ae,n,d):Wn=eo(ae,n,d);if(Wn==null)if(!sr&&me())n=to(y,e.cm,ae,n.line,oe);else return!1;else n=Wn;return!0}if(l=="char"||l=="codepoint")We();else if(l=="column")We(!0);else if(l=="word"||l=="group")for(var Ye=null,vt=l=="group",ht=e.cm&&e.cm.getHelper(n,"wordChars"),Bt=!0;!(d<0&&!We(!Bt));Bt=!1){var Zt=ae.text.charAt(n.ch)||`
`,mn=_t(Zt,ht)?"w":vt&&Zt==`
`?"n":!vt||/\s/.test(Zt)?null:"p";if(vt&&!Bt&&!mn&&(mn="s"),Ye&&Ye!=mn){d<0&&(d=1,We(),n.sticky="after");break}if(mn&&(Ye=mn),d>0&&!We(!Bt))break}var jn=cs(e,n,G,ee,!0);return Ce(G,jn)&&(jn.hitSide=!0),jn}function Xe(e,n,d,l){var y=e.doc,G=n.left,ee;if(l=="page"){var ae=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),oe=Math.max(ae-.5*Zi(e.display),3);ee=(d>0?n.bottom:n.top)+d*oe}else l=="line"&&(ee=d>0?n.bottom+3:n.top-3);for(var me;!(me=Rs(e,G,ee),!me.outside);){if(d<0?ee<=0:ee>=y.height){me.hitSide=!0;break}ee+=d*5}return me}var tt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new Y,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};tt.prototype.init=function(e){var n=this,d=this,l=d.cm,y=d.div=e.lineDiv;ze(y,l.options.spellcheck,l.options.autocorrect,l.options.autocapitalize);function G(ae){for(var oe=ae.target;oe;oe=oe.parentNode){if(oe==y)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(oe.className))break}return!1}Ze(y,"paste",function(ae){if(!G(ae)||ft(l,ae)||de(ae,l))return;z<=11&&setTimeout(Gr(l,function(){return n.updateFromDOM()}),20)}),Ze(y,"compositionstart",function(ae){n.composing={data:ae.data,done:!1}}),Ze(y,"compositionupdate",function(ae){n.composing||(n.composing={data:ae.data,done:!1})}),Ze(y,"compositionend",function(ae){n.composing&&(ae.data!=n.composing.data&&n.readFromDOMSoon(),n.composing.done=!0)}),Ze(y,"touchstart",function(){return d.forceCompositionEnd()}),Ze(y,"input",function(){n.composing||n.readFromDOMSoon()});function ee(ae){if(!G(ae)||ft(l,ae))return;if(l.somethingSelected())re({lineWise:!1,text:l.getSelections()}),ae.type=="cut"&&l.replaceSelection("",null,"cut");else if(l.options.lineWiseCopyCut){var oe=Se(l);re({lineWise:!0,text:oe.text}),ae.type=="cut"&&l.operation(function(){l.setSelections(oe.ranges,0,xe),l.replaceSelection("",null,"cut")})}else return;if(ae.clipboardData){ae.clipboardData.clearData();var me=V.text.join(`
`);if(ae.clipboardData.setData("Text",me),ae.clipboardData.getData("Text")==me){ae.preventDefault();return}}var We=it(),Ye=We.firstChild;l.display.lineSpace.insertBefore(We,l.display.lineSpace.firstChild),Ye.value=V.text.join(`
`);var vt=document.activeElement;F(Ye),setTimeout(function(){l.display.lineSpace.removeChild(We),vt.focus(),vt==y&&d.showPrimarySelection()},50)}Ze(y,"copy",ee),Ze(y,"cut",ee)},tt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},tt.prototype.prepareSelection=function(){var e=Is(this.cm,!1);return e.focus=document.activeElement==this.div,e},tt.prototype.showSelection=function(e,n){if(!e||!this.cm.display.view.length)return;(e.focus||n)&&this.showPrimarySelection(),this.showMultipleSelections(e)},tt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},tt.prototype.showPrimarySelection=function(){var e=this.getSelection(),n=this.cm,d=n.doc.sel.primary(),l=d.from(),y=d.to();if(n.display.viewTo==n.display.viewFrom||l.line>=n.display.viewTo||y.line<n.display.viewFrom){e.removeAllRanges();return}var G=cr(n,e.anchorNode,e.anchorOffset),ee=cr(n,e.focusNode,e.focusOffset);if(G&&!G.bad&&ee&&!ee.bad&&gt(mr(G,ee),l)==0&&gt(hr(G,ee),y)==0)return;var ae=n.display.view,oe=l.line>=n.display.viewFrom&&Dt(n,l)||{node:ae[0].measure.map[2],offset:0},me=y.line<n.display.viewTo&&Dt(n,y);if(!me){var We=ae[ae.length-1].measure,Ye=We.maps?We.maps[We.maps.length-1]:We.map;me={node:Ye[Ye.length-1],offset:Ye[Ye.length-2]-Ye[Ye.length-3]}}if(!oe||!me){e.removeAllRanges();return}var vt=e.rangeCount&&e.getRangeAt(0),ht;try{ht=E(oe.node,oe.offset,me.offset,me.node)}catch(Bt){}ht&&(!B&&n.state.focused?(e.collapse(oe.node,oe.offset),ht.collapsed||(e.removeAllRanges(),e.addRange(ht))):(e.removeAllRanges(),e.addRange(ht)),vt&&e.anchorNode==null?e.addRange(vt):B&&this.startGracePeriod()),this.rememberSelection()},tt.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)},tt.prototype.showMultipleSelections=function(e){h(this.cm.display.cursorDiv,e.cursors),h(this.cm.display.selectionDiv,e.selection)},tt.prototype.rememberSelection=function(){var e=this.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},tt.prototype.selectionInEditor=function(){var e=this.getSelection();if(!e.rangeCount)return!1;var n=e.getRangeAt(0).commonAncestorContainer;return _(this.div,n)},tt.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},tt.prototype.blur=function(){this.div.blur()},tt.prototype.getField=function(){return this.div},tt.prototype.supportsTouch=function(){return!0},tt.prototype.receivedFocus=function(){var e=this;this.selectionInEditor()?this.pollSelection():di(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)},tt.prototype.selectionChanged=function(){var e=this.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},tt.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())return;var e=this.getSelection(),n=this.cm;if(i&&m&&this.cm.display.gutterSpecs.length&&An(e.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(this.composing)return;this.rememberSelection();var d=cr(n,e.anchorNode,e.anchorOffset),l=cr(n,e.focusNode,e.focusOffset);d&&l&&di(n,function(){ni(n.doc,Fi(d,l),xe),(d.bad||l.bad)&&(n.curOp.selectionChanged=!0)})},tt.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var e=this.cm,n=e.display,d=e.doc.sel.primary(),l=d.from(),y=d.to();if(l.ch==0&&l.line>e.firstLine()&&(l=Ie(l.line-1,mt(e.doc,l.line-1).length)),y.ch==mt(e.doc,y.line).text.length&&y.line<e.lastLine()&&(y=Ie(y.line+1,0)),l.line<n.viewFrom||y.line>n.viewTo-1)return!1;var G,ee,ae;l.line==n.viewFrom||(G=zi(e,l.line))==0?(ee=ye(n.view[0].line),ae=n.view[0].node):(ee=ye(n.view[G].line),ae=n.view[G-1].node.nextSibling);var oe=zi(e,y.line),me,We;if(oe==n.view.length-1?(me=n.viewTo-1,We=n.lineDiv.lastChild):(me=ye(n.view[oe+1].line)-1,We=n.view[oe+1].node.previousSibling),!ae)return!1;for(var Ye=e.doc.splitLines(ar(e,ae,We,ee,me)),vt=Ke(e.doc,Ie(ee,0),Ie(me,mt(e.doc,me).text.length));Ye.length>1&&vt.length>1;)if(ne(Ye)==ne(vt))Ye.pop(),vt.pop(),me--;else if(Ye[0]==vt[0])Ye.shift(),vt.shift(),ee++;else break;for(var ht=0,Bt=0,Zt=Ye[0],mn=vt[0],jn=Math.min(Zt.length,mn.length);ht<jn&&Zt.charCodeAt(ht)==mn.charCodeAt(ht);)++ht;for(var sr=ne(Ye),Wn=ne(vt),dr=Math.min(sr.length-(Ye.length==1?ht:0),Wn.length-(vt.length==1?ht:0));Bt<dr&&sr.charCodeAt(sr.length-Bt-1)==Wn.charCodeAt(Wn.length-Bt-1);)++Bt;if(Ye.length==1&&vt.length==1&&ee==l.line)for(;ht&&ht>l.ch&&sr.charCodeAt(sr.length-Bt-1)==Wn.charCodeAt(Wn.length-Bt-1);)ht--,Bt++;Ye[Ye.length-1]=sr.slice(0,sr.length-Bt).replace(/^\u200b+/,""),Ye[0]=Ye[0].slice(ht).replace(/\u200b+$/,"");var Or=Ie(ee,ht),Tr=Ie(me,vt.length?ne(vt).length-Bt:0);if(Ye.length>1||Ye[0]||gt(Or,Tr))return ga(e.doc,Ye,Or,Tr,"+input"),!0},tt.prototype.ensurePolled=function(){this.forceCompositionEnd()},tt.prototype.reset=function(){this.forceCompositionEnd()},tt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},tt.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)},tt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&di(this.cm,function(){return li(e.cm)})},tt.prototype.setUneditable=function(e){e.contentEditable="false"},tt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||Gr(this.cm,ce)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},tt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},tt.prototype.onContextMenu=function(){},tt.prototype.resetPosition=function(){},tt.prototype.needsContentAttribute=!0;function Dt(e,n){var d=Ki(e,n.line);if(!d||d.hidden)return null;var l=mt(e.doc,n.line),y=Va(d,l,n.line),G=sn(l,e.doc.direction),ee="left";if(G){var ae=Qt(G,n.ch);ee=ae%2?"right":"left"}var oe=ys(y.map,n.ch,ee);return oe.offset=oe.collapse=="right"?oe.end:oe.start,oe}function An(e){for(var n=e;n;n=n.parentNode)if(/CodeMirror-gutter-wrapper/.test(n.className))return!0;return!1}function Fn(e,n){return n&&(e.bad=!0),e}function ar(e,n,d,l,y){var G="",ee=!1,ae=e.doc.lineSeparator(),oe=!1;function me(ht){return function(Bt){return Bt.id==ht}}function We(){ee&&(G+=ae,oe&&(G+=ae),ee=oe=!1)}function Ye(ht){ht&&(We(),G+=ht)}function vt(ht){if(ht.nodeType==1){var Bt=ht.getAttribute("cm-text");if(Bt){Ye(Bt);return}var Zt=ht.getAttribute("cm-marker"),mn;if(Zt){var jn=e.findMarks(Ie(l,0),Ie(y+1,0),me(+Zt));jn.length&&(mn=jn[0].find(0))&&Ye(Ke(e.doc,mn.from,mn.to).join(ae));return}if(ht.getAttribute("contenteditable")=="false")return;var sr=/^(pre|div|p|li|table|br)$/i.test(ht.nodeName);if(!/^br$/i.test(ht.nodeName)&&ht.textContent.length==0)return;sr&&We();for(var Wn=0;Wn<ht.childNodes.length;Wn++)vt(ht.childNodes[Wn]);/^(pre|p)$/i.test(ht.nodeName)&&(oe=!0),sr&&(ee=!0)}else ht.nodeType==3&&Ye(ht.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;!(vt(n),n==d);)n=n.nextSibling,oe=!1;return G}function cr(e,n,d){var l;if(n==e.display.lineDiv){if(l=e.display.lineDiv.childNodes[d],!l)return Fn(e.clipPos(Ie(e.display.viewTo-1)),!0);n=null,d=0}else for(l=n;;l=l.parentNode){if(!l||l==e.display.lineDiv)return null;if(l.parentNode&&l.parentNode==e.display.lineDiv)break}for(var y=0;y<e.display.view.length;y++){var G=e.display.view[y];if(G.node==l)return Sr(G,n,d)}}function Sr(e,n,d){var l=e.text.firstChild,y=!1;if(!n||!_(l,n))return Fn(Ie(ye(e.line),0),!0);if(n==l&&(y=!0,n=l.childNodes[d],d=0,!n)){var G=e.rest?ne(e.rest):e.line;return Fn(Ie(ye(G),G.text.length),y)}var ee=n.nodeType==3?n:null,ae=n;for(!ee&&n.childNodes.length==1&&n.firstChild.nodeType==3&&(ee=n.firstChild,d&&(d=ee.nodeValue.length));ae.parentNode!=l;)ae=ae.parentNode;var oe=e.measure,me=oe.maps;function We(mn,jn,sr){for(var Wn=-1;Wn<(me?me.length:0);Wn++)for(var dr=Wn<0?oe.map:me[Wn],Or=0;Or<dr.length;Or+=3){var Tr=dr[Or+2];if(Tr==mn||Tr==jn){var Dr=ye(Wn<0?e.line:e.rest[Wn]),Wr=dr[Or]+sr;return(sr<0||Tr!=mn)&&(Wr=dr[Or+(sr?1:0)]),Ie(Dr,Wr)}}}var Ye=We(ee,ae,d);if(Ye)return Fn(Ye,y);for(var vt=ae.nextSibling,ht=ee?ee.nodeValue.length-d:0;vt;vt=vt.nextSibling){if(Ye=We(vt,vt.firstChild,0),Ye)return Fn(Ie(Ye.line,Ye.ch-ht),y);ht+=vt.textContent.length}for(var Bt=ae.previousSibling,Zt=d;Bt;Bt=Bt.previousSibling){if(Ye=We(Bt,Bt.firstChild,-1),Ye)return Fn(Ie(Ye.line,Ye.ch+Zt),y);Zt+=Bt.textContent.length}}var ur=function(e){this.cm=e,this.prevInput="",this.pollingFast=!1,this.polling=new Y,this.hasSelection=!1,this.composing=null};ur.prototype.init=function(e){var n=this,d=this,l=this.cm;this.createField(e);var y=this.textarea;e.wrapper.insertBefore(this.wrapper,e.wrapper.firstChild),s&&(y.style.width="0px"),Ze(y,"input",function(){$&&z>=9&&n.hasSelection&&(n.hasSelection=null),d.poll()}),Ze(y,"paste",function(ee){if(ft(l,ee)||de(ee,l))return;l.state.pasteIncoming=+new Date,d.fastPoll()});function G(ee){if(ft(l,ee))return;if(l.somethingSelected())re({lineWise:!1,text:l.getSelections()});else if(l.options.lineWiseCopyCut){var ae=Se(l);re({lineWise:!0,text:ae.text}),ee.type=="cut"?l.setSelections(ae.ranges,null,xe):(d.prevInput="",y.value=ae.text.join(`
`),F(y))}else return;ee.type=="cut"&&(l.state.cutIncoming=+new Date)}Ze(y,"cut",G),Ze(y,"copy",G),Ze(e.scroller,"paste",function(ee){if(kr(e,ee)||ft(l,ee))return;if(!y.dispatchEvent){l.state.pasteIncoming=+new Date,d.focus();return}var ae=new Event("paste");ae.clipboardData=ee.clipboardData,y.dispatchEvent(ae)}),Ze(e.lineSpace,"selectstart",function(ee){kr(e,ee)||ge(ee)}),Ze(y,"compositionstart",function(){var ee=l.getCursor("from");d.composing&&d.composing.range.clear(),d.composing={start:ee,range:l.markText(ee,l.getCursor("to"),{className:"CodeMirror-composing"})}}),Ze(y,"compositionend",function(){d.composing&&(d.poll(),d.composing.range.clear(),d.composing=null)})},ur.prototype.createField=function(e){this.wrapper=it(),this.textarea=this.wrapper.firstChild},ur.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},ur.prototype.prepareSelection=function(){var e=this.cm,n=e.display,d=e.doc,l=Is(e);if(e.options.moveInputWithCursor){var y=xi(e,d.sel.primary().head,"div"),G=n.wrapper.getBoundingClientRect(),ee=n.lineDiv.getBoundingClientRect();l.teTop=Math.max(0,Math.min(n.wrapper.clientHeight-10,y.top+ee.top-G.top)),l.teLeft=Math.max(0,Math.min(n.wrapper.clientWidth-10,y.left+ee.left-G.left))}return l},ur.prototype.showSelection=function(e){var n=this.cm,d=n.display;h(d.cursorDiv,e.cursors),h(d.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},ur.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var n=this.cm;if(n.somethingSelected()){this.prevInput="";var d=n.getSelection();this.textarea.value=d,n.state.focused&&F(this.textarea),$&&z>=9&&(this.hasSelection=d)}else e||(this.prevInput=this.textarea.value="",$&&z>=9&&(this.hasSelection=null))},ur.prototype.getField=function(){return this.textarea},ur.prototype.supportsTouch=function(){return!1},ur.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!t||W()!=this.textarea))try{this.textarea.focus()}catch(e){}},ur.prototype.blur=function(){this.textarea.blur()},ur.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ur.prototype.receivedFocus=function(){this.slowPoll()},ur.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()})},ur.prototype.fastPoll=function(){var e=!1,n=this;n.pollingFast=!0;function d(){var l=n.poll();!l&&!e?(e=!0,n.polling.set(60,d)):(n.pollingFast=!1,n.slowPoll())}n.polling.set(20,d)},ur.prototype.poll=function(){var e=this,n=this.cm,d=this.textarea,l=this.prevInput;if(this.contextMenuPending||!n.state.focused||ln(d)&&!l&&!this.composing||n.isReadOnly()||n.options.disableInput||n.state.keySeq)return!1;var y=d.value;if(y==l&&!n.somethingSelected())return!1;if($&&z>=9&&this.hasSelection===y||u&&/[\uf700-\uf7ff]/.test(y))return n.display.input.reset(),!1;if(n.doc.sel==n.display.selForContextMenu){var G=y.charCodeAt(0);if(G==8203&&!l&&(l="\u200B"),G==8666)return this.reset(),this.cm.execCommand("undo")}for(var ee=0,ae=Math.min(l.length,y.length);ee<ae&&l.charCodeAt(ee)==y.charCodeAt(ee);)++ee;return di(n,function(){ce(n,y.slice(ee),l.length-ee,null,e.composing?"*compose":null),y.length>1e3||y.indexOf(`
`)>-1?d.value=e.prevInput="":e.prevInput=y,e.composing&&(e.composing.range.clear(),e.composing.range=n.markText(e.composing.start,n.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ur.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ur.prototype.onKeyPress=function(){$&&z>=9&&(this.hasSelection=null),this.fastPoll()},ur.prototype.onContextMenu=function(e){var n=this,d=n.cm,l=d.display,y=n.textarea;n.contextMenuPending&&n.contextMenuPending();var G=Gi(d,e),ee=l.scroller.scrollTop;if(!G||g)return;var ae=d.options.resetSelectionOnContextMenu;ae&&d.doc.sel.contains(G)==-1&&Gr(d,ni)(d.doc,Fi(G),xe);var oe=y.style.cssText,me=n.wrapper.style.cssText,We=n.wrapper.offsetParent.getBoundingClientRect();n.wrapper.style.cssText="position: static",y.style.cssText=`position: absolute; width: 30px; height: 30px;
top: `+(e.clientY-We.top-5)+"px; left: "+(e.clientX-We.left-5)+`px;
z-index: 1000; background: `+($?"rgba(255, 255, 255, .05)":"transparent")+`;
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var Ye;r&&(Ye=window.scrollY),l.input.focus(),r&&window.scrollTo(null,Ye),l.input.reset(),d.somethingSelected()||(y.value=n.prevInput=" "),n.contextMenuPending=ht,l.selForContextMenu=d.doc.sel,clearTimeout(l.detectingSelectAll);function vt(){if(y.selectionStart!=null){var Zt=d.somethingSelected(),mn="\u200B"+(Zt?y.value:"");y.value="\u21DA",y.value=mn,n.prevInput=Zt?"":"\u200B",y.selectionStart=1,y.selectionEnd=mn.length,l.selForContextMenu=d.doc.sel}}function ht(){if(n.contextMenuPending!=ht)return;if(n.contextMenuPending=!1,n.wrapper.style.cssText=me,y.style.cssText=oe,$&&z<9&&l.scrollbars.setScrollTop(l.scroller.scrollTop=ee),y.selectionStart!=null){(!$||$&&z<9)&&vt();var Zt=0,mn=function(){l.selForContextMenu==d.doc.sel&&y.selectionStart==0&&y.selectionEnd>0&&n.prevInput=="\u200B"?Gr(d,Qo)(d):Zt++<10?l.detectingSelectAll=setTimeout(mn,500):(l.selForContextMenu=null,l.input.reset())};l.detectingSelectAll=setTimeout(mn,200)}}if($&&z>=9&&vt(),A){ue(e);var Bt=function(){At(window,"mouseup",Bt),setTimeout(ht,20)};Ze(window,"mouseup",Bt)}else setTimeout(ht,50)},ur.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},ur.prototype.setUneditable=function(){},ur.prototype.needsContentAttribute=!1;function Mr(e,n){if(n=n?v(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 d=W();n.autofocus=d==e||e.getAttribute("autofocus")!=null&&d==document.body}function l(){e.value=ae.getValue()}var y;if(e.form&&(Ze(e.form,"submit",l),!n.leaveSubmitMethodAlone)){var G=e.form;y=G.submit;try{var ee=G.submit=function(){l(),G.submit=y,G.submit(),G.submit=ee}}catch(oe){}}n.finishInit=function(oe){oe.save=l,oe.getTextArea=function(){return e},oe.toTextArea=function(){oe.toTextArea=isNaN,l(),e.parentNode.removeChild(oe.getWrapperElement()),e.style.display="",e.form&&(At(e.form,"submit",l),!n.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=y))}},e.style.display="none";var ae=Hr(function(oe){return e.parentNode.insertBefore(oe,e.nextSibling)},n);return ae}function Lr(e){e.off=At,e.on=Ze,e.wheelEventPixels=rs,e.Doc=ui,e.splitLines=vn,e.countColumn=H,e.findColumn=Ae,e.isWordChar=ot,e.Pass=he,e.signal=ct,e.Line=bn,e.changeEnd=Yi,e.scrollbarModel=Ro,e.Pos=Ie,e.cmpPos=gt,e.modes=vr,e.mimeModes=ir,e.resolveMode=Jt,e.getMode=Ar,e.modeExtensions=Nn,e.extendMode=Tn,e.copyState=pr,e.startState=Pr,e.innerMode=_r,e.commands=Ea,e.keyMap=Li,e.keyName=fs,e.isModifierKey=Fa,e.lookupKey=Ii,e.normalizeKeyMap=ll,e.StringStream=yr,e.SharedTextMarker=ya,e.TextMarker=bi,e.LineWidget=Ma,e.e_preventDefault=ge,e.e_stopPropagation=Ee,e.e_stop=ue,e.addClass=j,e.contains=_,e.rmClass=x,e.keyNames=Wi}ql(Hr),ut(Hr);var Br="iter insert remove copy getEditor constructor".split(" ");for(var $r in ui.prototype)ui.prototype.hasOwnProperty($r)&&ie(Br,$r)<0&&(Hr.prototype[$r]=function(e){return function(){return e.apply(this.doc,arguments)}}(ui.prototype[$r]));return Ue(ui),Hr.inputStyles={textarea:ur,contenteditable:tt},Hr.defineMode=function(e){!Hr.defaults.mode&&e!="null"&&(Hr.defaults.mode=e),br.apply(this,arguments)},Hr.defineMIME=Rr,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){ui.prototype[e]=n},Hr.fromTextArea=Mr,Lr(Hr),Hr.version="5.58.2",Hr})},WaYH:function(It,Oe,U){"use strict";var te=U("rePB"),Q=U("Ff2n"),B=U("VTBJ"),J=U("1OyB"),K=U("vuIU"),N=U("JX7q"),$=U("Ji7U"),z=U("LK+K"),r=U("q1tI"),D=U("TSYQ"),m=U.n(D),g=U("sboe"),p=U("OZM5"),a=function(A){var I=A.prefixCls,x=A.level,b=A.isStart,h=A.isEnd;if(!x)return null;for(var f="".concat(I,"-indent-unit"),C=[],E=0;E<x;E+=1){var _;C.push(r.createElement("span",{key:E,className:m()(f,(_={},Object(te.a)(_,"".concat(f,"-start"),b[E+1]),Object(te.a)(_,"".concat(f,"-end"),h[E+1]),Object(te.a)(_,"".concat(f,"-end-first-level"),!E&&h[0]),_))}))}return r.createElement("span",{"aria-hidden":"true",className:"".concat(I,"-indent")},C)},c=a,s=U("815F"),i="open",t="close",u="---",o=function(S){Object($.a)(I,S);var A=Object(z.a)(I);function I(){var x;return Object(J.a)(this,I),x=A.apply(this,arguments),x.state={dragNodeHighlight:!1},x.onSelectorClick=function(b){var h=x.props.context.onNodeClick;h(b,Object(s.b)(x.props)),x.isSelectable()?x.onSelect(b):x.onCheck(b)},x.onSelectorDoubleClick=function(b){var h=x.props.context.onNodeDoubleClick;h(b,Object(s.b)(x.props))},x.onSelect=function(b){if(x.isDisabled())return;var h=x.props.context.onNodeSelect;b.preventDefault(),h(b,Object(s.b)(x.props))},x.onCheck=function(b){if(x.isDisabled())return;var h=x.props,f=h.disableCheckbox,C=h.checked,E=x.props.context.onNodeCheck;if(!x.isCheckable()||f)return;b.preventDefault();var _=!C;E(b,Object(s.b)(x.props),_)},x.onMouseEnter=function(b){var h=x.props.context.onNodeMouseEnter;h(b,Object(s.b)(x.props))},x.onMouseLeave=function(b){var h=x.props.context.onNodeMouseLeave;h(b,Object(s.b)(x.props))},x.onContextMenu=function(b){var h=x.props.context.onNodeContextMenu;h(b,Object(s.b)(x.props))},x.onDragStart=function(b){var h=x.props.context.onNodeDragStart;b.stopPropagation(),x.setState({dragNodeHighlight:!0}),h(b,Object(N.a)(x));try{b.dataTransfer.setData("text/plain","")}catch(f){}},x.onDragEnter=function(b){var h=x.props.context.onNodeDragEnter;b.preventDefault(),b.stopPropagation(),h(b,Object(N.a)(x))},x.onDragOver=function(b){var h=x.props.context.onNodeDragOver;b.preventDefault(),b.stopPropagation(),h(b,Object(N.a)(x))},x.onDragLeave=function(b){var h=x.props.context.onNodeDragLeave;b.stopPropagation(),h(b,Object(N.a)(x))},x.onDragEnd=function(b){var h=x.props.context.onNodeDragEnd;b.stopPropagation(),x.setState({dragNodeHighlight:!1}),h(b,Object(N.a)(x))},x.onDrop=function(b){var h=x.props.context.onNodeDrop;b.preventDefault(),b.stopPropagation(),x.setState({dragNodeHighlight:!1}),h(b,Object(N.a)(x))},x.onExpand=function(b){var h=x.props.context.onNodeExpand;h(b,Object(s.b)(x.props))},x.setSelectHandle=function(b){x.selectHandle=b},x.getNodeState=function(){var b=x.props.expanded;return x.isLeaf()?null:b?i:t},x.hasChildren=function(){var b=x.props.eventKey,h=x.props.context.keyEntities,f=h[b]||{},C=f.children;return!!(C||[]).length},x.isLeaf=function(){var b=x.props,h=b.isLeaf,f=b.loaded,C=x.props.context.loadData,E=x.hasChildren();return h===!1?!1:h||!C&&!E||C&&f&&!E},x.isDisabled=function(){var b=x.props.disabled,h=x.props.context.disabled;return!!(h||b)},x.isCheckable=function(){var b=x.props.checkable,h=x.props.context.checkable;return!h||b===!1?!1:h},x.syncLoadData=function(b){var h=b.expanded,f=b.loading,C=b.loaded,E=x.props.context,_=E.loadData,W=E.onNodeLoad;if(f)return;_&&h&&!x.isLeaf()&&(!x.hasChildren()&&!C&&W(Object(s.b)(x.props)))},x.renderSwitcher=function(){var b=x.props,h=b.expanded,f=b.switcherIcon,C=x.props.context,E=C.prefixCls,_=C.switcherIcon,W=f||_;if(x.isLeaf())return r.createElement("span",{className:m()("".concat(E,"-switcher"),"".concat(E,"-switcher-noop"))},typeof W=="function"?W(Object(B.a)(Object(B.a)({},x.props),{},{isLeaf:!0})):W);var j=m()("".concat(E,"-switcher"),"".concat(E,"-switcher_").concat(h?i:t));return r.createElement("span",{onClick:x.onExpand,className:j},typeof W=="function"?W(Object(B.a)(Object(B.a)({},x.props),{},{isLeaf:!1})):W)},x.renderCheckbox=function(){var b=x.props,h=b.checked,f=b.halfChecked,C=b.disableCheckbox,E=x.props.context.prefixCls,_=x.isDisabled(),W=x.isCheckable();if(!W)return null;var j=typeof W!="boolean"?W:null;return r.createElement("span",{className:m()("".concat(E,"-checkbox"),h&&"".concat(E,"-checkbox-checked"),!h&&f&&"".concat(E,"-checkbox-indeterminate"),(_||C)&&"".concat(E,"-checkbox-disabled")),onClick:x.onCheck},j)},x.renderIcon=function(){var b=x.props.loading,h=x.props.context.prefixCls;return r.createElement("span",{className:m()("".concat(h,"-iconEle"),"".concat(h,"-icon__").concat(x.getNodeState()||"docu"),b&&"".concat(h,"-icon_loading"))})},x.renderSelector=function(){var b=x.state.dragNodeHighlight,h=x.props,f=h.title,C=h.selected,E=h.icon,_=h.loading,W=h.data,j=x.props.context,w=j.prefixCls,F=j.showIcon,P=j.icon,v=j.draggable,H=j.loadData,Y=j.titleRender,ie=x.isDisabled(),le="".concat(w,"-node-content-wrapper"),he;if(F){var xe=E||P;he=xe?r.createElement("span",{className:m()("".concat(w,"-iconEle"),"".concat(w,"-icon__customize"))},typeof xe=="function"?xe(x.props):xe):x.renderIcon()}else H&&_&&(he=x.renderIcon());var Le;typeof f=="function"?Le=f(W):Y?Le=Y(W):Le=f;var we=r.createElement("span",{className:"".concat(w,"-title")},Le);return r.createElement("span",{ref:x.setSelectHandle,title:typeof f=="string"?f:"",className:m()("".concat(le),"".concat(le,"-").concat(x.getNodeState()||"normal"),!ie&&(C||b)&&"".concat(w,"-node-selected"),!ie&&v&&"draggable"),draggable:!ie&&v||void 0,"aria-grabbed":!ie&&v||void 0,onMouseEnter:x.onMouseEnter,onMouseLeave:x.onMouseLeave,onContextMenu:x.onContextMenu,onClick:x.onSelectorClick,onDoubleClick:x.onSelectorDoubleClick,onDragStart:v?x.onDragStart:void 0},he,we)},x}return Object(K.a)(I,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var b=this.props.selectable,h=this.props.context.selectable;return typeof b=="boolean"?b:h}},{key:"render",value:function(){var b,h=this.props,f=h.eventKey,C=h.className,E=h.style,_=h.dragOver,W=h.dragOverGapTop,j=h.dragOverGapBottom,w=h.isLeaf,F=h.isStart,P=h.isEnd,v=h.expanded,H=h.selected,Y=h.checked,ie=h.halfChecked,le=h.loading,he=h.domRef,xe=h.active,Le=h.onMouseMove,we=Object(Q.a)(h,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),Ae=this.props.context,pe=Ae.prefixCls,be=Ae.filterTreeNode,ne=Ae.draggable,fe=Ae.keyEntities,_e=this.isDisabled(),ke=Object(p.f)(we),et=fe[f]||{},je=et.level,ot=P[P.length-1];return r.createElement("div",Object.assign({ref:he,className:m()(C,"".concat(pe,"-treenode"),(b={},Object(te.a)(b,"".concat(pe,"-treenode-disabled"),_e),Object(te.a)(b,"".concat(pe,"-treenode-switcher-").concat(v?"open":"close"),!w),Object(te.a)(b,"".concat(pe,"-treenode-checkbox-checked"),Y),Object(te.a)(b,"".concat(pe,"-treenode-checkbox-indeterminate"),ie),Object(te.a)(b,"".concat(pe,"-treenode-selected"),H),Object(te.a)(b,"".concat(pe,"-treenode-loading"),le),Object(te.a)(b,"".concat(pe,"-treenode-active"),xe),Object(te.a)(b,"".concat(pe,"-treenode-leaf-last"),ot),Object(te.a)(b,"drag-over",!_e&&_),Object(te.a)(b,"drag-over-gap-top",!_e&&W),Object(te.a)(b,"drag-over-gap-bottom",!_e&&j),Object(te.a)(b,"filter-node",be&&be(Object(s.b)(this.props))),b)),style:E,onDragEnter:ne?this.onDragEnter:void 0,onDragOver:ne?this.onDragOver:void 0,onDragLeave:ne?this.onDragLeave:void 0,onDrop:ne?this.onDrop:void 0,onDragEnd:ne?this.onDragEnd:void 0,onMouseMove:Le},ke),r.createElement(c,{prefixCls:pe,level:je,isStart:F,isEnd:P}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),I}(r.Component),R=function(A){return r.createElement(g.a.Consumer,null,function(I){return r.createElement(o,Object.assign({},A,{context:I}))})};R.displayName="TreeNode",R.defaultProps={title:u},R.isTreeNode=1;var T=Oe.a=R},XIdC:function(It,Oe,U){"use strict";var te=U("rePB"),Q=U("ODXe"),B=U("Ff2n"),J=U("q1tI"),K=U.n(J),N=U("TSYQ"),$=U.n(N),z=U("6cGi"),r=U("4IlW"),D=J.forwardRef(function(m,g){var p,a=m.prefixCls,c=a===void 0?"rc-switch":a,s=m.className,i=m.checked,t=m.defaultChecked,u=m.disabled,o=m.loadingIcon,R=m.checkedChildren,T=m.unCheckedChildren,S=m.onClick,A=m.onChange,I=m.onKeyDown,x=Object(B.a)(m,["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"]),b=Object(z.a)(!1,{value:i,defaultValue:t}),h=Object(Q.a)(b,2),f=h[0],C=h[1];function E(w,F){var P=f;return u||(P=w,C(P),A==null||A(P,F)),P}function _(w){w.which===r.a.LEFT?E(!1,w):w.which===r.a.RIGHT&&E(!0,w),I==null||I(w)}function W(w){var F=E(!f,w);S==null||S(F,w)}var j=$()(c,s,(p={},Object(te.a)(p,"".concat(c,"-checked"),f),Object(te.a)(p,"".concat(c,"-disabled"),u),p));return J.createElement("button",Object.assign({},x,{type:"button",role:"switch","aria-checked":f,disabled:u,className:j,ref:g,onKeyDown:_,onClick:W}),o,J.createElement("span",{className:"".concat(c,"-inner")},f?R:T))});D.displayName="Switch",Oe.a=D},Y1PL:function(It,Oe,U){"use strict";U.r(Oe),U.d(Oe,"ResizableTextArea",function(){return ie});var te=U("wx14"),Q=U("1OyB"),B=U("vuIU"),J=U("Ji7U"),K=U("LK+K"),N=U("q1tI"),$=U("VTBJ"),z=U("rePB"),r=U("Zm9Q"),D=U("Kwbf"),m=U("c+Xe"),g=U("m+aA"),p=U("bdgK"),a=new Map;function c(xe){xe.forEach(function(Le){var we,Ae=Le.target;(we=a.get(Ae))===null||we===void 0||we.forEach(function(pe){return pe(Ae)})})}var s=new p.default(c),i=null,t=null;function u(xe,Le){a.has(xe)||(a.set(xe,new Set),s.observe(xe)),a.get(xe).add(Le)}function o(xe,Le){a.has(xe)&&(a.get(xe).delete(Le),a.get(xe).size||(s.unobserve(xe),a.delete(xe)))}var R=function(xe){Object(J.a)(we,xe);var Le=Object(K.a)(we);function we(){return Object(Q.a)(this,we),Le.apply(this,arguments)}return Object(B.a)(we,[{key:"render",value:function(){return this.props.children}}]),we}(N.Component),T=N.createContext(null);function S(xe){var Le=xe.children,we=xe.onBatchResize,Ae=N.useRef(0),pe=N.useRef([]),be=N.useContext(T),ne=N.useCallback(function(fe,_e,ke){Ae.current+=1;var et=Ae.current;pe.current.push({size:fe,element:_e,data:ke}),Promise.resolve().then(function(){et===Ae.current&&(we==null||we(pe.current),pe.current=[])}),be==null||be(fe,_e,ke)},[we,be]);return N.createElement(T.Provider,{value:ne},Le)}function A(xe){var Le=xe.children,we=xe.disabled,Ae=N.useRef(null),pe=N.useRef(null),be=N.useContext(T),ne=N.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),fe=N.isValidElement(Le)&&Object(m.c)(Le),_e=fe?Le.ref:null,ke=N.useMemo(function(){return Object(m.a)(_e,Ae)},[_e,Ae]),et=N.useRef(xe);et.current=xe;var je=N.useCallback(function(ot){var _t=et.current,Re=_t.onResize,Be=_t.data,Qe=ot.getBoundingClientRect(),Ve=Qe.width,Et=Qe.height,kt=ot.offsetWidth,Vt=ot.offsetHeight,Qt=Math.floor(Ve),an=Math.floor(Et);if(ne.current.width!==Qt||ne.current.height!==an||ne.current.offsetWidth!==kt||ne.current.offsetHeight!==Vt){var sn={width:Qt,height:an,offsetWidth:kt,offsetHeight:Vt};ne.current=sn;var qe=kt===Math.round(Ve)?Ve:kt,Ze=Vt===Math.round(Et)?Et:Vt,Ct=Object($.a)(Object($.a)({},sn),{},{offsetWidth:qe,offsetHeight:Ze});be==null||be(Ct,ot,Be),Re&&Promise.resolve().then(function(){Re(Ct,ot)})}},[]);return N.useEffect(function(){var ot=Object(g.a)(Ae.current)||Object(g.a)(pe.current);return ot&&!we&&u(ot,je),function(){return o(ot,je)}},[Ae.current,we]),N.createElement(R,{ref:pe},fe?N.cloneElement(Le,{ref:ke}):Le)}var I="rc-observer-key";function x(xe){var Le=xe.children,we=Object(r.a)(Le);return we.map(function(Ae,pe){var be=(Ae==null?void 0:Ae.key)||"".concat(I,"-").concat(pe);return N.createElement(A,Object(te.a)({},xe,{key:be}),Ae)})}x.Collection=S;var b=x,h=U("bT9E"),f=U("TSYQ"),C=U.n(f),E=`
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
`,_=["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"],W={},j;function w(xe){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=xe.getAttribute("id")||xe.getAttribute("data-reactid")||xe.getAttribute("name");if(Le&&W[we])return W[we];var Ae=window.getComputedStyle(xe),pe=Ae.getPropertyValue("box-sizing")||Ae.getPropertyValue("-moz-box-sizing")||Ae.getPropertyValue("-webkit-box-sizing"),be=parseFloat(Ae.getPropertyValue("padding-bottom"))+parseFloat(Ae.getPropertyValue("padding-top")),ne=parseFloat(Ae.getPropertyValue("border-bottom-width"))+parseFloat(Ae.getPropertyValue("border-top-width")),fe=_.map(function(ke){return"".concat(ke,":").concat(Ae.getPropertyValue(ke))}).join(";"),_e={sizingStyle:fe,paddingSize:be,borderSize:ne,boxSizing:pe};return Le&&we&&(W[we]=_e),_e}function F(xe){var Le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,we=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Ae=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;j||(j=document.createElement("textarea"),j.setAttribute("tab-index","-1"),j.setAttribute("aria-hidden","true"),document.body.appendChild(j)),xe.getAttribute("wrap")?j.setAttribute("wrap",xe.getAttribute("wrap")):j.removeAttribute("wrap");var pe=w(xe,Le),be=pe.paddingSize,ne=pe.borderSize,fe=pe.boxSizing,_e=pe.sizingStyle;j.setAttribute("style","".concat(_e,";").concat(E)),j.value=xe.value||xe.placeholder||"";var ke=Number.MIN_SAFE_INTEGER,et=Number.MAX_SAFE_INTEGER,je=j.scrollHeight,ot;if(fe==="border-box"?je+=ne:fe==="content-box"&&(je-=be),we!==null||Ae!==null){j.value=" ";var _t=j.scrollHeight-be;we!==null&&(ke=_t*we,fe==="border-box"&&(ke=ke+be+ne),je=Math.max(ke,je)),Ae!==null&&(et=_t*Ae,fe==="border-box"&&(et=et+be+ne),ot=je>et?"":"hidden",je=Math.min(et,je))}return{height:je,minHeight:ke,maxHeight:et,overflowY:ot,resize:"none"}}var P=U("Gytx"),v=U.n(P),H;(function(xe){xe[xe.NONE=0]="NONE",xe[xe.RESIZING=1]="RESIZING",xe[xe.RESIZED=2]="RESIZED"})(H||(H={}));var Y=function(xe){Object(J.a)(we,xe);var Le=Object(K.a)(we);function we(Ae){var pe;return Object(Q.a)(this,we),pe=Le.call(this,Ae),pe.nextFrameActionId=void 0,pe.resizeFrameId=void 0,pe.textArea=void 0,pe.saveTextArea=function(be){pe.textArea=be},pe.handleResize=function(be){var ne=pe.state.resizeStatus,fe=pe.props,_e=fe.autoSize,ke=fe.onResize;if(ne!==H.NONE)return;typeof ke=="function"&&ke(be),_e&&pe.resizeOnNextFrame()},pe.resizeOnNextFrame=function(){cancelAnimationFrame(pe.nextFrameActionId),pe.nextFrameActionId=requestAnimationFrame(pe.resizeTextarea)},pe.resizeTextarea=function(){var be=pe.props.autoSize;if(!be||!pe.textArea)return;var ne=be.minRows,fe=be.maxRows,_e=F(pe.textArea,!1,ne,fe);pe.setState({textareaStyles:_e,resizeStatus:H.RESIZING},function(){cancelAnimationFrame(pe.resizeFrameId),pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:H.RESIZED},function(){pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:H.NONE}),pe.fixFirefoxAutoScroll()})})})})},pe.renderTextArea=function(){var be=pe.props,ne=be.prefixCls,fe=ne===void 0?"rc-textarea":ne,_e=be.autoSize,ke=be.onResize,et=be.className,je=be.disabled,ot=pe.state,_t=ot.textareaStyles,Re=ot.resizeStatus,Be=Object(h.a)(pe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Qe=C()(fe,et,Object(z.a)({},"".concat(fe,"-disabled"),je));"value"in Be&&(Be.value=Be.value||"");var Ve=Object($.a)(Object($.a)(Object($.a)({},pe.props.style),_t),Re===H.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return N.createElement(b,{onResize:pe.handleResize,disabled:!(_e||ke)},N.createElement("textarea",Object(te.a)({},Be,{className:Qe,style:Ve,ref:pe.saveTextArea})))},pe.state={textareaStyles:{},resizeStatus:H.NONE},pe}return Object(B.a)(we,[{key:"componentDidUpdate",value:function(pe){(pe.value!==this.props.value||!v()(pe.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 pe=this.textArea.selectionStart,be=this.textArea.selectionEnd;this.textArea.setSelectionRange(pe,be)}}catch(ne){}}},{key:"render",value:function(){return this.renderTextArea()}}]),we}(N.Component),ie=Y,le=function(xe){Object(J.a)(we,xe);var Le=Object(K.a)(we);function we(Ae){var pe;Object(Q.a)(this,we),pe=Le.call(this,Ae),pe.resizableTextArea=void 0,pe.focus=function(){pe.resizableTextArea.textArea.focus()},pe.saveTextArea=function(ne){pe.resizableTextArea=ne},pe.handleChange=function(ne){var fe=pe.props.onChange;pe.setValue(ne.target.value,function(){pe.resizableTextArea.resizeTextarea()}),fe&&fe(ne)},pe.handleKeyDown=function(ne){var fe=pe.props,_e=fe.onPressEnter,ke=fe.onKeyDown;ne.keyCode===13&&_e&&_e(ne),ke&&ke(ne)};var be=typeof Ae.value=="undefined"||Ae.value===null?Ae.defaultValue:Ae.value;return pe.state={value:be},pe}return Object(B.a)(we,[{key:"setValue",value:function(pe,be){"value"in this.props||this.setState({value:pe},be)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return N.createElement(ie,Object(te.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(pe){return"value"in pe?{value:pe.value}:null}}]),we}(N.Component),he=Oe.default=le},YIbm:function(It,Oe,U){It.exports={content:"content___24s9X"}},"YJx+":function(It,Oe,U){It.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(It,Oe,U){"use strict";var te=U("+BJd"),Q=U("mr32"),B=U("14J3"),J=U("BMrR"),K=U("5NDa"),N=U("5rEg"),$=U("oBTY"),z=U("5Dmo"),r=U("3S7+"),D=U("miYZ"),m=U("tsqr"),g=U("tJVT"),p=U("q1tI"),a=U.n(p),c=function(i){var t,u,o=i.value,R=o===void 0?[[],[]]:o,T=i.onChange,S=Object(p.useState)(""),A=Object(g.a)(S,2),I=A[0],x=A[1],b=Object(p.useState)(""),h=Object(g.a)(b,2),f=h[0],C=h[1],E=function(W){if(!W)return!1;var j=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 j.test(W)?(m.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u542B\u6709\u7279\u6B8A\u5B57\u7B26\uFF01"),!1):W==="|"?(m.b.warn("\u5173\u952E\u8BCD\u4E0D\u80FD\u53EA\u8F93\u5165\u4E00\u4E2A\u201C|\u201D\u5B57\u7B26\uFF01"),!1):!0};return a.a.createElement("div",null,a.a.createElement("p",{className:"font14"},"\u5173\u952E\u8BCD",a.a.createElement("span",{className:"c-grey-999"},"\uFF08\u5173\u952E\u8BCD\u53EF\u7528\u4E8E\u81EA\u52A8\u5224\u5206\uFF09"),a.a.createElement(r.a,{overlayStyle:{maxWidth:350},title:a.a.createElement("div",null,a.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"),a.a.createElement("div",null,"\u4F8B\u5982\uFF1A"),a.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"),a.a.createElement("div",null,"\u666E\u901A\u5173\u952E\u8BCD2\u5206\uFF0C\u6BCF\u4E2A\u6838\u5FC3\u5173\u952E\u8BCD4\u5206"))},a.a.createElement("span",{className:"iconfont icon-a-wenhaobeifen2 font14"}))),a.a.createElement(J.a,{align:"middle",className:"font14"},"\u666E\u901A\u5173\u952E\u8BCD\uFF1A",a.a.createElement(N.a,{value:I,onChange:function(W){x(W.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(W){var j,w=(j=W.target)===null||j===void 0?void 0:j.value;if(E(w)){var F,P;(F=R[0])===null||F===void 0||F.push(w==null||((P=w.split("|"))===null||P===void 0)?void 0:P.filter(function(v){return!!v})),T(Object($.a)(R)),x("")}},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"}),a.a.createElement("span",{className:"c-grey-999"},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),a.a.createElement("div",{style:{paddingLeft:89},className:"mt10"},R==null||((t=R[0])===null||t===void 0)?void 0:t.map(function(_,W){return a.a.createElement(Q.a,{className:"mb10",key:W,closable:!0,onClose:function(w){var F;w.preventDefault(),R[0]=(F=R[0])===null||F===void 0?void 0:F.filter(function(P,v){return v!==W}),T(Object($.a)(R))}},_==null?void 0:_.join(" \u6216 "))})),a.a.createElement(J.a,{align:"middle",className:"font14"},"\u6838\u5FC3\u5173\u952E\u8BCD\uFF1A",a.a.createElement(N.a,{value:f,onChange:function(W){C(W.target.value)},maxLength:50,allowClear:!0,onPressEnter:function(W){var j,w=(j=W.target)===null||j===void 0?void 0:j.value;if(E(w)){var F,P;(F=R[1])===null||F===void 0||F.push(w==null||((P=w.split("|"))===null||P===void 0)?void 0:P.filter(function(v){return!!v})),T(Object($.a)(R)),C("")}},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"}),a.a.createElement("span",{className:"c-grey-999"},"\u201C\u56DE\u8F66\u952E\u201D\u4FDD\u5B58\u5173\u952E\u8BCD")),a.a.createElement("div",{style:{paddingLeft:89},className:"mt10"},R==null||((u=R[1])===null||u===void 0)?void 0:u.map(function(_,W){return a.a.createElement(Q.a,{className:"mb10",key:W,closable:!0,onClose:function(w){var F;w.preventDefault(),R[1]=(F=R[1])===null||F===void 0?void 0:F.filter(function(P,v){return v!==W}),T(Object($.a)(R))}},_==null?void 0:_.join(" \u6216 "))})))};Oe.a=c},ZW9T:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return P});var te=U("k1fw"),Q=U("oBTY"),B=U("miYZ"),J=U("tsqr"),K=U("rAM+"),N=U("tJVT"),$=U("PpiC"),z=U("q1tI"),r=U.n(z),D=U("bdgK"),m=U("9og8"),g=U("WmNS"),p=U.n(g),a={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"]},c={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"]},s={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
`)},{label:"if",content:["if () {"," $0","}"].join(`
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},i={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
`)}]},t=U("5VLF"),u=U.n(t),o={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},R=function(H,Y){return Y.map(function(ie){return{label:ie,kind:H.languages.CompletionItemKind.Keyword,insertText:ie}})},T=function(H){return Object.keys(o.tables).map(function(Y){return{label:Y,kind:H.languages.CompletionItemKind.Variable,insertText:Y}})},S=function(H,Y){var ie=o.tables[H];return ie?ie.map(function(le){return{label:le,kind:Y.languages.CompletionItemKind.Field,insertText:le}}):[]};function A(v,H,Y,ie,le){var he=H.getWordUntilPosition(Y),xe={startLineNumber:Y.lineNumber,endLineNumber:Y.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},Le=ie.map(function(we){return{label:we,kind:v.languages.CompletionItemKind.Keyword,insertText:we,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:xe}});return le.map(function(we){Le.push(Object(te.a)(Object(te.a)({},we),{},{range:xe}))}),Le}var I=function(v){o.languages.map(function(le){return v.languages.registerDocumentFormattingEditProvider(le,{provideDocumentFormattingEdits:function(xe,Le,we){return Object(m.a)(p.a.mark(function Ae(){var pe;return p.a.wrap(function(ne){for(;;)switch(ne.prev=ne.next){case 0:return pe=u()(xe.getValue(),{indent_size:"2",indent_char:" ",max_preserve_newlines:"2",preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:"0",indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1}),ne.abrupt("return",[{range:xe.getFullModelRange(),text:pe}]);case 2:case"end":return ne.stop()}},Ae)}))()}}),le});var H=s.quickKey.map(function(le){return{label:le.label,kind:v.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Y=i.quickKey.map(function(le){return{label:le.label,kind:v.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ie=c.quickKey.map(function(le){return{label:le.label,kind:v.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet}});v.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(he,xe){var Le=he.getWordUntilPosition(xe),we={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Ae=he.getLineContent(xe.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object(Q.a)(s.keywords.map(function(pe){return{label:pe,kind:v.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}})),Object(Q.a)(s.quickKey.map(function(pe){return{label:pe.label,kind:v.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Ae.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}})))}}}),v.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(he,xe){var Le=he.getWordUntilPosition(xe),we={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn};return{suggestions:Object(Q.a)(a.keywords.map(function(Ae){return{label:Ae,kind:v.languages.CompletionItemKind.Function,documentation:Ae,insertText:Ae,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}}))}}}),v.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(he,xe){var Le=he.getWordUntilPosition(xe),we={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Ae=he.getLineContent(xe.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object(Q.a)(c.keywords.map(function(pe){return{label:pe,kind:v.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}})),Object(Q.a)(c.quickKey.map(function(pe){return{label:pe.label,kind:v.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Ae.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}})))}}}),v.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(he,xe){var Le=he.getWordUntilPosition(xe),we={startLineNumber:xe.lineNumber,endLineNumber:xe.lineNumber,startColumn:Le.startColumn,endColumn:Le.endColumn},Ae=he.getLineContent(xe.lineNumber).substring(Le.startColumn-2,Le.endColumn);return{suggestions:[].concat(Object(Q.a)(i.keywords.map(function(pe){return{label:pe,kind:v.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}})),Object(Q.a)(i.quickKey.map(function(pe){return{label:pe.label,kind:v.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Ae.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:v.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:we}})))}}})},x="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",b=U("fjLI"),h=U("LvDl"),f=U("+ua5");function C(v){return/^\d+$/.test(v)?"".concat(v,"px"):v}function E(){}var _=!1,W={"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 j(){var v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],H=v;if(Array.isArray(v)){for(var Y=0;Y<v.length;Y++){var ie=W[v[Y]];if(ie)return ie}return H[0]}return W[H]||H}var w=null,F=Oe.b=function(v){var H=v.width,Y=H===void 0?"100%":H,ie=v.height,le=ie===void 0?"100%":ie,he=v.value,xe=v.language,Le=xe===void 0?"javascript":xe,we=v.style,Ae=we===void 0?{}:we,pe=v.options,be=pe===void 0?{}:pe,ne=v.overrideServices,fe=ne===void 0?{}:ne,_e=v.theme,ke=_e===void 0?"vs-dark":_e,et=v.onEditBlur,je=v.onSave,ot=v.autoHeight,_t=ot===void 0?!1:ot,Re=v.forbidCopy,Be=Re===void 0?!1:Re,Qe=v.onChange,Ve=Qe===void 0?E:Qe,Et=v.editorDidMount,kt=Et===void 0?E:Et,Vt=v.onFocus,Qt=Vt===void 0?E:Vt,an=v.filename,sn=an===void 0?"educoder.txt":an,qe=v.errorLine,Ze=v.errorContent,Ct=Ze===void 0?"":Ze,At=Object($.a)(v,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),ct=Object(z.useRef)(),ft=Object(z.useRef)({}),He=Object(z.useRef)(),Ne=Object(z.useRef)(),Ue=Object(z.useRef)(!1),ge=Object(z.useRef)(),Ee=Object(z.useState)(!1),De=Object(N.a)(Ee,2),ue=De[0],Fe=De[1];function at(){var Nn;return ct.current&&(Nn=new D.default(function(Tn){var pr=Object(K.a)(Tn),_r;try{for(pr.s();!(_r=pr.n()).done;){var Pr=_r.value;(Pr.target.offsetHeight>0||Pr.target.offsetWidth>0)&&ft.current.instance.layout()}}catch(yr){pr.e(yr)}finally{pr.f()}}),Nn.observe(ct.current)),Nn}function xt(){J.b.warn(decodeURIComponent(x))}var Kt=function(){var Tn=ft.current.instance;if(he!=null&&Tn&&ue){var pr=Tn.getModel();pr&&he!==pr.getValue()&&(_=!0,pr.setValue(he),Tn.layout(),_=!1)}};Object(z.useEffect)(function(){Ne.current&&clearTimeout(Ne.current),Ne.current=setTimeout(function(){Kt()},500)},[he,ue,ft.current]),Object(z.useEffect)(function(){if(qe&&ft.current&&ft.current.instance){var Nn=ft.current.instance;Nn.changeViewZones(function(pr){var _r=document.createElement("div");_r.style.padding="10px 20px",_r.style.width="calc(100% - 20px)",_r.className="my-error-line-wrp",_r.innerHTML=Ct,pr.addZone({afterLineNumber:qe||11,heightInLines:3,domNode:_r})});var Tn={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}};Nn.addOverlayWidget(Tn),Nn.revealPositionInCenter({lineNumber:20,column:1})}},[qe,ft.current,ue]);function Xt(){var Nn=ft.current.instance;if(Nn){var Tn=Nn.getSelection(),pr=ft.current.pastePos||{},_r=new w.Range(pr.startLineNumber||Tn.endLineNumber,pr.startColumn||Tn.endColumn,pr.endLineNumber||Tn.endLineNumber,pr.endColumn||Tn.endColumn);setTimeout(function(){Nn.executeEdits("",[{range:_r,text:""}])},300)}}function $t(Nn){(window.navigator.platform.match("Mac")?Nn.metaKey:Nn.ctrlKey)&&Nn.keyCode==83&&(Nn.preventDefault(),je())}var $n=function(){if(_t&&ft.current.instance){var Tn=ft.current.instance.getContentHeight();Jt(Tn<le?le:Tn)}else Jt(le)};function vn(Nn){var Tn=document.createEvent("MouseEvents");Tn.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Nn.dispatchEvent(Tn)}function ln(Nn,Tn){var pr=window.URL||window.webkitURL||window,_r=new Blob([Tn]),Pr=document.createElementNS("http://www.w3.org/1999/xhtml","a");Pr.href=pr.createObjectURL(_r),Pr.download=Nn,vn(Pr)}Object(z.useEffect)(function(){$n()},[$n]),Object(z.useEffect)(function(){ct.current&&!ue&&Promise.all([U.e(15),U.e(27)]).then(U.t.bind(null,"M/lh",7)).then(function(Nn){try{w=Nn,ft.current.instance=w.editor.create(ct.current,{value:he,language:j(Le),theme:ke,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},fe);var Tn=ft.current.instance,pr=b.d._menuItems,_r=Object(Q.a)(pr).find(function(Ot){return Ot[0]._debugName=="EditorContext"}),Pr=_r[1],yr=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],mt=function(Me,ye){var ve=Me._first;do{var or,en,Ie=ye.includes((or=ve.element)===null||or===void 0||((en=or.command)===null||en===void 0)?void 0:en.id);Ie&&Me._remove(ve)}while(ve=ve.next)};if(kt(Tn,w),setTimeout(function(){$n(),ft.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){ln(sn||"educoder.txt",Tn.getValue())}}),Tn.getDomNode().addEventListener("input",function(){He.current.autoFormat&&Tn.getAction("editor.action.formatDocument").run()})},500),ft.current.subscription=Tn.onDidChangeModelContent(function(Ot){Ue.current?clearTimeout(ge.current):($n(),Ve(Tn.getValue(),Ot)),ge.current=setTimeout(function(){Ue.current=!1},500)}),window.Monaco||I(w,j(Le)),Be&&(mt(Pr,yr),ct.current.classList.add("noCopyPaste"),Tn.onKeyDown(function(Ot){var Me=Ot.keyCode,ye=Ot.ctrlKey,ve=Ot.metaKey;(Me===33||Me===52)&&(ve||ye)&&(xt(),Ot.preventDefault())})),window.Monaco=w,et&&Tn.onDidBlurEditorWidget(function(){et(Tn.getValue())}),Qt&&Tn.onDidFocusEditorText(function(){Qt(Tn.getValue())}),Be){Tn.addCommand(w.KeyMod.CtrlCmd|w.KeyCode.KEY_V,function(){return xt(),null}),Tn.onDidPaste(function(Ot){ft.current.pastePos=Ot});try{window.addEventListener("paste",Xt)}catch(Ot){}}var Ke=at();return Fe(!0),function(){var Ot=ft.current.instance;Ot.dispose();var Me=Ot.getModel();Me&&Me.dispose(),ft.current.subscription&&ft.current.subscription.dispose(),Be&&window.removeEventListener("paste",Xt),Ke.unobserve(ct.current)}}catch(Ot){}})},[]),Object(z.useEffect)(function(){var Nn=ft.current.instance;if(Nn&&ue)return document.addEventListener("keydown",$t,!1),function(){document.removeEventListener("keydown",$t)}},[je,ue]),Object(z.useEffect)(function(){var Nn=ft.current.instance;if(Nn&&ue){var Tn=j(Le);w.editor.setModelLanguage(Nn.getModel(),Tn),console.log("language:",Le,Nn.getModel(),Tn)}},[Le,ue]),Object(z.useEffect)(function(){var Nn=ft.current.instance;Nn&&ue&&w.editor.setTheme(ke)},[ke,ue]),Object(z.useEffect)(function(){var Nn=ft.current.instance;He.current=be,Nn&&ue&&(Nn.updateOptions(Object(te.a)({},be)),setTimeout(function(){Nn.getModel().updateOptions(Object(te.a)({},be))},200))},[JSON.stringify(be),ue]),Object(z.useEffect)(function(){var Nn=ft.current.instance;Nn&&ue&&Nn.layout()},[Y,le,ue]);var hn=Object(z.useState)(C(Y)),Gn=Object(N.a)(hn,2),fr=Gn[0],vr=Gn[1],ir=Object(z.useState)(C(le)),br=Object(N.a)(ir,2),Rr=br[0],Jt=br[1],Ar=Object(te.a)(Object(te.a)({},Ae),{},{width:fr,height:Rr});return r.a.createElement("div",{className:"my-monaco-editor",ref:ct,style:Ar})};function P(v){var H=v.width,Y=H===void 0?"100%":H,ie=v.height,le=ie===void 0?"100%":ie,he=v.original,xe=v.modified,Le=v.language,we=v.options,Ae=we===void 0?{}:we,pe=Object(z.useRef)(),be=Object(z.useState)(null),ne=Object(N.a)(be,2),fe=ne[0],_e=ne[1];function ke(_t){var Re;return pe.current&&(Re=new D.default(function(Be){var Qe=Object(K.a)(Be),Ve;try{for(Qe.s();!(Ve=Qe.n()).done;){var Et=Ve.value;(Et.target.offsetHeight>0||Et.target.offsetWidth>0)&&_t.layout()}}catch(kt){Qe.e(kt)}finally{Qe.f()}}),Re.observe(pe.current)),Re}Object(z.useEffect)(function(){pe.current&&Promise.all([U.e(15),U.e(27)]).then(U.t.bind(null,"M/lh",7)).then(function(_t){w=_t;var Re=w.editor.createDiffEditor(pe.current,Object(te.a)(Object(te.a)({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",ignoreTrimWhitespace:!1,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},Ae),{},{wordWrap:!0}));_e(Re);var Be=ke(Re);return function(){Re.dispose();var Qe=Re.getModel();Qe&&Qe.dispose(),Be.unobserve(pe.current)}})},[]),Object(z.useEffect)(function(){fe&&fe.setModel({original:w.editor.createModel(he,Le),modified:w.editor.createModel(xe,Le)})},[he,xe,Le,fe]);var et=C(Y),je=C(le),ot={width:et,height:je};return r.a.createElement("div",{className:"my-diff-editor",ref:pe,style:ot})}},ZWs3:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return m});var te=U("+L6B"),Q=U("2/Rp"),B=U("0Owb"),J=U("9og8"),K=U("tJVT"),N=U("PpiC"),$=U("WmNS"),z=U.n($),r=U("q1tI"),D=U.n(r),m=function(p){var a=p.children,c=Object(N.a)(p,["children"]),s=Object(r.useState)(!1),i=Object(K.a)(s,2),t=i[0],u=i[1];return D.a.createElement(Q.a,Object(B.a)({},c,{loading:t,onClick:function(){var o=Object(J.a)(z.a.mark(function R(T){return z.a.wrap(function(A){for(;;)switch(A.prev=A.next){case 0:return A.prev=0,u(!0),A.next=4,c.onClick(T);case 4:u(!1),A.next=10;break;case 7:A.prev=7,A.t0=A.catch(0),u(!1);case 10:case"end":return A.stop()}},R,null,[[0,7]])}));return function(R){return o.apply(this,arguments)}}()}),a)}},ZpRC:function(It,Oe,U){"use strict";function te(m){return typeof m=="object"&&m!=null&&m.nodeType===1}function Q(m,g){return(!g||m!=="hidden")&&m!=="visible"&&m!=="clip"}function B(m,g){if(m.clientHeight<m.scrollHeight||m.clientWidth<m.scrollWidth){var p=getComputedStyle(m,null);return Q(p.overflowY,g)||Q(p.overflowX,g)||function(a){var c=function(s){if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch(i){return null}}(a);return!!c&&(c.clientHeight<a.scrollHeight||c.clientWidth<a.scrollWidth)}(m)}return!1}function J(m,g,p,a,c,s,i,t){return s<m&&i>g||s>m&&i<g?0:s<=m&&t<=p||i>=g&&t>=p?s-m-a:i>g&&t<p||s<m&&t>p?i-g+c:0}var K=function(m,g){var p=window,a=g.scrollMode,c=g.block,s=g.inline,i=g.boundary,t=g.skipOverflowHiddenElements,u=typeof i=="function"?i:function(_t){return _t!==i};if(!te(m))throw new TypeError("Invalid target");for(var o=document.scrollingElement||document.documentElement,R=[],T=m;te(T)&&u(T);){if((T=T.parentElement)===o){R.push(T);break}T!=null&&T===document.body&&B(T)&&!B(document.documentElement)||T!=null&&B(T,t)&&R.push(T)}for(var S=p.visualViewport?p.visualViewport.width:innerWidth,A=p.visualViewport?p.visualViewport.height:innerHeight,I=window.scrollX||pageXOffset,x=window.scrollY||pageYOffset,b=m.getBoundingClientRect(),h=b.height,f=b.width,C=b.top,E=b.right,_=b.bottom,W=b.left,j=c==="start"||c==="nearest"?C:c==="end"?_:C+h/2,w=s==="center"?W+f/2:s==="end"?E:W,F=[],P=0;P<R.length;P++){var v=R[P],H=v.getBoundingClientRect(),Y=H.height,ie=H.width,le=H.top,he=H.right,xe=H.bottom,Le=H.left;if(a==="if-needed"&&C>=0&&W>=0&&_<=A&&E<=S&&C>=le&&_<=xe&&W>=Le&&E<=he)return F;var we=getComputedStyle(v),Ae=parseInt(we.borderLeftWidth,10),pe=parseInt(we.borderTopWidth,10),be=parseInt(we.borderRightWidth,10),ne=parseInt(we.borderBottomWidth,10),fe=0,_e=0,ke="offsetWidth"in v?v.offsetWidth-v.clientWidth-Ae-be:0,et="offsetHeight"in v?v.offsetHeight-v.clientHeight-pe-ne:0;if(o===v)fe=c==="start"?j:c==="end"?j-A:c==="nearest"?J(x,x+A,A,pe,ne,x+j,x+j+h,h):j-A/2,_e=s==="start"?w:s==="center"?w-S/2:s==="end"?w-S:J(I,I+S,S,Ae,be,I+w,I+w+f,f),fe=Math.max(0,fe+x),_e=Math.max(0,_e+I);else{fe=c==="start"?j-le-pe:c==="end"?j-xe+ne+et:c==="nearest"?J(le,xe,Y,pe,ne+et,j,j+h,h):j-(le+Y/2)+et/2,_e=s==="start"?w-Le-Ae:s==="center"?w-(Le+ie/2)+ke/2:s==="end"?w-he+be+ke:J(Le,he,ie,Ae,be+ke,w,w+f,f);var je=v.scrollLeft,ot=v.scrollTop;j+=ot-(fe=Math.max(0,Math.min(ot+fe,v.scrollHeight-Y+et))),w+=je-(_e=Math.max(0,Math.min(je+_e,v.scrollWidth-ie+ke)))}F.push({el:v,top:fe,left:_e})}return F};function N(m){return m===Object(m)&&Object.keys(m).length!==0}function $(m,g){g===void 0&&(g="auto");var p="scrollBehavior"in document.body.style;m.forEach(function(a){var c=a.el,s=a.top,i=a.left;c.scroll&&p?c.scroll({top:s,left:i,behavior:g}):(c.scrollTop=s,c.scrollLeft=i)})}function z(m){return m===!1?{block:"end",inline:"nearest"}:N(m)?m:{block:"start",inline:"nearest"}}function r(m,g){var p=!m.ownerDocument.documentElement.contains(m);if(N(g)&&typeof g.behavior=="function")return g.behavior(p?[]:K(m,g));if(p)return;var a=z(g);return $(K(m,a),a.behavior)}var D=Oe.a=r},Zss7:function(It,Oe,U){var te;(function(Q){var B=/^\s+/,J=/\s+$/,K=0,N=Q.round,$=Q.min,z=Q.max,r=Q.random;function D(ne,fe){if(ne=ne||"",fe=fe||{},ne instanceof D)return ne;if(!(this instanceof D))return new D(ne,fe);var _e=m(ne);this._originalInput=ne,this._r=_e.r,this._g=_e.g,this._b=_e.b,this._a=_e.a,this._roundA=N(100*this._a)/100,this._format=fe.format||_e.format,this._gradientType=fe.gradientType,this._r<1&&(this._r=N(this._r)),this._g<1&&(this._g=N(this._g)),this._b<1&&(this._b=N(this._b)),this._ok=_e.ok,this._tc_id=K++}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 ne=this.toRgb();return(ne.r*299+ne.g*587+ne.b*114)/1e3},getLuminance:function(){var ne=this.toRgb(),fe,_e,ke,et,je,ot;return fe=ne.r/255,_e=ne.g/255,ke=ne.b/255,fe<=.03928?et=fe/12.92:et=Q.pow((fe+.055)/1.055,2.4),_e<=.03928?je=_e/12.92:je=Q.pow((_e+.055)/1.055,2.4),ke<=.03928?ot=ke/12.92:ot=Q.pow((ke+.055)/1.055,2.4),.2126*et+.7152*je+.0722*ot},setAlpha:function(ne){return this._a=F(ne),this._roundA=N(100*this._a)/100,this},toHsv:function(){var ne=c(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,v:ne.v,a:this._a}},toHsvString:function(){var ne=c(this._r,this._g,this._b),fe=N(ne.h*360),_e=N(ne.s*100),ke=N(ne.v*100);return this._a==1?"hsv("+fe+", "+_e+"%, "+ke+"%)":"hsva("+fe+", "+_e+"%, "+ke+"%, "+this._roundA+")"},toHsl:function(){var ne=p(this._r,this._g,this._b);return{h:ne.h*360,s:ne.s,l:ne.l,a:this._a}},toHslString:function(){var ne=p(this._r,this._g,this._b),fe=N(ne.h*360),_e=N(ne.s*100),ke=N(ne.l*100);return this._a==1?"hsl("+fe+", "+_e+"%, "+ke+"%)":"hsla("+fe+", "+_e+"%, "+ke+"%, "+this._roundA+")"},toHex:function(ne){return i(this._r,this._g,this._b,ne)},toHexString:function(ne){return"#"+this.toHex(ne)},toHex8:function(ne){return t(this._r,this._g,this._b,this._a,ne)},toHex8String:function(ne){return"#"+this.toHex8(ne)},toRgb:function(){return{r:N(this._r),g:N(this._g),b:N(this._b),a:this._a}},toRgbString:function(){return this._a==1?"rgb("+N(this._r)+", "+N(this._g)+", "+N(this._b)+")":"rgba("+N(this._r)+", "+N(this._g)+", "+N(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:N(P(this._r,255)*100)+"%",g:N(P(this._g,255)*100)+"%",b:N(P(this._b,255)*100)+"%",a:this._a}},toPercentageRgbString:function(){return this._a==1?"rgb("+N(P(this._r,255)*100)+"%, "+N(P(this._g,255)*100)+"%, "+N(P(this._b,255)*100)+"%)":"rgba("+N(P(this._r,255)*100)+"%, "+N(P(this._g,255)*100)+"%, "+N(P(this._b,255)*100)+"%, "+this._roundA+")"},toName:function(){return this._a===0?"transparent":this._a<1?!1:j[i(this._r,this._g,this._b,!0)]||!1},toFilter:function(ne){var fe="#"+u(this._r,this._g,this._b,this._a),_e=fe,ke=this._gradientType?"GradientType = 1, ":"";if(ne){var et=D(ne);_e="#"+u(et._r,et._g,et._b,et._a)}return"progid:DXImageTransform.Microsoft.gradient("+ke+"startColorstr="+fe+",endColorstr="+_e+")"},toString:function(ne){var fe=!!ne;ne=ne||this._format;var _e=!1,ke=this._a<1&&this._a>=0,et=!fe&&ke&&(ne==="hex"||ne==="hex6"||ne==="hex3"||ne==="hex4"||ne==="hex8"||ne==="name");return et?ne==="name"&&this._a===0?this.toName():this.toRgbString():(ne==="rgb"&&(_e=this.toRgbString()),ne==="prgb"&&(_e=this.toPercentageRgbString()),(ne==="hex"||ne==="hex6")&&(_e=this.toHexString()),ne==="hex3"&&(_e=this.toHexString(!0)),ne==="hex4"&&(_e=this.toHex8String(!0)),ne==="hex8"&&(_e=this.toHex8String()),ne==="name"&&(_e=this.toName()),ne==="hsl"&&(_e=this.toHslString()),ne==="hsv"&&(_e=this.toHsvString()),_e||this.toHexString())},clone:function(){return D(this.toString())},_applyModification:function(ne,fe){var _e=ne.apply(null,[this].concat([].slice.call(fe)));return this._r=_e._r,this._g=_e._g,this._b=_e._b,this.setAlpha(_e._a),this},lighten:function(){return this._applyModification(S,arguments)},brighten:function(){return this._applyModification(A,arguments)},darken:function(){return this._applyModification(I,arguments)},desaturate:function(){return this._applyModification(o,arguments)},saturate:function(){return this._applyModification(R,arguments)},greyscale:function(){return this._applyModification(T,arguments)},spin:function(){return this._applyModification(x,arguments)},_applyCombination:function(ne,fe){return ne.apply(null,[this].concat([].slice.call(fe)))},analogous:function(){return this._applyCombination(E,arguments)},complement:function(){return this._applyCombination(b,arguments)},monochromatic:function(){return this._applyCombination(_,arguments)},splitcomplement:function(){return this._applyCombination(C,arguments)},triad:function(){return this._applyCombination(h,arguments)},tetrad:function(){return this._applyCombination(f,arguments)}},D.fromRatio=function(ne,fe){if(typeof ne=="object"){var _e={};for(var ke in ne)ne.hasOwnProperty(ke)&&(ke==="a"?_e[ke]=ne[ke]:_e[ke]=he(ne[ke]));ne=_e}return D(ne,fe)};function m(ne){var fe={r:0,g:0,b:0},_e=1,ke=null,et=null,je=null,ot=!1,_t=!1;return typeof ne=="string"&&(ne=pe(ne)),typeof ne=="object"&&(Ae(ne.r)&&Ae(ne.g)&&Ae(ne.b)?(fe=g(ne.r,ne.g,ne.b),ot=!0,_t=String(ne.r).substr(-1)==="%"?"prgb":"rgb"):Ae(ne.h)&&Ae(ne.s)&&Ae(ne.v)?(ke=he(ne.s),et=he(ne.v),fe=s(ne.h,ke,et),ot=!0,_t="hsv"):Ae(ne.h)&&Ae(ne.s)&&Ae(ne.l)&&(ke=he(ne.s),je=he(ne.l),fe=a(ne.h,ke,je),ot=!0,_t="hsl"),ne.hasOwnProperty("a")&&(_e=ne.a)),_e=F(_e),{ok:ot,format:ne.format||_t,r:$(255,z(fe.r,0)),g:$(255,z(fe.g,0)),b:$(255,z(fe.b,0)),a:_e}}function g(ne,fe,_e){return{r:P(ne,255)*255,g:P(fe,255)*255,b:P(_e,255)*255}}function p(ne,fe,_e){ne=P(ne,255),fe=P(fe,255),_e=P(_e,255);var ke=z(ne,fe,_e),et=$(ne,fe,_e),je,ot,_t=(ke+et)/2;if(ke==et)je=ot=0;else{var Re=ke-et;ot=_t>.5?Re/(2-ke-et):Re/(ke+et);switch(ke){case ne:je=(fe-_e)/Re+(fe<_e?6:0);break;case fe:je=(_e-ne)/Re+2;break;case _e:je=(ne-fe)/Re+4;break}je/=6}return{h:je,s:ot,l:_t}}function a(ne,fe,_e){var ke,et,je;ne=P(ne,360),fe=P(fe,100),_e=P(_e,100);function ot(Be,Qe,Ve){return Ve<0&&(Ve+=1),Ve>1&&(Ve-=1),Ve<1/6?Be+(Qe-Be)*6*Ve:Ve<1/2?Qe:Ve<2/3?Be+(Qe-Be)*(2/3-Ve)*6:Be}if(fe===0)ke=et=je=_e;else{var _t=_e<.5?_e*(1+fe):_e+fe-_e*fe,Re=2*_e-_t;ke=ot(Re,_t,ne+1/3),et=ot(Re,_t,ne),je=ot(Re,_t,ne-1/3)}return{r:ke*255,g:et*255,b:je*255}}function c(ne,fe,_e){ne=P(ne,255),fe=P(fe,255),_e=P(_e,255);var ke=z(ne,fe,_e),et=$(ne,fe,_e),je,ot,_t=ke,Re=ke-et;if(ot=ke===0?0:Re/ke,ke==et)je=0;else{switch(ke){case ne:je=(fe-_e)/Re+(fe<_e?6:0);break;case fe:je=(_e-ne)/Re+2;break;case _e:je=(ne-fe)/Re+4;break}je/=6}return{h:je,s:ot,v:_t}}function s(ne,fe,_e){ne=P(ne,360)*6,fe=P(fe,100),_e=P(_e,100);var ke=Q.floor(ne),et=ne-ke,je=_e*(1-fe),ot=_e*(1-et*fe),_t=_e*(1-(1-et)*fe),Re=ke%6,Be=[_e,ot,je,je,_t,_e][Re],Qe=[_t,_e,_e,ot,je,je][Re],Ve=[je,je,_t,_e,_e,ot][Re];return{r:Be*255,g:Qe*255,b:Ve*255}}function i(ne,fe,_e,ke){var et=[le(N(ne).toString(16)),le(N(fe).toString(16)),le(N(_e).toString(16))];return ke&&et[0].charAt(0)==et[0].charAt(1)&&et[1].charAt(0)==et[1].charAt(1)&&et[2].charAt(0)==et[2].charAt(1)?et[0].charAt(0)+et[1].charAt(0)+et[2].charAt(0):et.join("")}function t(ne,fe,_e,ke,et){var je=[le(N(ne).toString(16)),le(N(fe).toString(16)),le(N(_e).toString(16)),le(xe(ke))];return et&&je[0].charAt(0)==je[0].charAt(1)&&je[1].charAt(0)==je[1].charAt(1)&&je[2].charAt(0)==je[2].charAt(1)&&je[3].charAt(0)==je[3].charAt(1)?je[0].charAt(0)+je[1].charAt(0)+je[2].charAt(0)+je[3].charAt(0):je.join("")}function u(ne,fe,_e,ke){var et=[le(xe(ke)),le(N(ne).toString(16)),le(N(fe).toString(16)),le(N(_e).toString(16))];return et.join("")}D.equals=function(ne,fe){return!ne||!fe?!1:D(ne).toRgbString()==D(fe).toRgbString()},D.random=function(){return D.fromRatio({r:r(),g:r(),b:r()})};function o(ne,fe){fe=fe===0?0:fe||10;var _e=D(ne).toHsl();return _e.s-=fe/100,_e.s=v(_e.s),D(_e)}function R(ne,fe){fe=fe===0?0:fe||10;var _e=D(ne).toHsl();return _e.s+=fe/100,_e.s=v(_e.s),D(_e)}function T(ne){return D(ne).desaturate(100)}function S(ne,fe){fe=fe===0?0:fe||10;var _e=D(ne).toHsl();return _e.l+=fe/100,_e.l=v(_e.l),D(_e)}function A(ne,fe){fe=fe===0?0:fe||10;var _e=D(ne).toRgb();return _e.r=z(0,$(255,_e.r-N(255*-(fe/100)))),_e.g=z(0,$(255,_e.g-N(255*-(fe/100)))),_e.b=z(0,$(255,_e.b-N(255*-(fe/100)))),D(_e)}function I(ne,fe){fe=fe===0?0:fe||10;var _e=D(ne).toHsl();return _e.l-=fe/100,_e.l=v(_e.l),D(_e)}function x(ne,fe){var _e=D(ne).toHsl(),ke=(_e.h+fe)%360;return _e.h=ke<0?360+ke:ke,D(_e)}function b(ne){var fe=D(ne).toHsl();return fe.h=(fe.h+180)%360,D(fe)}function h(ne){var fe=D(ne).toHsl(),_e=fe.h;return[D(ne),D({h:(_e+120)%360,s:fe.s,l:fe.l}),D({h:(_e+240)%360,s:fe.s,l:fe.l})]}function f(ne){var fe=D(ne).toHsl(),_e=fe.h;return[D(ne),D({h:(_e+90)%360,s:fe.s,l:fe.l}),D({h:(_e+180)%360,s:fe.s,l:fe.l}),D({h:(_e+270)%360,s:fe.s,l:fe.l})]}function C(ne){var fe=D(ne).toHsl(),_e=fe.h;return[D(ne),D({h:(_e+72)%360,s:fe.s,l:fe.l}),D({h:(_e+216)%360,s:fe.s,l:fe.l})]}function E(ne,fe,_e){fe=fe||6,_e=_e||30;var ke=D(ne).toHsl(),et=360/_e,je=[D(ne)];for(ke.h=(ke.h-(et*fe>>1)+720)%360;--fe;)ke.h=(ke.h+et)%360,je.push(D(ke));return je}function _(ne,fe){fe=fe||6;for(var _e=D(ne).toHsv(),ke=_e.h,et=_e.s,je=_e.v,ot=[],_t=1/fe;fe--;)ot.push(D({h:ke,s:et,v:je})),je=(je+_t)%1;return ot}D.mix=function(ne,fe,_e){_e=_e===0?0:_e||50;var ke=D(ne).toRgb(),et=D(fe).toRgb(),je=_e/100,ot={r:(et.r-ke.r)*je+ke.r,g:(et.g-ke.g)*je+ke.g,b:(et.b-ke.b)*je+ke.b,a:(et.a-ke.a)*je+ke.a};return D(ot)},D.readability=function(ne,fe){var _e=D(ne),ke=D(fe);return(Q.max(_e.getLuminance(),ke.getLuminance())+.05)/(Q.min(_e.getLuminance(),ke.getLuminance())+.05)},D.isReadable=function(ne,fe,_e){var ke=D.readability(ne,fe),et,je;je=!1,et=be(_e);switch(et.level+et.size){case"AAsmall":case"AAAlarge":je=ke>=4.5;break;case"AAlarge":je=ke>=3;break;case"AAAsmall":je=ke>=7;break}return je},D.mostReadable=function(ne,fe,_e){var ke=null,et=0,je,ot,_t,Re;_e=_e||{},ot=_e.includeFallbackColors,_t=_e.level,Re=_e.size;for(var Be=0;Be<fe.length;Be++)je=D.readability(ne,fe[Be]),je>et&&(et=je,ke=D(fe[Be]));return D.isReadable(ne,ke,{level:_t,size:Re})||!ot?ke:(_e.includeFallbackColors=!1,D.mostReadable(ne,["#fff","#000"],_e))};var W=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"},j=D.hexNames=w(W);function w(ne){var fe={};for(var _e in ne)ne.hasOwnProperty(_e)&&(fe[ne[_e]]=_e);return fe}function F(ne){return ne=parseFloat(ne),(isNaN(ne)||ne<0||ne>1)&&(ne=1),ne}function P(ne,fe){Y(ne)&&(ne="100%");var _e=ie(ne);return ne=$(fe,z(0,parseFloat(ne))),_e&&(ne=parseInt(ne*fe,10)/100),Q.abs(ne-fe)<1e-6?1:ne%fe/parseFloat(fe)}function v(ne){return $(1,z(0,ne))}function H(ne){return parseInt(ne,16)}function Y(ne){return typeof ne=="string"&&ne.indexOf(".")!=-1&&parseFloat(ne)===1}function ie(ne){return typeof ne=="string"&&ne.indexOf("%")!=-1}function le(ne){return ne.length==1?"0"+ne:""+ne}function he(ne){return ne<=1&&(ne=ne*100+"%"),ne}function xe(ne){return Q.round(parseFloat(ne)*255).toString(16)}function Le(ne){return H(ne)/255}var we=function(){var ne="[-\\+]?\\d+%?",fe="[-\\+]?\\d*\\.\\d+%?",_e="(?:"+fe+")|(?:"+ne+")",ke="[\\s|\\(]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")\\s*\\)?",et="[\\s|\\(]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")[,|\\s]+("+_e+")\\s*\\)?";return{CSS_UNIT:new RegExp(_e),rgb:new RegExp("rgb"+ke),rgba:new RegExp("rgba"+et),hsl:new RegExp("hsl"+ke),hsla:new RegExp("hsla"+et),hsv:new RegExp("hsv"+ke),hsva:new RegExp("hsva"+et),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 Ae(ne){return!!we.CSS_UNIT.exec(ne)}function pe(ne){ne=ne.replace(B,"").replace(J,"").toLowerCase();var fe=!1;if(W[ne])ne=W[ne],fe=!0;else if(ne=="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var _e;return(_e=we.rgb.exec(ne))?{r:_e[1],g:_e[2],b:_e[3]}:(_e=we.rgba.exec(ne))?{r:_e[1],g:_e[2],b:_e[3],a:_e[4]}:(_e=we.hsl.exec(ne))?{h:_e[1],s:_e[2],l:_e[3]}:(_e=we.hsla.exec(ne))?{h:_e[1],s:_e[2],l:_e[3],a:_e[4]}:(_e=we.hsv.exec(ne))?{h:_e[1],s:_e[2],v:_e[3]}:(_e=we.hsva.exec(ne))?{h:_e[1],s:_e[2],v:_e[3],a:_e[4]}:(_e=we.hex8.exec(ne))?{r:H(_e[1]),g:H(_e[2]),b:H(_e[3]),a:Le(_e[4]),format:fe?"name":"hex8"}:(_e=we.hex6.exec(ne))?{r:H(_e[1]),g:H(_e[2]),b:H(_e[3]),format:fe?"name":"hex"}:(_e=we.hex4.exec(ne))?{r:H(_e[1]+""+_e[1]),g:H(_e[2]+""+_e[2]),b:H(_e[3]+""+_e[3]),a:Le(_e[4]+""+_e[4]),format:fe?"name":"hex8"}:(_e=we.hex3.exec(ne))?{r:H(_e[1]+""+_e[1]),g:H(_e[2]+""+_e[2]),b:H(_e[3]+""+_e[3]),format:fe?"name":"hex"}:!1}function be(ne){var fe,_e;return ne=ne||{level:"AA",size:"small"},fe=(ne.level||"AA").toUpperCase(),_e=(ne.size||"small").toLowerCase(),fe!=="AA"&&fe!=="AAA"&&(fe="AA"),_e!=="small"&&_e!=="large"&&(_e="small"),{level:fe,size:_e}}It.exports?It.exports=D:!(te=function(){return D}.call(Oe,U,Oe,It),te!==void 0&&(It.exports=te))})(Math)},a99f:function(It,Oe,U){"use strict";U.r(Oe);var te=U("T2oS"),Q=U("W9HT"),B=U("14J3"),J=U("BMrR"),K=U("jCWc"),N=U("kPKH"),$=U("sPJy"),z=U("bE4q"),r=U("k1fw"),D=U("oBTY"),m=U("miYZ"),g=U("tsqr"),p=U("9og8"),a=U("tJVT"),c=U("WmNS"),s=U.n(c),i=U("q1tI"),t=U.n(i),u=U("Ty5D"),o=U("9kvl"),R=U("55Ip"),T=U("LvDl"),S=U("bbsP"),A=U("/wGt"),I=U("DjyN"),x=U("NUBc"),b=U("/zsF"),h=U("PArb"),f=U("5Dmo"),C=U("3S7+"),E=U("sRBo"),_=U("kaz8"),W=U("+L6B"),j=U("2/Rp"),w=U("5NDa"),F=U("5rEg"),P=U("xKgJ"),v=U("kCvp"),H=U.n(v),Y=U("NLgs"),ie=U("9z17"),le=F.a.Search,he=[{id:"type",name:"\u6765\u6E90",children:[{name:"\u5168\u90E8",id:"all",type:"type"},{name:"\u6211\u7684",id:"mine",type:"type"}]}],xe=[{id:"diff",name:"\u96BE\u5EA6",children:[{name:"\u5168\u90E8",id:"",type:"diff"},{name:"\u521D\u7EA7",id:1,type:"diff"},{name:"\u4E2D\u7EA7",id:2,type:"diff"},{name:"\u4E2D\u9AD8\u7EA7",id:3,type:"diff"},{name:"\u9AD8\u7EA7",id:4,type:"diff"}]}],Le=function(ue){var Fe,at=ue.classroomList,xt=ue.shixunsList,Kt=ue.dispatch,Xt=ue.callback,$t=ue.inNewPaperLibrary,$n=Object(i.useState)(Object(r.a)({},Object(u.i)())),vn=Object(a.a)($n,2),ln=vn[0],hn=vn[1],Gn=at.shixunLists,fr=Object(i.useState)([]),vr=Object(a.a)(fr,2),ir=vr[0],br=vr[1],Rr=Object(i.useState)(""),Jt=Object(a.a)(Rr,2),Ar=Jt[0],Nn=Jt[1],Tn=Object(i.useState)({page:1,type:"all",diff:"",status:"published",order:"desc",limit:20,sort:"publish_time",no_jupyter:1,keyword:""}),pr=Object(a.a)(Tn,2),_r=pr[0],Pr=pr[1];Object(i.useEffect)(function(){return at.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")}},[at.actionTabs.key]);var yr=at.actionTabs.key==="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE";Object(i.useEffect)(function(){yr&&Kt({type:"classroomList/getShixunLists",payload:Object(r.a)({},_r)})},[ln.categoryId,yr,_r]),Object(i.useEffect)(function(){Kt({type:"shixunsList/getMenus",payload:{}})},[]),Object(i.useEffect)(function(){br([])},[at.actionTabs.key]);var mt=Object(ie.b)(),Ke=Object(a.a)(mt,4),Ot=Ke[0],Me=Ke[1],ye=Ke[2],ve=Ke[3],or=function(gt,Ce,dn){_r.tag_level=gt,_r.sub_discipline_id=Ce,_r.discipline_id=dn,Pr(Object(r.a)({},_r))},en=function(){var Ie=Object(p.a)(s.a.mark(function gt(Ce){var dn,hr;return s.a.wrap(function(q){for(;;)switch(q.prev=q.next){case 0:Xt&&Xt(Gn==null||((dn=Gn.shixun_list)===null||dn===void 0)?void 0:dn.filter(function(O){return O.identifier===ir[0]})[0],(hr=at.actionTabs)===null||hr===void 0?void 0:hr.editData,Ce),Kt({type:"classroomList/setActionTabs",payload:{}}),Me();case 3:case"end":return q.stop()}},gt)}));return function(Ce){return Ie.apply(this,arguments)}}();return at.actionTabs.key!=="\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"?null:t.a.createElement(A.a,{title:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE",placement:"bottom",height:"100%",closable:!0,onClose:function(){Kt({type:"classroomList/setActionTabs",payload:{key:""}})},visible:!!yr,key:"bottom",className:H.a.drawer,footer:t.a.createElement("div",{className:"tc"},t.a.createElement(j.a,{size:"large",onClick:function(){Kt({type:"classroomList/setActionTabs",payload:{key:""}})},style:{marginRight:8}},"\u53D6\u6D88"),t.a.createElement(j.a,{size:"large",onClick:Object(p.a)(s.a.mark(function Ie(){var gt;return s.a.wrap(function(dn){for(;;)switch(dn.prev=dn.next){case 0:if(!(ir.length>1)){dn.next=4;break}g.b.error("\u53EA\u80FD\u9009\u62E9\u4E00\u4E2A\u5B9E\u8DF5\u9879\u76EE"),dn.next=16;break;case 4:if(!(ir.length===0)){dn.next=8;break}g.b.error("\u8BF7\u9009\u62E9\u5B9E\u8DF5\u9879\u76EE"),dn.next=16;break;case 8:if(!$t){dn.next=12;break}en(0),dn.next=16;break;case 12:return dn.next=14,ve({id:ir[0],course_id:ln.coursesId,type:"shixun"});case 14:gt=dn.sent,gt||en(0);case 16:case"end":return dn.stop()}},Ie)})),type:"primary"},"\u786E\u5B9A"))},t.a.createElement("section",{className:"tc"},t.a.createElement(le,{placeholder:"\u5B9E\u8BAD\u4FE1\u606F/\u9662\u6821\u540D\u79F0/\u521B\u5EFA\u8005",enterButton:"\u641C\u7D22",size:"large",value:Ar,onChange:function(gt){return Nn(gt.target.value)},className:H.a.search,onSearch:function(gt){_r.keyword=gt,_r.page=1,Pr(Object(r.a)({},_r))}})),t.a.createElement("section",{className:"edu-container"},he.map(function(Ie,gt){var Ce;return t.a.createElement("ul",{className:H.a.menu,key:gt},t.a.createElement("li",null,Ie.name),Ie==null||((Ce=Ie.children)===null||Ce===void 0)?void 0:Ce.map(function(dn,hr){return t.a.createElement("li",{key:hr,className:_r[Ie.id]==dn.id?H.a.actived:"",onClick:function(){_r[Ie.id]=dn.id,Pr(Object(r.a)({},_r)),Kt({type:"classroomList/getShixunLists",payload:Object(r.a)({},_r)})}},t.a.createElement("strong",null,dn.name))}))}),t.a.createElement("ul",{className:H.a.menut},t.a.createElement("span",{style:{padding:"18px",fontWeight:"600"}},"\u65B9\u5411\uFF1A"),t.a.createElement("li",{className:_r.discipline_id?"":H.a.actived3,onClick:function(){or(null,null,null)}},t.a.createElement("strong",null,"\u5168\u90E8")),xt.menus&&xt.menus.map(function(Ie,gt){return t.a.createElement("li",{key:gt,className:_r.discipline_id==Ie.id?H.a.actived3:""},t.a.createElement("strong",{onClick:function(){or(1,null,Ie.id)}},Ie.name),t.a.createElement("div",null,Ie.sub_repertoires.map(function(Ce,dn){return t.a.createElement("div",{key:dn,className:"mt5"},t.a.createElement("div",{className:_r.sub_discipline_id==Ce.id?"".concat(H.a.actived4," ").concat(H.a.subTag):H.a.subTag,onClick:function(){or(2,Ce.id,Ie.id)}},Ce.name),t.a.createElement("ul",{className:"mt5"},Ce.tags&&Ce.tags.map(function(hr,mr){return t.a.createElement("li",{key:mr,className:_r.sub_discipline_id==hr.id?H.a.actived4:"",onClick:function(){or(3,hr.id,Ie.id)}},hr.name)})))})))})),xe.map(function(Ie,gt){var Ce;return t.a.createElement("ul",{className:H.a.menu,key:gt},t.a.createElement("li",null,Ie.name),Ie==null||((Ce=Ie.children)===null||Ce===void 0)?void 0:Ce.map(function(dn,hr){return t.a.createElement("li",{key:hr,className:_r[Ie.id]==dn.id?H.a.actived:"",onClick:function(){_r[Ie.id]=dn.id,Pr(Object(r.a)({},_r)),Kt({type:"classroomList/getShixunLists",payload:Object(r.a)({},_r)})}},t.a.createElement("strong",null,dn.name))}))}),t.a.createElement("div",{className:H.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"},ir.length),"\u4E2A\u5B9E\u8BAD"),t.a.createElement("li",null,"\u5171",t.a.createElement("span",{className:"c-blue"},Gn.shixuns_count),"\u4E2A\u8BFE\u7A0B"),t.a.createElement("li",{className:"current",onClick:function(){_r.order=_r.order==="asc"?"desc":"asc",Pr(Object(r.a)({},_r))}},"\u5B66\u4E60\u4EBA\u6570",t.a.createElement("p",{className:"edu-sorter current ".concat(_r.order)},_r.order==="asc"?t.a.createElement("span",{className:"iconfont icon-sanjiaoxing-up"}):t.a.createElement("span",{className:"iconfont icon-sanjiaoxing-down"}))))),t.a.createElement(_.a.Group,{style:{display:"block"},value:ir,onChange:function(gt){br(gt)}},Gn==null||((Fe=Gn.shixun_list)===null||Fe===void 0)?void 0:Fe.map(function(Ie,gt){return t.a.createElement("div",{className:H.a.listItem,key:Ie.identifier},t.a.createElement(_.a,{value:Ie.identifier,disabled:Ie==null?void 0:Ie.need_authorize}),t.a.createElement("div",{className:H.a.info},t.a.createElement("div",{className:H.a.title},t.a.createElement("div",{className:H.a.titleLeft},t.a.createElement(R.a,{to:"/shixuns/".concat(Ie.identifier,"/challenges"),target:"_blank"},t.a.createElement("strong",{className:"font16",dangerouslySetInnerHTML:{__html:Ie.title}})),(Ie==null?void 0:Ie.need_authorize)&&t.a.createElement("span",{onClick:function(){Object(Y.a)(!1)},style:{marginRight:"auto"},className:"tag-style bg-pink current ml10"},"\u9700\u6388\u6743"),Object(P.v)()&&(Ie==null?void 0:Ie.mark_status)===1&&t.a.createElement(C.a,{title:Ie==null?void 0:Ie.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#2FA34F"},className:"tag-style current ml10"},"\u6B63\u5E38")),Object(P.v)()&&(Ie==null?void 0:Ie.mark_status)===2&&t.a.createElement(C.a,{title:Ie==null?void 0:Ie.mark_content},t.a.createElement("span",{style:{marginRight:"auto",background:"#FF8C29"},className:"tag-style current ml10"},"\u9700\u5B8C\u5584")),Object(P.v)()&&(Ie==null?void 0:Ie.mark_status)===3&&t.a.createElement(C.a,{title:Ie==null?void 0:Ie.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:H.a.description,dangerouslySetInnerHTML:{__html:Ie.description}})),t.a.createElement("div",{className:"flex-wrp mt15"},Ie.challenge_names.map(function(Ce,dn){return t.a.createElement("span",{key:dn,className:"mr30"},"\u7B2C",dn+1,"\u5173 ",Ce," ")})),t.a.createElement(h.a,{dashed:!0}),t.a.createElement("div",{className:"c-light-black mt20"},t.a.createElement("span",null,Ie.author_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,Ie.author_school_name),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u96BE\u5EA6\u7CFB\u6570 ",Ie.level),t.a.createElement("span",{className:"ml15 mr15"},"|"),t.a.createElement("span",null,"\u5B66\u4E60\u4EBA\u6570 "),t.a.createElement("span",null,Ie.study_count))))})),t.a.createElement("p",null)),t.a.createElement("div",{className:"tc"},t.a.createElement(x.a,{defaultCurrent:1,current:_r.page||1,hideOnSinglePage:!0,defaultPageSize:20,showQuickJumper:!0,showSizeChanger:!1,total:Gn==null?void 0:Gn.shixuns_count,onChange:function(gt){_r.page=gt,Pr(Object(r.a)({},_r)),br([])}})),t.a.createElement(ie.a,{visible:Ot,onCancel:Me,onOk:en,renderData:ye,inPaper:!0,modalType:"single",type:"shixun"}))},we=Object(o.a)(function(De){var ue=De.classroomList,Fe=De.shixunsList,at=De.user;return{classroomList:ue,shixunsList:Fe,user:at}})(Le),Ae=U("sZF6"),pe=U("2aBv"),be=U("zWo0"),ne=U.n(be),fe=U("LYsE"),_e=U("1vsH"),ke=U("vCeJ"),et=U("7Kak"),je=U("9yH6"),ot=U("giR+"),_t=U("fyUT"),Re=U("6UJt"),Be=U("DFOY"),Qe=U("rAM+"),Ve=U("y8nQ"),Et=U("Vl3Y"),kt=U("ZWs3"),Vt=function(ue){var Fe=ue.initValue,at=ue.courseOptions,xt=ue.setIsEdit,Kt=ue.setEditKey,Xt=ue.reload,$t=Et.a.useForm(),$n=Object(a.a)($t,1),vn=$n[0],ln=Object(u.i)(),hn=Object(i.useMemo)(function(){var Gn=Fe==null?void 0:Fe.sub_discipline_id,fr=[],vr=Object(Qe.a)(at),ir;try{for(vr.s();!(ir=vr.n()).done;){var br=ir.value,Rr=Object(Qe.a)(br.children),Jt;try{for(Rr.s();!(Jt=Rr.n()).done;){var Ar=Jt.value;Ar.value===Gn&&(fr=[br.value,Ar.value])}}catch(Tn){Rr.e(Tn)}finally{Rr.f()}}}catch(Tn){vr.e(Tn)}finally{vr.f()}var Nn=Fe.time;return Object(r.a)(Object(r.a)({},Fe),{},{sub_discipline_id:fr,time:Nn===-1?null:Nn})},[Fe,at]);return t.a.createElement(Et.a,{initialValues:hn,layout:"vertical",form:vn,className:ne.a.formWrap},t.a.createElement(Et.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(Be.a,{placeholder:"\u8BF7\u9009\u62E9...",options:at})),t.a.createElement(Et.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(F.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(Et.a.Item,{name:"time",label:"\u7B54\u9898\u65F6\u957F"},t.a.createElement(_t.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(Et.a.Item,{label:"\u96BE\u5EA6\uFF1A",name:"difficulty",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u96BE\u5EA6"}]},t.a.createElement(je.a.Group,null,t.a.createElement(je.a.Button,{value:1},"\u7B80\u5355"),t.a.createElement(je.a.Button,{value:2},"\u9002\u4E2D"),t.a.createElement(je.a.Button,{value:3},"\u56F0\u96BE"))),t.a.createElement(Et.a.Item,{label:"\u8BD5\u5377\u987B\u77E5\uFF1A",name:"exercise_description"},t.a.createElement(F.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(Et.a.Item,{className:"tr"},t.a.createElement(kt.a,{type:"primary",onClick:Object(p.a)(s.a.mark(function Gn(){var fr,vr;return s.a.wrap(function(br){for(;;)switch(br.prev=br.next){case 0:return br.next=2,vn.validateFields();case 2:return fr=vn.getFieldsValue(),fr.sub_discipline_id=fr.sub_discipline_id[1],br.next=6,Object(ke.z)(Object(r.a)({id:ln.id},fr));case 6:vr=br.sent,vr.status===0&&(xt(!1),Kt(-1),Xt());case 8:case"end":return br.stop()}},Gn)}))},"\u4FDD\u5B58"),t.a.createElement(j.a,{style:{marginLeft:10},onClick:function(){vn.resetFields(),xt(!1)}},"\u53D6\u6D88")))},Qt=Vt,an=U("g9YV"),sn=U("wCAj"),qe=U("+BqJ"),Ze=U.n(qe),Ct=U("9Bee"),At=function(ue){var Fe=ue.isPreview,at=Fe===void 0?!1:Fe,xt=ue.isExportBlank,Kt=xt===void 0?!1:xt,Xt=ue.newExercisePaper,$t=ue.setIsEdit,$n=Object(u.i)(),vn=Object(i.useState)(),ln=Object(a.a)(vn,2),hn=ln[0],Gn=ln[1],fr=Object(i.useState)(),vr=Object(a.a)(fr,2),ir=vr[0],br=vr[1],Rr=Object(i.useRef)(null),Jt=Object(i.useState)(21),Ar=Object(a.a)(Jt,2),Nn=Ar[0],Tn=Ar[1];Object(i.useEffect)(function(){pr()},[]),Object(i.useEffect)(function(){Rr.current&&Tn(Rr.current.clientHeight)},[Rr.current]),Object(i.useEffect)(function(){var mt;if((mt=Xt.exerciseExportHeadData)!==null&&mt!==void 0&&mt.title){var Ke=Xt.exerciseExportHeadData;Gn(Object(r.a)({},Ke||{}));var Ot=Ke||{},Me=Ot.table,ye,ve;(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)&&(ye=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.combination_scores)&&(ve=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.combination_scores));var or=[{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,mains_score:Me==null?void 0:Me.total_mains_scores,combinations_score:Me==null?void 0:Me.total_combination_scores,total_score:ye},{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:ve},{key:"3",name:"\u8BC4\u5377\u4EBA"}],en=[{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,mains_score:Me==null?void 0:Me.total_mains_scores,combinations_score:Me==null?void 0:Me.combination_scores,total_score:ye},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}];br(Object(D.a)(Kt?en:or))}},[Xt.exerciseExportHeadData]);var pr=function(){var mt=Object(p.a)(s.a.mark(function Ke(){var Ot,Me,ye,ve,or,en,Ie;return s.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return Ce.next=2,Object(ke.m)($n.id);case 2:Ot=Ce.sent,Gn(Ot||{}),Me=Ot||{},ye=Me.table,(ye!=null&&ye.total_singles_scores||ye!=null&&ye.total_doubles_scores||ye!=null&&ye.total_nulls_scores||ye!=null&&ye.total_judges_scores||ye!=null&&ye.total_pros_scores||ye!=null&&ye.total_shixuns_scores||ye!=null&&ye.total_mains_scores||ye!=null&&ye.total_combination_scores)&&(ve=Number(ye==null?void 0:ye.total_singles_scores)+Number(ye==null?void 0:ye.total_doubles_scores)+Number(ye==null?void 0:ye.total_nulls_scores)+Number(ye==null?void 0:ye.total_judges_scores)+Number(ye==null?void 0:ye.total_pros_scores)+Number(ye==null?void 0:ye.total_shixuns_scores)+Number(ye==null?void 0:ye.total_mains_scores)+Number(ye==null?void 0:ye.total_combination_scores)),(ye!=null&&ye.singles_scores||ye!=null&&ye.doubles_scores||ye!=null&&ye.nulls_scores||ye!=null&&ye.judges_scores||ye!=null&&ye.pros_scores||ye!=null&&ye.shixuns_scores||ye!=null&&ye.mains_scores||ye!=null&&ye.combinations_score)&&(or=Number(ye==null?void 0:ye.singles_scores)+Number(ye==null?void 0:ye.doubles_scores)+Number(ye==null?void 0:ye.nulls_scores)+Number(ye==null?void 0:ye.judges_scores)+Number(ye==null?void 0:ye.pros_scores)+Number(ye==null?void 0:ye.shixuns_scores)+Number(ye==null?void 0:ye.mains_scores)+Number(ye==null?void 0:ye.combinations_score)),en=[{key:"1",name:"\u5E94\u5F97\u5206",singles_score:ye==null?void 0:ye.total_singles_scores,doubles_score:ye==null?void 0:ye.total_doubles_scores,nulls_score:ye==null?void 0:ye.total_nulls_scores,judges_score:ye==null?void 0:ye.total_judges_scores,pros_score:ye==null?void 0:ye.total_pros_scores,shixuns_score:ye==null?void 0:ye.total_shixuns_scores,combinations_score:ye==null?void 0:ye.total_combination_scores,mains_score:ye==null?void 0:ye.total_mains_scores,total_score:ve},{key:"2",name:"\u5B9E\u5F97\u5206",singles_score:ye==null?void 0:ye.singles_scores,doubles_score:ye==null?void 0:ye.doubles_scores,nulls_score:ye==null?void 0:ye.nulls_scores,judges_score:ye==null?void 0:ye.judges_scores,pros_score:ye==null?void 0:ye.pros_scores,shixuns_score:ye==null?void 0:ye.shixuns_scores,mains_score:ye==null?void 0:ye.mains_scores,combinations_score:ye==null?void 0:ye.combination_scores,total_score:or},{key:"3",name:"\u8BC4\u5377\u4EBA"}],Ie=[{key:"1",name:"\u5E94\u5F97\u5206"},{key:"2",name:"\u5B9E\u5F97\u5206"},{key:"3",name:"\u8BC4\u5377\u4EBA"}],br(Kt?Ie:en);case 10:case"end":return Ce.stop()}},Ke)}));return function(){return mt.apply(this,arguments)}}(),_r=[{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)}}],Pr=hn||{},yr=Pr.exercise_header;return t.a.createElement(t.a.Fragment,null,t.a.createElement("section",{className:"".concat(Ze.a.wrap," ").concat(at?"pl20":""," ")},(hn==null?void 0:hn.photo_url)&&t.a.createElement("img",{className:Ze.a.img,src:hn==null?void 0:hn.photo_url}),t.a.createElement("div",{style:{width:"100%",textAlign:"end"}},t.a.createElement(j.a,{onClick:function(){return $t(!0)}},"\u7F16\u8F91\u8BD5\u5377")),(yr==null?void 0:yr.show_title)&&t.a.createElement("p",{className:"font16 tc c-grey-333"},t.a.createElement("strong",null,hn==null?void 0:hn.title)),(hn==null?void 0:hn.exercise_description)&&t.a.createElement("span",{ref:Rr,style:{justifyContent:Nn===21?"center":"left",wordBreak:"break-all",display:"flex",textAlign:"left",marginBottom:12},className:"tc c-grey-333"},"\u8BD5\u5377\u987B\u77E5\uFF1A".concat(hn==null?void 0:hn.exercise_description)),(yr==null?void 0:yr.show_info)&&t.a.createElement("p",{className:"tc c-grey-666"},"\u5171:\u3010",hn==null?void 0:hn.large_counts,"\u5927\u9898\u3011\u3010",hn==null?void 0:hn.total_count,"\u5C0F\u9898\u3011\u3010 \u6EE1\u5206",hn==null?void 0:hn.score,"\u5206\u3011 \u8003\u8BD5\u65F6\u95F4\uFF1A\u3010",(hn==null?void 0:hn.time)>-1?"".concat(hn==null?void 0:hn.time,"\u5206\u949F"):"\u4E0D\u9650","\u3011"),(yr==null?void 0:yr.show_desc)&&t.a.createElement("div",{className:"mt10"},t.a.createElement("p",{className:"font16"},"\u8003\u8BD5\u8BF4\u660E\uFF1A"),t.a.createElement(Ct.a,{value:hn==null?void 0:hn.description})),(yr==null?void 0:yr.show_table)&&t.a.createElement("div",{className:"mt10"},t.a.createElement(sn.a,{className:Ze.a.table,columns:_r,dataSource:Object(D.a)(ir||[]),bordered:!0,pagination:!1}))))},ct=Object(o.a)(function(De){var ue=De.newExercisePaper;return{newExercisePaper:ue}})(At),ft=U("VYcG"),He=function(ue){var Fe=ue.onImport,at=ue.questionType,xt=ue.onAdd,Kt=ue.onSort,Xt=ue.user,$t=Object(u.i)(),$n=function(){var vn=Object(p.a)(s.a.mark(function ln(){var hn,Gn;return s.a.wrap(function(vr){for(;;)switch(vr.prev=vr.next){case 0:return vr.next=2,Object(ke.h)($t.id);case 2:hn=vr.sent,hn.status===0&&o.d.push("/classrooms/coursesId/exercise/".concat(hn.exercise_id,"/").concat((Gn=Xt.userInfo)===null||Gn===void 0?void 0:Gn.login,"/initate_answer"));case 4:case"end":return vr.stop()}},ln)}));return function(){return vn.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:[ne.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(j.a,{style:{height:30,marginRight:10,width:104},type:"primary",onClick:function(){o.d.push("/paperlibrary/edit_select/".concat($t.id))}},"\u4ECE\u9898\u5E93\u4E2D\u9009\u62E9"),t.a.createElement(j.a,{style:{height:30,marginRight:27,width:104},type:"primary",onClick:Fe},"\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}},at.map(function(vn){return t.a.createElement("span",{key:vn.id,className:ne.a.button,onClick:function(){return xt(vn.id)}},t.a.createElement("i",{className:"iconfont icon-tianjiashitixiaojiahao mr5",style:{fontSize:"10px",color:"#B1BACD"}}),vn.name)})),t.a.createElement("div",{style:{marginRight:"25px",height:"30px",width:1,background:"#F5F5F5"}}),t.a.createElement(j.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},className:"mr8",onClick:Kt},t.a.createElement("i",{className:"iconfont icon-tixingpaixu mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u9898\u578B\u6392\u5E8F"),t.a.createElement(j.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},className:"mr8"},t.a.createElement(R.a,{to:"/paperlibrary/see/".concat($t.id)},t.a.createElement("i",{className:"iconfont icon-yulan mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u9884\u89C8")),t.a.createElement(j.a,{style:{width:96,height:30,border:"1px solid #98BDF7",color:"#145DFF"},onClick:Object(T.throttle)($n,3500)},t.a.createElement("i",{className:"iconfont icon-monikaoshi1 mr8",style:{fontSize:"14px",color:"#98BDF7"}}),"\u6A21\u62DF\u8003\u8BD5")))},Ne=Object(o.a)(function(De){var ue=De.user;return{user:ue}})(He),Ue=U("hQp1"),ge=function(ue){var Fe,at,xt,Kt=ue.exercise,Xt=ue.newExercisePaper,$t=ue.user,$n=ue.dispatch,vn=Object(u.i)(),ln=Object(i.useState)(!1),hn=Object(a.a)(ln,2),Gn=hn[0],fr=hn[1],vr=Object(i.useState)(!1),ir=Object(a.a)(vr,2),br=ir[0],Rr=ir[1],Jt=Object(i.useState)(-1),Ar=Object(a.a)(Jt,2),Nn=Ar[0],Tn=Ar[1],pr=Object(i.useRef)(),_r=[{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"}],Pr=Object(_e.I)();Object(i.useEffect)(function(){return $n({type:"globalSetting/footerToggle",payload:!1}),function(){$n({type:"globalSetting/footerToggle",payload:!0})}},[]),Object(i.useEffect)(function(){or()},[]);var yr=Object(ft.useCourseOptions)();Object(i.useEffect)(function(){var Z,Pe,st;if(Xt!=null&&(Z=Xt.editData)!==null&&Z!==void 0&&Z.exercise_question_types){var wt,Pt;ye(Object(T.cloneDeep)(Xt==null||((wt=Xt.editData)===null||wt===void 0)?void 0:wt.exercise_question_types)),ve.current=Object(T.cloneDeep)(Xt==null||((Pt=Xt.editData)===null||Pt===void 0)?void 0:Pt.exercise_question_types)}var dt=(Pe=Xt.editData)===null||Pe===void 0||((st=Pe.exercise)===null||st===void 0)?void 0:st.sub_discipline_id;dt&&mt(dt)},[Xt.editData]);var mt=function(){var Z=Object(p.a)(s.a.mark(function Pe(st){return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,$n({type:"newExercisePaper/getTagDiscipline",payload:{sub_discipline_id:st}});case 2:case"end":return Pt.stop()}},Pe)}));return function(st){return Z.apply(this,arguments)}}(),Ke=Object(i.useState)(),Ot=Object(a.a)(Ke,2),Me=Ot[0],ye=Ot[1],ve=Object(i.useRef)(Me),or=function(){var Z=Object(p.a)(s.a.mark(function Pe(){var st;return s.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:st=$n({type:"newExercisePaper/editExercise",payload:{id:vn.id}}),st.status===0&&ye(st.exercise_question_types);case 2:case"end":return Pt.stop()}},Pe)}));return function(){return Z.apply(this,arguments)}}(),en=function(){var Z=Object(p.a)(s.a.mark(function Pe(st){var wt,Pt,dt,bt,Mt,Cn,Yn;return s.a.wrap(function(fn){for(;;)switch(fn.prev=fn.next){case 0:if(!(Nn!==-1)){fn.next=3;break}return g.b.error("\u4E0D\u80FD\u540C\u65F6\u7F16\u8F91\u4E24\u9898"),fn.abrupt("return");case 3:if(!(st===Ue.a.Shixun)){fn.next=7;break}$n({type:"classroomList/setActionTabs",payload:{key:"\u9009\u7528\u5B9E\u8DF5\u9879\u76EE"}}),fn.next=21;break;case 7:if(!(st===Ue.a.Program)){fn.next=11;break}o.d.push("/problems/new?difficult=".concat((wt=Xt.editData)===null||wt===void 0||((Pt=wt.exercise)===null||Pt===void 0)?void 0:Pt.difficulty,"&sub_discipline_id=").concat((dt=Xt.editData)===null||dt===void 0||((bt=dt.exercise)===null||bt===void 0)?void 0:bt.sub_discipline_id,"&express_id=").concat(vn.id,"&callback_url=").concat(location.pathname)),fn.next=21;break;case 11:if(Cn=Me.find(function(Wt){return Wt.question_type===st}),Cn){fn.next=18;break}return ve.current=Object(T.cloneDeep)(Me),Me.push({name:_r.find(function(Wt){return Wt.id===st}).name,question_type:st,count:0,score:0,items:[{key:1,insert_id:1,question_type:st}]}),ye(Object(D.a)(Me)),Tn("".concat(st,"-",1)),fn.abrupt("return");case 18:setTimeout(function(){var Wt;(Wt=document.getElementById("".concat(st,"-").concat(Cn.count-1)))===null||Wt===void 0||Wt.scrollIntoView()},400),Yn={key:Cn.count,insert_id:(Mt=Cn.items[Cn.count])===null||Mt===void 0?void 0:Mt.question_id,question_type:st},gt(Yn);case 21:case"end":return fn.stop()}},Pe)}));return function(st){return Z.apply(this,arguments)}}(),Ie=function(){Tn(-1),ye(ve.current)},gt=function(){var Pe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(ve.current=Object(T.cloneDeep)(Me),Pe.question_type===Ue.a.Program){var st,wt,Pt,dt;return o.d.push("/problems/new?difficult=".concat((st=Xt.editData)===null||st===void 0||((wt=st.exercise)===null||wt===void 0)?void 0:wt.difficulty,"&sub_discipline_id=").concat((Pt=Xt.editData)===null||Pt===void 0||((dt=Pt.exercise)===null||dt===void 0)?void 0:dt.sub_discipline_id,"&express_id=").concat(vn.id,"&callback_url=").concat(location.pathname)),!1}Me.map(function(bt){if(bt.question_type===Pe.question_type){var Mt=Object(T.cloneDeep)(bt.items);Mt.splice(Pe==null?void 0:Pe.key,0,Object(r.a)({insert_id:Pe==null?void 0:Pe.insert_id},Pe)),bt.items=Mt}return bt}),ye(Object(D.a)(Me)),Tn("".concat(Pe.question_type,"-").concat(Pe.key+1))},Ce={ref:pr,editKey:Nn,hideAction:!1,cancelAdd:function(){return Ie()},setEditKey:function(Pe){return Tn(Pe)},addCallback:function(Pe){return gt(Pe)}},dn=Object(i.useState)(!1),hr=Object(a.a)(dn,2),mr=hr[0],q=hr[1],O=function(){var Z=Object(p.a)(s.a.mark(function Pe(st,wt){var Pt,dt;return s.a.wrap(function(Mt){for(;;)switch(Mt.prev=Mt.next){case 0:if(!(st.length===0)){Mt.next=4;break}return g.b.warn("\u8BF7\u4E0A\u4F20\u6587\u4EF6"),wt(),Mt.abrupt("return");case 4:return Mt.next=6,Object(ke.s)(vn.id,(Pt=st[0])===null||Pt===void 0?void 0:Pt.file);case 6:dt=Mt.sent,dt.status===0&&(g.b.success("\u6210\u529F\u5BFC\u5165".concat(dt==null?void 0:dt.success,"\u6761")),q(!1),or());case 8:case"end":return Mt.stop()}},Pe)}));return function(st,wt){return Z.apply(this,arguments)}}(),M=function(){var Z=Object(p.a)(s.a.mark(function Pe(st,wt){var Pt;return s.a.wrap(function(bt){for(;;)switch(bt.prev=bt.next){case 0:return bt.next=2,Object(ke.y)(vn.id,{question_type:st});case 2:Pt=bt.sent,(Pt==null?void 0:Pt.status)===0&&(g.b.success(Pt==null?void 0:Pt.message),Rr(!1),or()),wt();case 5:case"end":return bt.stop()}},Pe)}));return function(st,wt){return Z.apply(this,arguments)}}(),X=function(){if(Nn!==-1){g.b.error("\u8BF7\u5148\u4FDD\u5B58\u6216\u53D6\u6D88\u5F53\u524D\u6B63\u5728\u7F16\u8F91\u7684\u95EE\u9898\u3002");return}q(!0)},se=function(){var Z=Object(p.a)(s.a.mark(function Pe(st,wt,Pt){var dt,bt,Mt;return s.a.wrap(function(Yn){for(;;)switch(Yn.prev=Yn.next){case 0:return ve.current=Object(T.cloneDeep)(Me),dt=Me.findIndex(function(Hn){return Hn.question_type===Pt}),bt=Me,bt[dt].items=wt,ye(Object(D.a)(bt)),Yn.next=7,Object(ke.a)({id:vn.id,itemId:parseInt(st.draggableId),position:st.destination.index+1});case 7:Mt=Yn.sent;case 8:case"end":return Yn.stop()}},Pe)}));return function(st,wt,Pt){return Z.apply(this,arguments)}}();return t.a.createElement("div",null,t.a.createElement("section",{className:"edu-container minH500"},t.a.createElement(Q.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(z.a,{separator:">"},t.a.createElement(z.a.Item,null,t.a.createElement(R.a,{to:"/paperlibrary"},"\u8BD5\u5377\u5E93")),t.a.createElement(z.a.Item,null,"\u7F16\u8F91\u8BD5\u5377"))),t.a.createElement("aside",{className:"".concat(ne.a.title," mt20")},t.a.createElement(J.a,{style:{width:"100%"}},t.a.createElement(N.a,{flex:"1"},t.a.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91\u8BD5\u5377")),t.a.createElement(N.a,null,t.a.createElement(R.a,{className:"font16 c-light-black",to:(Pr==null?void 0:Pr.fromadd)==="1"?"/paperlibrary/add/".concat(vn.id):"/paperlibrary"},"\u8FD4\u56DE"))))),t.a.createElement("section",{className:[ne.a.bg,"pt30","pl30","pr30","pb60","mt20"].join(" ")},!Gn&&t.a.createElement(ct,{setIsEdit:fr,isExportBlank:!1}),Gn&&t.a.createElement(Qt,{initValue:(Fe=Xt.editData)===null||Fe===void 0?void 0:Fe.exercise,setIsEdit:fr,courseOptions:yr,reload:or,setEditKey:Tn})),Me&&t.a.createElement("section",{className:[ne.a.bg,"pt30","pl20","pr20","pb20","mt20"].join(" ")},t.a.createElement(fe.a,{inNewPaperLibrary:!0,data:Me,editorProps:Ce,isDragDisabled:Nn!==-1,onDragEnd:se,batchScore:["\u5355\u9009\u9898","\u591A\u9009\u9898","\u5224\u65AD\u9898","\u586B\u7A7A\u9898","\u7B80\u7B54\u9898","\u7F16\u7A0B\u9898"],reload:or})),t.a.createElement(we,{inNewPaperLibrary:!0,callback:function(Pe,st,wt){var Pt;ve.current=Object(T.cloneDeep)(Me);var dt={shixun:Pe.challenge_names.map(function(Cn){return{challenge_name:Cn,challenge_score:5}}),shixun_name:Pe==null||((Pt=Pe.title)===null||Pt===void 0)?void 0:Pt.replace(/<.*?>/gi,""),shixun_id:Pe.id,question_type:5,edit:!0,is_copy:wt};if(st&&(Me.map(function(Cn){if(Cn.question_type===5){var Yn=Object(T.cloneDeep)(Cn.items);Yn.splice(st==null?void 0:st.key,0,dt),Cn.items=Yn}return Cn}),Tn("5-".concat(Me.key+1)),ye(Object(D.a)(Me))),!st){var bt,Mt=Me.find(function(Cn){return Cn.question_type===5});if(!Mt){Me.push({name:_r.find(function(Cn){return Cn.id===5}).name,question_type:5,count:0,score:0,items:[dt]}),ye(Object(D.a)(Me)),Tn("".concat(5,"-",1));return}(bt=document.getElementById("".concat(5,"-",Mt.count-1)))===null||bt===void 0||bt.scrollIntoView({block:"center",inline:"nearest"}),Mt.items.push(dt),ye(Object(D.a)(Me)),Tn("".concat(5,"-",Mt.count))}}})),t.a.createElement(Ae.a,{visible:mr,onCancel:function(){return q(!1)},onOk:O}),t.a.createElement(pe.a,{visible:br,onCancel:function(){return Rr(!1)},onOk:M,data:(at=Xt.editData)===null||at===void 0||((xt=at.exercise)===null||xt===void 0)?void 0:xt.sort_by_qustion_type})),t.a.createElement(Ne,{questionType:_r,onAdd:en,onImport:X,onSort:function(){return Rr(!0)}}))},Ee=Oe.default=Object(o.a)(function(De){var ue=De.exercise,Fe=De.newExercisePaper,at=De.user;return{exercise:ue,user:at,newExercisePaper:Fe}})(ge)},bT9E:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return Q});var te=U("VTBJ");function Q(B,J){var K=Object(te.a)({},B);return Array.isArray(J)&&J.forEach(function(N){delete K[N]}),K}},biw7:function(It,Oe,U){"use strict";var te=U("q1tI"),Q=U.n(te),B=te.createContext(null);Oe.a=B},c5Ni:function(It,Oe,U){},dejd:function(It,Oe,U){},dmUQ:function(It,Oe,U){"use strict";var te=U("Ff2n"),Q=U("rePB"),B=U("1OyB"),J=U("vuIU"),K=U("Ji7U"),N=U("md7G"),$=U("foSv"),z=U("q1tI"),r=U.n(z),D=U("TSYQ"),m=U.n(D),g=U("4IlW");function p(h,f){var C=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);f&&(E=E.filter(function(_){return Object.getOwnPropertyDescriptor(h,_).enumerable})),C.push.apply(C,E)}return C}function a(h){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?p(Object(C),!0).forEach(function(E){Object(Q.a)(h,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(C)):p(Object(C)).forEach(function(E){Object.defineProperty(h,E,Object.getOwnPropertyDescriptor(C,E))})}return h}function c(h){var f=s();return function(){var E=Object($.a)(h),_;if(f){var W=Object($.a)(this).constructor;_=Reflect.construct(E,arguments,W)}else _=E.apply(this,arguments);return Object(N.a)(this,_)}}function s(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],function(){})),!0}catch(h){return!1}}function i(){}function t(h){h.preventDefault()}var u=function(f){return f.replace(/[^\w.-]+/g,"")},o=200,R=600,T=Number.MAX_SAFE_INTEGER||Math.pow(2,53)-1,S=function(f){return f!=null},A=function(f,C){return C===f||typeof C=="number"&&typeof f=="number"&&isNaN(C)&&isNaN(f)},I=function(h){Object(K.a)(C,h);var f=c(C);function C(E){var _;Object(B.a)(this,C),_=f.call(this,E),_.onKeyDown=function(w){var F=_.props,P=F.onKeyDown,v=F.onPressEnter;if(w.keyCode===g.a.UP){var H=_.getRatio(w);_.up(w,H,null),_.stop()}else if(w.keyCode===g.a.DOWN){var Y=_.getRatio(w);_.down(w,Y,null),_.stop()}else w.keyCode===g.a.ENTER&&v&&v(w);if(_.recordCursorPosition(),_.lastKeyCode=w.keyCode,P){for(var ie=arguments.length,le=new Array(ie>1?ie-1:0),he=1;he<ie;he++)le[he-1]=arguments[he];P.apply(void 0,[w].concat(le))}},_.onKeyUp=function(w){var F=_.props.onKeyUp;if(_.stop(),_.recordCursorPosition(),F){for(var P=arguments.length,v=new Array(P>1?P-1:0),H=1;H<P;H++)v[H-1]=arguments[H];F.apply(void 0,[w].concat(v))}},_.onChange=function(w){var F=_.props.onChange;_.state.focused&&(_.inputting=!0),_.rawInput=_.props.parser(_.getValueFromEvent(w)),_.setState({inputValue:_.rawInput}),F(_.toNumber(_.rawInput))},_.onMouseUp=function(){var w=_.props.onMouseUp;_.recordCursorPosition(),w&&w.apply(void 0,arguments)},_.onFocus=function(){var w;_.setState({focused:!0}),(w=_.props).onFocus.apply(w,arguments)},_.onBlur=function(){var w=_.props.onBlur;_.inputting=!1,_.setState({focused:!1});var F=_.getCurrentValidValue(_.state.inputValue),P=_.setValue(F,i);if(w){var v=_.input.value,H=_.getInputDisplayValue({focus:!1,value:P});_.input.value=H&&Number(H),w.apply(void 0,arguments),_.input.value=v}},_.getRatio=function(w){var F=1;return w.metaKey||w.ctrlKey?F=.1:w.shiftKey&&(F=10),F},_.getFullNum=function(w){return isNaN(w)?w:/e/i.test(String(w))?Number(w).toFixed(18).replace(/\.?0+$/,""):w},_.getPrecision=function(w){if(S(_.props.precision))return _.props.precision;var F=String(w);if(F.indexOf("e-")>=0)return parseInt(F.slice(F.indexOf("e-")+2),10);var P=0;return F.indexOf(".")>=0&&(P=F.length-F.indexOf(".")-1),P},_.getInputDisplayValue=function(w){var F=w||_.state,P=F.focused,v=F.inputValue,H=F.value,Y;P?Y=v:Y=_.toPrecisionAsStep(H),Y==null&&(Y="");var ie=_.formatWrapper(Y);return S(_.props.decimalSeparator)&&(ie=ie.toString().replace(".",_.props.decimalSeparator)),ie},_.recordCursorPosition=function(){try{_.cursorStart=_.input.selectionStart,_.cursorEnd=_.input.selectionEnd,_.currentValue=_.input.value,_.cursorBefore=_.input.value.substring(0,_.cursorStart),_.cursorAfter=_.input.value.substring(_.cursorEnd)}catch(w){}},_.restoreByAfter=function(w){if(w===void 0)return!1;var F=_.input.value,P=F.lastIndexOf(w);if(P===-1)return!1;var v=_.cursorBefore.length;return _.lastKeyCode===g.a.DELETE&&_.cursorBefore.charAt(v-1)===w[0]?(_.fixCaret(v,v),!0):P+w.length===F.length?(_.fixCaret(P,P),!0):!1},_.partRestoreByAfter=function(w){return w===void 0?!1:Array.prototype.some.call(w,function(F,P){var v=w.substring(P);return _.restoreByAfter(v)})},_.isNotCompleteNumber=function(w){return isNaN(w)||w===""||w===null||w&&w.toString().indexOf(".")===w.toString().length-1},_.stop=function(){_.autoStepTimer&&clearTimeout(_.autoStepTimer)},_.down=function(w,F,P){_.pressingUpOrDown=!0,_.step("down",w,F,P)},_.up=function(w,F,P){_.pressingUpOrDown=!0,_.step("up",w,F,P)},_.saveInput=function(w){_.input=w};var W=E.value;W===void 0&&(W=E.defaultValue),_.state={focused:E.autoFocus};var j=_.getValidValue(_.toNumber(W));return _.state=a(a({},_.state),{},{inputValue:_.toPrecisionAsStep(j),value:j}),_}return Object(J.a)(C,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(_){var W=this.props,j=W.value,w=W.onChange,F=W.max,P=W.min,v=this.state.focused;if(_){if(!A(_.value,j)||!A(_.max,F)||!A(_.min,P)){var H=v?j:this.getValidValue(j),Y;this.pressingUpOrDown?Y=H:this.inputting?Y=this.rawInput:Y=this.toPrecisionAsStep(H),this.setState({value:H,inputValue:Y})}var ie="value"in this.props?j:this.state.value;"max"in this.props&&_.max!==F&&typeof ie=="number"&&ie>F&&w&&w(F),"min"in this.props&&_.min!==P&&typeof ie=="number"&&ie<P&&w&&w(P)}try{if(this.cursorStart!==void 0&&this.state.focused){if(!this.partRestoreByAfter(this.cursorAfter)&&this.state.value!==this.props.value){var le=this.cursorStart+1;this.cursorAfter?this.lastKeyCode===g.a.BACKSPACE?le=this.cursorStart-1:this.lastKeyCode===g.a.DELETE&&(le=this.cursorStart):le=this.input.value.length,this.fixCaret(le,le)}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(he){}if(this.lastKeyCode=null,!this.pressingUpOrDown)return;this.props.focusOnUpDown&&this.state.focused&&(document.activeElement!==this.input&&this.focus())}},{key:"componentWillUnmount",value:function(){this.stop()}},{key:"getCurrentValidValue",value:function(_){var W=_;return W===""?W="":this.isNotCompleteNumber(parseFloat(W))?W=this.state.value:W=this.getValidValue(W),this.toNumber(W)}},{key:"getValueFromEvent",value:function(_){var W=_.target.value.trim().replace(/。/g,".");return S(this.props.decimalSeparator)&&(W=W.replace(this.props.decimalSeparator,".")),W}},{key:"getValidValue",value:function(_){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.props.min,j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,w=parseFloat(_);return isNaN(w)?_:(w<W&&(w=W),w>j&&(w=j),w)}},{key:"setValue",value:function(_,W){var j=this.props.precision,w=this.isNotCompleteNumber(parseFloat(_))?null:parseFloat(_),F=this.state.value,P=F===void 0?null:F,v=this.state.inputValue,H=v===void 0?null:v,Y=typeof w=="number"?w.toFixed(j):"".concat(w),ie=w!==P||Y!=="".concat(H);return"value"in this.props?(H=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:H},W)):this.setState({value:w,inputValue:this.toPrecisionAsStep(_)},W),ie&&this.props.onChange(w),w}},{key:"getMaxPrecision",value:function(_){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.props,w=j.precision,F=j.step;if(S(w))return w;var P=this.getPrecision(W),v=this.getPrecision(F),H=this.getPrecision(_);return _?Math.max(H,P+v):P+v}},{key:"getPrecisionFactor",value:function(_){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,j=this.getMaxPrecision(_,W);return Math.pow(10,j)}},{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(_){return this.props.formatter?this.props.formatter(_):_}},{key:"toPrecisionAsStep",value:function(_){if(this.isNotCompleteNumber(_)||_==="")return _;var W=Math.abs(this.getMaxPrecision(_));return isNaN(W)?_.toString():Number(_).toFixed(W)}},{key:"toNumber",value:function(_){var W=this.props.precision,j=this.state.focused,w=_&&_.length>16&&j;return this.isNotCompleteNumber(_)||w?_:S(W)?Math.round(_*Math.pow(10,W))/Math.pow(10,W):Number(_)}},{key:"upStep",value:function(_,W){var j=this.props.step,w=this.getPrecisionFactor(_,W),F=Math.abs(this.getMaxPrecision(_,W)),P=((w*_+w*j*W)/w).toFixed(F);return this.toNumber(P)}},{key:"downStep",value:function(_,W){var j=this.props.step,w=this.getPrecisionFactor(_,W),F=Math.abs(this.getMaxPrecision(_,W)),P=((w*_-w*j*W)/w).toFixed(F);return this.toNumber(P)}},{key:"step",value:function(_,W){var j=this,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,F=arguments.length>3?arguments[3]:void 0;this.stop(),W&&(W.persist(),W.preventDefault());var P=this.props;if(P.disabled)return;var v=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(v))return;var H=this["".concat(_,"Step")](v,w),Y=H>P.max||H<P.min;if(H>P.max?H=P.max:H<P.min&&(H=P.min),this.setValue(H,null),this.setState({focused:!0},function(){j.pressingUpOrDown=!1}),Y)return;this.autoStepTimer=setTimeout(function(){j[_](W,w,!0)},F?o:R)}},{key:"fixCaret",value:function(_,W){if(_===void 0||W===void 0||!this.input||!this.input.value)return;try{var j=this.input.selectionStart,w=this.input.selectionEnd;(_!==j||W!==w)&&this.input.setSelectionRange(_,W)}catch(F){}}},{key:"render",value:function(){var _,W=this.props,j=W.prefixCls,w=W.disabled,F=W.readOnly,P=W.useTouch,v=W.autoComplete,H=W.upHandler,Y=W.downHandler,ie=W.className,le=W.max,he=W.min,xe=W.style,Le=W.title,we=W.onMouseEnter,Ae=W.onMouseLeave,pe=W.onMouseOver,be=W.onMouseOut,ne=W.required,fe=W.onClick,_e=W.tabIndex,ke=W.type,et=W.placeholder,je=W.id,ot=W.inputMode,_t=W.pattern,Re=W.step,Be=W.maxLength,Qe=W.autoFocus,Ve=W.name,Et=W.onPaste,kt=W.onInput,Vt=Object(te.a)(W,["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"]),Qt=this.state,an=Qt.value,sn=Qt.focused,qe=m()(j,(_={},Object(Q.a)(_,ie,!!ie),Object(Q.a)(_,"".concat(j,"-disabled"),w),Object(Q.a)(_,"".concat(j,"-focused"),sn),_)),Ze={};Object.keys(Vt).forEach(function(ue){(ue.substr(0,5)==="data-"||ue.substr(0,5)==="aria-"||ue==="role")&&(Ze[ue]=Vt[ue])});var Ct=!F&&!w,At=this.getInputDisplayValue(null),ct=(an||an===0)&&(isNaN(an)||Number(an)>=le),ft=(an||an===0)&&(isNaN(an)||Number(an)<=he),He=ct||w||F,Ne=ft||w||F,Ue=m()("".concat(j,"-handler"),"".concat(j,"-handler-up"),Object(Q.a)({},"".concat(j,"-handler-up-disabled"),He)),ge=m()("".concat(j,"-handler"),"".concat(j,"-handler-down"),Object(Q.a)({},"".concat(j,"-handler-down-disabled"),Ne)),Ee=P?{onTouchStart:He?i:this.up,onTouchEnd:this.stop}:{onMouseDown:He?i:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},De=P?{onTouchStart:Ne?i:this.down,onTouchEnd:this.stop}:{onMouseDown:Ne?i:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return r.a.createElement("div",{className:qe,style:xe,title:Le,onMouseEnter:we,onMouseLeave:Ae,onMouseOver:pe,onMouseOut:be,onFocus:function(){return null},onBlur:function(){return null}},r.a.createElement("div",{className:"".concat(j,"-handler-wrap")},r.a.createElement("span",Object.assign({unselectable:"on"},Ee,{role:"button","aria-label":"Increase Value","aria-disabled":He,className:Ue}),H||r.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-up-inner"),onClick:t})),r.a.createElement("span",Object.assign({unselectable:"on"},De,{role:"button","aria-label":"Decrease Value","aria-disabled":Ne,className:ge}),Y||r.a.createElement("span",{unselectable:"on",className:"".concat(j,"-handler-down-inner"),onClick:t}))),r.a.createElement("div",{className:"".concat(j,"-input-wrap")},r.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":he,"aria-valuemax":le,"aria-valuenow":an,required:ne,type:ke,placeholder:et,onPaste:Et,onClick:fe,onMouseUp:this.onMouseUp,className:"".concat(j,"-input"),tabIndex:_e,autoComplete:v,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:Ct?this.onKeyDown:i,onKeyUp:Ct?this.onKeyUp:i,autoFocus:Qe,maxLength:Be,readOnly:F,disabled:w,max:le,min:he,step:Re,name:Ve,title:Le,id:je,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(At),pattern:_t,inputMode:ot,onInput:kt},Ze))))}}]),C}(r.a.Component);I.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:T,min:-T,step:1,style:{},onChange:i,onKeyDown:i,onPressEnter:i,onFocus:i,onBlur:i,parser:u,required:!1,autoComplete:"off"};var x=I,b=Oe.a=x},fcSX:function(It,Oe,U){"use strict";var te=U("Ff2n"),Q=U("1OyB"),B=U("vuIU"),J=U("Ji7U"),K=U("md7G"),N=U("foSv"),$=U("1W/9"),z=U("q1tI"),r=U("rePB"),D=U("JX7q"),m=U("TSYQ"),g=U.n(m),p=U("qx4F"),a=U("4IlW");function c(w){return Array.isArray(w)?w:[w]}var s={transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend"},i=Object.keys(s).filter(function(w){if(typeof document=="undefined")return!1;var F=document.getElementsByTagName("html")[0];return w in(F?F.style:{})})[0],t=s[i];function u(w,F,P,v){w.addEventListener?w.addEventListener(F,P,v):w.attachEvent&&w.attachEvent("on".concat(F),P)}function o(w,F,P,v){w.removeEventListener?w.removeEventListener(F,P,v):w.attachEvent&&w.detachEvent("on".concat(F),P)}function R(w,F){var P=typeof w=="function"?w(F):w;return Array.isArray(P)?P.length===2?P:[P[0],P[1]]:[P]}var T=function(F){return!isNaN(parseFloat(F))&&isFinite(F)},S=!(typeof window!="undefined"&&window.document&&window.document.createElement),A=function w(F,P,v,H){if(!P||P===document||P instanceof Document)return!1;if(P===F.parentNode)return!0;var Y=Math.max(Math.abs(v),Math.abs(H))===Math.abs(H),ie=Math.max(Math.abs(v),Math.abs(H))===Math.abs(v),le=P.scrollHeight-P.clientHeight,he=P.scrollWidth-P.clientWidth,xe=document.defaultView.getComputedStyle(P),Le=xe.overflowY==="auto"||xe.overflowY==="scroll",we=xe.overflowX==="auto"||xe.overflowX==="scroll",Ae=le&&Le,pe=he&&we;return Y&&(!Ae||Ae&&(P.scrollTop>=le&&H<0||P.scrollTop<=0&&H>0))||ie&&(!pe||pe&&(P.scrollLeft>=he&&v<0||P.scrollLeft<=0&&v>0))?w(F,P.parentNode,v,H):!1};function I(w){var F=x();return function(){var v=Object(N.a)(w),H;if(F){var Y=Object(N.a)(this).constructor;H=Reflect.construct(v,arguments,Y)}else H=v.apply(this,arguments);return Object(K.a)(this,H)}}function x(){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(w){return!1}}var b={},h=function(w){Object(J.a)(P,w);var F=I(P);function P(v){var H;return Object(Q.a)(this,P),H=F.call(this,v),H.domFocus=function(){H.dom&&H.dom.focus()},H.removeStartHandler=function(Y){if(Y.touches.length>1)return;H.startPos={x:Y.touches[0].clientX,y:Y.touches[0].clientY}},H.removeMoveHandler=function(Y){if(Y.changedTouches.length>1)return;var ie=Y.currentTarget,le=Y.changedTouches[0].clientX-H.startPos.x,he=Y.changedTouches[0].clientY-H.startPos.y;(ie===H.maskDom||ie===H.handlerDom||ie===H.contentDom&&A(ie,Y.target,le,he))&&Y.cancelable&&Y.preventDefault()},H.transitionEnd=function(Y){var ie=Y.target;o(ie,t,H.transitionEnd),ie.style.transition=""},H.onKeyDown=function(Y){if(Y.keyCode===a.a.ESC){var ie=H.props.onClose;Y.stopPropagation(),ie&&ie(Y)}},H.onWrapperTransitionEnd=function(Y){var ie=H.props,le=ie.open,he=ie.afterVisibleChange;Y.target===H.contentWrapper&&Y.propertyName.match(/transform$/)&&(H.dom.style.transition="",!le&&H.getCurrentDrawerSome()&&(document.body.style.overflowX="",H.maskDom&&(H.maskDom.style.left="",H.maskDom.style.width="")),he&&he(!!le))},H.openLevelTransition=function(){var Y=H.props,ie=Y.open,le=Y.width,he=Y.height,xe=H.getHorizontalBoolAndPlacementName(),Le=xe.isHorizontal,we=xe.placementName,Ae=H.contentDom?H.contentDom.getBoundingClientRect()[Le?"width":"height"]:0,pe=(Le?le:he)||Ae;H.setLevelAndScrolling(ie,we,pe)},H.setLevelTransform=function(Y,ie,le,he){var xe=H.props,Le=xe.placement,we=xe.levelMove,Ae=xe.duration,pe=xe.ease,be=xe.showMask;H.levelDom.forEach(function(ne){ne.style.transition="transform ".concat(Ae," ").concat(pe),u(ne,t,H.transitionEnd);var fe=Y?le:0;if(we){var _e=R(we,{target:ne,open:Y});fe=Y?_e[0]:_e[1]||0}var ke=typeof fe=="number"?"".concat(fe,"px"):fe,et=Le==="left"||Le==="top"?ke:"-".concat(ke);et=be&&Le==="right"&&he?"calc(".concat(et," + ").concat(he,"px)"):et,ne.style.transform=fe?"".concat(ie,"(").concat(et,")"):""})},H.setLevelAndScrolling=function(Y,ie,le){var he=H.props.onChange;if(!S){var xe=document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth?Object(p.a)(!0):0;H.setLevelTransform(Y,ie,le,xe),H.toggleScrollingToDrawerAndBody(xe)}he&&he(Y)},H.toggleScrollingToDrawerAndBody=function(Y){var ie=H.props,le=ie.getOpenCount,he=ie.getContainer,xe=ie.showMask,Le=ie.open,we=he&&he(),Ae=le&&le();if(we&&we.parentNode===document.body&&xe){var pe=["touchstart"],be=[document.body,H.maskDom,H.handlerDom,H.contentDom];Le&&document.body.style.overflow!=="hidden"?(Y&&H.addScrollingEffect(Y),Ae===1&&(document.body.style.overflow="hidden"),document.body.style.touchAction="none",be.forEach(function(ne,fe){if(!ne)return;u(ne,pe[fe]||"touchmove",fe?H.removeMoveHandler:H.removeStartHandler,H.passive)})):H.getCurrentDrawerSome()&&(Ae||(document.body.style.overflow=""),document.body.style.touchAction="",Y&&H.remScrollingEffect(Y),be.forEach(function(ne,fe){if(!ne)return;o(ne,pe[fe]||"touchmove",fe?H.removeMoveHandler:H.removeStartHandler,H.passive)}))}},H.addScrollingEffect=function(Y){var ie=H.props,le=ie.placement,he=ie.duration,xe=ie.ease,Le=ie.getOpenCount,we=ie.switchScrollingEffect,Ae=Le&&Le();Ae===1&&we();var pe="width ".concat(he," ").concat(xe),be="transform ".concat(he," ").concat(xe);H.dom.style.transition="none";switch(le){case"right":H.dom.style.transform="translateX(-".concat(Y,"px)");break;case"top":case"bottom":H.dom.style.width="calc(100% - ".concat(Y,"px)"),H.dom.style.transform="translateZ(0)";break;default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(be,",").concat(pe),H.dom.style.width="",H.dom.style.transform="")})},H.remScrollingEffect=function(Y){var ie=H.props,le=ie.placement,he=ie.duration,xe=ie.ease,Le=ie.getOpenCount,we=ie.switchScrollingEffect,Ae=Le&&Le();Ae||we(!0),i&&(document.body.style.overflowX="hidden"),H.dom.style.transition="none";var pe,be="width ".concat(he," ").concat(xe),ne="transform ".concat(he," ").concat(xe);switch(le){case"left":{H.dom.style.width="100%",be="width 0s ".concat(xe," ").concat(he);break}case"right":{H.dom.style.transform="translateX(".concat(Y,"px)"),H.dom.style.width="100%",be="width 0s ".concat(xe," ").concat(he),H.maskDom&&(H.maskDom.style.left="-".concat(Y,"px"),H.maskDom.style.width="calc(100% + ".concat(Y,"px)"));break}case"top":case"bottom":{H.dom.style.width="calc(100% + ".concat(Y,"px)"),H.dom.style.height="100%",H.dom.style.transform="translateZ(0)",pe="height 0s ".concat(xe," ").concat(he);break}default:break}clearTimeout(H.timeout),H.timeout=setTimeout(function(){H.dom&&(H.dom.style.transition="".concat(ne,",").concat(pe?"".concat(pe,","):"").concat(be),H.dom.style.transform="",H.dom.style.width="",H.dom.style.height="")})},H.getCurrentDrawerSome=function(){return!Object.keys(b).some(function(Y){return b[Y]})},H.getLevelDom=function(Y){var ie=Y.level,le=Y.getContainer;if(S)return;var he=le&&le(),xe=he?he.parentNode:null;if(H.levelDom=[],ie==="all"){var Le=xe?Array.prototype.slice.call(xe.children):[];Le.forEach(function(we){we.nodeName!=="SCRIPT"&&we.nodeName!=="STYLE"&&we.nodeName!=="LINK"&&we!==he&&H.levelDom.push(we)})}else ie&&c(ie).forEach(function(we){document.querySelectorAll(we).forEach(function(Ae){H.levelDom.push(Ae)})})},H.getHorizontalBoolAndPlacementName=function(){var Y=H.props.placement,ie=Y==="left"||Y==="right",le="translate".concat(ie?"X":"Y");return{isHorizontal:ie,placementName:le}},H.state={_self:Object(D.a)(H)},H}return Object(B.a)(P,[{key:"componentDidMount",value:function(){var H=this;if(!S){var Y=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:function(){return Y=!0,null}}))}catch(Le){}this.passive=Y?{passive:!1}:!1}var ie=this.props,le=ie.open,he=ie.getContainer,xe=he&&he();this.drawerId="drawer_id_".concat(Number((Date.now()+Math.random()).toString().replace(".",Math.round(Math.random()*9).toString())).toString(16)),this.getLevelDom(this.props),le&&(xe&&xe.parentNode===document.body&&(b[this.drawerId]=le),this.openLevelTransition(),this.forceUpdate(function(){H.domFocus()}))}},{key:"componentDidUpdate",value:function(H){var Y=this.props,ie=Y.open,le=Y.getContainer,he=le&&le();ie!==H.open&&(ie&&this.domFocus(),he&&he.parentNode===document.body&&(b[this.drawerId]=!!ie),this.openLevelTransition())}},{key:"componentWillUnmount",value:function(){var H=this.props,Y=H.getOpenCount,ie=H.open,le=H.switchScrollingEffect,he=typeof Y=="function"&&Y();delete b[this.drawerId],ie&&(this.setLevelTransform(!1),document.body.style.touchAction=""),he||(document.body.style.overflow="",le(!0))}},{key:"render",value:function(){var H,Y=this,ie=this.props,le=ie.className,he=ie.children,xe=ie.style,Le=ie.width,we=ie.height,Ae=ie.defaultOpen,pe=ie.open,be=ie.prefixCls,ne=ie.placement,fe=ie.level,_e=ie.levelMove,ke=ie.ease,et=ie.duration,je=ie.getContainer,ot=ie.handler,_t=ie.onChange,Re=ie.afterVisibleChange,Be=ie.showMask,Qe=ie.maskClosable,Ve=ie.maskStyle,Et=ie.onClose,kt=ie.onHandleClick,Vt=ie.keyboard,Qt=ie.getOpenCount,an=ie.switchScrollingEffect,sn=Object(te.a)(ie,["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"]),qe=this.dom?pe:!1,Ze=g()(be,(H={},Object(r.a)(H,"".concat(be,"-").concat(ne),!0),Object(r.a)(H,"".concat(be,"-open"),qe),Object(r.a)(H,le||"",!!le),Object(r.a)(H,"no-mask",!Be),H)),Ct=this.getHorizontalBoolAndPlacementName(),At=Ct.placementName,ct=ne==="left"||ne==="top"?"-100%":"100%",ft=qe?"":"".concat(At,"(").concat(ct,")"),He=ot&&z.cloneElement(ot,{onClick:function(Ue){ot.props.onClick&&ot.props.onClick(),kt&&kt(Ue)},ref:function(Ue){Y.handlerDom=Ue}});return z.createElement("div",Object.assign({},sn,{tabIndex:-1,className:Ze,style:xe,ref:function(Ue){Y.dom=Ue},onKeyDown:qe&&Vt?this.onKeyDown:void 0,onTransitionEnd:this.onWrapperTransitionEnd}),Be&&z.createElement("div",{className:"".concat(be,"-mask"),onClick:Qe?Et:void 0,style:Ve,ref:function(Ue){Y.maskDom=Ue}}),z.createElement("div",{className:"".concat(be,"-content-wrapper"),style:{transform:ft,msTransform:ft,width:T(Le)?"".concat(Le,"px"):Le,height:T(we)?"".concat(we,"px"):we},ref:function(Ue){Y.contentWrapper=Ue}},z.createElement("div",{className:"".concat(be,"-content"),ref:function(Ue){Y.contentDom=Ue},onTouchStart:qe&&Be?this.removeStartHandler:void 0,onTouchMove:qe&&Be?this.removeMoveHandler:void 0},he),He))}}],[{key:"getDerivedStateFromProps",value:function(H,Y){var ie=Y.prevProps,le=Y._self,he={prevProps:H};if(ie!==void 0){var xe=H.placement,Le=H.level;xe!==ie.placement&&(le.contentDom=null),Le!==ie.level&&le.getLevelDom(H)}return he}}]),P}(z.Component);h.defaultProps={switchScrollingEffect:function(){}};var f=h;function C(w){var F=E();return function(){var v=Object(N.a)(w),H;if(F){var Y=Object(N.a)(this).constructor;H=Reflect.construct(v,arguments,Y)}else H=v.apply(this,arguments);return Object(K.a)(this,H)}}function E(){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(w){return!1}}var _=function(w){Object(J.a)(P,w);var F=C(P);function P(v){var H;Object(Q.a)(this,P),H=F.call(this,v),H.onHandleClick=function(ie){var le=H.props,he=le.onHandleClick,xe=le.open;if(he&&he(ie),typeof xe=="undefined"){var Le=H.state.open;H.setState({open:!Le})}},H.onClose=function(ie){var le=H.props,he=le.onClose,xe=le.open;he&&he(ie),typeof xe=="undefined"&&H.setState({open:!1})};var Y=typeof v.open!="undefined"?v.open:!!v.defaultOpen;return H.state={open:Y},"onMaskClick"in v&&console.warn("`onMaskClick` are removed, please use `onClose` instead."),H}return Object(B.a)(P,[{key:"render",value:function(){var H=this,Y=this.props,ie=Y.defaultOpen,le=Y.getContainer,he=Y.wrapperClassName,xe=Y.forceRender,Le=Y.handler,we=Object(te.a)(Y,["defaultOpen","getContainer","wrapperClassName","forceRender","handler"]),Ae=this.state.open;if(!le)return z.createElement("div",{className:he,ref:function(ne){H.dom=ne}},z.createElement(f,Object.assign({},we,{open:Ae,handler:Le,getContainer:function(){return H.dom},onClose:this.onClose,onHandleClick:this.onHandleClick})));var pe=!!Le||xe;return z.createElement($.a,{visible:Ae,forceRender:pe,getContainer:le,wrapperClassName:he},function(be){var ne=be.visible,fe=be.afterClose,_e=Object(te.a)(be,["visible","afterClose"]);return z.createElement(f,Object.assign({},we,_e,{open:ne!==void 0?ne:Ae,afterVisibleChange:fe!==void 0?fe:we.afterVisibleChange,handler:Le,onClose:H.onClose,onHandleClick:H.onHandleClick}))})}}],[{key:"getDerivedStateFromProps",value:function(H,Y){var ie=Y.prevProps,le={prevProps:H};return typeof ie!="undefined"&&H.open!==ie.open&&(le.open=H.open),le}}]),P}(z.Component);_.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:z.createElement("div",{className:"drawer-handle"},z.createElement("i",{className:"drawer-handle-icon"})),showMask:!0,maskClosable:!0,maskStyle:{},wrapperClassName:"",className:"",keyboard:!0,forceRender:!1};var W=_,j=Oe.a=W},fjLI:function(It,Oe,U){"use strict";U.d(Oe,"f",function(){return p}),U.d(Oe,"b",function(){return a}),U.d(Oe,"a",function(){return c}),U.d(Oe,"d",function(){return s}),U.d(Oe,"e",function(){return i}),U.d(Oe,"c",function(){return t});var te=U("8HAY"),Q=U("Vhoy"),B=U("MI8n"),J=U("JYp7"),K=U("pmY6"),N=U("24hK"),$=U("nnTU"),z=U("T8No"),r=U("Cg/j"),D=U("t9D7"),m=function(u,o,R,T){var S=arguments.length,A=S<3?o:T===null?T=Object.getOwnPropertyDescriptor(o,R):T,I;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")A=Reflect.decorate(u,o,R,T);else for(var x=u.length-1;x>=0;x--)(I=u[x])&&(A=(S<3?I(A):S>3?I(o,R,A):I(o,R))||A);return S>3&&A&&Object.defineProperty(o,R,A),A},g=function(u,o){return function(R,T){o(R,T,u)}};function p(u){return u.command!==void 0}class a{constructor(u){this.id=a._idPool++,this._debugName=u}}a._idPool=0,a.CommandPalette=new a("CommandPalette"),a.EditorContext=new a("EditorContext"),a.SimpleEditorContext=new a("SimpleEditorContext"),a.EditorContextCopy=new a("EditorContextCopy"),a.EditorContextPeek=new a("EditorContextPeek"),a.MenubarEditMenu=new a("MenubarEditMenu"),a.MenubarCopy=new a("MenubarCopy"),a.MenubarGoMenu=new a("MenubarGoMenu"),a.MenubarSelectionMenu=new a("MenubarSelectionMenu"),a.InlineCompletionsActions=new a("InlineCompletionsActions");const c=Object(r.c)("menuService"),s=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new B.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:u=>u===a.CommandPalette}}addCommand(u){return this.addCommands(J.a.single(u))}addCommands(u){for(const o of u)this._commands.set(o.id,o);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(K.i)(()=>{let o=!1;for(const R of u)o=this._commands.delete(R.id)||o;o&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(u){return this._commands.get(u)}getCommands(){const u=new Map;return this._commands.forEach((o,R)=>u.set(R,o)),u}appendMenuItem(u,o){return this.appendMenuItems(J.a.single({id:u,item:o}))}appendMenuItems(u){const o=new Set,R=new N.a;for(const{id:T,item:S}of u){let A=this._menuItems.get(T);A||(A=new N.a,this._menuItems.set(T,A)),R.push(A.push(S)),o.add(T)}return this._onDidChangeMenu.fire(o),Object(K.i)(()=>{if(R.size>0){for(let T of R)T();this._onDidChangeMenu.fire(o),R.clear()}})}getMenuItems(u){let o;return this._menuItems.has(u)?o=[...this._menuItems.get(u)]:o=[],u===a.CommandPalette&&this._appendImplicitItems(o),o}_appendImplicitItems(u){const o=new Set;for(const R of u)p(R)&&(o.add(R.command.id),R.alt&&o.add(R.alt.id));this._commands.forEach((R,T)=>{o.has(T)||u.push({command:R})})}};class i extends te.e{constructor(u,o,R,T){super(`submenuitem.${u.submenu.id}`,typeof u.title=="string"?u.title:u.title.value,[],"submenu");this.item=u,this._menuService=o,this._contextKeyService=R,this._options=T}get actions(){const u=[],o=this._menuService.createMenu(this.item.submenu,this._contextKeyService),R=o.getActions(this._options);o.dispose();for(const[,T]of R)T.length>0&&(u.push(...T),u.push(new te.d));return u.length&&u.pop(),u}}let t=class u{constructor(o,R,T,S,A){var I,x;if(this._commandService=A,this.id=o.id,this.label=(T==null?void 0:T.renderShortTitle)&&o.shortTitle?typeof o.shortTitle=="string"?o.shortTitle:o.shortTitle.value:typeof o.title=="string"?o.title:o.title.value,this.tooltip=(x=typeof o.tooltip=="string"?o.tooltip:(I=o.tooltip)===null||I===void 0?void 0:I.value)!==null&&x!==void 0?x:"",this.enabled=!o.precondition||S.contextMatchesRules(o.precondition),this.checked=void 0,o.toggled){const b=o.toggled.condition?o.toggled:{condition:o.toggled};this.checked=S.contextMatchesRules(b.condition),this.checked&&b.tooltip&&(this.tooltip=typeof b.tooltip=="string"?b.tooltip:b.tooltip.value),b.title&&(this.label=typeof b.title=="string"?b.title:b.title.value)}this.item=o,this.alt=R?new u(R,void 0,T,S,A):void 0,this._options=T,D.d.isThemeIcon(o.icon)&&(this.class=Q.a.asClassName(o.icon))}dispose(){}run(...o){var R,T;let S=[];return((R=this._options)===null||R===void 0?void 0:R.arg)&&(S=[...S,this._options.arg]),((T=this._options)===null||T===void 0?void 0:T.shouldForwardArgs)&&(S=[...S,...o]),this._commandService.executeCommand(this.id,...S)}};t=m([g(3,z.b),g(4,$.b)],t)},fyJ8:function(It,Oe,U){"use strict";var te=U("rePB"),Q=U("VTBJ"),B=U("Ff2n"),J=U("U8pU"),K=U("q1tI"),N=U.n(K),$=U("TSYQ"),z=U.n($),r=U("c+Xe"),D=U("sR1s");function m(s){return s&&Object(J.a)(s)==="object"&&!Array.isArray(s)&&!K.isValidElement(s)}function g(s){return typeof s=="string"?!0:Object(r.c)(s)}function p(s,i){var t,u=s.prefixCls,o=s.className,R=s.record,T=s.index,S=s.dataIndex,A=s.render,I=s.children,x=s.component,b=x===void 0?"td":x,h=s.colSpan,f=s.rowSpan,C=s.fixLeft,E=s.fixRight,_=s.firstFixLeft,W=s.lastFixLeft,j=s.firstFixRight,w=s.lastFixRight,F=s.appendNode,P=s.additionalProps,v=P===void 0?{}:P,H=s.ellipsis,Y=s.align,ie=s.rowType,le=s.isSticky,he="".concat(u,"-cell"),xe,Le;if(I)Le=I;else{var we=Object(D.b)(R,S);if(Le=we,A){var Ae=A(we,R,T);m(Ae)?(Le=Ae.children,xe=Ae.props):Le=Ae}}Object(J.a)(Le)==="object"&&!Array.isArray(Le)&&!K.isValidElement(Le)&&(Le=null),H&&(W||j)&&(Le=K.createElement("span",{className:"".concat(he,"-content")},Le));var pe=xe||{},be=pe.colSpan,ne=pe.rowSpan,fe=pe.style,_e=pe.className,ke=Object(B.a)(pe,["colSpan","rowSpan","style","className"]),et=be!==void 0?be:h,je=ne!==void 0?ne:f;if(et===0||je===0)return null;var ot={},_t=typeof C=="number",Re=typeof E=="number";_t&&(ot.position="sticky",ot.left=C),Re&&(ot.position="sticky",ot.right=E);var Be={};Y&&(Be.textAlign=Y);var Qe,Ve=H===!0?{showTitle:!0}:H;Ve&&(Ve.showTitle||ie==="header")&&(typeof Le=="string"||typeof Le=="number"?Qe=Le.toString():K.isValidElement(Le)&&typeof Le.props.children=="string"&&(Qe=Le.props.children));var Et=Object(Q.a)(Object(Q.a)(Object(Q.a)({title:Qe},ke),v),{},{colSpan:et&&et!==1?et:null,rowSpan:je&&je!==1?je:null,className:z()(he,o,(t={},Object(te.a)(t,"".concat(he,"-fix-left"),_t),Object(te.a)(t,"".concat(he,"-fix-left-first"),_),Object(te.a)(t,"".concat(he,"-fix-left-last"),W),Object(te.a)(t,"".concat(he,"-fix-right"),Re),Object(te.a)(t,"".concat(he,"-fix-right-first"),j),Object(te.a)(t,"".concat(he,"-fix-right-last"),w),Object(te.a)(t,"".concat(he,"-ellipsis"),H),Object(te.a)(t,"".concat(he,"-with-append"),F),Object(te.a)(t,"".concat(he,"-fix-sticky"),(_t||Re)&&le),t),v.className,_e),style:Object(Q.a)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},v.style),Be),ot),fe),ref:g(b)?i:null});return K.createElement(b,Object.assign({},Et),F,Le)}var a=K.forwardRef(p);a.displayName="Cell";var c=K.memo(a,function(s,i){return i.shouldCellUpdate?!i.shouldCellUpdate(i.record,s.record):!1});Oe.a=c},h78n:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return _});var te=U("q1tI"),Q=U.n(te),B=U("TSYQ"),J=U.n(B),K={className:"",percent:0,prefixCls:"rc-progress",strokeColor:"#2db7f5",strokeLinecap:"round",strokeWidth:1,style:{},trailColor:"#D9D9D9",trailWidth:1},N=function(w){var F=w.map(function(){return Object(te.useRef)()}),P=Object(te.useRef)();return Object(te.useEffect)(function(){var v=Date.now(),H=!1;Object.keys(F).forEach(function(Y){var ie=F[Y].current;if(!ie)return;H=!0;var le=ie.style;le.transitionDuration=".3s, .3s, .3s, .06s",P.current&&v-P.current<100&&(le.transitionDuration="0s, 0s")}),H&&(P.current=Date.now())}),[F]};function $(){return $=Object.assign||function(j){for(var w=1;w<arguments.length;w++){var F=arguments[w];for(var P in F)Object.prototype.hasOwnProperty.call(F,P)&&(j[P]=F[P])}return j},$.apply(this,arguments)}function z(j,w){return p(j)||g(j,w)||D(j,w)||r()}function r(){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(j,w){if(!j)return;if(typeof j=="string")return m(j,w);var F=Object.prototype.toString.call(j).slice(8,-1);if(F==="Object"&&j.constructor&&(F=j.constructor.name),F==="Map"||F==="Set")return Array.from(j);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return m(j,w)}function m(j,w){(w==null||w>j.length)&&(w=j.length);for(var F=0,P=new Array(w);F<w;F++)P[F]=j[F];return P}function g(j,w){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var F=[],P=!0,v=!1,H=void 0;try{for(var Y=j[Symbol.iterator](),ie;!(P=(ie=Y.next()).done)&&!(F.push(ie.value),w&&F.length===w);P=!0);}catch(le){v=!0,H=le}finally{try{!P&&Y.return!=null&&Y.return()}finally{if(v)throw H}}return F}function p(j){if(Array.isArray(j))return j}function a(j,w){if(j==null)return{};var F=c(j,w),P,v;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(j);for(v=0;v<H.length;v++){if(P=H[v],w.indexOf(P)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,P))continue;F[P]=j[P]}}return F}function c(j,w){if(j==null)return{};var F={},P=Object.keys(j),v,H;for(H=0;H<P.length;H++){if(v=P[H],w.indexOf(v)>=0)continue;F[v]=j[v]}return F}var s=function(w){var F=w.className,P=w.percent,v=w.prefixCls,H=w.strokeColor,Y=w.strokeLinecap,ie=w.strokeWidth,le=w.style,he=w.trailColor,xe=w.trailWidth,Le=w.transition,we=a(w,["className","percent","prefixCls","strokeColor","strokeLinecap","strokeWidth","style","trailColor","trailWidth","transition"]);delete we.gapPosition;var Ae=Array.isArray(P)?P:[P],pe=Array.isArray(H)?H:[H],be=N(Ae),ne=z(be,1),fe=ne[0],_e=ie/2,ke=100-ie/2,et="M ".concat(Y==="round"?_e:0,",").concat(_e,`
L `).concat(Y==="round"?ke:100,",").concat(_e),je="0 0 100 ".concat(ie),ot=0;return Q.a.createElement("svg",$({className:J()("".concat(v,"-line"),F),viewBox:je,preserveAspectRatio:"none",style:le},we),Q.a.createElement("path",{className:"".concat(v,"-line-trail"),d:et,strokeLinecap:Y,stroke:he,strokeWidth:xe||ie,fillOpacity:"0"}),Ae.map(function(_t,Re){var Be={strokeDasharray:"".concat(_t,"px, 100px"),strokeDashoffset:"-".concat(ot,"px"),transition:Le||"stroke-dashoffset 0.3s ease 0s, stroke-dasharray .3s ease 0s, stroke 0.3s linear"},Qe=pe[Re]||pe[pe.length-1];return ot+=_t,Q.a.createElement("path",{key:Re,className:"".concat(v,"-line-path"),d:et,strokeLinecap:Y,stroke:Qe,strokeWidth:ie,fillOpacity:"0",ref:fe[Re],style:Be})}))};s.defaultProps=K;var i=s;function t(){return t=Object.assign||function(j){for(var w=1;w<arguments.length;w++){var F=arguments[w];for(var P in F)Object.prototype.hasOwnProperty.call(F,P)&&(j[P]=F[P])}return j},t.apply(this,arguments)}function u(j,w){return A(j)||S(j,w)||R(j,w)||o()}function o(){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 R(j,w){if(!j)return;if(typeof j=="string")return T(j,w);var F=Object.prototype.toString.call(j).slice(8,-1);if(F==="Object"&&j.constructor&&(F=j.constructor.name),F==="Map"||F==="Set")return Array.from(j);if(F==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(F))return T(j,w)}function T(j,w){(w==null||w>j.length)&&(w=j.length);for(var F=0,P=new Array(w);F<w;F++)P[F]=j[F];return P}function S(j,w){if(typeof Symbol=="undefined"||!(Symbol.iterator in Object(j)))return;var F=[],P=!0,v=!1,H=void 0;try{for(var Y=j[Symbol.iterator](),ie;!(P=(ie=Y.next()).done)&&!(F.push(ie.value),w&&F.length===w);P=!0);}catch(le){v=!0,H=le}finally{try{!P&&Y.return!=null&&Y.return()}finally{if(v)throw H}}return F}function A(j){if(Array.isArray(j))return j}function I(j,w){if(j==null)return{};var F=x(j,w),P,v;if(Object.getOwnPropertySymbols){var H=Object.getOwnPropertySymbols(j);for(v=0;v<H.length;v++){if(P=H[v],w.indexOf(P)>=0)continue;if(!Object.prototype.propertyIsEnumerable.call(j,P))continue;F[P]=j[P]}}return F}function x(j,w){if(j==null)return{};var F={},P=Object.keys(j),v,H;for(H=0;H<P.length;H++){if(v=P[H],w.indexOf(v)>=0)continue;F[v]=j[v]}return F}var b=0;function h(j){return+j.replace("%","")}function f(j){return Array.isArray(j)?j:[j]}function C(j,w,F,P){var v=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,H=arguments.length>5?arguments[5]:void 0,Y=50-P/2,ie=0,le=-Y,he=0,xe=-2*Y;switch(H){case"left":ie=-Y,le=0,he=2*Y,xe=0;break;case"right":ie=Y,le=0,he=-2*Y,xe=0;break;case"bottom":le=Y,xe=2*Y;break;default:}var Le="M 50,50 m ".concat(ie,",").concat(le,`
a `).concat(Y,",").concat(Y," 0 1 1 ").concat(he,",").concat(-xe,`
a `).concat(Y,",").concat(Y," 0 1 1 ").concat(-he,",").concat(xe),we=Math.PI*2*Y,Ae={stroke:F,strokeDasharray:"".concat(w/100*(we-v),"px ").concat(we,"px"),strokeDashoffset:"-".concat(v/2+j/100*(we-v),"px"),transition:"stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s"};return{pathString:Le,pathStyle:Ae}}var E=function(w){var F=w.prefixCls,P=w.strokeWidth,v=w.trailWidth,H=w.gapDegree,Y=w.gapPosition,ie=w.trailColor,le=w.strokeLinecap,he=w.style,xe=w.className,Le=w.strokeColor,we=w.percent,Ae=I(w,["prefixCls","strokeWidth","trailWidth","gapDegree","gapPosition","trailColor","strokeLinecap","style","className","strokeColor","percent"]),pe=Object(te.useMemo)(function(){return b+=1,b},[]),be=C(0,100,ie,P,H,Y),ne=be.pathString,fe=be.pathStyle,_e=f(we),ke=f(Le),et=ke.find(function(Be){return Object.prototype.toString.call(Be)==="[object Object]"}),je=N(_e),ot=u(je,1),_t=ot[0],Re=function(){var Qe=0;return _e.map(function(Ve,Et){var kt=ke[Et]||ke[ke.length-1],Vt=Object.prototype.toString.call(kt)==="[object Object]"?"url(#".concat(F,"-gradient-").concat(pe,")"):"",Qt=C(Qe,Ve,kt,P,H,Y);return Qe+=Ve,Q.a.createElement("path",{key:Et,className:"".concat(F,"-circle-path"),d:Qt.pathString,stroke:Vt,strokeLinecap:le,strokeWidth:P,opacity:Ve===0?0:1,fillOpacity:"0",style:Qt.pathStyle,ref:_t[Et]})})};return Q.a.createElement("svg",t({className:J()("".concat(F,"-circle"),xe),viewBox:"0 0 100 100",style:he},Ae),et&&Q.a.createElement("defs",null,Q.a.createElement("linearGradient",{id:"".concat(F,"-gradient-").concat(pe),x1:"100%",y1:"0%",x2:"0%",y2:"0%"},Object.keys(et).sort(function(Be,Qe){return h(Be)-h(Qe)}).map(function(Be,Qe){return Q.a.createElement("stop",{key:Qe,offset:Be,stopColor:et[Be]})}))),Q.a.createElement("path",{className:"".concat(F,"-circle-trail"),d:ne,stroke:ie,strokeLinecap:le,strokeWidth:v||P,fillOpacity:"0",style:fe}),Re().reverse())};E.defaultProps=K;var _=E,W={Line:i,Circle:_}},hQp1:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return Q});var te;(function(B){B.FirstPage="firstPage",B.PrevPage="prevPage",B.NextPage="nextPage"})(te||(te={}));var Q;(function(B){B[B.Single=0]="Single",B[B.Multiple=1]="Multiple",B[B.Judge=2]="Judge",B[B.Fill=3]="Fill",B[B.Subjective=4]="Subjective",B[B.Shixun=5]="Shixun",B[B.Program=6]="Program",B[B.Combine=7]="Combine"})(Q||(Q={}))},hW8S:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return J}),U.d(Oe,"c",function(){return K}),U.d(Oe,"b",function(){return N});var te=U("VTBJ"),Q=U("Ff2n"),B=U("Kwbf"),J="RC_TABLE_INTERNAL_COL_DEFINE";function K($){var z=$.expandable,r=Object(Q.a)($,["expandable"]);return"expandable"in $?Object(te.a)(Object(te.a)({},r),z):r}function N($){return Object.keys($).reduce(function(z,r){return(r.substr(0,5)==="data-"||r.substr(0,5)==="aria-")&&(z[r]=$[r]),z},{})}},i58Z:function(It,Oe,U){It.exports={wrap:"wrap___Yg2Z9",addKnowledge:"addKnowledge___2FlI0",disabled:"disabled___1_wxN"}},ic2d:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return J});var te=U("FWmy"),Q=U("746U");class B{constructor(){this.data=new Map}add(K,N){te.a(Q.l(K)),te.a(Q.k(N)),te.a(!this.data.has(K),"There is already an extension with this id"),this.data.set(K,N)}as(K){return this.data.get(K)||null}}const J=new B},ie49:function(It,Oe,U){It.exports={brief:"brief___29L5W",contentTitle:"contentTitle___2wPLj",content:"content___2MAv3",tips:"tips___3qmPX",antdTable:"antdTable___o4ScH",tableCell:"tableCell___24I9Y",antdModal:"antdModal___1nRWw"}},kCvp:function(It,Oe,U){It.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(It,Oe,U){},kqOp:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return D});var te=U("0Owb"),Q=U("fWQN"),B=U("mtLc"),J=U("yKVA"),K=U("879j"),N=U("q1tI"),$=U.n(N),z=U("Ot1p"),r="\u2581",D=function(m){Object(J.a)(p,m);var g=Object(K.a)(p);function p(){var a;Object(Q.a)(this,p);for(var c=arguments.length,s=new Array(c),i=0;i<c;i++)s[i]=arguments[i];return a=g.call.apply(g,[this].concat(s)),a.getChCountBeforeCursor=function(t,u){for(var o=u.line,R=0,T=0;T<o;T++)R+=t.getLine(T).split(r).length-1;var S=t.getLine(o).substring(0,u.ch);return R+=S.split(r).length-1,R},a.onCMBeforeChange=function(t,u){var o=t.getRange(u.from,u.to),R=0;if(u.text.forEach(function(I){R+=I.split(r).length-1}),o&&o.indexOf(r)!=-1){var T=o.split(r).length-1,S=a.getChCountBeforeCursor(t,u.from);console.log("\u5220\u9664".concat(T,"\u4E2A\uFF0C \u4E4B\u524D\u6709").concat(S,"\u4E2A\uFF0C\u65B0\u589E").concat(R,"\u4E2A")),a.props.deleteEmptyDisabled?u.cancel():a.props.onPlaceholderChange&&a.props.onPlaceholderChange(S,T,R)}else if(R){var A=a.getChCountBeforeCursor(t,u.from);console.log("\u65B0\u589E".concat(R,"\u4E2A\uFF0C\u4E4B\u524D\u6709").concat(A,"\u4E2A")),a.props.onPlaceholderChange&&a.props.onPlaceholderChange(A,0,R)}},a}return Object(B.a)(p,[{key:"render",value:function(){return $.a.createElement(z.a,Object(te.a)({},this.props,{onCMBeforeChange:this.onCMBeforeChange}))}}]),p}(N.Component)},lZu9:function(It,Oe,U){(function(te){te(U("VrN/"),U("1eCo"),U("8EBN"))})(function(te){"use strict";te.defineMode("markdown",function(Q,B){var J=te.getMode(Q,"text/html"),K=J.name=="null";function N(P){if(te.findModeByName){var v=te.findModeByName(P);v&&(P=v.mime||v.mimes[0])}var H=te.getMode(Q,P);return H.name=="null"?null:H}B.highlightFormatting===void 0&&(B.highlightFormatting=!1),B.maxBlockquoteDepth===void 0&&(B.maxBlockquoteDepth=0),B.taskLists===void 0&&(B.taskLists=!1),B.strikethrough===void 0&&(B.strikethrough=!1),B.emoji===void 0&&(B.emoji=!1),B.fencedCodeBlockHighlighting===void 0&&(B.fencedCodeBlockHighlighting=!0),B.fencedCodeBlockDefaultMode===void 0&&(B.fencedCodeBlockDefaultMode="text/plain"),B.xml===void 0&&(B.xml=!0),B.tokenTypeOverrides===void 0&&(B.tokenTypeOverrides={});var $={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var z in $)$.hasOwnProperty(z)&&B.tokenTypeOverrides[z]&&($[z]=B.tokenTypeOverrides[z]);var r=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,m=/^\[(x| )\](?=\s)/i,g=B.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,p=/^ {0,3}(?:\={1,}|-{2,})\s*$/,a=/^[^#!\[\]*_\\<>` "'(~:]+/,c=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,s=/^\s*\[[^\]]+?\]:.*$/,i=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,t=" ";function u(P,v,H){return v.f=v.inline=H,H(P,v)}function o(P,v,H){return v.f=v.block=H,H(P,v)}function R(P){return!P||!/\S/.test(P.string)}function T(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==A){var v=K;if(!v){var H=te.innerMode(J,P.htmlState);v=H.mode.name=="xml"&&H.state.tagStart===null&&!H.state.context&&H.state.tokenize.isInText}v&&(P.f=h,P.block=S,P.htmlState=null)}return P.trailingSpace=0,P.trailingSpaceNewLine=!1,P.prevLine=P.thisLine,P.thisLine={stream:null},null}function S(P,v){var H=P.column()===v.indentation,Y=R(v.prevLine.stream),ie=v.indentedCode,le=v.prevLine.hr,he=v.list!==!1,xe=(v.listStack[v.listStack.length-1]||0)+3;v.indentedCode=!1;var Le=v.indentation;if(v.indentationDiff===null&&(v.indentationDiff=v.indentation,he)){for(v.list=null;Le<v.listStack[v.listStack.length-1];)v.listStack.pop(),v.listStack.length?v.indentation=v.listStack[v.listStack.length-1]:v.list=!1;v.list!==!1&&(v.indentationDiff=Le-v.listStack[v.listStack.length-1])}var we=!Y&&!le&&!v.prevLine.header&&(!he||!ie)&&!v.prevLine.fencedCodeEnd,Ae=(v.list===!1||le||Y)&&v.indentation<=xe&&P.match(r),pe=null;if(v.indentationDiff>=4&&(ie||v.prevLine.fencedCodeEnd||v.prevLine.header||Y))return P.skipToEnd(),v.indentedCode=!0,$.code;if(P.eatSpace())return null;if(H&&v.indentation<=xe&&(pe=P.match(g))&&pe[1].length<=6)return v.quote=0,v.header=pe[1].length,v.thisLine.header=!0,B.highlightFormatting&&(v.formatting="header"),v.f=v.inline,x(v);if(v.indentation<=xe&&P.eat(">"))return v.quote=H?1:v.quote+1,B.highlightFormatting&&(v.formatting="quote"),P.eatSpace(),x(v);if(!Ae&&!v.setext&&H&&v.indentation<=xe&&(pe=P.match(D))){var be=pe[1]?"ol":"ul";return v.indentation=Le+P.current().length,v.list=!0,v.quote=0,v.listStack.push(v.indentation),v.em=!1,v.strong=!1,v.code=!1,v.strikethrough=!1,B.taskLists&&P.match(m,!1)&&(v.taskList=!0),v.f=v.inline,B.highlightFormatting&&(v.formatting=["list","list-"+be]),x(v)}else{if(H&&v.indentation<=xe&&(pe=P.match(c,!0)))return v.quote=0,v.fencedEndRE=new RegExp(pe[1]+"+ *$"),v.localMode=B.fencedCodeBlockHighlighting&&N(pe[2]||B.fencedCodeBlockDefaultMode),v.localMode&&(v.localState=te.startState(v.localMode)),v.f=v.block=I,B.highlightFormatting&&(v.formatting="code-block"),v.code=-1,x(v);if(v.setext||(!we||!he)&&!v.quote&&v.list===!1&&!v.code&&!Ae&&!s.test(P.string)&&(pe=P.lookAhead(1))&&(pe=pe.match(p)))return v.setext?(v.header=v.setext,v.setext=0,P.skipToEnd(),B.highlightFormatting&&(v.formatting="header")):(v.header=pe[0].charAt(0)=="="?1:2,v.setext=v.header),v.thisLine.header=!0,v.f=v.inline,x(v);if(Ae)return P.skipToEnd(),v.hr=!0,v.thisLine.hr=!0,$.hr;if(P.peek()==="[")return u(P,v,W)}return u(P,v,v.inline)}function A(P,v){var H=J.token(P,v.htmlState);if(!K){var Y=te.innerMode(J,v.htmlState);(Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText||v.md_inside&&P.current().indexOf(">")>-1)&&(v.f=h,v.block=S,v.htmlState=null)}return H}function I(P,v){var H=v.listStack[v.listStack.length-1]||0,Y=v.indentation<H,ie=H+3;if(v.fencedEndRE&&v.indentation<=ie&&(Y||P.match(v.fencedEndRE))){B.highlightFormatting&&(v.formatting="code-block");var le;return Y||(le=x(v)),v.localMode=v.localState=null,v.block=S,v.f=h,v.fencedEndRE=null,v.code=0,v.thisLine.fencedCodeEnd=!0,Y?o(P,v,v.block):le}else return v.localMode?v.localMode.token(P,v.localState):(P.skipToEnd(),$.code)}function x(P){var v=[];if(P.formatting){v.push($.formatting),typeof P.formatting=="string"&&(P.formatting=[P.formatting]);for(var H=0;H<P.formatting.length;H++)v.push($.formatting+"-"+P.formatting[H]),P.formatting[H]==="header"&&v.push($.formatting+"-"+P.formatting[H]+"-"+P.header),P.formatting[H]==="quote"&&(!B.maxBlockquoteDepth||B.maxBlockquoteDepth>=P.quote?v.push($.formatting+"-"+P.formatting[H]+"-"+P.quote):v.push("error"))}if(P.taskOpen)return v.push("meta"),v.length?v.join(" "):null;if(P.taskClosed)return v.push("property"),v.length?v.join(" "):null;if(P.linkHref?v.push($.linkHref,"url"):(P.strong&&v.push($.strong),P.em&&v.push($.em),P.strikethrough&&v.push($.strikethrough),P.emoji&&v.push($.emoji),P.linkText&&v.push($.linkText),P.code&&v.push($.code),P.image&&v.push($.image),P.imageAltText&&v.push($.imageAltText,"link"),P.imageMarker&&v.push($.imageMarker)),P.header&&v.push($.header,$.header+"-"+P.header),P.quote&&(v.push($.quote),!B.maxBlockquoteDepth||B.maxBlockquoteDepth>=P.quote?v.push($.quote+"-"+P.quote):v.push($.quote+"-"+B.maxBlockquoteDepth)),P.list!==!1){var Y=(P.listStack.length-1)%3;Y?Y===1?v.push($.list2):v.push($.list3):v.push($.list1)}return P.trailingSpaceNewLine?v.push("trailing-space-new-line"):P.trailingSpace&&v.push("trailing-space-"+(P.trailingSpace%2?"a":"b")),v.length?v.join(" "):null}function b(P,v){return P.match(a,!0)?x(v):void 0}function h(P,v){var H=v.text(P,v);if(typeof H!="undefined")return H;if(v.list)return v.list=null,x(v);if(v.taskList){var Y=P.match(m,!0)[1]===" ";return Y?v.taskOpen=!0:v.taskClosed=!0,B.highlightFormatting&&(v.formatting="task"),v.taskList=!1,x(v)}if(v.taskOpen=!1,v.taskClosed=!1,v.header&&P.match(/^#+$/,!0))return B.highlightFormatting&&(v.formatting="header"),x(v);var ie=P.next();if(v.linkTitle){v.linkTitle=!1;var le=ie;ie==="("&&(le=")"),le=(le+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var he="^\\s*(?:[^"+le+"\\\\]+|\\\\\\\\|\\\\.)"+le;if(P.match(new RegExp(he),!0))return $.linkHref}if(ie==="`"){var xe=v.formatting;B.highlightFormatting&&(v.formatting="code"),P.eatWhile("`");var Le=P.current().length;if(v.code==0&&(!v.quote||Le==1))return v.code=Le,x(v);if(Le==v.code){var we=x(v);return v.code=0,we}else return v.formatting=xe,x(v)}else if(v.code)return x(v);if(ie==="\\"&&(P.next(),B.highlightFormatting)){var Ae=x(v),pe=$.formatting+"-escape";return Ae?Ae+" "+pe:pe}if(ie==="!"&&P.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return v.imageMarker=!0,v.image=!0,B.highlightFormatting&&(v.formatting="image"),x(v);if(ie==="["&&v.imageMarker&&P.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return v.imageMarker=!1,v.imageAltText=!0,B.highlightFormatting&&(v.formatting="image"),x(v);if(ie==="]"&&v.imageAltText){B.highlightFormatting&&(v.formatting="image");var Ae=x(v);return v.imageAltText=!1,v.image=!1,v.inline=v.f=C,Ae}if(ie==="["&&!v.image)return v.linkText&&P.match(/^.*?\]/)||(v.linkText=!0,B.highlightFormatting&&(v.formatting="link")),x(v);if(ie==="]"&&v.linkText){B.highlightFormatting&&(v.formatting="link");var Ae=x(v);return v.linkText=!1,v.inline=v.f=P.match(/\(.*?\)| ?\[.*?\]/,!1)?C:h,Ae}if(ie==="<"&&P.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=f,B.highlightFormatting&&(v.formatting="link");var Ae=x(v);return Ae?Ae+=" ":Ae="",Ae+$.linkInline}if(ie==="<"&&P.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){v.f=v.inline=f,B.highlightFormatting&&(v.formatting="link");var Ae=x(v);return Ae?Ae+=" ":Ae="",Ae+$.linkEmail}if(B.xml&&ie==="<"&&P.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var be=P.string.indexOf(">",P.pos);if(be!=-1){var ne=P.string.substring(P.start,be);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ne)&&(v.md_inside=!0)}return P.backUp(1),v.htmlState=te.startState(J),o(P,v,A)}if(B.xml&&ie==="<"&&P.match(/^\/\w*?>/))return v.md_inside=!1,"tag";if(ie==="*"||ie==="_"){for(var fe=1,_e=P.pos==1?" ":P.string.charAt(P.pos-2);fe<3&&P.eat(ie);)fe++;var ke=P.peek()||" ",et=!/\s/.test(ke)&&(!i.test(ke)||/\s/.test(_e)||i.test(_e)),je=!/\s/.test(_e)&&(!i.test(_e)||/\s/.test(ke)||i.test(ke)),ot=null,_t=null;if(fe%2&&(!v.em&&et&&(ie==="*"||!je||i.test(_e))?ot=!0:v.em==ie&&je&&(ie==="*"||!et||i.test(ke))&&(ot=!1)),fe>1&&(!v.strong&&et&&(ie==="*"||!je||i.test(_e))?_t=!0:v.strong==ie&&je&&(ie==="*"||!et||i.test(ke))&&(_t=!1)),_t!=null||ot!=null){B.highlightFormatting&&(v.formatting=ot==null?"strong":_t==null?"em":"strong em"),ot===!0&&(v.em=ie),_t===!0&&(v.strong=ie);var we=x(v);return ot===!1&&(v.em=!1),_t===!1&&(v.strong=!1),we}}else if(ie===" "&&(P.eat("*")||P.eat("_"))){if(P.peek()===" ")return x(v);P.backUp(1)}if(B.strikethrough){if(ie==="~"&&P.eatWhile(ie)){if(v.strikethrough){B.highlightFormatting&&(v.formatting="strikethrough");var we=x(v);return v.strikethrough=!1,we}else if(P.match(/^[^\s]/,!1))return v.strikethrough=!0,B.highlightFormatting&&(v.formatting="strikethrough"),x(v)}else if(ie===" "&&P.match(/^~~/,!0)){if(P.peek()===" ")return x(v);P.backUp(2)}}if(B.emoji&&ie===":"&&P.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){v.emoji=!0,B.highlightFormatting&&(v.formatting="emoji");var Re=x(v);return v.emoji=!1,Re}return ie===" "&&(P.match(/^ +$/,!1)?v.trailingSpace++:v.trailingSpace&&(v.trailingSpaceNewLine=!0)),x(v)}function f(P,v){var H=P.next();if(H===">"){v.f=v.inline=h,B.highlightFormatting&&(v.formatting="link");var Y=x(v);return Y?Y+=" ":Y="",Y+$.linkInline}return P.match(/^[^>]+/,!0),$.linkInline}function C(P,v){if(P.eatSpace())return null;var H=P.next();return H==="("||H==="["?(v.f=v.inline=_(H==="("?")":"]"),B.highlightFormatting&&(v.formatting="link-string"),v.linkHref=!0,x(v)):"error"}var E={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function _(P){return function(v,H){var Y=v.next();if(Y===P){H.f=H.inline=h,B.highlightFormatting&&(H.formatting="link-string");var ie=x(H);return H.linkHref=!1,ie}return v.match(E[P]),H.linkHref=!0,x(H)}}function W(P,v){return P.match(/^([^\]\\]|\\.)*\]:/,!1)?(v.f=j,P.next(),B.highlightFormatting&&(v.formatting="link"),v.linkText=!0,x(v)):u(P,v,h)}function j(P,v){if(P.match(/^\]:/,!0)){v.f=v.inline=w,B.highlightFormatting&&(v.formatting="link");var H=x(v);return v.linkText=!1,H}return P.match(/^([^\]\\]|\\.)+/,!0),$.linkText}function w(P,v){return P.eatSpace()?null:(P.match(/^[^\s]+/,!0),P.peek()===void 0?v.linkTitle=!0:P.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),v.f=v.inline=h,$.linkHref+" url")}var F={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:h,text:b,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&&te.copyState(J,P.htmlState),indentation:P.indentation,localMode:P.localMode,localState:P.localMode?te.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,v){if(v.formatting=!1,P!=v.thisLine.stream){if(v.header=0,v.hr=!1,P.match(/^\s*$/,!0))return T(v),null;if(v.prevLine=v.thisLine,v.thisLine={stream:P},v.taskList=!1,v.trailingSpace=0,v.trailingSpaceNewLine=!1,!v.localState&&(v.f=v.block,v.f!=A)){var H=P.match(/^\s*/,!0)[0].replace(/\t/g,t).length;if(v.indentation=H,v.indentationDiff=null,H>0)return null}}return v.f(P,v)},innerMode:function(P){return P.block==A?{state:P.htmlState,mode:J}:P.localState?{state:P.localState,mode:P.localMode}:{state:P,mode:F}},indent:function(P,v,H){return P.block==A&&J.indent?J.indent(P.htmlState,v,H):P.localState&&P.localMode.indent?P.localMode.indent(P.localState,v,H):te.Pass},blankLine:T,getType:x,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return F},"xml"),te.defineMIME("text/markdown","markdown"),te.defineMIME("text/x-markdown","markdown")})},loLm:function(It,Oe,U){It.exports={flex_box_center:"flex_box_center___Ea2v9",flex_space_between:"flex_space_between___1bTGw",flex_box_vertical_center:"flex_box_vertical_center___2J4zW",flex_box_center_end:"flex_box_center_end___9_5OK",flex_box_column:"flex_box_column___2FLgO",posWarp:"posWarp___3pf1n",pos:"pos___3-NfR",tips:"tips___2-j_s",markWrongBtnWrapper:"markWrongBtnWrapper___37HXF"}},n6Qo:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return z});var te=U("q1tI"),Q=U("biw7"),B=U("fyJ8");function J(r){var D=r.className,m=r.index,g=r.children,p=r.colSpan,a=r.rowSpan,c=te.useContext(Q.a),s=c.prefixCls,i=c.fixedInfoList,t=i[m];return te.createElement(B.a,Object.assign({className:D,index:m,component:"td",prefixCls:s,record:null,dataIndex:null,render:function(){return{children:g,props:{colSpan:p,rowSpan:a}}}},t))}function K(r){return te.createElement("tr",Object.assign({},r))}function N(r){var D=r.children,m=te.useContext(Q.a),g=m.prefixCls;return te.createElement("tfoot",{className:"".concat(g,"-summary")},D)}var $=Oe.b=N,z={Cell:J,Row:K}},nEHx:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return te});var te;(function(Q){Q.DARK="dark",Q.LIGHT="light",Q.HIGH_CONTRAST="hc"})(te||(te={}))},ngQI:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return Ul}),U.d(Oe,"b",function(){return yl}),U.d(Oe,"c",function(){return bl});var te=U("q1tI"),Q=U.n(te),B=U("dI71"),J=U("wx14"),K=U("ANjH"),N=U("/MKj");function $(L,k){if(L.length!==k.length)return!1;for(var V=0;V<L.length;V++)if(L[V]!==k[V])return!1;return!0}function z(L,k){var V=Object(te.useState)(function(){return{inputs:k,result:L()}})[0],re=Object(te.useRef)(!0),ce=Object(te.useRef)(V),de=re.current||Boolean(k&&ce.current.inputs&&$(k,ce.current.inputs)),Te=de?ce.current:{inputs:k,result:L()};return Object(te.useEffect)(function(){re.current=!1,ce.current=Te},[Te]),Te.result}function r(L,k){return z(function(){return L},k)}var D=z,m=r,g=U("9R94"),p=function(k){var V=k.top,re=k.right,ce=k.bottom,de=k.left,Te=re-de,Se=ce-V,ze={top:V,right:re,bottom:ce,left:de,width:Te,height:Se,x:de,y:V,center:{x:(re+de)/2,y:(ce+V)/2}};return ze},a=function(k,V){return{top:k.top-V.top,left:k.left-V.left,bottom:k.bottom+V.bottom,right:k.right+V.right}},c=function(k,V){return{top:k.top+V.top,left:k.left+V.left,bottom:k.bottom-V.bottom,right:k.right-V.right}},s=function(k,V){return{top:k.top+V.y,left:k.left+V.x,bottom:k.bottom+V.y,right:k.right+V.x}},i={top:0,right:0,bottom:0,left:0},t=function(k){var V=k.borderBox,re=k.margin,ce=re===void 0?i:re,de=k.border,Te=de===void 0?i:de,Se=k.padding,ze=Se===void 0?i:Se,it=p(a(V,ce)),ut=p(c(V,Te)),$e=p(c(ut,ze));return{marginBox:it,borderBox:p(V),paddingBox:ut,contentBox:$e,margin:ce,border:Te,padding:ze}},u=function(k){var V=k.slice(0,-2),re=k.slice(-2);if(re!=="px")return 0;var ce=Number(V);return isNaN(ce)&&Object(g.a)(!1),ce},o=function(){return{x:window.pageXOffset,y:window.pageYOffset}},R=function(k,V){var re=k.borderBox,ce=k.border,de=k.margin,Te=k.padding,Se=s(re,V);return t({borderBox:Se,border:ce,margin:de,padding:Te})},T=function(k,V){return V===void 0&&(V=o()),R(k,V)},S=function(k,V){var re={top:u(V.marginTop),right:u(V.marginRight),bottom:u(V.marginBottom),left:u(V.marginLeft)},ce={top:u(V.paddingTop),right:u(V.paddingRight),bottom:u(V.paddingBottom),left:u(V.paddingLeft)},de={top:u(V.borderTopWidth),right:u(V.borderRightWidth),bottom:u(V.borderBottomWidth),left:u(V.borderLeftWidth)};return t({borderBox:k,margin:re,padding:ce,border:de})},A=function(k){var V=k.getBoundingClientRect(),re=window.getComputedStyle(k);return S(V,re)},I=Number.isNaN||function(k){return typeof k=="number"&&k!==k};function x(L,k){return L===k?!0:!!(I(L)&&I(k))}function b(L,k){if(L.length!==k.length)return!1;for(var V=0;V<L.length;V++)if(!x(L[V],k[V]))return!1;return!0}function h(L,k){k===void 0&&(k=b);var V,re=[],ce,de=!1;function Te(){for(var Se=[],ze=0;ze<arguments.length;ze++)Se[ze]=arguments[ze];return de&&V===this&&k(Se,re)||(ce=L.apply(this,Se),de=!0,V=this,re=Se),ce}return Te}var f=h,C=function(k){var V=[],re=null,ce=function(){for(var Te=arguments.length,Se=new Array(Te),ze=0;ze<Te;ze++)Se[ze]=arguments[ze];if(V=Se,re)return;re=requestAnimationFrame(function(){re=null,k.apply(void 0,V)})};return ce.cancel=function(){if(!re)return;cancelAnimationFrame(re),re=null},ce},E=C,_=U("i8i4"),W=U.n(_),j=!0,w=/[ \t]{2,}/g,F=/^[ \t]*/gm,P=function(k){return k.replace(w," ").replace(F,"").trim()},v=function(k){return P(`
%creact-beautiful-dnd
%c`+P(k)+`
%c\u{1F477}\u200D This is a development only message. It will be removed in production builds.
`)},H=function(k){return[v(k),"color: #00C584; font-size: 1.2em; font-weight: bold;","line-height: 1.5","color: #723874;"]},Y="__react-beautiful-dnd-disable-dev-warnings";function ie(L,k){var V;if(j)return;if(typeof window!="undefined"&&window[Y])return;(V=console)[L].apply(V,H(k))}var le=ie.bind(null,"warn"),he=ie.bind(null,"error");function xe(){}function Le(L,k){return Object(J.a)({},L,{},k)}function we(L,k,V){var re=k.map(function(ce){var de=Le(V,ce.options);return L.addEventListener(ce.eventName,ce.fn,de),function(){L.removeEventListener(ce.eventName,ce.fn,de)}});return function(){re.forEach(function(de){de()})}}var Ae=!0,pe="Invariant failed";function be(L){this.message=L}be.prototype.toString=function(){return this.message};function ne(L,k){if(L)return;throw Ae?new be(pe):new be(pe+": "+(k||""))}var fe=function(L){Object(B.a)(k,L);function k(){for(var re,ce=arguments.length,de=new Array(ce),Te=0;Te<ce;Te++)de[Te]=arguments[Te];return re=L.call.apply(L,[this].concat(de))||this,re.callbacks=null,re.unbind=xe,re.onWindowError=function(Se){var ze=re.getCallbacks();ze.isDragging()&&ze.tryAbort();var it=Se.error;it instanceof be&&Se.preventDefault()},re.getCallbacks=function(){if(!re.callbacks)throw new Error("Unable to find AppCallbacks in <ErrorBoundary/>");return re.callbacks},re.setCallbacks=function(Se){re.callbacks=Se},re}var V=k.prototype;return V.componentDidMount=function(){this.unbind=we(window,[{eventName:"error",fn:this.onWindowError}])},V.componentWillUnmount=function(){this.unbind()},V.componentDidCatch=function(ce){if(ce instanceof be){this.setState({});return}throw ce},V.render=function(){return this.props.children(this.setCallbacks)},k}(Q.a.Component),_e=`
Press space bar to start a drag.
When dragging you can use the arrow keys to move the item around and escape to cancel.
Some screen readers may require you to be in focus mode or to use your pass through key
`,ke=function(k){return k+1},et=function(k){return`
You have lifted an item in position `+ke(k.source.index)+`
`},je=function(k,V){var re=k.droppableId===V.droppableId,ce=ke(k.index),de=ke(V.index);return re?`
You have moved the item from position `+ce+`
to position `+de+`
`:`
You have moved the item from position `+ce+`
in list `+k.droppableId+`
to list `+V.droppableId+`
in position `+de+`
`},ot=function(k,V,re){var ce=V.droppableId===re.droppableId;return ce?`
The item `+k+`
has been combined with `+re.draggableId:`
The item `+k+`
in list `+V.droppableId+`
has been combined with `+re.draggableId+`
in list `+re.droppableId+`
`},_t=function(k){var V=k.destination;if(V)return je(k.source,V);var re=k.combine;return re?ot(k.draggableId,k.source,re):"You are over an area that cannot be dropped on"},Re=function(k){return`
The item has returned to its starting position
of `+ke(k.index)+`
`},Be=function(k){if(k.reason==="CANCEL")return`
Movement cancelled.
`+Re(k.source)+`
`;var V=k.destination,re=k.combine;return V?`
You have dropped the item.
`+je(k.source,V)+`
`:re?`
You have dropped the item.
`+ot(k.draggableId,k.source,re)+`
`:`
The item has been dropped while not over a drop area.
`+Re(k.source)+`
`},Qe={dragHandleUsageInstructions:_e,onDragStart:et,onDragUpdate:_t,onDragEnd:Be},Ve={x:0,y:0},Et=function(k,V){return{x:k.x+V.x,y:k.y+V.y}},kt=function(k,V){return{x:k.x-V.x,y:k.y-V.y}},Vt=function(k,V){return k.x===V.x&&k.y===V.y},Qt=function(k){return{x:k.x!==0?-k.x:0,y:k.y!==0?-k.y:0}},an=function(k,V,re){var ce;return re===void 0&&(re=0),ce={},ce[k]=V,ce[k==="x"?"y":"x"]=re,ce},sn=function(k,V){return Math.sqrt(Math.pow(V.x-k.x,2)+Math.pow(V.y-k.y,2))},qe=function(k,V){return Math.min.apply(Math,V.map(function(re){return sn(k,re)}))},Ze=function(k){return function(V){return{x:k(V.x),y:k(V.y)}}},Ct=function(L,k){var V=p({top:Math.max(k.top,L.top),right:Math.min(k.right,L.right),bottom:Math.min(k.bottom,L.bottom),left:Math.max(k.left,L.left)});return V.width<=0||V.height<=0?null:V},At=function(k,V){return{top:k.top+V.y,left:k.left+V.x,bottom:k.bottom+V.y,right:k.right+V.x}},ct=function(k){return[{x:k.left,y:k.top},{x:k.right,y:k.top},{x:k.left,y:k.bottom},{x:k.right,y:k.bottom}]},ft={top:0,right:0,bottom:0,left:0},He=function(k,V){return V?At(k,V.scroll.diff.displacement):k},Ne=function(k,V,re){if(re&&re.increasedBy){var ce;return Object(J.a)({},k,(ce={},ce[V.end]=k[V.end]+re.increasedBy[V.line],ce))}return k},Ue=function(k,V){return V&&V.shouldClipSubject?Ct(V.pageMarginBox,k):p(k)},ge=function(L){var k=L.page,V=L.withPlaceholder,re=L.axis,ce=L.frame,de=He(k.marginBox,ce),Te=Ne(de,re,V),Se=Ue(Te,ce);return{page:k,withPlaceholder:V,active:Se}},Ee=function(L,k){L.frame||ne(!1);var V=L.frame,re=kt(k,V.scroll.initial),ce=Qt(re),de=Object(J.a)({},V,{scroll:{initial:V.scroll.initial,current:k,diff:{value:re,displacement:ce},max:V.scroll.max}}),Te=ge({page:L.subject.page,withPlaceholder:L.subject.withPlaceholder,axis:L.axis,frame:de}),Se=Object(J.a)({},L,{frame:de,subject:Te});return Se};function De(L){return Number.isInteger?Number.isInteger(L):typeof L=="number"&&isFinite(L)&&Math.floor(L)===L}function ue(L){return Object.values?Object.values(L):Object.keys(L).map(function(k){return L[k]})}function Fe(L,k){if(L.findIndex)return L.findIndex(k);for(var V=0;V<L.length;V++)if(k(L[V]))return V;return-1}function at(L,k){if(L.find)return L.find(k);var V=Fe(L,k);return V!==-1?L[V]:void 0}function xt(L){return Array.prototype.slice.call(L)}var Kt=f(function(L){return L.reduce(function(k,V){return k[V.descriptor.id]=V,k},{})}),Xt=f(function(L){return L.reduce(function(k,V){return k[V.descriptor.id]=V,k},{})}),$t=f(function(L){return ue(L)}),$n=f(function(L){return ue(L)}),vn=f(function(L,k){var V=$n(k).filter(function(re){return L===re.descriptor.droppableId}).sort(function(re,ce){return re.descriptor.index-ce.descriptor.index});return V});function ln(L){return L.at&&L.at.type==="REORDER"?L.at.destination:null}function hn(L){return L.at&&L.at.type==="COMBINE"?L.at.combine:null}var Gn=f(function(L,k){return k.filter(function(V){return V.descriptor.id!==L.descriptor.id})}),fr=function(L){var k=L.isMovingForward,V=L.draggable,re=L.destination,ce=L.insideDestination,de=L.previousImpact;if(!re.isCombineEnabled)return null;var Te=ln(de);if(!Te)return null;function Se(An){var Fn={type:"COMBINE",combine:{draggableId:An,droppableId:re.descriptor.id}};return Object(J.a)({},de,{at:Fn})}var ze=de.displaced.all,it=ze.length?ze[0]:null;if(k)return it?Se(it):null;var ut=Gn(V,ce);if(!it){if(!ut.length)return null;var $e=ut[ut.length-1];return Se($e.descriptor.id)}var Xe=Fe(ut,function(An){return An.descriptor.id===it});Xe!==-1||ne(!1);var tt=Xe-1;if(tt<0)return null;var Dt=ut[tt];return Se(Dt.descriptor.id)},vr=function(L,k){return L.descriptor.droppableId===k.descriptor.id},ir={point:Ve,value:0},br={invisible:{},visible:{},all:[]},Rr={displaced:br,displacedBy:ir,at:null},Jt=function(L,k){return function(V){return L<=V&&V<=k}},Ar=function(L){var k=Jt(L.top,L.bottom),V=Jt(L.left,L.right);return function(re){var ce=k(re.top)&&k(re.bottom)&&V(re.left)&&V(re.right);if(ce)return!0;var de=k(re.top)||k(re.bottom),Te=V(re.left)||V(re.right),Se=de&&Te;if(Se)return!0;var ze=re.top<L.top&&re.bottom>L.bottom,it=re.left<L.left&&re.right>L.right,ut=ze&&it;if(ut)return!0;var $e=ze&&Te||it&&de;return $e}},Nn=function(L){var k=Jt(L.top,L.bottom),V=Jt(L.left,L.right);return function(re){var ce=k(re.top)&&k(re.bottom)&&V(re.left)&&V(re.right);return ce}},Tn={direction:"vertical",line:"y",crossAxisLine:"x",start:"top",end:"bottom",size:"height",crossAxisStart:"left",crossAxisEnd:"right",crossAxisSize:"width"},pr={direction:"horizontal",line:"x",crossAxisLine:"y",start:"left",end:"right",size:"width",crossAxisStart:"top",crossAxisEnd:"bottom",crossAxisSize:"height"},_r=function(L){return function(k){var V=Jt(k.top,k.bottom),re=Jt(k.left,k.right);return function(ce){return L===Tn?V(ce.top)&&V(ce.bottom):re(ce.left)&&re(ce.right)}}},Pr=function(k,V){var re=V.frame?V.frame.scroll.diff.displacement:Ve;return At(k,re)},yr=function(k,V,re){return V.subject.active?re(V.subject.active)(k):!1},mt=function(k,V,re){return re(V)(k)},Ke=function(k){var V=k.target,re=k.destination,ce=k.viewport,de=k.withDroppableDisplacement,Te=k.isVisibleThroughFrameFn,Se=de?Pr(V,re):V;return yr(Se,re,Te)&&mt(Se,ce,Te)},Ot=function(k){return Ke(Object(J.a)({},k,{isVisibleThroughFrameFn:Ar}))},Me=function(k){return Ke(Object(J.a)({},k,{isVisibleThroughFrameFn:Nn}))},ye=function(k){return Ke(Object(J.a)({},k,{isVisibleThroughFrameFn:_r(k.destination.axis)}))},ve=function(k,V,re){if(typeof re=="boolean")return re;if(!V)return!0;var ce=V.invisible,de=V.visible;if(ce[k])return!1;var Te=de[k];return Te?Te.shouldAnimate:!0};function or(L,k){var V=L.page.marginBox,re={top:k.point.y,right:0,bottom:0,left:k.point.x};return p(a(V,re))}function en(L){var k=L.afterDragging,V=L.destination,re=L.displacedBy,ce=L.viewport,de=L.forceShouldAnimate,Te=L.last;return k.reduce(function(ze,it){var ut=or(it,re),$e=it.descriptor.id;ze.all.push($e);var Xe=Ot({target:ut,destination:V,viewport:ce,withDroppableDisplacement:!0});if(!Xe)return ze.invisible[it.descriptor.id]=!0,ze;var tt=ve($e,Te,de),Dt={draggableId:$e,shouldAnimate:tt};return ze.visible[$e]=Dt,ze},{all:[],visible:{},invisible:{}})}function Ie(L,k){if(!L.length)return 0;var V=L[L.length-1].descriptor.index;return k.inHomeList?V:V+1}function gt(L){var k=L.insideDestination,V=L.inHomeList,re=L.displacedBy,ce=L.destination,de=Ie(k,{inHomeList:V});return{displaced:br,displacedBy:re,at:{type:"REORDER",destination:{droppableId:ce.descriptor.id,index:de}}}}function Ce(L){var k=L.draggable,V=L.insideDestination,re=L.destination,ce=L.viewport,de=L.displacedBy,Te=L.last,Se=L.index,ze=L.forceShouldAnimate,it=vr(k,re);if(Se==null)return gt({insideDestination:V,inHomeList:it,displacedBy:de,destination:re});var ut=at(V,function(An){return An.descriptor.index===Se});if(!ut)return gt({insideDestination:V,inHomeList:it,displacedBy:de,destination:re});var $e=Gn(k,V),Xe=V.indexOf(ut),tt=$e.slice(Xe),Dt=en({afterDragging:tt,destination:re,displacedBy:de,last:Te,viewport:ce.frame,forceShouldAnimate:ze});return{displaced:Dt,displacedBy:de,at:{type:"REORDER",destination:{droppableId:re.descriptor.id,index:Se}}}}function dn(L,k){return Boolean(k.effected[L])}var hr=function(L){var k=L.isMovingForward,V=L.destination,re=L.draggables,ce=L.combine,de=L.afterCritical;if(!V.isCombineEnabled)return null;var Te=ce.draggableId,Se=re[Te],ze=Se.descriptor.index,it=dn(Te,de);return it?k?ze:ze-1:k?ze+1:ze},mr=function(L){var k=L.isMovingForward,V=L.isInHomeList,re=L.insideDestination,ce=L.location;if(!re.length)return null;var de=ce.index,Te=k?de+1:de-1,Se=re[0].descriptor.index,ze=re[re.length-1].descriptor.index,it=V?ze:ze+1;return Te<Se||Te>it?null:Te},q=function(L){var k=L.isMovingForward,V=L.isInHomeList,re=L.draggable,ce=L.draggables,de=L.destination,Te=L.insideDestination,Se=L.previousImpact,ze=L.viewport,it=L.afterCritical,ut=Se.at;if(ut||ne(!1),ut.type==="REORDER"){var $e=mr({isMovingForward:k,isInHomeList:V,location:ut.destination,insideDestination:Te});return $e==null?null:Ce({draggable:re,insideDestination:Te,destination:de,viewport:ze,last:Se.displaced,displacedBy:Se.displacedBy,index:$e})}var Xe=hr({isMovingForward:k,destination:de,displaced:Se.displaced,draggables:ce,combine:ut.combine,afterCritical:it});return Xe==null?null:Ce({draggable:re,insideDestination:Te,destination:de,viewport:ze,last:Se.displaced,displacedBy:Se.displacedBy,index:Xe})},O=function(L){var k=L.displaced,V=L.afterCritical,re=L.combineWith,ce=L.displacedBy,de=Boolean(k.visible[re]||k.invisible[re]);return dn(re,V)?de?Ve:Qt(ce.point):de?ce.point:Ve},M=function(L){var k=L.afterCritical,V=L.impact,re=L.draggables,ce=hn(V);ce||ne(!1);var de=ce.draggableId,Te=re[de].page.borderBox.center,Se=O({displaced:V.displaced,afterCritical:k,combineWith:de,displacedBy:V.displacedBy});return Et(Te,Se)},X=function(k,V){return V.margin[k.start]+V.borderBox[k.size]/2},se=function(k,V){return V.margin[k.end]+V.borderBox[k.size]/2},Z=function(k,V,re){return V[k.crossAxisStart]+re.margin[k.crossAxisStart]+re.borderBox[k.crossAxisSize]/2},Pe=function(k){var V=k.axis,re=k.moveRelativeTo,ce=k.isMoving;return an(V.line,re.marginBox[V.end]+X(V,ce),Z(V,re.marginBox,ce))},st=function(k){var V=k.axis,re=k.moveRelativeTo,ce=k.isMoving;return an(V.line,re.marginBox[V.start]-se(V,ce),Z(V,re.marginBox,ce))},wt=function(k){var V=k.axis,re=k.moveInto,ce=k.isMoving;return an(V.line,re.contentBox[V.start]+X(V,ce),Z(V,re.contentBox,ce))},Pt=function(L){var k=L.impact,V=L.draggable,re=L.draggables,ce=L.droppable,de=L.afterCritical,Te=vn(ce.descriptor.id,re),Se=V.page,ze=ce.axis;if(!Te.length)return wt({axis:ze,moveInto:ce.page,isMoving:Se});var it=k.displaced,ut=k.displacedBy,$e=it.all[0];if($e){var Xe=re[$e];if(dn($e,de))return st({axis:ze,moveRelativeTo:Xe.page,isMoving:Se});var tt=R(Xe.page,ut.point);return st({axis:ze,moveRelativeTo:tt,isMoving:Se})}var Dt=Te[Te.length-1];if(Dt.descriptor.id===V.descriptor.id)return Se.borderBox.center;if(dn(Dt.descriptor.id,de)){var An=R(Dt.page,Qt(de.displacedBy.point));return Pe({axis:ze,moveRelativeTo:An,isMoving:Se})}return Pe({axis:ze,moveRelativeTo:Dt.page,isMoving:Se})},dt=function(L,k){var V=L.frame;return V?Et(k,V.scroll.diff.displacement):k},bt=function(k){var V=k.impact,re=k.draggable,ce=k.droppable,de=k.draggables,Te=k.afterCritical,Se=re.page.borderBox.center,ze=V.at;return ce&&ze?ze.type==="REORDER"?Pt({impact:V,draggable:re,draggables:de,droppable:ce,afterCritical:Te}):M({impact:V,draggables:de,afterCritical:Te}):Se},Mt=function(L){var k=bt(L),V=L.droppable,re=V?dt(V,k):k;return re},Cn=function(L,k){var V=kt(k,L.scroll.initial),re=Qt(V),ce=p({top:k.y,bottom:k.y+L.frame.height,left:k.x,right:k.x+L.frame.width}),de={frame:ce,scroll:{initial:L.scroll.initial,max:L.scroll.max,current:k,diff:{value:V,displacement:re}}};return de};function Yn(L,k){return L.map(function(V){return k[V]})}function Hn(L,k){for(var V=0;V<k.length;V++){var re=k[V].visible[L];if(re)return re}return null}var fn=function(L){var k=L.impact,V=L.viewport,re=L.destination,ce=L.draggables,de=L.maxScrollChange,Te=Cn(V,Et(V.scroll.current,de)),Se=re.frame?Ee(re,Et(re.frame.scroll.current,de)):re,ze=k.displaced,it=en({afterDragging:Yn(ze.all,ce),destination:re,displacedBy:k.displacedBy,viewport:Te.frame,last:ze,forceShouldAnimate:!1}),ut=en({afterDragging:Yn(ze.all,ce),destination:Se,displacedBy:k.displacedBy,viewport:V.frame,last:ze,forceShouldAnimate:!1}),$e={},Xe={},tt=[ze,it,ut];ze.all.forEach(function(An){var Fn=Hn(An,tt);if(Fn){Xe[An]=Fn;return}$e[An]=!0});var Dt=Object(J.a)({},k,{displaced:{all:ze.all,invisible:$e,visible:Xe}});return Dt},Wt=function(L,k){return Et(L.scroll.diff.displacement,k)},rn=function(L){var k=L.pageBorderBoxCenter,V=L.draggable,re=L.viewport,ce=Wt(re,k),de=kt(ce,V.page.borderBox.center);return Et(V.client.borderBox.center,de)},qt=function(L){var k=L.draggable,V=L.destination,re=L.newPageBorderBoxCenter,ce=L.viewport,de=L.withDroppableDisplacement,Te=L.onlyOnMainAxis,Se=Te===void 0?!1:Te,ze=kt(re,k.page.borderBox.center),it=At(k.page.borderBox,ze),ut={target:it,destination:V,withDroppableDisplacement:de,viewport:ce};return Se?ye(ut):Me(ut)},Ft=function(L){var k=L.isMovingForward,V=L.draggable,re=L.destination,ce=L.draggables,de=L.previousImpact,Te=L.viewport,Se=L.previousPageBorderBoxCenter,ze=L.previousClientSelection,it=L.afterCritical;if(!re.isEnabled)return null;var ut=vn(re.descriptor.id,ce),$e=vr(V,re),Xe=fr({isMovingForward:k,draggable:V,destination:re,insideDestination:ut,previousImpact:de})||q({isMovingForward:k,isInHomeList:$e,draggable:V,draggables:ce,destination:re,insideDestination:ut,previousImpact:de,viewport:Te,afterCritical:it});if(!Xe)return null;var tt=Mt({impact:Xe,draggable:V,droppable:re,draggables:ce,afterCritical:it}),Dt=qt({draggable:V,destination:re,newPageBorderBoxCenter:tt,viewport:Te.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});if(Dt){var An=rn({pageBorderBoxCenter:tt,draggable:V,viewport:Te});return{clientSelection:An,impact:Xe,scrollJumpRequest:null}}var Fn=kt(tt,Se),ar=fn({impact:Xe,viewport:Te,destination:re,draggables:ce,maxScrollChange:Fn});return{clientSelection:ze,impact:ar,scrollJumpRequest:Fn}},Qn=function(k){var V=k.subject.active;return V||ne(!1),V},Bn=function(L){var k=L.isMovingForward,V=L.pageBorderBoxCenter,re=L.source,ce=L.droppables,de=L.viewport,Te=re.subject.active;if(!Te)return null;var Se=re.axis,ze=Jt(Te[Se.start],Te[Se.end]),it=$t(ce).filter(function($e){return $e!==re}).filter(function($e){return $e.isEnabled}).filter(function($e){return Boolean($e.subject.active)}).filter(function($e){return Ar(de.frame)(Qn($e))}).filter(function($e){var Xe=Qn($e);return k?Te[Se.crossAxisEnd]<Xe[Se.crossAxisEnd]:Xe[Se.crossAxisStart]<Te[Se.crossAxisStart]}).filter(function($e){var Xe=Qn($e),tt=Jt(Xe[Se.start],Xe[Se.end]);return ze(Xe[Se.start])||ze(Xe[Se.end])||tt(Te[Se.start])||tt(Te[Se.end])}).sort(function($e,Xe){var tt=Qn($e)[Se.crossAxisStart],Dt=Qn(Xe)[Se.crossAxisStart];return k?tt-Dt:Dt-tt}).filter(function($e,Xe,tt){return Qn($e)[Se.crossAxisStart]===Qn(tt[0])[Se.crossAxisStart]});if(!it.length)return null;if(it.length===1)return it[0];var ut=it.filter(function($e){var Xe=Jt(Qn($e)[Se.start],Qn($e)[Se.end]);return Xe(V[Se.line])});return ut.length===1?ut[0]:ut.length>1?ut.sort(function($e,Xe){return Qn($e)[Se.start]-Qn(Xe)[Se.start]})[0]:it.sort(function($e,Xe){var tt=qe(V,ct(Qn($e))),Dt=qe(V,ct(Qn(Xe)));return tt!==Dt?tt-Dt:Qn($e)[Se.start]-Qn(Xe)[Se.start]})[0]},xn=function(k,V){var re=k.page.borderBox.center;return dn(k.descriptor.id,V)?kt(re,V.displacedBy.point):re},Jn=function(k,V){var re=k.page.borderBox;return dn(k.descriptor.id,V)?At(re,Qt(V.displacedBy.point)):re},pn=function(L){var k=L.pageBorderBoxCenter,V=L.viewport,re=L.destination,ce=L.insideDestination,de=L.afterCritical,Te=ce.filter(function(Se){return Me({target:Jn(Se,de),destination:re,viewport:V.frame,withDroppableDisplacement:!0})}).sort(function(Se,ze){var it=sn(k,dt(re,xn(Se,de))),ut=sn(k,dt(re,xn(ze,de)));return it<ut?-1:ut<it?1:Se.descriptor.index-ze.descriptor.index});return Te[0]||null},Sn=f(function(k,V){var re=V[k.line];return{value:re,point:an(k.line,re)}}),un=function(k,V,re){var ce=k.axis;if(k.descriptor.mode==="virtual")return an(ce.line,V[ce.line]);var de=k.subject.page.contentBox[ce.size],Te=vn(k.descriptor.id,re),Se=Te.reduce(function(ut,$e){return ut+$e.client.marginBox[ce.size]},0),ze=Se+V[ce.line],it=ze-de;return it<=0?null:an(ce.line,it)},Un=function(k,V){return Object(J.a)({},k,{scroll:Object(J.a)({},k.scroll,{max:V})})},Xn=function(k,V,re){var ce=k.frame;vr(V,k)&&ne(!1),k.subject.withPlaceholder&&ne(!1);var de=Sn(k.axis,V.displaceBy).point,Te=un(k,de,re),Se={placeholderSize:de,increasedBy:Te,oldFrameMaxScroll:k.frame?k.frame.scroll.max:null};if(!ce){var ze=ge({page:k.subject.page,withPlaceholder:Se,axis:k.axis,frame:k.frame});return Object(J.a)({},k,{subject:ze})}var it=Te?Et(ce.scroll.max,Te):ce.scroll.max,ut=Un(ce,it),$e=ge({page:k.subject.page,withPlaceholder:Se,axis:k.axis,frame:ut});return Object(J.a)({},k,{subject:$e,frame:ut})},nr=function(k){var V=k.subject.withPlaceholder;V||ne(!1);var re=k.frame;if(!re){var ce=ge({page:k.subject.page,axis:k.axis,frame:null,withPlaceholder:null});return Object(J.a)({},k,{subject:ce})}var de=V.oldFrameMaxScroll;de||ne(!1);var Te=Un(re,de),Se=ge({page:k.subject.page,axis:k.axis,frame:Te,withPlaceholder:null});return Object(J.a)({},k,{subject:Se,frame:Te})},Ln=function(L){var k=L.previousPageBorderBoxCenter,V=L.moveRelativeTo,re=L.insideDestination,ce=L.draggable,de=L.draggables,Te=L.destination,Se=L.viewport,ze=L.afterCritical;if(!V){if(re.length)return null;var it={displaced:br,displacedBy:ir,at:{type:"REORDER",destination:{droppableId:Te.descriptor.id,index:0}}},ut=Mt({impact:it,draggable:ce,droppable:Te,draggables:de,afterCritical:ze}),$e=vr(ce,Te)?Te:Xn(Te,ce,de),Xe=qt({draggable:ce,destination:$e,newPageBorderBoxCenter:ut,viewport:Se.frame,withDroppableDisplacement:!1,onlyOnMainAxis:!0});return Xe?it:null}var tt=Boolean(k[Te.axis.line]<=V.page.borderBox.center[Te.axis.line]),Dt=function(){var Fn=V.descriptor.index;return V.descriptor.id===ce.descriptor.id||tt?Fn:Fn+1}(),An=Sn(Te.axis,ce.displaceBy);return Ce({draggable:ce,insideDestination:re,destination:Te,viewport:Se,displacedBy:An,last:br,index:Dt})},Kn=function(L){var k=L.isMovingForward,V=L.previousPageBorderBoxCenter,re=L.draggable,ce=L.isOver,de=L.draggables,Te=L.droppables,Se=L.viewport,ze=L.afterCritical,it=Bn({isMovingForward:k,pageBorderBoxCenter:V,source:ce,droppables:Te,viewport:Se});if(!it)return null;var ut=vn(it.descriptor.id,de),$e=pn({pageBorderBoxCenter:V,viewport:Se,destination:it,insideDestination:ut,afterCritical:ze}),Xe=Ln({previousPageBorderBoxCenter:V,destination:it,draggable:re,draggables:de,moveRelativeTo:$e,insideDestination:ut,viewport:Se,afterCritical:ze});if(!Xe)return null;var tt=Mt({impact:Xe,draggable:re,droppable:it,draggables:de,afterCritical:ze}),Dt=rn({pageBorderBoxCenter:tt,draggable:re,viewport:Se});return{clientSelection:Dt,impact:Xe,scrollJumpRequest:null}},nn=function(L){var k=L.at;return k?k.type==="REORDER"?k.destination.droppableId:k.combine.droppableId:null},_n=function(k,V){var re=nn(k);return re?V[re]:null},In=function(L){var k=L.state,V=L.type,re=_n(k.impact,k.dimensions.droppables),ce=Boolean(re),de=k.dimensions.droppables[k.critical.droppable.id],Te=re||de,Se=Te.axis.direction,ze=Se==="vertical"&&(V==="MOVE_UP"||V==="MOVE_DOWN")||Se==="horizontal"&&(V==="MOVE_LEFT"||V==="MOVE_RIGHT");if(ze&&!ce)return null;var it=V==="MOVE_DOWN"||V==="MOVE_RIGHT",ut=k.dimensions.draggables[k.critical.draggable.id],$e=k.current.page.borderBoxCenter,Xe=k.dimensions,tt=Xe.draggables,Dt=Xe.droppables;return ze?Ft({isMovingForward:it,previousPageBorderBoxCenter:$e,draggable:ut,destination:Te,draggables:tt,viewport:k.viewport,previousClientSelection:k.current.client.selection,previousImpact:k.impact,afterCritical:k.afterCritical}):Kn({isMovingForward:it,previousPageBorderBoxCenter:$e,draggable:ut,isOver:Te,draggables:tt,droppables:Dt,viewport:k.viewport,afterCritical:k.afterCritical})};function wn(L){return L.phase==="DRAGGING"||L.phase==="COLLECTING"}function Zn(L){var k=Jt(L.top,L.bottom),V=Jt(L.left,L.right);return function(ce){return k(ce.y)&&V(ce.x)}}function yn(L,k){return L.left<k.right&&L.right>k.left&&L.top<k.bottom&&L.bottom>k.top}function Vn(L){var k=L.pageBorderBox,V=L.draggable,re=L.candidates,ce=V.page.borderBox.center,de=re.map(function(Te){var Se=Te.axis,ze=an(Te.axis.line,k.center[Se.line],Te.page.borderBox.center[Se.crossAxisLine]);return{id:Te.descriptor.id,distance:sn(ce,ze)}}).sort(function(Te,Se){return Se.distance-Te.distance});return de[0]?de[0].id:null}function qn(L){var k=L.pageBorderBox,V=L.draggable,re=L.droppables,ce=$t(re).filter(function(de){if(!de.isEnabled)return!1;var Te=de.subject.active;if(!Te)return!1;if(!yn(k,Te))return!1;if(Zn(Te)(k.center))return!0;var Se=de.axis,ze=Te.center[Se.crossAxisLine],it=k[Se.crossAxisStart],ut=k[Se.crossAxisEnd],$e=Jt(Te[Se.crossAxisStart],Te[Se.crossAxisEnd]),Xe=$e(it),tt=$e(ut);return!Xe&&!tt?!0:Xe?it<ze:ut>ze});return ce.length?ce.length===1?ce[0].descriptor.id:Vn({pageBorderBox:k,draggable:V,candidates:ce}):null}var kn=function(k,V){return p(At(k,V))},Pn=function(L,k){var V=L.frame;return V?kn(k,V.scroll.diff.value):k};function Mn(L){var k=L.displaced,V=L.id;return Boolean(k.visible[V]||k.invisible[V])}function Dn(L){var k=L.draggable,V=L.closest,re=L.inHomeList;return V?re&&V.descriptor.index>k.descriptor.index?V.descriptor.index-1:V.descriptor.index:null}var cn=function(L){var k=L.pageBorderBoxWithDroppableScroll,V=L.draggable,re=L.destination,ce=L.insideDestination,de=L.last,Te=L.viewport,Se=L.afterCritical,ze=re.axis,it=Sn(re.axis,V.displaceBy),ut=it.value,$e=k[ze.start],Xe=k[ze.end],tt=Gn(V,ce),Dt=at(tt,function(Fn){var ar=Fn.descriptor.id,cr=Fn.page.borderBox.center[ze.line],Sr=dn(ar,Se),ur=Mn({displaced:de,id:ar});return Sr?ur?Xe<=cr:$e<cr-ut:ur?Xe<=cr+ut:$e<cr}),An=Dn({draggable:V,closest:Dt,inHomeList:vr(V,re)});return Ce({draggable:V,insideDestination:ce,destination:re,viewport:Te,last:de,displacedBy:it,index:An})},Ut=4,Gt=function(L){var k=L.draggable,V=L.pageBorderBoxWithDroppableScroll,re=L.previousImpact,ce=L.destination,de=L.insideDestination,Te=L.afterCritical;if(!ce.isCombineEnabled)return null;var Se=ce.axis,ze=Sn(ce.axis,k.displaceBy),it=ze.value,ut=V[Se.start],$e=V[Se.end],Xe=Gn(k,de),tt=at(Xe,function(An){var Fn=An.descriptor.id,ar=An.page.borderBox,cr=ar[Se.size],Sr=cr/Ut,ur=dn(Fn,Te),Mr=Mn({displaced:re.displaced,id:Fn});return ur?Mr?$e>ar[Se.start]+Sr&&$e<ar[Se.end]-Sr:ut>ar[Se.start]-it+Sr&&ut<ar[Se.end]-it-Sr:Mr?$e>ar[Se.start]+it+Sr&&$e<ar[Se.end]+it-Sr:ut>ar[Se.start]+Sr&&ut<ar[Se.end]-Sr});if(!tt)return null;var Dt={displacedBy:ze,displaced:re.displaced,at:{type:"COMBINE",combine:{draggableId:tt.descriptor.id,droppableId:ce.descriptor.id}}};return Dt},zt=function(L){var k=L.pageOffset,V=L.draggable,re=L.draggables,ce=L.droppables,de=L.previousImpact,Te=L.viewport,Se=L.afterCritical,ze=kn(V.page.borderBox,k),it=qn({pageBorderBox:ze,draggable:V,droppables:ce});if(!it)return Rr;var ut=ce[it],$e=vn(ut.descriptor.id,re),Xe=Pn(ut,ze);return Gt({pageBorderBoxWithDroppableScroll:Xe,draggable:V,previousImpact:de,destination:ut,insideDestination:$e,afterCritical:Se})||cn({pageBorderBoxWithDroppableScroll:Xe,draggable:V,destination:ut,insideDestination:$e,last:de.displaced,viewport:Te,afterCritical:Se})},jt=function(L,k){var V;return Object(J.a)({},L,(V={},V[k.descriptor.id]=k,V))},tn=function(k){var V=k.previousImpact,re=k.impact,ce=k.droppables,de=nn(V),Te=nn(re);if(!de)return ce;if(de===Te)return ce;var Se=ce[de];if(!Se.subject.withPlaceholder)return ce;var ze=nr(Se);return jt(ce,ze)},bn=function(L){var k=L.draggable,V=L.draggables,re=L.droppables,ce=L.previousImpact,de=L.impact,Te=tn({previousImpact:ce,impact:de,droppables:re}),Se=nn(de);if(!Se)return Te;var ze=re[Se];if(vr(k,ze))return Te;if(ze.subject.withPlaceholder)return Te;var it=Xn(ze,k,V);return jt(Te,it)},gn=function(L){var k=L.state,V=L.clientSelection,re=L.dimensions,ce=L.viewport,de=L.impact,Te=L.scrollJumpRequest,Se=ce||k.viewport,ze=re||k.dimensions,it=V||k.current.client.selection,ut=kt(it,k.initial.client.selection),$e={offset:ut,selection:it,borderBoxCenter:Et(k.initial.client.borderBoxCenter,ut)},Xe={selection:Et($e.selection,Se.scroll.current),borderBoxCenter:Et($e.borderBoxCenter,Se.scroll.current),offset:Et($e.offset,Se.scroll.diff.value)},tt={client:$e,page:Xe};if(k.phase==="COLLECTING")return Object(J.a)({phase:"COLLECTING"},k,{dimensions:ze,viewport:Se,current:tt});var Dt=ze.draggables[k.critical.draggable.id],An=de||zt({pageOffset:Xe.offset,draggable:Dt,draggables:ze.draggables,droppables:ze.droppables,previousImpact:k.impact,viewport:Se,afterCritical:k.afterCritical}),Fn=bn({draggable:Dt,impact:An,previousImpact:k.impact,draggables:ze.draggables,droppables:ze.droppables}),ar=Object(J.a)({},k,{current:tt,dimensions:{draggables:ze.draggables,droppables:Fn},impact:An,viewport:Se,scrollJumpRequest:Te||null,forceShouldAnimate:Te?!1:null});return ar};function yt(L,k){return L.map(function(V){return k[V]})}var lt=function(L){var k=L.impact,V=L.viewport,re=L.draggables,ce=L.destination,de=L.forceShouldAnimate,Te=k.displaced,Se=yt(Te.all,re),ze=en({afterDragging:Se,destination:ce,displacedBy:k.displacedBy,viewport:V.frame,forceShouldAnimate:de,last:Te});return Object(J.a)({},k,{displaced:ze})},Je=function(L){var k=L.impact,V=L.draggable,re=L.droppable,ce=L.draggables,de=L.viewport,Te=L.afterCritical,Se=Mt({impact:k,draggable:V,draggables:ce,droppable:re,afterCritical:Te});return rn({pageBorderBoxCenter:Se,draggable:V,viewport:de})},nt=function(L){var k=L.state,V=L.dimensions,re=L.viewport;k.movementMode==="SNAP"||ne(!1);var ce=k.impact,de=re||k.viewport,Te=V||k.dimensions,Se=Te.draggables,ze=Te.droppables,it=Se[k.critical.draggable.id],ut=nn(ce);ut||ne(!1);var $e=ze[ut],Xe=lt({impact:ce,viewport:de,destination:$e,draggables:Se}),tt=Je({impact:Xe,draggable:it,droppable:$e,draggables:Se,viewport:de,afterCritical:k.afterCritical});return gn({impact:Xe,clientSelection:tt,state:k,dimensions:Te,viewport:de})},Ge=function(L){return{index:L.index,droppableId:L.droppableId}},pt=function(L){var k=L.draggable,V=L.home,re=L.draggables,ce=L.viewport,de=Sn(V.axis,k.displaceBy),Te=vn(V.descriptor.id,re),Se=Te.indexOf(k);Se!==-1||ne(!1);var ze=Te.slice(Se+1),it=ze.reduce(function(tt,Dt){return tt[Dt.descriptor.id]=!0,tt},{}),ut={inVirtualList:V.descriptor.mode==="virtual",displacedBy:de,effected:it},$e=en({afterDragging:ze,destination:V,displacedBy:de,last:null,viewport:ce.frame,forceShouldAnimate:!1}),Xe={displaced:$e,displacedBy:de,at:{type:"REORDER",destination:Ge(k.descriptor)}};return{impact:Xe,afterCritical:ut}},rt=function(L,k){return{draggables:L.draggables,droppables:jt(L.droppables,k)}},Tt=function(k){},Nt=function(k){},St=function(L){var k=L.draggable,V=L.offset,re=L.initialWindowScroll,ce=R(k.client,V),de=T(ce,re),Te=Object(J.a)({},k,{placeholder:Object(J.a)({},k.placeholder,{client:ce}),client:ce,page:de});return Te},Ht=function(L){var k=L.frame;return k||ne(!1),k},Rt=function(L){var k=L.additions,V=L.updatedDroppables,re=L.viewport,ce=re.scroll.diff.value;return k.map(function(de){var Te=de.descriptor.droppableId,Se=V[Te],ze=Ht(Se),it=ze.scroll.diff.value,ut=Et(ce,it),$e=St({draggable:de,offset:ut,initialWindowScroll:re.scroll.initial});return $e})},Lt=function(L){var k=L.state,V=L.published;Tt();var re=V.modified.map(function(Sr){var ur=k.dimensions.droppables[Sr.droppableId],Mr=Ee(ur,Sr.scroll);return Mr}),ce=Object(J.a)({},k.dimensions.droppables,{},Kt(re)),de=Xt(Rt({additions:V.additions,updatedDroppables:ce,viewport:k.viewport})),Te=Object(J.a)({},k.dimensions.draggables,{},de);V.removals.forEach(function(Sr){delete Te[Sr]});var Se={droppables:ce,draggables:Te},ze=nn(k.impact),it=ze?Se.droppables[ze]:null,ut=Se.draggables[k.critical.draggable.id],$e=Se.droppables[k.critical.droppable.id],Xe=pt({draggable:ut,home:$e,draggables:Te,viewport:k.viewport}),tt=Xe.impact,Dt=Xe.afterCritical,An=it&&it.isCombineEnabled?k.impact:tt,Fn=zt({pageOffset:k.current.page.offset,draggable:Se.draggables[k.critical.draggable.id],draggables:Se.draggables,droppables:Se.droppables,previousImpact:An,viewport:k.viewport,afterCritical:Dt});Nt();var ar=Object(J.a)({phase:"DRAGGING"},k,{phase:"DRAGGING",impact:Fn,onLiftImpact:tt,dimensions:Se,afterCritical:Dt,forceShouldAnimate:!1});if(k.phase==="COLLECTING")return ar;var cr=Object(J.a)({phase:"DROP_PENDING"},ar,{phase:"DROP_PENDING",reason:k.reason,isWaiting:!1});return cr},En=function(k){return k.movementMode==="SNAP"},on=function(k,V,re){var ce=rt(k.dimensions,V);return!En(k)||re?gn({state:k,dimensions:ce}):nt({state:k,dimensions:ce})};function gr(L){return L.isDragging&&L.movementMode==="SNAP"?Object(J.a)({phase:"DRAGGING"},L,{scrollJumpRequest:null}):L}var er={phase:"IDLE",completed:null,shouldFlush:!1},tr=function(L,k){if(L===void 0&&(L=er),k.type==="FLUSH")return Object(J.a)({},er,{shouldFlush:!0});if(k.type==="INITIAL_PUBLISH"){L.phase==="IDLE"||ne(!1);var V=k.payload,re=V.critical,ce=V.clientSelection,de=V.viewport,Te=V.dimensions,Se=V.movementMode,ze=Te.draggables[re.draggable.id],it=Te.droppables[re.droppable.id],ut={selection:ce,borderBoxCenter:ze.client.borderBox.center,offset:Ve},$e={client:ut,page:{selection:Et(ut.selection,de.scroll.initial),borderBoxCenter:Et(ut.selection,de.scroll.initial),offset:Et(ut.selection,de.scroll.diff.value)}},Xe=$t(Te.droppables).every(function(Tr){return!Tr.isFixedOnPage}),tt=pt({draggable:ze,home:it,draggables:Te.draggables,viewport:de}),Dt=tt.impact,An=tt.afterCritical,Fn={phase:"DRAGGING",isDragging:!0,critical:re,movementMode:Se,dimensions:Te,initial:$e,current:$e,isWindowScrollAllowed:Xe,impact:Dt,afterCritical:An,onLiftImpact:Dt,viewport:de,scrollJumpRequest:null,forceShouldAnimate:null};return Fn}if(k.type==="COLLECTION_STARTING"){if(L.phase==="COLLECTING"||L.phase==="DROP_PENDING")return L;L.phase==="DRAGGING"||ne(!1);var ar=Object(J.a)({phase:"COLLECTING"},L,{phase:"COLLECTING"});return ar}if(k.type==="PUBLISH_WHILE_DRAGGING")return L.phase==="COLLECTING"||L.phase==="DROP_PENDING"||ne(!1),Lt({state:L,published:k.payload});if(k.type==="MOVE"){if(L.phase==="DROP_PENDING")return L;wn(L)||ne(!1);var cr=k.payload.client;return Vt(cr,L.current.client.selection)?L:gn({state:L,clientSelection:cr,impact:En(L)?L.impact:null})}if(k.type==="UPDATE_DROPPABLE_SCROLL"){if(L.phase==="DROP_PENDING")return gr(L);if(L.phase==="COLLECTING")return gr(L);wn(L)||ne(!1);var Sr=k.payload,ur=Sr.id,Mr=Sr.newScroll,Lr=L.dimensions.droppables[ur];if(!Lr)return L;var Br=Ee(Lr,Mr);return on(L,Br,!1)}if(k.type==="UPDATE_DROPPABLE_IS_ENABLED"){if(L.phase==="DROP_PENDING")return L;wn(L)||ne(!1);var $r=k.payload,e=$r.id,n=$r.isEnabled,d=L.dimensions.droppables[e];d||ne(!1),d.isEnabled!==n||ne(!1);var l=Object(J.a)({},d,{isEnabled:n});return on(L,l,!0)}if(k.type==="UPDATE_DROPPABLE_IS_COMBINE_ENABLED"){if(L.phase==="DROP_PENDING")return L;wn(L)||ne(!1);var y=k.payload,G=y.id,ee=y.isCombineEnabled,ae=L.dimensions.droppables[G];ae||ne(!1),ae.isCombineEnabled!==ee||ne(!1);var oe=Object(J.a)({},ae,{isCombineEnabled:ee});return on(L,oe,!0)}if(k.type==="MOVE_BY_WINDOW_SCROLL"){if(L.phase==="DROP_PENDING"||L.phase==="DROP_ANIMATING")return L;wn(L)||ne(!1),L.isWindowScrollAllowed||ne(!1);var me=k.payload.newScroll;if(Vt(L.viewport.scroll.current,me))return gr(L);var We=Cn(L.viewport,me);return En(L)?nt({state:L,viewport:We}):gn({state:L,viewport:We})}if(k.type==="UPDATE_VIEWPORT_MAX_SCROLL"){if(!wn(L))return L;var Ye=k.payload.maxScroll;if(Vt(Ye,L.viewport.scroll.max))return L;var vt=Object(J.a)({},L.viewport,{scroll:Object(J.a)({},L.viewport.scroll,{max:Ye})});return Object(J.a)({phase:"DRAGGING"},L,{viewport:vt})}if(k.type==="MOVE_UP"||k.type==="MOVE_DOWN"||k.type==="MOVE_LEFT"||k.type==="MOVE_RIGHT"){if(L.phase==="COLLECTING"||L.phase==="DROP_PENDING")return L;L.phase==="DRAGGING"||ne(!1);var ht=In({state:L,type:k.type});return ht?gn({state:L,impact:ht.impact,clientSelection:ht.clientSelection,scrollJumpRequest:ht.scrollJumpRequest}):L}if(k.type==="DROP_PENDING"){var Bt=k.payload.reason;L.phase==="COLLECTING"||ne(!1);var Zt=Object(J.a)({phase:"DROP_PENDING"},L,{phase:"DROP_PENDING",isWaiting:!0,reason:Bt});return Zt}if(k.type==="DROP_ANIMATE"){var mn=k.payload,jn=mn.completed,sr=mn.dropDuration,Wn=mn.newHomeClientOffset;L.phase==="DRAGGING"||L.phase==="DROP_PENDING"||ne(!1);var dr={phase:"DROP_ANIMATING",completed:jn,dropDuration:sr,newHomeClientOffset:Wn,dimensions:L.dimensions};return dr}if(k.type==="DROP_COMPLETE"){var Or=k.payload.completed;return{phase:"IDLE",completed:Or,shouldFlush:!1}}return L},Yt=function(k){return{type:"BEFORE_INITIAL_CAPTURE",payload:k}},Rn=function(k){return{type:"LIFT",payload:k}},zn=function(k){return{type:"INITIAL_PUBLISH",payload:k}},rr=function(k){return{type:"PUBLISH_WHILE_DRAGGING",payload:k}},On=function(){return{type:"COLLECTION_STARTING",payload:null}},Ir=function(k){return{type:"UPDATE_DROPPABLE_SCROLL",payload:k}},jr=function(k){return{type:"UPDATE_DROPPABLE_IS_ENABLED",payload:k}},xr=function(k){return{type:"UPDATE_DROPPABLE_IS_COMBINE_ENABLED",payload:k}},lr=function(k){return{type:"MOVE",payload:k}},wr=function(k){return{type:"MOVE_BY_WINDOW_SCROLL",payload:k}},Er=function(k){return{type:"UPDATE_VIEWPORT_MAX_SCROLL",payload:k}},Cr=function(){return{type:"MOVE_UP",payload:null}},Ur=function(){return{type:"MOVE_DOWN",payload:null}},Vr=function(){return{type:"MOVE_RIGHT",payload:null}},Fr=function(){return{type:"MOVE_LEFT",payload:null}},kr=function(){return{type:"FLUSH",payload:null}},Ti=function(k){return{type:"DROP_ANIMATE",payload:k}},Kr=function(k){return{type:"DROP_COMPLETE",payload:k}},Si=function(k){return{type:"DROP",payload:k}},Zr=function(k){return{type:"DROP_PENDING",payload:k}},ei=function(){return{type:"DROP_ANIMATION_FINISHED",payload:null}};function yi(L){if(L.length<=1)return;for(var k=L.map(function(Se){return Se.descriptor.index}),V={},re=1;re<k.length;re++){var ce=k[re],de=k[re-1];ce!==de+1&&(V[ce]=!0)}if(!Object.keys(V).length)return;var Te=k.map(function(Se){var ze=Boolean(V[Se]);return ze?"[\u{1F525}"+Se+"]":""+Se}).join(", ")}function Ri(L,k){if(!1)var V}var Va=function(L){return function(k){var V=k.getState,re=k.dispatch;return function(ce){return function(de){if(de.type!=="LIFT"){ce(de);return}var Te=de.payload,Se=Te.id,ze=Te.clientSelection,it=Te.movementMode,ut=V();ut.phase==="DROP_ANIMATING"&&re(Kr({completed:ut.completed})),V().phase==="IDLE"||ne(!1),re(kr()),re(Yt({draggableId:Se,movementMode:it}));var $e={shouldPublishImmediately:it==="SNAP"},Xe={draggableId:Se,scrollOptions:$e},tt=L.startPublishing(Xe),Dt=tt.critical,An=tt.dimensions,Fn=tt.viewport;Ri(Dt,An),re(zn({critical:Dt,dimensions:An,clientSelection:ze,movementMode:it,viewport:Fn}))}}}},fi=function(L){return function(){return function(k){return function(V){V.type==="INITIAL_PUBLISH"&&L.dragging(),V.type==="DROP_ANIMATE"&&L.dropping(V.payload.completed.result.reason),(V.type==="FLUSH"||V.type==="DROP_COMPLETE")&&L.resting(),k(V)}}}},Xa={outOfTheWay:"cubic-bezier(0.2, 0, 0, 1)",drop:"cubic-bezier(.2,1,.1,1)"},Ki={opacity:{drop:0,combining:.7},scale:{drop:.75}},ki={outOfTheWay:.2,minDropTime:.33,maxDropTime:.55},ai=ki.outOfTheWay+"s "+Xa.outOfTheWay,Ji={fluid:"opacity "+ai,snap:"transform "+ai+", opacity "+ai,drop:function(k){var V=k+"s "+Xa.drop;return"transform "+V+", opacity "+V},outOfTheWay:"transform "+ai,placeholder:"height "+ai+", width "+ai+", margin "+ai},ys=function(k){return Vt(k,Ve)?null:"translate("+k.x+"px, "+k.y+"px)"},bs={moveTo:ys,drop:function(k,V){var re=ys(k);return re?V?re+" scale("+Ki.scale.drop+")":re:null}},Es=ki.minDropTime,co=ki.maxDropTime,ho=co-Es,xs=1500,Ca=.6,fo=function(L){var k=L.current,V=L.destination,re=L.reason,ce=sn(k,V);if(ce<=0)return Es;if(ce>=xs)return co;var de=ce/xs,Te=Es+ho*de,Se=re==="CANCEL"?Te*Ca:Te;return Number(Se.toFixed(2))},po=function(L){var k=L.impact,V=L.draggable,re=L.dimensions,ce=L.viewport,de=L.afterCritical,Te=re.draggables,Se=re.droppables,ze=nn(k),it=ze?Se[ze]:null,ut=Se[V.descriptor.droppableId],$e=Je({impact:k,draggable:V,draggables:Te,afterCritical:de,droppable:it||ut,viewport:ce}),Xe=kt($e,V.client.borderBox.center);return Xe},ws=function(L){var k=L.draggables,V=L.reason,re=L.lastImpact,ce=L.home,de=L.viewport,Te=L.onLiftImpact;if(!re.at||V!=="DROP"){var Se=lt({draggables:k,impact:Te,destination:ce,viewport:de,forceShouldAnimate:!0});return{impact:Se,didDropInsideDroppable:!1}}if(re.at.type==="REORDER")return{impact:re,didDropInsideDroppable:!0};var ze=Object(J.a)({},re,{displaced:br});return{impact:ze,didDropInsideDroppable:!0}},$a=function(L){var k=L.getState,V=L.dispatch;return function(re){return function(ce){if(ce.type!=="DROP"){re(ce);return}var de=k(),Te=ce.payload.reason;if(de.phase==="COLLECTING"){V(Zr({reason:Te}));return}if(de.phase==="IDLE")return;var Se=de.phase==="DROP_PENDING"&&de.isWaiting;Se&&ne(!1),de.phase==="DRAGGING"||de.phase==="DROP_PENDING"||ne(!1);var ze=de.critical,it=de.dimensions,ut=it.draggables[de.critical.draggable.id],$e=ws({reason:Te,lastImpact:de.impact,afterCritical:de.afterCritical,onLiftImpact:de.onLiftImpact,home:de.dimensions.droppables[de.critical.droppable.id],viewport:de.viewport,draggables:de.dimensions.draggables}),Xe=$e.impact,tt=$e.didDropInsideDroppable,Dt=tt?ln(Xe):null,An=tt?hn(Xe):null,Fn={index:ze.draggable.index,droppableId:ze.droppable.id},ar={draggableId:ut.descriptor.id,type:ut.descriptor.type,source:Fn,reason:Te,mode:de.movementMode,destination:Dt,combine:An},cr=po({impact:Xe,draggable:ut,dimensions:it,viewport:de.viewport,afterCritical:de.afterCritical}),Sr={critical:de.critical,afterCritical:de.afterCritical,result:ar,impact:Xe},ur=!Vt(de.current.client.offset,cr)||Boolean(ar.combine);if(!ur){V(Kr({completed:Sr}));return}var Mr=fo({current:de.current.client.offset,destination:cr,reason:Te}),Lr={newHomeClientOffset:cr,dropDuration:Mr,completed:Sr};V(Ti(Lr))}}},Cs=function(){return{x:window.pageXOffset,y:window.pageYOffset}};function Ts(L){return{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(V){if(V.target!==window&&V.target!==window.document)return;L()}}}function xi(L){var k=L.onWindowScroll;function V(){k(Cs())}var re=E(V),ce=Ts(re),de=xe;function Te(){return de!==xe}function Se(){Te()&&ne(!1),de=we(window,[ce])}function ze(){Te()||ne(!1),re.cancel(),de(),de=xe}return{start:Se,stop:ze,isActive:Te}}var mo=function(k){return k.type==="DROP_COMPLETE"||k.type==="DROP_ANIMATE"||k.type==="FLUSH"},Ss=function(L){var k=xi({onWindowScroll:function(re){L.dispatch(wr({newScroll:re}))}});return function(V){return function(re){!k.isActive()&&re.type==="INITIAL_PUBLISH"&&k.start(),k.isActive()&&mo(re)&&k.stop(),V(re)}}},Rs=function(L){var k=!1,V=!1,re=setTimeout(function(){V=!0}),ce=function(Te){if(k)return;if(V)return;k=!0,L(Te),clearTimeout(re)};return ce.wasCalled=function(){return k},ce},go=function(){var L=[],k=function(de){var Te=Fe(L,function(it){return it.timerId===de});Te!==-1||ne(!1);var Se=L.splice(Te,1),ze=Se[0];ze.callback()},V=function(de){var Te=setTimeout(function(){return k(Te)}),Se={timerId:Te,callback:de};L.push(Se)},re=function(){if(!L.length)return;var de=[].concat(L);L.length=0,de.forEach(function(Te){clearTimeout(Te.timerId),Te.callback()})};return{add:V,flush:re}},vo=function(k,V){return k==null&&V==null?!0:k==null||V==null?!1:k.droppableId===V.droppableId&&k.index===V.index},Os=function(k,V){return k==null&&V==null?!0:k==null||V==null?!1:k.draggableId===V.draggableId&&k.droppableId===V.droppableId},El=function(k,V){if(k===V)return!0;var re=k.draggable.id===V.draggable.id&&k.draggable.droppableId===V.draggable.droppableId&&k.draggable.type===V.draggable.type&&k.draggable.index===V.draggable.index,ce=k.droppable.id===V.droppable.id&&k.droppable.type===V.droppable.type;return re&&ce},Ta=function(k,V){Tt(),V(),Nt()},Ya=function(k,V){return{draggableId:k.draggable.id,type:k.droppable.type,source:{droppableId:k.droppable.id,index:k.draggable.index},mode:V}},Oi=function(k,V,re,ce){if(!k){re(ce(V));return}var de=Rs(re),Te={announce:de};k(V,Te),de.wasCalled()||re(ce(V))},Zi=function(L,k){var V=go(),re=null,ce=function(Xe,tt){re&&ne(!1),Ta("onBeforeCapture",function(){var Dt=L().onBeforeCapture;if(Dt){var An={draggableId:Xe,mode:tt};Dt(An)}})},de=function(Xe,tt){re&&ne(!1),Ta("onBeforeDragStart",function(){var Dt=L().onBeforeDragStart;Dt&&Dt(Ya(Xe,tt))})},Te=function(Xe,tt){re&&ne(!1);var Dt=Ya(Xe,tt);re={mode:tt,lastCritical:Xe,lastLocation:Dt.source,lastCombine:null},V.add(function(){Ta("onDragStart",function(){return Oi(L().onDragStart,Dt,k,Qe.onDragStart)})})},Se=function(Xe,tt){var Dt=ln(tt),An=hn(tt);re||ne(!1);var Fn=!El(Xe,re.lastCritical);Fn&&(re.lastCritical=Xe);var ar=!vo(re.lastLocation,Dt);ar&&(re.lastLocation=Dt);var cr=!Os(re.lastCombine,An);if(cr&&(re.lastCombine=An),!Fn&&!ar&&!cr)return;var Sr=Object(J.a)({},Ya(Xe,re.mode),{combine:An,destination:Dt});V.add(function(){Ta("onDragUpdate",function(){return Oi(L().onDragUpdate,Sr,k,Qe.onDragUpdate)})})},ze=function(){re||ne(!1),V.flush()},it=function(Xe){re||ne(!1),re=null,Ta("onDragEnd",function(){return Oi(L().onDragEnd,Xe,k,Qe.onDragEnd)})},ut=function(){if(!re)return;var Xe=Object(J.a)({},Ya(re.lastCritical,re.mode),{combine:null,destination:null,reason:"CANCEL"});it(Xe)};return{beforeCapture:ce,beforeStart:de,start:Te,update:Se,flush:ze,drop:it,abort:ut}},qi=function(L,k){var V=Zi(L,k);return function(re){return function(ce){return function(de){if(de.type==="BEFORE_INITIAL_CAPTURE"){V.beforeCapture(de.payload.draggableId,de.payload.movementMode);return}if(de.type==="INITIAL_PUBLISH"){var Te=de.payload.critical;V.beforeStart(Te,de.payload.movementMode),ce(de),V.start(Te,de.payload.movementMode);return}if(de.type==="DROP_COMPLETE"){var Se=de.payload.completed.result;V.flush(),ce(de),V.drop(Se);return}if(ce(de),de.type==="FLUSH"){V.abort();return}var ze=re.getState();ze.phase==="DRAGGING"&&V.update(ze.critical,ze.impact)}}}},As=function(L){return function(k){return function(V){if(V.type!=="DROP_ANIMATION_FINISHED"){k(V);return}var re=L.getState();re.phase==="DROP_ANIMATING"||ne(!1),L.dispatch(Kr({completed:re.completed}))}}},Ds=function(L){var k=null,V=null;function re(){V&&(cancelAnimationFrame(V),V=null),k&&(k(),k=null)}return function(ce){return function(de){if((de.type==="FLUSH"||de.type==="DROP_COMPLETE"||de.type==="DROP_ANIMATION_FINISHED")&&re(),ce(de),de.type!=="DROP_ANIMATE")return;var Te={eventName:"scroll",options:{capture:!0,passive:!1,once:!0},fn:function(){var ze=L.getState();ze.phase==="DROP_ANIMATING"&&L.dispatch(ei())}};V=requestAnimationFrame(function(){V=null,k=we(window,[Te])})}}},_o=function(L){return function(){return function(k){return function(V){(V.type==="DROP_COMPLETE"||V.type==="FLUSH"||V.type==="DROP_ANIMATE")&&L.stopPublishing(),k(V)}}}},Ps=function(L){var k=!1;return function(){return function(V){return function(re){if(re.type==="INITIAL_PUBLISH"){k=!0,L.tryRecordFocus(re.payload.critical.draggable.id),V(re),L.tryRestoreFocusRecorded();return}if(V(re),!k)return;if(re.type==="FLUSH"){k=!1,L.tryRestoreFocusRecorded();return}if(re.type==="DROP_COMPLETE"){k=!1;var ce=re.payload.completed.result;ce.combine&&L.tryShiftRecord(ce.draggableId,ce.combine.draggableId),L.tryRestoreFocusRecorded()}}}}},Gi=function(k){return k.type==="DROP_COMPLETE"||k.type==="DROP_ANIMATE"||k.type==="FLUSH"},zi=function(L){return function(k){return function(V){return function(re){if(Gi(re)){L.stop(),V(re);return}if(re.type==="INITIAL_PUBLISH"){V(re);var ce=k.getState();ce.phase==="DRAGGING"||ne(!1),L.start(ce);return}V(re),L.scroll(k.getState())}}}},li=function(L){return function(k){return function(V){if(k(V),V.type!=="PUBLISH_WHILE_DRAGGING")return;var re=L.getState();if(re.phase!=="DROP_PENDING")return;if(re.isWaiting)return;L.dispatch(Si({reason:re.reason}))}}},Mi=K.d,Ni=function(L){var k=L.dimensionMarshal,V=L.focusMarshal,re=L.styleMarshal,ce=L.getResponders,de=L.announce,Te=L.autoScroller;return Object(K.e)(tr,Mi(Object(K.a)(fi(re),_o(k),Va(k),$a,As,Ds,li,zi(Te),Ss,Ps(V),qi(ce,de))))},ea=function(){return{additions:{},removals:{},modified:{}}};function xl(L){var k=L.registry,V=L.callbacks,re=ea(),ce=null,de=function(){if(ce)return;V.collectionStarting(),ce=requestAnimationFrame(function(){ce=null,Tt();var ut=re,$e=ut.additions,Xe=ut.removals,tt=ut.modified,Dt=Object.keys($e).map(function(ar){return k.draggable.getById(ar).getDimension(Ve)}).sort(function(ar,cr){return ar.descriptor.index-cr.descriptor.index}),An=Object.keys(tt).map(function(ar){var cr=k.droppable.getById(ar),Sr=cr.callbacks.getScrollWhileDragging();return{droppableId:ar,scroll:Sr}}),Fn={additions:Dt,removals:Object.keys(Xe),modified:An};re=ea(),Nt(),V.publish(Fn)})},Te=function(ut){var $e=ut.descriptor.id;re.additions[$e]=ut,re.modified[ut.descriptor.droppableId]=!0,re.removals[$e]&&delete re.removals[$e],de()},Se=function(ut){var $e=ut.descriptor;re.removals[$e.id]=!0,re.modified[$e.droppableId]=!0,re.additions[$e.id]&&delete re.additions[$e.id],de()},ze=function(){if(!ce)return;cancelAnimationFrame(ce),ce=null,re=ea()};return{add:Te,remove:Se,stop:ze}}var Ls=function(L){var k=L.scrollHeight,V=L.scrollWidth,re=L.height,ce=L.width,de=kt({x:V,y:k},{x:ce,y:re}),Te={x:Math.max(0,de.x),y:Math.max(0,de.y)};return Te},ta=function(){var L=document.documentElement;return L||ne(!1),L},Is=function(){var L=ta(),k=Ls({scrollHeight:L.scrollHeight,scrollWidth:L.scrollWidth,width:L.clientWidth,height:L.clientHeight});return k},yo=function(){var L=Cs(),k=Is(),V=L.y,re=L.x,ce=ta(),de=ce.clientWidth,Te=ce.clientHeight,Se=re+de,ze=V+Te,it=p({top:V,left:re,right:Se,bottom:ze}),ut={frame:it,scroll:{initial:L,current:L,max:k,diff:{value:Ve,displacement:Ve}}};return ut},Qa=function(L){var k=L.critical,V=L.scrollOptions,re=L.registry;Tt();var ce=yo(),de=ce.scroll.current,Te=k.droppable,Se=re.droppable.getAllByType(Te.type).map(function($e){return $e.callbacks.getDimensionAndWatchScroll(de,V)}),ze=re.draggable.getAllByType(k.draggable.type).map(function($e){return $e.getDimension(de)}),it={draggables:Xt(ze),droppables:Kt(Se)};Nt();var ut={dimensions:it,critical:k,viewport:ce};return ut};function bo(L,k,V){if(V.descriptor.id===k.id)return!1;if(V.descriptor.type!==k.type)return!1;var re=L.droppable.getById(V.descriptor.droppableId);return!(re.descriptor.mode!=="virtual")}var ks=function(L,k){var V=null,re=xl({callbacks:{publish:k.publishWhileDragging,collectionStarting:k.collectionStarting},registry:L}),ce=function(tt,Dt){if(L.droppable.exists(tt)||ne(!1),!V)return;k.updateDroppableIsEnabled({id:tt,isEnabled:Dt})},de=function(tt,Dt){if(!V)return;L.droppable.exists(tt)||ne(!1),k.updateDroppableIsCombineEnabled({id:tt,isCombineEnabled:Dt})},Te=function(tt,Dt){if(!V)return;L.droppable.exists(tt)||ne(!1),k.updateDroppableScroll({id:tt,newScroll:Dt})},Se=function(tt,Dt){if(!V)return;L.droppable.getById(tt).callbacks.scroll(Dt)},ze=function(){if(!V)return;re.stop();var tt=V.critical.droppable;L.droppable.getAllByType(tt.type).forEach(function(Dt){return Dt.callbacks.dragStopped()}),V.unsubscribe(),V=null},it=function(tt){V||ne(!1);var Dt=V.critical.draggable;tt.type==="ADDITION"&&(bo(L,Dt,tt.value)&&re.add(tt.value)),tt.type==="REMOVAL"&&(bo(L,Dt,tt.value)&&re.remove(tt.value))},ut=function(tt){V&&ne(!1);var Dt=L.draggable.getById(tt.draggableId),An=L.droppable.getById(Dt.descriptor.droppableId),Fn={draggable:Dt.descriptor,droppable:An.descriptor},ar=L.subscribe(it);return V={critical:Fn,unsubscribe:ar},Qa({critical:Fn,registry:L,scrollOptions:tt.scrollOptions})},$e={updateDroppableIsEnabled:ce,updateDroppableIsCombineEnabled:de,scrollDroppable:Se,updateDroppableScroll:Te,startPublishing:ut,stopPublishing:ze};return $e},Ms=function(L,k){return L.phase==="IDLE"?!0:L.phase!=="DROP_ANIMATING"||L.completed.result.draggableId===k?!1:L.completed.result.reason==="DROP"},Eo=function(L){window.scrollBy(L.x,L.y)},Ns=f(function(L){return $t(L).filter(function(k){return k.isEnabled?!!k.frame:!1})}),na=function(k,V){var re=at(Ns(V),function(ce){return ce.frame||ne(!1),Zn(ce.frame.pageMarginBox)(k)});return re},Ja=function(L){var k=L.center,V=L.destination,re=L.droppables;if(V){var ce=re[V];return ce.frame?ce:null}var de=na(k,re);return de},Ai={startFromPercentage:.25,maxScrollAtPercentage:.05,maxPixelScroll:28,ease:function(k){return Math.pow(k,2)},durationDampening:{stopDampeningAt:1200,accelerateAt:360}},Za=function(L,k){var V=L[k.size]*Ai.startFromPercentage,re=L[k.size]*Ai.maxScrollAtPercentage,ce={startScrollingFrom:V,maxScrollValueAt:re};return ce},xo=function(L){var k=L.startOfRange,V=L.endOfRange,re=L.current,ce=V-k;if(ce===0)return 0;var de=re-k,Te=de/ce;return Te},Us=1,wl=function(L,k){if(L>k.startScrollingFrom)return 0;if(L<=k.maxScrollValueAt)return Ai.maxPixelScroll;if(L===k.startScrollingFrom)return Us;var V=xo({startOfRange:k.maxScrollValueAt,endOfRange:k.startScrollingFrom,current:L}),re=1-V,ce=Ai.maxPixelScroll*Ai.ease(re);return Math.ceil(ce)},qa=Ai.durationDampening.accelerateAt,es=Ai.durationDampening.stopDampeningAt,ra=function(L,k){var V=k,re=es,ce=Date.now(),de=ce-V;if(de>=es)return L;if(de<qa)return Us;var Te=xo({startOfRange:qa,endOfRange:re,current:de}),Se=L*Ai.ease(Te);return Math.ceil(Se)},ia=function(L){var k=L.distanceToEdge,V=L.thresholds,re=L.dragStartTime,ce=L.shouldUseTimeDampening,de=wl(k,V);return de===0?0:ce?Math.max(ra(de,re),Us):de},wo=function(L){var k=L.container,V=L.distanceToEdges,re=L.dragStartTime,ce=L.axis,de=L.shouldUseTimeDampening,Te=Za(k,ce),Se=V[ce.end]<V[ce.start];return Se?ia({distanceToEdge:V[ce.end],thresholds:Te,dragStartTime:re,shouldUseTimeDampening:de}):-1*ia({distanceToEdge:V[ce.start],thresholds:Te,dragStartTime:re,shouldUseTimeDampening:de})},ts=function(L){var k=L.container,V=L.subject,re=L.proposedScroll,ce=V.height>k.height,de=V.width>k.width;return!de&&!ce?re:de&&ce?null:{x:de?0:re.x,y:ce?0:re.y}},Co=Ze(function(L){return L===0?0:L}),aa=function(L){var k=L.dragStartTime,V=L.container,re=L.subject,ce=L.center,de=L.shouldUseTimeDampening,Te={top:ce.y-V.top,right:V.right-ce.x,bottom:V.bottom-ce.y,left:ce.x-V.left},Se=wo({container:V,distanceToEdges:Te,dragStartTime:k,axis:Tn,shouldUseTimeDampening:de}),ze=wo({container:V,distanceToEdges:Te,dragStartTime:k,axis:pr,shouldUseTimeDampening:de}),it=Co({x:ze,y:Se});if(Vt(it,Ve))return null;var ut=ts({container:V,subject:re,proposedScroll:it});return ut?Vt(ut,Ve)?null:ut:null},To=Ze(function(L){return L===0?0:L>0?1:-1}),Di=function(){var L=function(V,re){return V<0?V:V>re?V-re:0};return function(k){var V=k.current,re=k.max,ce=k.change,de=Et(V,ce),Te={x:L(de.x,re.x),y:L(de.y,re.y)};return Vt(Te,Ve)?null:Te}}(),sa=function(k){var V=k.max,re=k.current,ce=k.change,de={x:Math.max(re.x,V.x),y:Math.max(re.y,V.y)},Te=To(ce),Se=Di({max:de,current:re,change:Te});return Se?Te.x!==0&&Se.x===0?!0:Te.y!==0&&Se.y===0:!0},Pi=function(k,V){return sa({current:k.scroll.current,max:k.scroll.max,change:V})},Sa=function(k,V){if(!Pi(k,V))return null;var re=k.scroll.max,ce=k.scroll.current;return Di({current:ce,max:re,change:V})},Ui=function(k,V){var re=k.frame;return re?sa({current:re.scroll.current,max:re.scroll.max,change:V}):!1},So=function(k,V){var re=k.frame;return re&&Ui(k,V)?Di({current:re.scroll.current,max:re.scroll.max,change:V}):null},Ro=function(L){var k=L.viewport,V=L.subject,re=L.center,ce=L.dragStartTime,de=L.shouldUseTimeDampening,Te=aa({dragStartTime:ce,container:k.frame,subject:V,center:re,shouldUseTimeDampening:de});return Te&&Pi(k,Te)?Te:null},Oo=function(L){var k=L.droppable,V=L.subject,re=L.center,ce=L.dragStartTime,de=L.shouldUseTimeDampening,Te=k.frame;if(!Te)return null;var Se=aa({dragStartTime:ce,container:Te.pageMarginBox,subject:V,center:re,shouldUseTimeDampening:de});return Se&&Ui(k,Se)?Se:null},Ao=function(L){var k=L.state,V=L.dragStartTime,re=L.shouldUseTimeDampening,ce=L.scrollWindow,de=L.scrollDroppable,Te=k.current.page.borderBoxCenter,Se=k.dimensions.draggables[k.critical.draggable.id],ze=Se.page.marginBox;if(k.isWindowScrollAllowed){var it=k.viewport,ut=Ro({dragStartTime:V,viewport:it,subject:ze,center:Te,shouldUseTimeDampening:re});if(ut){ce(ut);return}}var $e=Ja({center:Te,destination:nn(k.impact),droppables:k.dimensions.droppables});if(!$e)return;var Xe=Oo({dragStartTime:V,droppable:$e,subject:ze,center:Te,shouldUseTimeDampening:re});Xe&&de($e.descriptor.id,Xe)},Vi=function(L){var k=L.scrollWindow,V=L.scrollDroppable,re=E(k),ce=E(V),de=null,Te=function(ut){de||ne(!1);var $e=de,Xe=$e.shouldUseTimeDampening,tt=$e.dragStartTime;Ao({state:ut,scrollWindow:re,scrollDroppable:ce,dragStartTime:tt,shouldUseTimeDampening:Xe})},Se=function(ut){Tt(),de&&ne(!1);var $e=Date.now(),Xe=!1,tt=function(){Xe=!0};Ao({state:ut,dragStartTime:0,shouldUseTimeDampening:!1,scrollWindow:tt,scrollDroppable:tt}),de={dragStartTime:$e,shouldUseTimeDampening:Xe},Nt(),Xe&&Te(ut)},ze=function(){if(!de)return;re.cancel(),ce.cancel(),de=null};return{start:Se,stop:ze,scroll:Te}},Xi=function(L){var k=L.move,V=L.scrollDroppable,re=L.scrollWindow,ce=function(it,ut){var $e=Et(it.current.client.selection,ut);k({client:$e})},de=function(it,ut){if(!Ui(it,ut))return ut;var $e=So(it,ut);if(!$e)return V(it.descriptor.id,ut),null;var Xe=kt(ut,$e);V(it.descriptor.id,Xe);var tt=kt(ut,Xe);return tt},Te=function(it,ut,$e){if(!it)return $e;if(!Pi(ut,$e))return $e;var Xe=Sa(ut,$e);if(!Xe)return re($e),null;var tt=kt($e,Xe);re(tt);var Dt=kt($e,tt);return Dt},Se=function(it){var ut=it.scrollJumpRequest;if(!ut)return;var $e=nn(it.impact);$e||ne(!1);var Xe=de(it.dimensions.droppables[$e],ut);if(!Xe)return;var tt=it.viewport,Dt=Te(it.isWindowScrollAllowed,tt,Xe);if(!Dt)return;ce(it,Dt)};return Se},Cl=function(L){var k=L.scrollDroppable,V=L.scrollWindow,re=L.move,ce=Vi({scrollWindow:V,scrollDroppable:k}),de=Xi({move:re,scrollWindow:V,scrollDroppable:k}),Te=function(it){if(it.phase!=="DRAGGING")return;if(it.movementMode==="FLUID"){ce.scroll(it);return}if(!it.scrollJumpRequest)return;de(it)},Se={scroll:Te,start:ce.start,stop:ce.stop};return Se},oa="data-rbd",la=function(){var L=oa+"-drag-handle";return{base:L,draggableId:L+"-draggable-id",contextId:L+"-context-id"}}(),Fs=function(){var L=oa+"-draggable";return{base:L,contextId:L+"-context-id",id:L+"-id"}}(),Tl=function(){var L=oa+"-droppable";return{base:L,contextId:L+"-context-id",id:L+"-id"}}(),Do={contextId:oa+"-scroll-container-context-id"},di=function(k){return function(V){return"["+V+'="'+k+'"]'}},Gr=function(k,V){return k.map(function(re){var ce=re.styles[V];return ce?re.selector+" { "+ce+" }":""}).join(" ")},si="pointer-events: none;",Yr=function(L){var k=di(L),V=function(){var Se=`
cursor: -webkit-grab;
cursor: grab;
`;return{selector:k(la.contextId),styles:{always:`
-webkit-touch-callout: none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
touch-action: manipulation;
`,resting:Se,dragging:si,dropAnimating:Se}}}(),re=function(){var Se=`
transition: `+Ji.outOfTheWay+`;
`;return{selector:k(Fs.contextId),styles:{dragging:Se,dropAnimating:Se,userCancel:Se}}}(),ce={selector:k(Tl.contextId),styles:{always:"overflow-anchor: none;"}},de={selector:"body",styles:{dragging:`
cursor: grabbing;
cursor: -webkit-grabbing;
user-select: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
overflow-anchor: none;
`}},Te=[re,V,ce,de];return{always:Gr(Te,"always"),resting:Gr(Te,"resting"),dragging:Gr(Te,"dragging"),dropAnimating:Gr(Te,"dropAnimating"),userCancel:Gr(Te,"userCancel")}},ti=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined"?te.useLayoutEffect:te.useEffect,Bs=function(){var k=document.querySelector("head");return k||ne(!1),k},Ra=function(k){var V=document.createElement("style");return k&&V.setAttribute("nonce",k),V.type="text/css",V};function Sl(L,k){var V=D(function(){return Yr(L)},[L]),re=Object(te.useRef)(null),ce=Object(te.useRef)(null),de=m(f(function($e){var Xe=ce.current;Xe||ne(!1),Xe.textContent=$e}),[]),Te=m(function($e){var Xe=re.current;Xe||ne(!1),Xe.textContent=$e},[]);ti(function(){!re.current&&!ce.current||ne(!1);var $e=Ra(k),Xe=Ra(k);return re.current=$e,ce.current=Xe,$e.setAttribute(oa+"-always",L),Xe.setAttribute(oa+"-dynamic",L),Bs().appendChild($e),Bs().appendChild(Xe),Te(V.always),de(V.resting),function(){var tt=function(An){var Fn=An.current;Fn||ne(!1),Bs().removeChild(Fn),An.current=null};tt(re),tt(ce)}},[k,Te,de,V.always,V.resting,L]);var Se=m(function(){return de(V.dragging)},[de,V.dragging]),ze=m(function($e){if($e==="DROP"){de(V.dropAnimating);return}de(V.userCancel)},[de,V.dropAnimating,V.userCancel]),it=m(function(){if(!ce.current)return;de(V.resting)},[de,V.resting]),ut=D(function(){return{dragging:Se,dropping:ze,resting:it}},[Se,ze,it]);return ut}var Po=function(L){return L&&L.ownerDocument?L.ownerDocument.defaultView:window};function Oa(L){return L instanceof Po(L).HTMLElement}function ns(L,k){var V="["+la.contextId+'="'+L+'"]',re=xt(document.querySelectorAll(V));if(!re.length)return null;var ce=at(re,function(de){return de.getAttribute(la.draggableId)===k});return ce&&Oa(ce)?ce:null}function Lo(L){var k=Object(te.useRef)({}),V=Object(te.useRef)(null),re=Object(te.useRef)(null),ce=Object(te.useRef)(!1),de=m(function(Xe,tt){var Dt={id:Xe,focus:tt};return k.current[Xe]=Dt,function(){var Fn=k.current,ar=Fn[Xe];ar!==Dt&&delete Fn[Xe]}},[]),Te=m(function(Xe){var tt=ns(L,Xe);tt&&tt!==document.activeElement&&tt.focus()},[L]),Se=m(function(Xe,tt){V.current===Xe&&(V.current=tt)},[]),ze=m(function(){if(re.current)return;if(!ce.current)return;re.current=requestAnimationFrame(function(){re.current=null;var Xe=V.current;Xe&&Te(Xe)})},[Te]),it=m(function(Xe){V.current=null;var tt=document.activeElement;if(!tt)return;if(tt.getAttribute(la.draggableId)!==Xe)return;V.current=Xe},[]);ti(function(){return ce.current=!0,function(){ce.current=!1;var Xe=re.current;Xe&&cancelAnimationFrame(Xe)}},[]);var ut=D(function(){return{register:de,tryRecordFocus:it,tryRestoreFocusRecorded:ze,tryShiftRecord:Se}},[de,it,ze,Se]);return ut}function js(){var L={draggables:{},droppables:{}},k=[];function V($e){return k.push($e),function(){var tt=k.indexOf($e);if(tt===-1)return;k.splice(tt,1)}}function re($e){k.length&&k.forEach(function(Xe){return Xe($e)})}function ce($e){return L.draggables[$e]||null}function de($e){var Xe=ce($e);return Xe||ne(!1),Xe}var Te={register:function(Xe){L.draggables[Xe.descriptor.id]=Xe,re({type:"ADDITION",value:Xe})},update:function(Xe,tt){var Dt=L.draggables[tt.descriptor.id];if(!Dt)return;if(Dt.uniqueId!==Xe.uniqueId)return;delete L.draggables[tt.descriptor.id],L.draggables[Xe.descriptor.id]=Xe},unregister:function(Xe){var tt=Xe.descriptor.id,Dt=ce(tt);if(!Dt)return;if(Xe.uniqueId!==Dt.uniqueId)return;delete L.draggables[tt],re({type:"REMOVAL",value:Xe})},getById:de,findById:ce,exists:function(Xe){return Boolean(ce(Xe))},getAllByType:function(Xe){return ue(L.draggables).filter(function(tt){return tt.descriptor.type===Xe})}};function Se($e){return L.droppables[$e]||null}function ze($e){var Xe=Se($e);return Xe||ne(!1),Xe}var it={register:function(Xe){L.droppables[Xe.descriptor.id]=Xe},unregister:function(Xe){var tt=Se(Xe.descriptor.id);if(!tt)return;if(Xe.uniqueId!==tt.uniqueId)return;delete L.droppables[Xe.descriptor.id]},getById:ze,findById:Se,exists:function(Xe){return Boolean(Se(Xe))},getAllByType:function(Xe){return ue(L.droppables).filter(function(tt){return tt.descriptor.type===Xe})}};function ut(){L.draggables={},L.droppables={},k.length=0}return{draggable:Te,droppable:it,subscribe:V,clean:ut}}function Rl(){var L=D(js,[]);return Object(te.useEffect)(function(){return function(){requestAnimationFrame(L.clean)}},[L]),L}var Aa=Q.a.createContext(null),$i=function(){var L=document.body;return L||ne(!1),L},Io={position:"absolute",width:"1px",height:"1px",margin:"-1px",border:"0",padding:"0",overflow:"hidden",clip:"rect(0 0 0 0)","clip-path":"inset(100%)"},ko=function(k){return"rbd-announcement-"+k};function Ws(L){var k=D(function(){return ko(L)},[L]),V=Object(te.useRef)(null);Object(te.useEffect)(function(){var de=document.createElement("div");return V.current=de,de.id=k,de.setAttribute("aria-live","assertive"),de.setAttribute("aria-atomic","true"),Object(J.a)(de.style,Io),$i().appendChild(de),function(){setTimeout(function(){var ze=$i();ze.contains(de)&&ze.removeChild(de),de===V.current&&(V.current=null)})}},[k]);var re=m(function(ce){var de=V.current;if(de){de.textContent=ce;return}},[]);return re}var Hs=0,Da={separator:"::"};function Ol(){Hs=0}function ua(L,k){return k===void 0&&(k=Da),D(function(){return""+L+k.separator+Hs++},[k.separator,L])}function pi(L){var k=L.contextId,V=L.uniqueId;return"rbd-hidden-text-"+k+"-"+V}function Mo(L){var k=L.contextId,V=L.text,re=ua("hidden-text",{separator:"-"}),ce=D(function(){return pi({contextId:k,uniqueId:re})},[re,k]);return Object(te.useEffect)(function(){var Te=document.createElement("div");return Te.id=ce,Te.textContent=V,Te.style.display="none",$i().appendChild(Te),function(){var ze=$i();ze.contains(Te)&&ze.removeChild(Te)}},[ce,V]),ce}var rs=Q.a.createContext(null),No={react:"^16.8.5","react-dom":"^16.8.5"},mi=/(\d+)\.(\d+)\.(\d+)/,Nr=function(k){var V=mi.exec(k);V!=null||ne(!1);var re=Number(V[1]),ce=Number(V[2]),de=Number(V[3]);return{major:re,minor:ce,patch:de,raw:k}},wi=function(k,V){return V.major>k.major?!0:V.major<k.major?!1:V.minor>k.minor?!0:V.minor<k.minor?!1:V.patch>=k.patch},Fi=function(L,k){var V=Nr(L),re=Nr(k);if(wi(V,re))return},Yi=`
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
`,Uo=function(L){var k=L.doctype;if(!k)return;k.name.toLowerCase()!=="html",k.publicId!==""};function Pa(L){}function ca(L,k){Pa(function(){Object(te.useEffect)(function(){try{L()}catch(V){he(`
A setup problem was encountered.
> `+V.message+`
`)}},k)})}function Al(){ca(function(){Fi(No.react,Q.a.version),Uo(document)},[])}function La(L){var k=Object(te.useRef)(L);return Object(te.useEffect)(function(){k.current=L}),k}function Ia(){var L=null;function k(){return Boolean(L)}function V(Te){return Te===L}function re(Te){L&&ne(!1);var Se={abandon:Te};return L=Se,Se}function ce(){L||ne(!1),L=null}function de(){L&&(L.abandon(),ce())}return{isClaimed:k,isActive:V,claim:re,release:ce,tryAbandon:de}}var Fo=9,Ks=13,Ci=27,Gs=32,Bo=33,Dl=34,is=35,zs=36,jo=37,Pl=38,Wo=39,Ll=40,as,ss=(as={},as[Ks]=!0,as[Fo]=!0,as),Vs=function(L){ss[L.keyCode]&&L.preventDefault()},os=function(){var L="visibilitychange";if(typeof document=="undefined")return L;var k=[L,"ms"+L,"webkit"+L,"moz"+L,"o"+L],V=at(k,function(re){return"on"+re in document});return V||L}(),Ho=0,Xs=5;function da(L,k){return Math.abs(k.x-L.x)>=Xs||Math.abs(k.y-L.y)>=Xs}var ls={type:"IDLE"};function us(L){var k=L.cancel,V=L.completed,re=L.getPhase,ce=L.setPhase;return[{eventName:"mousemove",fn:function(Te){var Se=Te.button,ze=Te.clientX,it=Te.clientY;if(Se!==Ho)return;var ut={x:ze,y:it},$e=re();if($e.type==="DRAGGING"){Te.preventDefault(),$e.actions.move(ut);return}$e.type==="PENDING"||ne(!1);var Xe=$e.point;if(!da(Xe,ut))return;Te.preventDefault();var tt=$e.actions.fluidLift(ut);ce({type:"DRAGGING",actions:tt})}},{eventName:"mouseup",fn:function(Te){var Se=re();if(Se.type!=="DRAGGING"){k();return}Te.preventDefault(),Se.actions.drop({shouldBlockNextClick:!0}),V()}},{eventName:"mousedown",fn:function(Te){re().type==="DRAGGING"&&Te.preventDefault(),k()}},{eventName:"keydown",fn:function(Te){var Se=re();if(Se.type==="PENDING"){k();return}if(Te.keyCode===Ci){Te.preventDefault(),k();return}Vs(Te)}},{eventName:"resize",fn:k},{eventName:"scroll",options:{passive:!0,capture:!1},fn:function(){re().type==="PENDING"&&k()}},{eventName:"webkitmouseforcedown",fn:function(Te){var Se=re();if(Se.type!=="IDLE"||ne(!1),Se.actions.shouldRespectForcePress()){k();return}Te.preventDefault()}},{eventName:os,fn:k}]}function Ko(L){var k=Object(te.useRef)(ls),V=Object(te.useRef)(xe),re=D(function(){return{eventName:"mousedown",fn:function($e){if($e.defaultPrevented)return;if($e.button!==Ho)return;if($e.ctrlKey||$e.metaKey||$e.shiftKey||$e.altKey)return;var Xe=L.findClosestDraggableId($e);if(!Xe)return;var tt=L.tryGetLock(Xe,Te,{sourceEvent:$e});if(!tt)return;$e.preventDefault();var Dt={x:$e.clientX,y:$e.clientY};V.current(),it(tt,Dt)}}},[L]),ce=D(function(){return{eventName:"webkitmouseforcewillbegin",fn:function($e){if($e.defaultPrevented)return;var Xe=L.findClosestDraggableId($e);if(!Xe)return;var tt=L.findOptionsForDraggable(Xe);if(!tt)return;if(tt.shouldRespectForcePress)return;if(!L.canGetLock(Xe))return;$e.preventDefault()}}},[L]),de=m(function(){var $e={passive:!1,capture:!0};V.current=we(window,[ce,re],$e)},[ce,re]),Te=m(function(){var ut=k.current;if(ut.type==="IDLE")return;k.current=ls,V.current(),de()},[de]),Se=m(function(){var ut=k.current;Te(),ut.type==="DRAGGING"&&ut.actions.cancel({shouldBlockNextClick:!0}),ut.type==="PENDING"&&ut.actions.abort()},[Te]),ze=m(function(){var $e={capture:!0,passive:!1},Xe=us({cancel:Se,completed:Te,getPhase:function(){return k.current},setPhase:function(Dt){k.current=Dt}});V.current=we(window,Xe,$e)},[Se,Te]),it=m(function($e,Xe){k.current.type==="IDLE"||ne(!1),k.current={type:"PENDING",point:Xe,actions:$e},ze()},[ze]);ti(function(){return de(),function(){V.current()}},[de])}var Bi;function Go(){}var Il=(Bi={},Bi[Dl]=!0,Bi[Bo]=!0,Bi[zs]=!0,Bi[is]=!0,Bi);function zo(L,k){function V(){k(),L.cancel()}function re(){k(),L.drop()}return[{eventName:"keydown",fn:function(de){if(de.keyCode===Ci){de.preventDefault(),V();return}if(de.keyCode===Gs){de.preventDefault(),re();return}if(de.keyCode===Ll){de.preventDefault(),L.moveDown();return}if(de.keyCode===Pl){de.preventDefault(),L.moveUp();return}if(de.keyCode===Wo){de.preventDefault(),L.moveRight();return}if(de.keyCode===jo){de.preventDefault(),L.moveLeft();return}if(Il[de.keyCode]){de.preventDefault();return}Vs(de)}},{eventName:"mousedown",fn:V},{eventName:"mouseup",fn:V},{eventName:"click",fn:V},{eventName:"touchstart",fn:V},{eventName:"resize",fn:V},{eventName:"wheel",fn:V,options:{passive:!0}},{eventName:os,fn:V}]}function ni(L){var k=Object(te.useRef)(Go),V=D(function(){return{eventName:"keydown",fn:function(de){if(de.defaultPrevented)return;if(de.keyCode!==Gs)return;var Te=L.findClosestDraggableId(de);if(!Te)return;var Se=L.tryGetLock(Te,ut,{sourceEvent:de});if(!Se)return;de.preventDefault();var ze=!0,it=Se.snapLift();k.current();function ut(){ze||ne(!1),ze=!1,k.current(),re()}k.current=we(window,zo(it,ut),{capture:!0,passive:!1})}}},[L]),re=m(function(){var de={passive:!1,capture:!0};k.current=we(window,[V],de)},[V]);ti(function(){return re(),function(){k.current()}},[re])}var ha={type:"IDLE"},Vo=120,Xo=.15;function $o(L){var k=L.cancel,V=L.getPhase;return[{eventName:"orientationchange",fn:k},{eventName:"resize",fn:k},{eventName:"contextmenu",fn:function(ce){ce.preventDefault()}},{eventName:"keydown",fn:function(ce){if(V().type!=="DRAGGING"){k();return}ce.keyCode===Ci&&ce.preventDefault(),k()}},{eventName:os,fn:k}]}function fa(L){var k=L.cancel,V=L.completed,re=L.getPhase;return[{eventName:"touchmove",options:{capture:!1},fn:function(de){var Te=re();if(Te.type!=="DRAGGING"){k();return}Te.hasMoved=!0;var Se=de.touches[0],ze=Se.clientX,it=Se.clientY,ut={x:ze,y:it};de.preventDefault(),Te.actions.move(ut)}},{eventName:"touchend",fn:function(de){var Te=re();if(Te.type!=="DRAGGING"){k();return}de.preventDefault(),Te.actions.drop({shouldBlockNextClick:!0}),V()}},{eventName:"touchcancel",fn:function(de){if(re().type!=="DRAGGING"){k();return}de.preventDefault(),k()}},{eventName:"touchforcechange",fn:function(de){var Te=re();Te.type!=="IDLE"||ne(!1);var Se=de.touches[0];if(!Se)return;var ze=Se.force>=Xo;if(!ze)return;var it=Te.actions.shouldRespectForcePress();if(Te.type==="PENDING"){it&&k();return}if(it){if(Te.hasMoved){de.preventDefault();return}k();return}de.preventDefault()}},{eventName:os,fn:k}]}function cs(L){var k=Object(te.useRef)(ha),V=Object(te.useRef)(xe),re=m(function(){return k.current},[]),ce=m(function(tt){k.current=tt},[]),de=D(function(){return{eventName:"touchstart",fn:function(tt){if(tt.defaultPrevented)return;var Dt=L.findClosestDraggableId(tt);if(!Dt)return;var An=L.tryGetLock(Dt,Se,{sourceEvent:tt});if(!An)return;var Fn=tt.touches[0],ar=Fn.clientX,cr=Fn.clientY,Sr={x:ar,y:cr};V.current(),$e(An,Sr)}}},[L]),Te=m(function(){var tt={capture:!0,passive:!1};V.current=we(window,[de],tt)},[de]),Se=m(function(){var Xe=k.current;if(Xe.type==="IDLE")return;Xe.type==="PENDING"&&clearTimeout(Xe.longPressTimerId),ce(ha),V.current(),Te()},[Te,ce]),ze=m(function(){var Xe=k.current;Se(),Xe.type==="DRAGGING"&&Xe.actions.cancel({shouldBlockNextClick:!0}),Xe.type==="PENDING"&&Xe.actions.abort()},[Se]),it=m(function(){var tt={capture:!0,passive:!1},Dt={cancel:ze,completed:Se,getPhase:re},An=we(window,fa(Dt),tt),Fn=we(window,$o(Dt),tt);V.current=function(){An(),Fn()}},[ze,re,Se]),ut=m(function(){var tt=re();tt.type==="PENDING"||ne(!1);var Dt=tt.actions.fluidLift(tt.point);ce({type:"DRAGGING",actions:Dt,hasMoved:!1})},[re,ce]),$e=m(function(tt,Dt){re().type==="IDLE"||ne(!1);var An=setTimeout(ut,Vo);ce({type:"PENDING",point:Dt,actions:tt,longPressTimerId:An}),it()},[it,re,ce,ut]);ti(function(){return Te(),function(){V.current();var Dt=re();Dt.type==="PENDING"&&(clearTimeout(Dt.longPressTimerId),ce(ha))}},[re,Te,ce]),ti(function(){var tt=we(window,[{eventName:"touchmove",fn:function(){},options:{capture:!1,passive:!1}}]);return tt},[])}function Yo(L){Pa(function(){var k=La(L);ca(function(){k.current.length===L.length||ne(!1)})})}var Qo={input:!0,button:!0,textarea:!0,select:!0,option:!0,optgroup:!0,video:!0,audio:!0};function $s(L,k){if(k==null)return!1;var V=Boolean(Qo[k.tagName.toLowerCase()]);if(V)return!0;var re=k.getAttribute("contenteditable");return re==="true"||re===""?!0:k===L?!1:$s(L,k.parentElement)}function pa(L,k){var V=k.target;return Oa(V)?$s(L,V):!1}var Jo=function(L){return p(L.getBoundingClientRect()).center};function ds(L){return L instanceof Po(L).Element}var Zo=function(){var L="matches";if(typeof document=="undefined")return L;var k=[L,"msMatchesSelector","webkitMatchesSelector"],V=at(k,function(re){return re in Element.prototype});return V||L}();function ma(L,k){return L==null?null:L[Zo](k)?L:ma(L.parentElement,k)}function kl(L,k){return L.closest?L.closest(k):ma(L,k)}function ga(L){return"["+la.contextId+'="'+L+'"]'}function qo(L,k){var V=k.target;if(!ds(V))return null;var re=ga(L),ce=kl(V,re);return ce&&Oa(ce)?ce:null}function el(L,k){var V=qo(L,k);return V?V.getAttribute(la.draggableId):null}function tl(L,k){var V="["+Fs.contextId+'="'+L+'"]',re=xt(document.querySelectorAll(V)),ce=at(re,function(de){return de.getAttribute(Fs.id)===k});return ce&&Oa(ce)?ce:null}function ka(L){L.preventDefault()}function ji(L){var k=L.expected,V=L.phase,re=L.isLockActive,ce=L.shouldWarn;return re()?!(k!==V):!1}function va(L){var k=L.lockAPI,V=L.store,re=L.registry,ce=L.draggableId;if(k.isClaimed())return!1;var de=re.draggable.findById(ce);return de&&de.options.isEnabled?!!Ms(V.getState(),ce):!1}function Ma(L){var k=L.lockAPI,V=L.contextId,re=L.store,ce=L.registry,de=L.draggableId,Te=L.forceSensorStop,Se=L.sourceEvent,ze=va({lockAPI:k,store:re,registry:ce,draggableId:de});if(!ze)return null;var it=ce.draggable.getById(de),ut=tl(V,it.descriptor.id);if(!ut)return null;if(Se&&!it.options.canDragInteractiveElements&&pa(ut,Se))return null;var $e=k.claim(Te||xe),Xe="PRE_DRAG";function tt(){return it.options.shouldRespectForcePress}function Dt(){return k.isActive($e)}function An(Lr,Br){ji({expected:Lr,phase:Xe,isLockActive:Dt,shouldWarn:!0})&&re.dispatch(Br())}var Fn=An.bind(null,"DRAGGING");function ar(Lr){function Br(){k.release(),Xe="COMPLETED"}Xe!=="PRE_DRAG"&&(Br(),Xe==="PRE_DRAG"||ne(!1)),re.dispatch(Rn(Lr.liftActionArgs)),Xe="DRAGGING";function $r(e,n){if(n===void 0&&(n={shouldBlockNextClick:!1}),Lr.cleanup(),n.shouldBlockNextClick){var d=we(window,[{eventName:"click",fn:ka,options:{once:!0,passive:!1,capture:!0}}]);setTimeout(d)}Br(),re.dispatch(Si({reason:e}))}return Object(J.a)({isActive:function(){return ji({expected:"DRAGGING",phase:Xe,isLockActive:Dt,shouldWarn:!1})},shouldRespectForcePress:tt,drop:function(n){return $r("DROP",n)},cancel:function(n){return $r("CANCEL",n)}},Lr.actions)}function cr(Lr){var Br=E(function(e){Fn(function(){return lr({client:e})})}),$r=ar({liftActionArgs:{id:de,clientSelection:Lr,movementMode:"FLUID"},cleanup:function(){return Br.cancel()},actions:{move:Br}});return Object(J.a)({},$r,{move:Br})}function Sr(){var Lr={moveUp:function(){return Fn(Cr)},moveRight:function(){return Fn(Vr)},moveDown:function(){return Fn(Ur)},moveLeft:function(){return Fn(Fr)}};return ar({liftActionArgs:{id:de,clientSelection:Jo(ut),movementMode:"SNAP"},cleanup:xe,actions:Lr})}function ur(){var Lr=ji({expected:"PRE_DRAG",phase:Xe,isLockActive:Dt,shouldWarn:!0});Lr&&k.release()}var Mr={isActive:function(){return ji({expected:"PRE_DRAG",phase:Xe,isLockActive:Dt,shouldWarn:!1})},shouldRespectForcePress:tt,fluidLift:cr,snapLift:Sr,abort:ur};return Mr}var nl=[Ko,ni,cs];function Ml(L){var k=L.contextId,V=L.store,re=L.registry,ce=L.customSensors,de=L.enableDefaultSensors,Te=[].concat(de?nl:[],ce||[]),Se=Object(te.useState)(function(){return Ia()})[0],ze=m(function(cr,Sr){cr.isDragging&&!Sr.isDragging&&Se.tryAbandon()},[Se]);ti(function(){var cr=V.getState(),Sr=V.subscribe(function(){var ur=V.getState();ze(cr,ur),cr=ur});return Sr},[Se,V,ze]),ti(function(){return Se.tryAbandon},[Se.tryAbandon]);var it=m(function(ar){return va({lockAPI:Se,registry:re,store:V,draggableId:ar})},[Se,re,V]),ut=m(function(ar,cr,Sr){return Ma({lockAPI:Se,registry:re,contextId:k,store:V,draggableId:ar,forceSensorStop:cr,sourceEvent:Sr&&Sr.sourceEvent?Sr.sourceEvent:null})},[k,Se,re,V]),$e=m(function(ar){return el(k,ar)},[k]),Xe=m(function(ar){var cr=re.draggable.findById(ar);return cr?cr.options:null},[re.draggable]),tt=m(function(){if(!Se.isClaimed())return;Se.tryAbandon(),V.getState().phase!=="IDLE"&&V.dispatch(kr())},[Se,V]),Dt=m(Se.isClaimed,[Se]),An=D(function(){return{canGetLock:it,tryGetLock:ut,findClosestDraggableId:$e,findOptionsForDraggable:Xe,tryReleaseLock:tt,isLockClaimed:Dt}},[it,ut,$e,Xe,tt,Dt]);Yo(Te);for(var Fn=0;Fn<Te.length;Fn++)Te[Fn](An)}var rl=function(k){return{onBeforeCapture:k.onBeforeCapture,onBeforeDragStart:k.onBeforeDragStart,onDragStart:k.onDragStart,onDragEnd:k.onDragEnd,onDragUpdate:k.onDragUpdate}};function bi(L){return L.current||ne(!1),L.current}function _a(L){var k=L.contextId,V=L.setCallbacks,re=L.sensors,ce=L.nonce,de=L.dragHandleUsageInstructions,Te=Object(te.useRef)(null);Al();var Se=La(L),ze=m(function(){return rl(Se.current)},[Se]),it=Ws(k),ut=Mo({contextId:k,text:de}),$e=Sl(k,ce),Xe=m(function(e){bi(Te).dispatch(e)},[]),tt=D(function(){return Object(K.b)({publishWhileDragging:rr,updateDroppableScroll:Ir,updateDroppableIsEnabled:jr,updateDroppableIsCombineEnabled:xr,collectionStarting:On},Xe)},[Xe]),Dt=Rl(),An=D(function(){return ks(Dt,tt)},[Dt,tt]),Fn=D(function(){return Cl(Object(J.a)({scrollWindow:Eo,scrollDroppable:An.scrollDroppable},Object(K.b)({move:lr},Xe)))},[An.scrollDroppable,Xe]),ar=Lo(k),cr=D(function(){return Ni({announce:it,autoScroller:Fn,dimensionMarshal:An,focusMarshal:ar,getResponders:ze,styleMarshal:$e})},[it,Fn,An,ar,ze,$e]);Te.current=cr;var Sr=m(function(){var e=bi(Te),n=e.getState();n.phase!=="IDLE"&&e.dispatch(kr())},[]),ur=m(function(){var e=bi(Te).getState();return e.isDragging||e.phase==="DROP_ANIMATING"},[]),Mr=D(function(){return{isDragging:ur,tryAbort:Sr}},[ur,Sr]);V(Mr);var Lr=m(function(e){return Ms(bi(Te).getState(),e)},[]),Br=m(function(){return wn(bi(Te).getState())},[]),$r=D(function(){return{marshal:An,focus:ar,contextId:k,canLift:Lr,isMovementAllowed:Br,dragHandleUsageInstructionsId:ut,registry:Dt}},[k,An,ut,ar,Lr,Br,Dt]);return Ml({contextId:k,store:cr,registry:Dt,customSensors:re,enableDefaultSensors:L.enableDefaultSensors!==!1}),Object(te.useEffect)(function(){return Sr},[Sr]),Q.a.createElement(rs.Provider,{value:$r},Q.a.createElement(N.a,{context:Aa,store:cr},L.children))}var ya=0;function Nl(){ya=0}function il(){return D(function(){return""+ya++},[])}function iu(){Nl(),Ol()}function Ul(L){var k=il(),V=L.dragHandleUsageInstructions||Qe.dragHandleUsageInstructions;return Q.a.createElement(fe,null,function(re){return Q.a.createElement(_a,{nonce:L.nonce,contextId:k,setCallbacks:re,dragHandleUsageInstructions:V,enableDefaultSensors:L.enableDefaultSensors,sensors:L.sensors,onBeforeCapture:L.onBeforeCapture,onBeforeDragStart:L.onBeforeDragStart,onDragStart:L.onDragStart,onDragUpdate:L.onDragUpdate,onDragEnd:L.onDragEnd},L.children)})}var Ys=function(k){return function(V){return k===V}},ui=Ys("scroll"),al=Ys("auto"),Fl=Ys("visible"),sl=function(k,V){return V(k.overflowX)||V(k.overflowY)},Bl=function(k,V){return V(k.overflowX)&&V(k.overflowY)},Qs=function(k){var V=window.getComputedStyle(k),re={overflowX:V.overflowX,overflowY:V.overflowY};return sl(re,ui)||sl(re,al)},ol=function(){return!1;var k,V;if(!Qs(k))return!1;var re,ce;if(Bl(ce,Fl))return!1},Js=function L(k){return k==null?null:k===document.body?ol()?k:null:k===document.documentElement?null:Qs(k)?k:L(k.parentElement)},au=function(L){if(!L)return;var k=Js(L.parentElement);if(!k)return},Zs=function(L){return{x:L.scrollLeft,y:L.scrollTop}},jl=function L(k){if(!k)return!1;var V=window.getComputedStyle(k);return V.position==="fixed"?!0:L(k.parentElement)},Wi=function(L){var k=Js(L),V=jl(L);return{closestScrollable:k,isFixedOnPage:V}},Na=function(L){var k=L.descriptor,V=L.isEnabled,re=L.isCombineEnabled,ce=L.isFixedOnPage,de=L.direction,Te=L.client,Se=L.page,ze=L.closest,it=function(){if(!ze)return null;var tt=ze.scrollSize,Dt=ze.client,An=Ls({scrollHeight:tt.scrollHeight,scrollWidth:tt.scrollWidth,height:Dt.paddingBox.height,width:Dt.paddingBox.width});return{pageMarginBox:ze.page.marginBox,frameClient:Dt,scrollSize:tt,shouldClipSubject:ze.shouldClipSubject,scroll:{initial:ze.scroll,current:ze.scroll,max:An,diff:{value:Ve,displacement:Ve}}}}(),ut=de==="vertical"?Tn:pr,$e=ge({page:Se,withPlaceholder:null,axis:ut,frame:it}),Xe={descriptor:k,isCombineEnabled:re,isFixedOnPage:ce,axis:ut,isEnabled:V,client:Te,page:Se,frame:it,subject:$e};return Xe},hs=function(k,V){var re=A(k);if(!V)return re;if(k!==V)return re;var ce=re.paddingBox.top-V.scrollTop,de=re.paddingBox.left-V.scrollLeft,Te=ce+V.scrollHeight,Se=de+V.scrollWidth,ze={top:ce,right:Se,bottom:Te,left:de},it=a(ze,re.border),ut=t({borderBox:it,margin:re.margin,border:re.border,padding:re.padding});return ut},Ua=function(L){var k=L.ref,V=L.descriptor,re=L.env,ce=L.windowScroll,de=L.direction,Te=L.isDropDisabled,Se=L.isCombineEnabled,ze=L.shouldClipSubject,it=re.closestScrollable,ut=hs(k,it),$e=T(ut,ce),Xe=function(){if(!it)return null;var Dt=A(it),An={scrollHeight:it.scrollHeight,scrollWidth:it.scrollWidth};return{client:Dt,page:T(Dt,ce),scroll:Zs(it),scrollSize:An,shouldClipSubject:ze}}(),tt=Na({descriptor:V,isEnabled:!Te,isCombineEnabled:Se,isFixedOnPage:re.isFixedOnPage,direction:de,client:ut,page:$e,closest:Xe});return tt},Li={passive:!1},Wl={passive:!0},ll=function(L){return L.shouldPublishImmediately?Li:Wl};function Ii(L){var k=Object(te.useContext)(L);return k||ne(!1),k}var Fa=function(k){return k&&k.env.closestScrollable||null};function ul(L){var k=Object(te.useRef)(null),V=Ii(rs),re=ua("droppable"),ce=V.registry,de=V.marshal,Te=La(L),Se=D(function(){return{id:L.droppableId,type:L.type,mode:L.mode}},[L.droppableId,L.mode,L.type]),ze=Object(te.useRef)(Se),it=D(function(){return f(function(ur,Mr){k.current||ne(!1);var Lr={x:ur,y:Mr};de.updateDroppableScroll(Se.id,Lr)})},[Se.id,de]),ut=m(function(){var ur=k.current;return!ur||!ur.env.closestScrollable?Ve:Zs(ur.env.closestScrollable)},[]),$e=m(function(){var ur=ut();it(ur.x,ur.y)},[ut,it]),Xe=D(function(){return E($e)},[$e]),tt=m(function(){var ur=k.current,Mr=Fa(ur);ur&&Mr||ne(!1);var Lr=ur.scrollOptions;if(Lr.shouldPublishImmediately){$e();return}Xe()},[Xe,$e]),Dt=m(function(ur,Mr){k.current&&ne(!1);var Lr=Te.current,Br=Lr.getDroppableRef();Br||ne(!1);var $r=Wi(Br),e={ref:Br,descriptor:Se,env:$r,scrollOptions:Mr};k.current=e;var n=Ua({ref:Br,descriptor:Se,env:$r,windowScroll:ur,direction:Lr.direction,isDropDisabled:Lr.isDropDisabled,isCombineEnabled:Lr.isCombineEnabled,shouldClipSubject:!Lr.ignoreContainerClipping}),d=$r.closestScrollable;return d&&(d.setAttribute(Do.contextId,V.contextId),d.addEventListener("scroll",tt,ll(e.scrollOptions))),n},[V.contextId,Se,tt,Te]),An=m(function(){var ur=k.current,Mr=Fa(ur);return ur&&Mr||ne(!1),Zs(Mr)},[]),Fn=m(function(){var ur=k.current;ur||ne(!1);var Mr=Fa(ur);if(k.current=null,!Mr)return;Xe.cancel(),Mr.removeAttribute(Do.contextId),Mr.removeEventListener("scroll",tt,ll(ur.scrollOptions))},[tt,Xe]),ar=m(function(ur){var Mr=k.current;Mr||ne(!1);var Lr=Fa(Mr);Lr||ne(!1),Lr.scrollTop+=ur.y,Lr.scrollLeft+=ur.x},[]),cr=D(function(){return{getDimensionAndWatchScroll:Dt,getScrollWhileDragging:An,dragStopped:Fn,scroll:ar}},[Fn,Dt,An,ar]),Sr=D(function(){return{uniqueId:re,descriptor:Se,callbacks:cr}},[cr,Se,re]);ti(function(){return ze.current=Sr.descriptor,ce.droppable.register(Sr),function(){k.current&&Fn(),ce.droppable.unregister(Sr)}},[cr,Se,Fn,Sr,de,ce.droppable]),ti(function(){if(!k.current)return;de.updateDroppableIsEnabled(ze.current.id,!L.isDropDisabled)},[L.isDropDisabled,de]),ti(function(){if(!k.current)return;de.updateDroppableIsCombineEnabled(ze.current.id,L.isCombineEnabled)},[L.isCombineEnabled,de])}function fs(){}var Ba={width:0,height:0,margin:ft},ba=function(k){var V=k.isAnimatingOpenOnMount,re=k.placeholder,ce=k.animate;return V||ce==="close"?Ba:{height:re.client.borderBox.height,width:re.client.borderBox.width,margin:re.client.margin}},qs=function(k){var V=k.isAnimatingOpenOnMount,re=k.placeholder,ce=k.animate,de=ba({isAnimatingOpenOnMount:V,placeholder:re,animate:ce});return{display:re.display,boxSizing:"border-box",width:de.width,height:de.height,marginTop:de.margin.top,marginRight:de.margin.right,marginBottom:de.margin.bottom,marginLeft:de.margin.left,flexShrink:"0",flexGrow:"0",pointerEvents:"none",transition:ce!=="none"?Ji.placeholder:null}};function eo(L){var k=Object(te.useRef)(null),V=m(function(){if(!k.current)return;clearTimeout(k.current),k.current=null},[]),re=L.animate,ce=L.onTransitionEnd,de=L.onClose,Te=L.contextId,Se=Object(te.useState)(L.animate==="open"),ze=Se[0],it=Se[1];Object(te.useEffect)(function(){return ze?re!=="open"?(V(),it(!1),fs):k.current?fs:(k.current=setTimeout(function(){k.current=null,it(!1)}),V):fs},[re,ze,V]);var ut=m(function(Xe){if(Xe.propertyName!=="height")return;ce(),re==="close"&&de()},[re,de,ce]),$e=qs({isAnimatingOpenOnMount:ze,animate:L.animate,placeholder:L.placeholder});return Q.a.createElement(L.placeholder.tagName,{style:$e,"data-rbd-placeholder-context-id":Te,onTransitionEnd:ut,ref:L.innerRef})}var to=Q.a.memo(eo),no=Q.a.createContext(null);function Ea(L){L&&Oa(L)||ne(!1)}function ps(L){return typeof L=="boolean"}function ro(L,k){k.forEach(function(V){return V(L)})}var cl=[function(k){var V=k.props;V.droppableId||ne(!1),typeof V.droppableId=="string"||ne(!1)},function(k){var V=k.props;ps(V.isDropDisabled)||ne(!1),ps(V.isCombineEnabled)||ne(!1),ps(V.ignoreContainerClipping)||ne(!1)},function(k){var V=k.getDroppableRef;Ea(V())}],ms=[function(k){var V=k.props,re=k.getPlaceholderRef;if(!V.placeholder)return;var ce=re();if(ce)return}],Hl=[function(k){var V=k.props;V.renderClone||ne(!1)},function(k){var V=k.getPlaceholderRef;V()&&ne(!1)}];function Kl(L){ca(function(){ro(L,cl),L.props.mode==="standard"&&ro(L,ms),L.props.mode==="virtual"&&ro(L,Hl)})}var ja=function(L){Object(B.a)(k,L);function k(){for(var re,ce=arguments.length,de=new Array(ce),Te=0;Te<ce;Te++)de[Te]=arguments[Te];return re=L.call.apply(L,[this].concat(de))||this,re.state={isVisible:Boolean(re.props.on),data:re.props.on,animate:re.props.shouldAnimate&&re.props.on?"open":"none"},re.onClose=function(){if(re.state.animate!=="close")return;re.setState({isVisible:!1})},re}k.getDerivedStateFromProps=function(ce,de){return ce.shouldAnimate?ce.on?{isVisible:!0,data:ce.on,animate:"open"}:de.isVisible?{isVisible:!0,data:de.data,animate:"close"}:{isVisible:!1,animate:"close",data:null}:{isVisible:Boolean(ce.on),data:ce.on,animate:"none"}};var V=k.prototype;return V.render=function(){if(!this.state.isVisible)return null;var ce={onClose:this.onClose,data:this.state.data,animate:this.state.animate};return this.props.children(ce)},k}(Q.a.PureComponent),io={dragging:5e3,dropAnimating:4500},dl=function(k,V){return V?Ji.drop(V.duration):k?Ji.snap:Ji.fluid},Gl=function(k,V){return k?V?Ki.opacity.drop:Ki.opacity.combining:null},ao=function(k){return k.forceShouldAnimate!=null?k.forceShouldAnimate:k.mode==="SNAP"};function hl(L){var k=L.dimension,V=k.client,re=L.offset,ce=L.combineWith,de=L.dropping,Te=Boolean(ce),Se=ao(L),ze=Boolean(de),it=ze?bs.drop(re,Te):bs.moveTo(re),ut={position:"fixed",top:V.marginBox.top,left:V.marginBox.left,boxSizing:"border-box",width:V.borderBox.width,height:V.borderBox.height,transition:dl(Se,de),transform:it,opacity:Gl(Te,ze),zIndex:ze?io.dropAnimating:io.dragging,pointerEvents:"none"};return ut}function zl(L){return{transform:bs.moveTo(L.offset),transition:L.shouldAnimateDisplacement?null:"none"}}function fl(L){return L.type==="DRAGGING"?hl(L):zl(L)}function pl(L,k,V){V===void 0&&(V=Ve);var re=window.getComputedStyle(k),ce=k.getBoundingClientRect(),de=S(ce,re),Te=T(de,V),Se={client:de,tagName:k.tagName.toLowerCase(),display:re.display},ze={x:de.marginBox.width,y:de.marginBox.height},it={descriptor:L,placeholder:Se,displaceBy:ze,client:de,page:Te};return it}function Vl(L){var k=ua("draggable"),V=L.descriptor,re=L.registry,ce=L.getDraggableRef,de=L.canDragInteractiveElements,Te=L.shouldRespectForcePress,Se=L.isEnabled,ze=D(function(){return{canDragInteractiveElements:de,shouldRespectForcePress:Te,isEnabled:Se}},[de,Se,Te]),it=m(function(tt){var Dt=ce();return Dt||ne(!1),pl(V,Dt,tt)},[V,ce]),ut=D(function(){return{uniqueId:k,descriptor:V,options:ze,getDimension:it}},[V,it,ze,k]),$e=Object(te.useRef)(ut),Xe=Object(te.useRef)(!0);ti(function(){return re.draggable.register($e.current),function(){return re.draggable.unregister($e.current)}},[re.draggable]),ti(function(){if(Xe.current){Xe.current=!1;return}var tt=$e.current;$e.current=ut,re.draggable.update(ut,tt)},[ut,re.draggable])}function so(L,k,V){ca(function(){function re(de){return"Draggable[id: "+de+"]: "}var ce=L.draggableId;if(ce||ne(!1),typeof ce=="string"||ne(!1),De(L.index)||ne(!1),L.mapped.type==="DRAGGING")return;Ea(V()),L.isEnabled&&(ns(k,ce)||ne(!1))})}function Wa(L){Pa(function(){var k=Object(te.useRef)(L);ca(function(){L===k.current||ne(!1)},[L])})}function Ha(L){L.preventDefault()}function Xl(L){var k=Object(te.useRef)(null),V=m(function(e){k.current=e},[]),re=m(function(){return k.current},[]),ce=Ii(rs),de=ce.contextId,Te=ce.dragHandleUsageInstructionsId,Se=ce.registry,ze=Ii(no),it=ze.type,ut=ze.droppableId,$e=D(function(){return{id:L.draggableId,index:L.index,type:it,droppableId:ut}},[L.draggableId,L.index,it,ut]),Xe=L.children,tt=L.draggableId,Dt=L.isEnabled,An=L.shouldRespectForcePress,Fn=L.canDragInteractiveElements,ar=L.isClone,cr=L.mapped,Sr=L.dropAnimationFinished;if(so(L,de,re),Wa(ar),!ar){var ur=D(function(){return{descriptor:$e,registry:Se,getDraggableRef:re,canDragInteractiveElements:Fn,shouldRespectForcePress:An,isEnabled:Dt}},[$e,Se,re,Fn,An,Dt]);Vl(ur)}var Mr=D(function(){return Dt?{tabIndex:0,role:"button","aria-describedby":Te,"data-rbd-drag-handle-draggable-id":tt,"data-rbd-drag-handle-context-id":de,draggable:!1,onDragStart:Ha}:null},[de,Te,tt,Dt]),Lr=m(function(e){if(cr.type!=="DRAGGING")return;if(!cr.dropping)return;if(e.propertyName!=="transform")return;Sr()},[Sr,cr]),Br=D(function(){var e=fl(cr),n=cr.type==="DRAGGING"&&cr.dropping?Lr:null,d={innerRef:V,draggableProps:{"data-rbd-draggable-context-id":de,"data-rbd-draggable-id":tt,style:e,onTransitionEnd:n},dragHandleProps:Mr};return d},[de,Mr,tt,cr,Lr,V]),$r=D(function(){return{draggableId:$e.id,type:$e.type,source:{index:$e.index,droppableId:$e.droppableId}}},[$e.droppableId,$e.id,$e.index,$e.type]);return Xe(Br,cr.snapshot,$r)}var oo=function(L,k){return L===k},ml=function(L){var k=L.combine,V=L.destination;return V?V.droppableId:k?k.droppableId:null},$l=function(k){return k.combine?k.combine.draggableId:null},Yl=function(k){return k.at&&k.at.type==="COMBINE"?k.at.combine.draggableId:null};function Ql(){var L=f(function(ce,de){return{x:ce,y:de}}),k=f(function(ce,de,Te,Se,ze){return{isDragging:!0,isClone:de,isDropAnimating:Boolean(ze),dropAnimation:ze,mode:ce,draggingOver:Te,combineWith:Se,combineTargetFor:null}}),V=f(function(ce,de,Te,Se,ze,it,ut){return{mapped:{type:"DRAGGING",dropping:null,draggingOver:ze,combineWith:it,mode:de,offset:ce,dimension:Te,forceShouldAnimate:ut,snapshot:k(de,Se,ze,it,null)}}}),re=function(de,Te){if(de.isDragging){if(de.critical.draggable.id!==Te.draggableId)return null;var Se=de.current.client.offset,ze=de.dimensions.draggables[Te.draggableId],it=nn(de.impact),ut=Yl(de.impact),$e=de.forceShouldAnimate;return V(L(Se.x,Se.y),de.movementMode,ze,Te.isClone,it,ut,$e)}if(de.phase==="DROP_ANIMATING"){var Xe=de.completed;if(Xe.result.draggableId!==Te.draggableId)return null;var tt=Te.isClone,Dt=de.dimensions.draggables[Te.draggableId],An=Xe.result,Fn=An.mode,ar=ml(An),cr=$l(An),Sr=de.dropDuration,ur={duration:Sr,curve:Xa.drop,moveTo:de.newHomeClientOffset,opacity:cr?Ki.opacity.drop:null,scale:cr?Ki.scale.drop:null};return{mapped:{type:"DRAGGING",offset:de.newHomeClientOffset,dimension:Dt,dropping:ur,draggingOver:ar,combineWith:cr,mode:Fn,forceShouldAnimate:null,snapshot:k(Fn,tt,ar,cr,ur)}}}return null};return re}function lo(L){return{isDragging:!1,isDropAnimating:!1,isClone:!1,dropAnimation:null,mode:null,draggingOver:null,combineTargetFor:L,combineWith:null}}var Jl={mapped:{type:"SECONDARY",offset:Ve,combineTargetFor:null,shouldAnimateDisplacement:!0,snapshot:lo(null)}};function Zl(){var L=f(function(Te,Se){return{x:Te,y:Se}}),k=f(lo),V=f(function(Te,Se,ze){return Se===void 0&&(Se=null),{mapped:{type:"SECONDARY",offset:Te,combineTargetFor:Se,shouldAnimateDisplacement:ze,snapshot:k(Se)}}}),re=function(Se){return Se?V(Ve,Se,!0):null},ce=function(Se,ze,it,ut){var $e=it.displaced.visible[Se],Xe=Boolean(ut.inVirtualList&&ut.effected[Se]),tt=hn(it),Dt=tt&&tt.draggableId===Se?ze:null;if(!$e){if(!Xe)return re(Dt);if(it.displaced.invisible[Se])return null;var An=Qt(ut.displacedBy.point),Fn=L(An.x,An.y);return V(Fn,Dt,!0)}if(Xe)return re(Dt);var ar=it.displacedBy.point,cr=L(ar.x,ar.y);return V(cr,Dt,$e.shouldAnimate)},de=function(Se,ze){if(Se.isDragging)return Se.critical.draggable.id===ze.draggableId?null:ce(ze.draggableId,Se.critical.draggable.id,Se.impact,Se.afterCritical);if(Se.phase==="DROP_ANIMATING"){var it=Se.completed;return it.result.draggableId===ze.draggableId?null:ce(ze.draggableId,it.result.draggableId,it.impact,it.afterCritical)}return null};return de}var gl=function(){var k=Ql(),V=Zl(),re=function(de,Te){return k(de,Te)||V(de,Te)||Jl};return re},uo={dropAnimationFinished:ei},vl=Object(N.c)(gl,uo,null,{context:Aa,pure:!0,areStatePropsEqual:oo})(Xl);function _l(L){var k=Ii(no),V=k.isUsingCloneFor;return V===L.draggableId&&!L.isClone?null:Q.a.createElement(vl,L)}function yl(L){var k=typeof L.isDragDisabled=="boolean"?!L.isDragDisabled:!0,V=Boolean(L.disableInteractiveElementBlocking),re=Boolean(L.shouldRespectForcePress);return Q.a.createElement(_l,Object(J.a)({},L,{isClone:!1,isEnabled:k,canDragInteractiveElements:V,shouldRespectForcePress:re}))}function xa(L){var k=Object(te.useContext)(rs);k||ne(!1);var V=k.contextId,re=k.isMovementAllowed,ce=Object(te.useRef)(null),de=Object(te.useRef)(null),Te=L.children,Se=L.droppableId,ze=L.type,it=L.mode,ut=L.direction,$e=L.ignoreContainerClipping,Xe=L.isDropDisabled,tt=L.isCombineEnabled,Dt=L.snapshot,An=L.useClone,Fn=L.updateViewportMaxScroll,ar=L.getContainerForClone,cr=m(function(){return ce.current},[]),Sr=m(function(l){ce.current=l},[]),ur=m(function(){return de.current},[]),Mr=m(function(l){de.current=l},[]);Kl({props:L,getDroppableRef:cr,getPlaceholderRef:ur});var Lr=m(function(){re()&&Fn({maxScroll:Is()})},[re,Fn]);ul({droppableId:Se,type:ze,mode:it,direction:ut,isDropDisabled:Xe,isCombineEnabled:tt,ignoreContainerClipping:$e,getDroppableRef:cr});var Br=Q.a.createElement(ja,{on:L.placeholder,shouldAnimate:L.shouldAnimatePlaceholder},function(l){var y=l.onClose,G=l.data,ee=l.animate;return Q.a.createElement(to,{placeholder:G,onClose:y,innerRef:Mr,animate:ee,contextId:V,onTransitionEnd:Lr})}),$r=D(function(){return{innerRef:Sr,placeholder:Br,droppableProps:{"data-rbd-droppable-id":Se,"data-rbd-droppable-context-id":V}}},[V,Se,Br,Sr]),e=An?An.dragging.draggableId:null,n=D(function(){return{droppableId:Se,type:ze,isUsingCloneFor:e}},[Se,e,ze]);function d(){if(!An)return null;var l=An.dragging,y=An.render,G=Q.a.createElement(_l,{draggableId:l.draggableId,index:l.source.index,isClone:!0,isEnabled:!0,shouldRespectForcePress:!1,canDragInteractiveElements:!0},function(ee,ae){return y(ee,ae,l)});return W.a.createPortal(G,ar())}return Q.a.createElement(no.Provider,{value:n},Te($r,Dt),d())}var gs=function(k,V){return k===V.droppable.type},Ka=function(k,V){return V.draggables[k.draggable.id]},ql=function(){var k={placeholder:null,shouldAnimatePlaceholder:!0,snapshot:{isDraggingOver:!1,draggingOverWith:null,draggingFromThisWith:null,isUsingPlaceholder:!1},useClone:null},V=Object(J.a)({},k,{shouldAnimatePlaceholder:!1}),re=f(function(Te){return{draggableId:Te.id,type:Te.type,source:{index:Te.index,droppableId:Te.droppableId}}}),ce=f(function(Te,Se,ze,it,ut,$e){var Xe=ut.descriptor.id,tt=ut.descriptor.droppableId===Te;if(tt){var Dt=$e?{render:$e,dragging:re(ut.descriptor)}:null,An={isDraggingOver:ze,draggingOverWith:ze?Xe:null,draggingFromThisWith:Xe,isUsingPlaceholder:!0};return{placeholder:ut.placeholder,shouldAnimatePlaceholder:!1,snapshot:An,useClone:Dt}}if(!Se)return V;if(!it)return k;var Fn={isDraggingOver:ze,draggingOverWith:Xe,draggingFromThisWith:null,isUsingPlaceholder:!0};return{placeholder:ut.placeholder,shouldAnimatePlaceholder:!0,snapshot:Fn,useClone:null}}),de=function(Se,ze){var it=ze.droppableId,ut=ze.type,$e=!ze.isDropDisabled,Xe=ze.renderClone;if(Se.isDragging){var tt=Se.critical;if(!gs(ut,tt))return V;var Dt=Ka(tt,Se.dimensions),An=nn(Se.impact)===it;return ce(it,$e,An,An,Dt,Xe)}if(Se.phase==="DROP_ANIMATING"){var Fn=Se.completed;if(!gs(ut,Fn.critical))return V;var ar=Ka(Fn.critical,Se.dimensions);return ce(it,$e,ml(Fn.result)===it,nn(Fn.impact)===it,ar,Xe)}if(Se.phase==="IDLE"&&Se.completed&&!Se.shouldFlush){var cr=Se.completed;if(!gs(ut,cr.critical))return V;var Sr=nn(cr.impact)===it,ur=Boolean(cr.impact.at&&cr.impact.at.type==="COMBINE"),Mr=cr.critical.droppable.id===it;return Sr?ur?k:V:Mr?k:V}return V};return de},eu={updateViewportMaxScroll:Er};function tu(){return document.body||ne(!1),document.body}var Hr={mode:"standard",type:"DEFAULT",direction:"vertical",isDropDisabled:!1,isCombineEnabled:!1,ignoreContainerClipping:!1,renderClone:null,getContainerForClone:tu},bl=Object(N.c)(ql,eu,null,{context:Aa,pure:!0,areStatePropsEqual:oo})(xa);bl.defaultProps=Hr},nnTU:function(It,Oe,U){"use strict";U.d(Oe,"b",function(){return $}),U.d(Oe,"a",function(){return z});var te=U("MI8n"),Q=U("JYp7"),B=U("pmY6"),J=U("24hK"),K=U("746U"),N=U("Cg/j");const $=Object(N.c)("commandService"),z=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new te.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(r,D){if(!r)throw new Error("invalid command");if(typeof r=="string"){if(!D)throw new Error("invalid command");return this.registerCommand({id:r,handler:D})}if(r.description){const c=[];for(let i of r.description.args)c.push(i.constraint);const s=r.handler;r.handler=function(i,...t){return Object(K.o)(t,c),s(i,...t)}}const{id:m}=r;let g=this._commands.get(m);g||(g=new J.a,this._commands.set(m,g));let p=g.unshift(r),a=Object(B.i)(()=>{p();const c=this._commands.get(m);(c==null?void 0:c.isEmpty())&&this._commands.delete(m)});return this._onDidRegisterCommand.fire(m),a}registerCommandAlias(r,D){return z.registerCommand(r,(m,...g)=>m.get($).executeCommand(D,...g))}getCommand(r){const D=this._commands.get(r);return!D||D.isEmpty()?void 0:Q.a.first(D)}getCommands(){const r=new Map;for(const D of this._commands.keys()){const m=this.getCommand(D);m&&r.set(D,m)}return r}};z.registerCommand("noop",()=>{})},osHv:function(It,Oe,U){(function(te){te(U("VrN/"))})(function(te){"use strict";var Q=te.Pos;function B(i,t){return i.line-t.line||i.ch-t.ch}var J="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",K=J+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",N=new RegExp("<(/?)(["+J+"]["+K+"]*)","g");function $(i,t,u,o){this.line=t,this.ch=u,this.cm=i,this.text=i.getLine(t),this.min=o?Math.max(o.from,i.firstLine()):i.firstLine(),this.max=o?Math.min(o.to-1,i.lastLine()):i.lastLine()}function z(i,t){var u=i.cm.getTokenTypeAt(Q(i.line,t));return u&&/\btag\b/.test(u)}function r(i){return i.line>=i.max?void 0:(i.ch=0,i.text=i.cm.getLine(++i.line),!0)}function D(i){return i.line<=i.min?void 0:(i.text=i.cm.getLine(--i.line),i.ch=i.text.length,!0)}function m(i){for(;;){var t=i.text.indexOf(">",i.ch);if(t==-1){if(r(i))continue;return}if(!z(i,t+1)){i.ch=t+1;continue}var u=i.text.lastIndexOf("/",t),o=u>-1&&!/\S/.test(i.text.slice(u+1,t));return i.ch=t+1,o?"selfClose":"regular"}}function g(i){for(;;){var t=i.ch?i.text.lastIndexOf("<",i.ch-1):-1;if(t==-1){if(D(i))continue;return}if(!z(i,t+1)){i.ch=t;continue}N.lastIndex=t,i.ch=t;var u=N.exec(i.text);if(u&&u.index==t)return u}}function p(i){for(;;){N.lastIndex=i.ch;var t=N.exec(i.text);if(!t){if(r(i))continue;return}if(!z(i,t.index+1)){i.ch=t.index+1;continue}return i.ch=t.index+t[0].length,t}}function a(i){for(;;){var t=i.ch?i.text.lastIndexOf(">",i.ch-1):-1;if(t==-1){if(D(i))continue;return}if(!z(i,t+1)){i.ch=t;continue}var u=i.text.lastIndexOf("/",t),o=u>-1&&!/\S/.test(i.text.slice(u+1,t));return i.ch=t+1,o?"selfClose":"regular"}}function c(i,t){for(var u=[];;){var o=p(i),R,T=i.line,S=i.ch-(o?o[0].length:0);if(!o||!(R=m(i)))return;if(R=="selfClose")continue;if(o[1]){for(var A=u.length-1;A>=0;--A)if(u[A]==o[2]){u.length=A;break}if(A<0&&(!t||t==o[2]))return{tag:o[2],from:Q(T,S),to:Q(i.line,i.ch)}}else u.push(o[2])}}function s(i,t){for(var u=[];;){var o=a(i);if(!o)return;if(o=="selfClose"){g(i);continue}var R=i.line,T=i.ch,S=g(i);if(!S)return;if(S[1])u.push(S[2]);else{for(var A=u.length-1;A>=0;--A)if(u[A]==S[2]){u.length=A;break}if(A<0&&(!t||t==S[2]))return{tag:S[2],from:Q(i.line,i.ch),to:Q(R,T)}}}}te.registerHelper("fold","xml",function(i,t){for(var u=new $(i,t.line,0);;){var o=p(u);if(!o||u.line!=t.line)return;var R=m(u);if(!R)return;if(!o[1]&&R!="selfClose"){var T=Q(u.line,u.ch),S=c(u,o[2]);return S&&B(S.from,T)>0?{from:T,to:S.from}:null}}}),te.findMatchingTag=function(i,t,u){var o=new $(i,t.line,t.ch,u);if(o.text.indexOf(">")==-1&&o.text.indexOf("<")==-1)return;var R=m(o),T=R&&Q(o.line,o.ch),S=R&&g(o);if(!R||!S||B(o,t)>0)return;var A={from:Q(o.line,o.ch),to:T,tag:S[2]};return R=="selfClose"?{open:A,close:null,at:"open"}:S[1]?{open:s(o,S[2]),close:A,at:"close"}:(o=new $(i,T.line,T.ch,u),{open:A,close:c(o,S[2]),at:"open"})},te.findEnclosingTag=function(i,t,u,o){for(var R=new $(i,t.line,t.ch,u);;){var T=s(R,o);if(!T)break;var S=new $(i,t.line,t.ch,u),A=c(S,T.tag);if(A)return{open:T,close:A}}},te.scanForClosingTag=function(i,t,u,o){var R=new $(i,t.line,t.ch,o?{from:0,to:o}:null);return c(R,u)}})},p5ED:function(It,Oe,U){"use strict";var te=U("+L6B"),Q=U("2/Rp"),B=U("5Dmo"),J=U("3S7+"),K=U("k1fw"),N=U("tJVT"),$=U("q1tI"),z=U.n($),r=U("vHTk"),D=U.n(r),m=U("yEEn"),g=U("ZW9T"),p=U("1vsH");Oe.a=function(a){var c=a.name,s=a.data,i=a.theme,t=a.type,u=a.filename,o=a.monacoEditor,R=a.className,T=a.style,S=a.close,A=a.onClose,I=a.hasMask,x=Object($.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),b=Object(N.a)(x,2),h=b[0],f=b[1],C=Object($.useState)(""),E=Object(N.a)(C,2),_=E[0],W=E[1],j,w=1024*1024,F=10*w,P=Object($.useRef)();t==="office"&&(j=Object(p.T)(s).filesize,j>F&&(t="other")),u&&(o.filename=u),Object($.useEffect)(function(){var Y,ie,le=(Y=document.cookie)===null||Y===void 0||((ie=Y.replace(/\s/g,""))===null||ie===void 0)?void 0:ie.split(";");le==null||le.map(function(he){var xe=he.split("=");xe[0]==="_educoder_session"&&W(xe[1])})},[]);var v=function(){if(s.startsWith("http")||s.startsWith("/")){H();return}Object(p.z)(u||"educoder",s,u)},H=function(){Object(p.x)(u||c,s)};return console.log("data:",s,"fileanme:",u," name:",c),z.a.createElement("div",{style:Object(K.a)({},T||{}),className:"".concat(I&&D.a.bgBlack," ").concat(t?D.a.wrp:"hide")},S&&z.a.createElement("div",{className:D.a.close,ref:P},z.a.createElement(J.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return P.current}},z.a.createElement("span",{onClick:H},z.a.createElement("i",{className:"icon-quxiaozhiding"}))),z.a.createElement(J.a,{title:"\u5173\u95ED",getPopupContainer:function(){return P.current}},z.a.createElement("span",{className:"",onClick:A},z.a.createElement("i",{className:"icon-guanbi1"})))),z.a.createElement("div",{className:"".concat(D.a[R]," ").concat(R," ").concat(D.a.monaco," ").concat(t==="txt"?"show":"hide")},t==="txt"&&z.a.createElement(g.b,o)),t==="audio"&&z.a.createElement("audio",{src:"".concat(s!=null&&s.startsWith("/")||(s==null?void 0:s.indexOf("https://"))>-1?s:"data:audio/mp3;base64,").concat(s),autoPlay:!0}),t==="video"&&z.a.createElement(z.a.Fragment,null,s!=null&&s.startsWith("/")?z.a.createElement("video",{controls:!0,src:"".concat(s),autoPlay:!0}):z.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(s),autoPlay:!0})),t==="html"&&z.a.createElement("iframe",{src:s+"&disposition=inline"}),t==="pdf"&&z.a.createElement("embed",{className:D.a.embed,src:s}),t==="image"&&z.a.createElement(z.a.Fragment,null,z.a.createElement("img",{src:"".concat(s!=null&&s.startsWith("/")||(s==null?void 0:s.indexOf("https://"))>-1?"":"data:image/png;base64,").concat(s)})),t==="other"&&z.a.createElement("div",null,z.a.createElement(Q.a,{type:"primary",size:"large",onClick:v},z.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),(t==="download"||t==="office")&&z.a.createElement(Q.a,{type:"primary",size:"large",onClick:v},z.a.createElement(m.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(It,Oe,U){},pmY6:function(It,Oe,U){"use strict";U.d(Oe,"h",function(){return D}),U.d(Oe,"g",function(){return g}),U.d(Oe,"f",function(){return p}),U.d(Oe,"e",function(){return a}),U.d(Oe,"i",function(){return c}),U.d(Oe,"b",function(){return s}),U.d(Oe,"a",function(){return i}),U.d(Oe,"d",function(){return t}),U.d(Oe,"c",function(){return u});var te=U("C/vA"),Q=U("JYp7");const B=!1;let J=null;function K(o){J=o}if(B){const o="__is_disposable_tracked__";K(new class{trackDisposable(R){const T=new Error("Potentially leaked disposable").stack;setTimeout(()=>{R[o]||console.log(T)},3e3)}setParent(R,T){if(R&&R!==i.None)try{R[o]=!0}catch(S){}}markAsDisposed(R){if(R&&R!==i.None)try{R[o]=!0}catch(T){}}markAsSingleton(R){}})}function N(o){return J==null||J.trackDisposable(o),o}function $(o){J==null||J.markAsDisposed(o)}function z(o,R){J==null||J.setParent(o,R)}function r(o,R){if(!J)return;for(const T of o)J.setParent(T,R)}function D(o){return J==null||J.markAsSingleton(o),o}class m extends Error{constructor(o){super(`Encountered errors while disposing of store. Errors: [${o.join(", ")}]`);this.errors=o}}function g(o){return typeof o.dispose=="function"&&o.dispose.length===0}function p(o){if(Q.a.is(o)){let R=[];for(const T of o)if(T)try{T.dispose()}catch(S){R.push(S)}if(R.length===1)throw R[0];if(R.length>1)throw new m(R);return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function a(...o){const R=c(()=>p(o));return r(o,R),R}function c(o){const R=N({dispose:Object(te.a)(()=>{$(R),o()})});return R}class s{constructor(){this._toDispose=new Set,this._isDisposed=!1,N(this)}dispose(){if(this._isDisposed)return;$(this),this._isDisposed=!0,this.clear()}clear(){try{p(this._toDispose.values())}finally{this._toDispose.clear()}}add(o){if(!o)return o;if(o===this)throw new Error("Cannot register a disposable on itself!");return z(o,this),this._isDisposed?s.DISABLE_DISPOSED_WARNING||console.warn(new Error("Trying to add a disposable to a DisposableStore that has already been disposed of. The added object will be leaked!").stack):this._toDispose.add(o),o}}s.DISABLE_DISPOSED_WARNING=!1;class i{constructor(){this._store=new s,N(this),z(this._store,this)}dispose(){$(this),this._store.dispose()}_register(o){if(o===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(o)}}i.None=Object.freeze({dispose(){}});class t{constructor(){this._isDisposed=!1,N(this)}get value(){return this._isDisposed?void 0:this._value}set value(o){var R;if(this._isDisposed||o===this._value)return;(R=this._value)===null||R===void 0||R.dispose(),o&&z(o,this),this._value=o}clear(){this.value=void 0}dispose(){var o;this._isDisposed=!0,$(this),(o=this._value)===null||o===void 0||o.dispose(),this._value=void 0}clearAndLeak(){const o=this._value;return this._value=void 0,o&&z(o,null),o}}class u{constructor(o){this.object=o}dispose(){}}},psGv:function(It,Oe,U){var te,Q;(function(){var B;(function(){"use strict";var $=[,,function(m){function g(c){this.__parent=c,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 c=new g(this.__parent);return c.set_indent(this.__indent_count,this.__alignment_count),c},g.prototype.item=function(c){return c<0?this.__items[this.__items.length+c]:this.__items[c]},g.prototype.has_match=function(c){for(var s=this.__items.length-1;s>=0;s--)if(this.__items[s].match(c))return!0;return!1},g.prototype.set_indent=function(c,s){this.is_empty()&&(this.__indent_count=c||0,this.__alignment_count=s||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 c=this.__parent.current_line;return c.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),c.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),c.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,c.__items[0]===" "&&(c.__items.splice(0,1),c.__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(c){this.__items.push(c);var s=c.lastIndexOf(`
`);s!==-1?this.__character_count=c.length-s:this.__character_count+=c.length},g.prototype.pop=function(){var c=null;return this.is_empty()||(c=this.__items.pop(),this.__character_count-=c.length),c},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 c="";return this.is_empty()?this.__parent.indent_empty_lines&&(c=this.__parent.get_indent_string(this.__indent_count)):(c=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),c+=this.__items.join("")),c};function p(c,s){this.__cache=[""],this.__indent_size=c.indent_size,this.__indent_string=c.indent_char,c.indent_with_tabs||(this.__indent_string=new Array(c.indent_size+1).join(c.indent_char)),s=s||"",c.indent_level>0&&(s=new Array(c.indent_level+1).join(this.__indent_string)),this.__base_string=s,this.__base_string_length=s.length}p.prototype.get_indent_size=function(c,s){var i=this.__base_string_length;return s=s||0,c<0&&(i=0),i+=c*this.__indent_size,i+=s,i},p.prototype.get_indent_string=function(c,s){var i=this.__base_string;return s=s||0,c<0&&(c=0,i=""),s+=c*this.__indent_size,this.__ensure_cache(s),i+=this.__cache[s],i},p.prototype.__ensure_cache=function(c){for(;c>=this.__cache.length;)this.__add_column()},p.prototype.__add_column=function(){var c=this.__cache.length,s=0,i="";this.__indent_size&&c>=this.__indent_size&&(s=Math.floor(c/this.__indent_size),c-=s*this.__indent_size,i=new Array(s+1).join(this.__indent_string)),c&&(i+=new Array(c+1).join(" ")),this.__cache.push(i)};function a(c,s){this.__indent_cache=new p(c,s),this.raw=!1,this._end_with_newline=c.end_with_newline,this.indent_size=c.indent_size,this.wrap_line_length=c.wrap_line_length,this.indent_empty_lines=c.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()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(c,s){return this.__indent_cache.get_indent_string(c,s)},a.prototype.get_indent_size=function(c,s){return this.__indent_cache.get_indent_size(c,s)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(c){return this.is_empty()||!c&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(c){this.trim(!0);var s=this.current_line.pop();s&&(s[s.length-1]===`
`&&(s=s.replace(/\n+$/g,"")),this.current_line.push(s)),this._end_with_newline&&this.__add_outputline();var i=this.__lines.join(`
`);return c!==`
`&&(i=i.replace(/[\n]/g,c)),i},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(c,s){return c=c||0,s=s||0,this.next_line.set_indent(c,s),this.__lines.length>1?(this.current_line.set_indent(c,s),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(c){for(var s=0;s<c.newlines;s++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(c.whitespace_before),this.current_line.push(c.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(c){this.__add_space_before_token(),this.current_line.push(c),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.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(" "))},a.prototype.remove_indent=function(c){for(var s=this.__lines.length;c<s;)this.__lines[c]._remove_indent(),c++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(c){for(c=c===void 0?!1:c,this.current_line.trim();c&&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},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(c,s){for(var i=this.__lines.length-2;i>=0;){var t=this.__lines[i];if(t.is_empty())break;if(t.item(0).indexOf(c)!==0&&t.item(-1)!==s){this.__lines.splice(i+1,0,new g(this)),this.previous_line=this.__lines[this.__lines.length-2];break}i--}},m.exports.Output=a},function(m){function g(p,a,c,s){this.type=p,this.text=a,this.comments_before=null,this.newlines=c||0,this.whitespace_before=s||"",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(c,s){this.raw_options=p(c,s),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(c,s){var i=this.raw_options[c],t=s||[];return typeof i=="object"?i!==null&&typeof i.concat=="function"&&(t=i.concat()):typeof i=="string"&&(t=i.split(/[^a-zA-Z0-9_\/\-]+/)),t},g.prototype._get_boolean=function(c,s){var i=this.raw_options[c],t=i===void 0?!!s:!!i;return t},g.prototype._get_characters=function(c,s){var i=this.raw_options[c],t=s||"";return typeof i=="string"&&(t=i.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),t},g.prototype._get_number=function(c,s){var i=this.raw_options[c];s=parseInt(s,10),isNaN(s)&&(s=0);var t=parseInt(i,10);return isNaN(t)&&(t=s),t},g.prototype._get_selection=function(c,s,i){var t=this._get_selection_list(c,s,i);if(t.length!==1)throw new Error("Invalid Option Value: The option '"+c+`' can only be one of the following values:
`+s+`
You passed in: '`+this.raw_options[c]+"'");return t[0]},g.prototype._get_selection_list=function(c,s,i){if(!s||s.length===0)throw new Error("Selection list cannot be empty.");if(i=i||[s[0]],!this._is_valid_selection(i,s))throw new Error("Invalid Default Value!");var t=this._get_array(c,i);if(!this._is_valid_selection(t,s))throw new Error("Invalid Option Value: The option '"+c+`' can contain only the following values:
`+s+`
You passed in: '`+this.raw_options[c]+"'");return t},g.prototype._is_valid_selection=function(c,s){return c.length&&s.length&&!c.some(function(i){return s.indexOf(i)===-1})};function p(c,s){var i={};c=a(c);var t;for(t in c)t!==s&&(i[t]=c[t]);if(s&&c[s])for(t in c[s])i[t]=c[s][t];return i}function a(c){var s={},i;for(i in c){var t=i.replace(/-/g,"_");s[t]=c[i]}return s}m.exports.Options=g,m.exports.normalizeOpts=a,m.exports.mergeOpts=p},,function(m){var g=RegExp.prototype.hasOwnProperty("sticky");function p(a){this.__input=a||"",this.__input_length=this.__input.length,this.__position=0}p.prototype.restart=function(){this.__position=0},p.prototype.back=function(){this.__position>0&&(this.__position-=1)},p.prototype.hasNext=function(){return this.__position<this.__input_length},p.prototype.next=function(){var a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},p.prototype.peek=function(a){var c=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(c=this.__input.charAt(a)),c},p.prototype.__match=function(a,c){a.lastIndex=c;var s=a.exec(this.__input);return s&&!(g&&a.sticky)&&(s.index!==c&&(s=null)),s},p.prototype.test=function(a,c){return c=c||0,c+=this.__position,c>=0&&c<this.__input_length?!!this.__match(a,c):!1},p.prototype.testChar=function(a,c){var s=this.peek(c);return a.lastIndex=0,s!==null&&a.test(s)},p.prototype.match=function(a){var c=this.__match(a,this.__position);return c?this.__position+=c[0].length:c=null,c},p.prototype.read=function(a,c,s){var i="",t;return a&&(t=this.match(a),t&&(i+=t[0])),c&&(t||!a)&&(i+=this.readUntil(c,s)),i},p.prototype.readUntil=function(a,c){var s="",i=this.__position;a.lastIndex=this.__position;var t=a.exec(this.__input);return t?(i=t.index,c&&(i+=t[0].length)):i=this.__input_length,s=this.__input.substring(this.__position,i),this.__position=i,s},p.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},p.prototype.get_regexp=function(a,c){var s=null,i="g";return c&&g&&(i="y"),typeof a=="string"&&a!==""?s=new RegExp(a,i):a&&(s=new RegExp(a.source,i)),s},p.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},p.prototype.peekUntilAfter=function(a){var c=this.__position,s=this.readUntilAfter(a);return this.__position=c,s},p.prototype.lookBack=function(a){var c=this.__position-1;return c>=a.length&&this.__input.substring(c-a.length,c).toLowerCase()===a},m.exports.InputScanner=p},function(m,g,p){var a=p(8).InputScanner,c=p(3).Token,s=p(10).TokenStream,i=p(11).WhitespacePattern,t={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},u=function(o,R){this._input=new a(o),this._options=R||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new i(this._input)};u.prototype.tokenize=function(){this._input.restart(),this.__tokens=new s,this._reset();for(var o,R=new c(t.START,""),T=null,S=[],A=new s;R.type!==t.EOF;){for(o=this._get_next_token(R,T);this._is_comment(o);)A.add(o),o=this._get_next_token(R,T);A.isEmpty()||(o.comments_before=A,A=new s),o.parent=T,this._is_opening(o)?(S.push(T),T=o):T&&this._is_closing(o,T)&&(o.opened=T,T.closed=o,T=S.pop(),o.parent=T),o.previous=R,R.next=o,this.__tokens.add(o),R=o}return this.__tokens},u.prototype._is_first_token=function(){return this.__tokens.isEmpty()},u.prototype._reset=function(){},u.prototype._get_next_token=function(o,R){this._readWhitespace();var T=this._input.read(/.+/g);return T?this._create_token(t.RAW,T):this._create_token(t.EOF,"")},u.prototype._is_comment=function(o){return!1},u.prototype._is_opening=function(o){return!1},u.prototype._is_closing=function(o,R){return!1},u.prototype._create_token=function(o,R){var T=new c(o,R,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return T},u.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},m.exports.Tokenizer=u,m.exports.TOKEN=t},function(m){function g(p){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=p}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 p=null;return this.hasNext()&&(p=this.__tokens[this.__position],this.__position+=1),p},g.prototype.peek=function(p){var a=null;return p=p||0,p+=this.__position,p>=0&&p<this.__tokens_length&&(a=this.__tokens[p]),a},g.prototype.add=function(p){this.__parent_token&&(p.parent=this.__parent_token),this.__tokens.push(p),this.__tokens_length+=1},m.exports.TokenStream=g},function(m,g,p){var a=p(12).Pattern;function c(s,i){a.call(this,s,i),i?this._line_regexp=this._input.get_regexp(i._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}c.prototype=new a,c.prototype.__set_whitespace_patterns=function(s,i){s+="\\t ",i+="\\n\\r",this._match_pattern=this._input.get_regexp("["+s+i+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+i+"]")},c.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var s=this._input.read(this._match_pattern);if(s===" ")this.whitespace_before_token=" ";else if(s){var i=this.__split(this._newline_regexp,s);this.newline_count=i.length-1,this.whitespace_before_token=i[this.newline_count]}return s},c.prototype.matching=function(s,i){var t=this._create();return t.__set_whitespace_patterns(s,i),t._update(),t},c.prototype._create=function(){return new c(this._input,this)},c.prototype.__split=function(s,i){s.lastIndex=0;for(var t=0,u=[],o=s.exec(i);o;)u.push(i.substring(t,o.index)),t=o.index+o[0].length,o=s.exec(i);return t<i.length?u.push(i.substring(t,i.length)):u.push(""),u},m.exports.WhitespacePattern=c},function(m){function g(p,a){this._input=p,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}g.prototype.read=function(){var p=this._input.read(this._starting_pattern);return(!this._starting_pattern||p)&&(p+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),p},g.prototype.read_match=function(){return this._input.match(this._match_pattern)},g.prototype.until_after=function(p){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(p),a._update(),a},g.prototype.until=function(p){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(p),a._update(),a},g.prototype.starting_with=function(p){var a=this._create();return a._starting_pattern=this._input.get_regexp(p,!0),a._update(),a},g.prototype.matching=function(p){var a=this._create();return a._match_pattern=this._input.get_regexp(p,!0),a._update(),a},g.prototype._create=function(){return new g(this._input,this)},g.prototype._update=function(){},m.exports.Pattern=g},function(m){function g(p,a){p=typeof p=="string"?p:p.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(p+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(p+/\sbeautify\signore:end\s/.source+a,"g")}g.prototype.get_directives=function(p){if(!p.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var c=this.__directive_pattern.exec(p);c;)a[c[1]]=c[2],c=this.__directive_pattern.exec(p);return a},g.prototype.readIgnored=function(p){return p.readUntilAfter(this.__directives_end_ignore_pattern)},m.exports.Directives=g},function(m,g,p){var a=p(12).Pattern,c={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function s(i,t){a.call(this,i,t),this.__template_pattern=null,this._disabled=Object.assign({},c),this._excluded=Object.assign({},c),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 u=new a(i);this.__patterns={handlebars_comment:u.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:u.starting_with(/{{{/).until_after(/}}}/),handlebars:u.starting_with(/{{/).until_after(/}}/),php:u.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:u.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:u.starting_with(/{%/).until_after(/%}/),django_value:u.starting_with(/{{/).until_after(/}}/),django_comment:u.starting_with(/{#/).until_after(/#}/),smarty:u.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:u.starting_with(/{\*/).until_after(/\*}/),smarty_literal:u.starting_with(/{literal}/).until_after(/{\/literal}/)}}s.prototype=new a,s.prototype._create=function(){return new s(this._input,this)},s.prototype._update=function(){this.__set_templated_pattern()},s.prototype.disable=function(i){var t=this._create();return t._disabled[i]=!0,t._update(),t},s.prototype.read_options=function(i){var t=this._create();for(var u in c)t._disabled[u]=i.templating.indexOf(u)===-1;return t._update(),t},s.prototype.exclude=function(i){var t=this._create();return t._excluded[i]=!0,t._update(),t},s.prototype.read=function(){var i="";this._match_pattern?i=this._input.read(this._starting_pattern):i=this._input.read(this._starting_pattern,this.__template_pattern);for(var t=this._read_template();t;)this._match_pattern?t+=this._input.read(this._match_pattern):t+=this._input.readUntil(this.__template_pattern),i+=t,t=this._read_template();return this._until_after&&(i+=this._input.readUntilAfter(this._until_pattern)),i},s.prototype.__set_templated_pattern=function(){var i=[];this._disabled.php||i.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||i.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||i.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(i.push(this.__patterns.django._starting_pattern.source),i.push(this.__patterns.django_value._starting_pattern.source),i.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||i.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&i.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+i.join("|")+")")},s.prototype._read_template=function(){var i="",t=this._input.peek();if(t==="<"){var u=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&u==="?"&&(i=i||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&u==="%"&&(i=i||this.__patterns.erb.read())}else t==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(i=i||this.__patterns.handlebars_comment.read(),i=i||this.__patterns.handlebars_unescaped.read(),i=i||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(i=i||this.__patterns.django_value.read()),this._excluded.django||(i=i||this.__patterns.django_comment.read(),i=i||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(i=i||this.__patterns.smarty_comment.read(),i=i||this.__patterns.smarty_literal.read(),i=i||this.__patterns.smarty.read()));return i},m.exports.TemplatablePattern=s},,,,function(m,g,p){var a=p(19).Beautifier,c=p(20).Options;function s(i,t,u,o){var R=new a(i,t,u,o);return R.beautify()}m.exports=s,m.exports.defaultOptions=function(){return new c}},function(m,g,p){var a=p(20).Options,c=p(2).Output,s=p(21).Tokenizer,i=p(21).TOKEN,t=/\r\n|[\r\n]/,u=/\r\n|[\r\n]/g,o=function(C,E){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=C.max_preserve_newlines,this.preserve_newlines=C.preserve_newlines,this._output=new c(C,E)};o.prototype.current_line_has_match=function(C){return this._output.current_line.has_match(C)},o.prototype.set_space_before_token=function(C,E){this._output.space_before_token=C,this._output.non_breaking_space=E},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(C){this._output.add_raw_token(C)},o.prototype.print_preserved_newlines=function(C){var E=0;C.type!==i.TEXT&&C.previous.type!==i.TEXT&&(E=C.newlines?1:0),this.preserve_newlines&&(E=C.newlines<this.max_preserve_newlines+1?C.newlines:this.max_preserve_newlines+1);for(var _=0;_<E;_++)this.print_newline(_>0);return E!==0},o.prototype.traverse_whitespace=function(C){return C.whitespace_before||C.newlines?(this.print_preserved_newlines(C)||(this._output.space_before_token=!0),!0):!1},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(C){this._output.add_new_line(C)},o.prototype.print_token=function(C){C.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(C.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.get_full_indent=function(C){return C=this.indent_level+(C||0),C<1?"":this._output.get_indent_string(C)};var R=function(C){for(var E=null,_=C.next;_.type!==i.EOF&&C.closed!==_;){if(_.type===i.ATTRIBUTE&&_.text==="type"){_.next&&_.next.type===i.EQUALS&&_.next.next&&_.next.next.type===i.VALUE&&(E=_.next.next.text);break}_=_.next}return E},T=function(C,E){var _=null,W=null;return E.closed?(C==="script"?_="text/javascript":C==="style"&&(_="text/css"),_=R(E)||_,_.search("text/css")>-1?W="css":_.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?W="javascript":_.search(/(text|application|dojo)\/(x-)?(html)/)>-1?W="html":_.search(/test\/null/)>-1&&(W="null"),W):null};function S(C,E){return E.indexOf(C)!==-1}function A(C,E,_){this.parent=C||null,this.tag=E?E.tag_name:"",this.indent_level=_||0,this.parser_token=E||null}function I(C){this._printer=C,this._current_frame=null}I.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},I.prototype.record_tag=function(C){var E=new A(this._current_frame,C,this._printer.indent_level);this._current_frame=E},I.prototype._try_pop_frame=function(C){var E=null;return C&&(E=C.parser_token,this._printer.indent_level=C.indent_level,this._current_frame=C.parent),E},I.prototype._get_frame=function(C,E){for(var _=this._current_frame;_&&!(C.indexOf(_.tag)!==-1);){if(E&&E.indexOf(_.tag)!==-1){_=null;break}_=_.parent}return _},I.prototype.try_pop=function(C,E){var _=this._get_frame([C],E);return this._try_pop_frame(_)},I.prototype.indent_to_tag=function(C){var E=this._get_frame(C);E&&(this._printer.indent_level=E.indent_level)};function x(C,E,_,W){this._source_text=C||"",E=E||{},this._js_beautify=_,this._css_beautify=W,this._tag_stack=null;var j=new a(E,"html");this._options=j,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"}x.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var C=this._source_text,E=this._options.eol;this._options.eol==="auto"&&(E=`
`,C&&t.test(C)&&(E=C.match(t)[0])),C=C.replace(u,`
`);var _=C.match(/^[\t ]*/)[0],W={text:"",type:""},j=new b,w=new o(this._options,_),F=new s(C,this._options).tokenize();this._tag_stack=new I(w);for(var P=null,v=F.next();v.type!==i.EOF;)v.type===i.TAG_OPEN||v.type===i.COMMENT?(P=this._handle_tag_open(w,v,j,W),j=P):v.type===i.ATTRIBUTE||v.type===i.EQUALS||v.type===i.VALUE||v.type===i.TEXT&&!j.tag_complete?P=this._handle_inside_tag(w,v,j,F):v.type===i.TAG_CLOSE?P=this._handle_tag_close(w,v,j):v.type===i.TEXT?P=this._handle_text(w,v,j):w.add_raw_token(v),W=P,v=F.next();var H=w._output.get_code(E);return H},x.prototype._handle_tag_close=function(C,E,_){var W={text:E.text,type:E.type};return C.alignment_size=0,_.tag_complete=!0,C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),_.is_unformatted?C.add_raw_token(E):(_.tag_start_char==="<"&&(C.set_space_before_token(E.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&_.has_wrapped_attrs&&C.print_newline(!1)),C.print_token(E)),_.indent_content&&!(_.is_unformatted||_.is_content_unformatted)&&(C.indent(),_.indent_content=!1),!_.is_inline_element&&!(_.is_unformatted||_.is_content_unformatted)&&C.set_wrap_point(),W},x.prototype._handle_inside_tag=function(C,E,_,W){var j=_.has_wrapped_attrs,w={text:E.text,type:E.type};if(C.set_space_before_token(E.newlines||E.whitespace_before!=="",!0),_.is_unformatted)C.add_raw_token(E);else if(_.tag_start_char==="{"&&E.type===i.TEXT)C.print_preserved_newlines(E)?(E.newlines=0,C.add_raw_token(E)):C.print_token(E);else{if(E.type===i.ATTRIBUTE?(C.set_space_before_token(!0),_.attr_count+=1):(E.type===i.EQUALS||E.type===i.VALUE&&E.previous.type===i.EQUALS)&&C.set_space_before_token(!1),E.type===i.ATTRIBUTE&&_.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(C.traverse_whitespace(E),j=j||E.newlines!==0),this._is_wrap_attributes_force)){var F=_.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&_.attr_count===1){var P=!0,v=0,H;do{if(H=W.peek(v),H.type===i.ATTRIBUTE){P=!1;break}v+=1}while(v<4&&H.type!==i.EOF&&H.type!==i.TAG_CLOSE);F=!P}F&&(C.print_newline(!1),j=!0)}C.print_token(E),j=j||C.previous_token_wrapped(),_.has_wrapped_attrs=j}return w},x.prototype._handle_text=function(C,E,_){var W={text:E.text,type:"TK_CONTENT"};return _.custom_beautifier_name?this._print_custom_beatifier_text(C,E,_):_.is_unformatted||_.is_content_unformatted?C.add_raw_token(E):(C.traverse_whitespace(E),C.print_token(E)),W},x.prototype._print_custom_beatifier_text=function(C,E,_){var W=this;if(E.text!==""){var j=E.text,w,F=1,P="",v="";_.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?w=this._js_beautify:_.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?w=this._css_beautify:_.custom_beautifier_name==="html"&&(w=function(xe,Le){var we=new x(xe,Le,W._js_beautify,W._css_beautify);return we.beautify()}),this._options.indent_scripts==="keep"?F=0:this._options.indent_scripts==="separate"&&(F=-C.indent_level);var H=C.get_full_indent(F);if(j=j.replace(/\n[ \t]*$/,""),_.custom_beautifier_name!=="html"&&j[0]==="<"&&j.match(/^(<!--|<!\[CDATA\[)/)){var Y=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(j);if(!Y){C.add_raw_token(E);return}P=H+Y[1]+`
`,j=Y[4],Y[5]&&(v=H+Y[5]),j=j.replace(/\n[ \t]*$/,""),(Y[2]||Y[3].indexOf(`
`)!==-1)&&(Y=Y[3].match(/[ \t]+$/),Y&&(E.whitespace_before=Y[0]))}if(j)if(w){var ie=function(){this.eol=`
`};ie.prototype=this._options.raw_options;var le=new ie;j=w(H+j,le)}else{var he=E.whitespace_before;he&&(j=j.replace(new RegExp(`
(`+he+")?","g"),`
`)),j=H+j.replace(/\n/g,`
`+H)}P&&(j?j=P+j+`
`+v:j=P+v),C.print_newline(!1),j&&(E.text=j,E.whitespace_before="",E.newlines=0,C.add_raw_token(E),C.print_newline(!0))}},x.prototype._handle_tag_open=function(C,E,_,W){var j=this._get_tag_open_token(E);return(_.is_unformatted||_.is_content_unformatted)&&!_.is_empty_element&&E.type===i.TAG_OPEN&&E.text.indexOf("</")===0?(C.add_raw_token(E),j.start_tag_token=this._tag_stack.try_pop(j.tag_name)):(C.traverse_whitespace(E),this._set_tag_position(C,E,j,_,W),j.is_inline_element||C.set_wrap_point(),C.print_token(E)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(j.alignment_size=E.text.length+1),!j.tag_complete&&!j.is_unformatted&&(C.alignment_size=j.alignment_size),j};var b=function(C,E){if(this.parent=C||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="",!E)this.tag_complete=!0;else{var _;this.tag_start_char=E.text[0],this.text=E.text,this.tag_start_char==="<"?(_=E.text.match(/^<([^\s>]*)/),this.tag_check=_?_[1]:""):(_=E.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=_?_[1]:"",(E.text.startsWith("{{#>")||E.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&E.next!==null?this.tag_check=E.next.text.split(" ")[0]:this.tag_check=E.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),E.type===i.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||E.closed&&E.closed.text==="/>";var W=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(W=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(W)))}};x.prototype._get_tag_open_token=function(C){var E=new b(this._tag_stack.get_parser_token(),C);return E.alignment_size=this._options.wrap_attributes_indent_size,E.is_end_tag=E.is_end_tag||S(E.tag_check,this._options.void_elements),E.is_empty_element=E.tag_complete||E.is_start_tag&&E.is_end_tag,E.is_unformatted=!E.tag_complete&&S(E.tag_check,this._options.unformatted),E.is_content_unformatted=!E.is_empty_element&&S(E.tag_check,this._options.content_unformatted),E.is_inline_element=S(E.tag_name,this._options.inline)||E.tag_name.includes("-")||E.tag_start_char==="{",E},x.prototype._set_tag_position=function(C,E,_,W,j){if(_.is_empty_element||(_.is_end_tag?_.start_tag_token=this._tag_stack.try_pop(_.tag_name):(this._do_optional_end_element(_)&&(_.is_inline_element||C.print_newline(!1)),this._tag_stack.record_tag(_),(_.tag_name==="script"||_.tag_name==="style")&&!(_.is_unformatted||_.is_content_unformatted)&&(_.custom_beautifier_name=T(_.tag_check,E)))),S(_.tag_check,this._options.extra_liners)&&(C.print_newline(!1),C._output.just_added_blankline()||C.print_newline(!0)),_.is_empty_element){if(_.tag_start_char==="{"&&_.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),_.indent_content=!0;var w=C.current_line_has_match(/{{#if/);w||C.print_newline(!1)}_.tag_name==="!--"&&j.type===i.TAG_CLOSE&&W.is_end_tag&&_.text.indexOf(`
`)===-1||(_.is_inline_element||_.is_unformatted||C.print_newline(!1),this._calcluate_parent_multiline(C,_))}else if(_.is_end_tag){var F=!1;F=_.start_tag_token&&_.start_tag_token.multiline_content,F=F||!_.is_inline_element&&!(W.is_inline_element||W.is_unformatted)&&!(j.type===i.TAG_CLOSE&&_.start_tag_token===W)&&j.type!=="TK_CONTENT",(_.is_content_unformatted||_.is_unformatted)&&(F=!1),F&&C.print_newline(!1)}else _.indent_content=!_.custom_beautifier_name,_.tag_start_char==="<"&&(_.tag_name==="html"?_.indent_content=this._options.indent_inner_html:_.tag_name==="head"?_.indent_content=this._options.indent_head_inner_html:_.tag_name==="body"&&(_.indent_content=this._options.indent_body_inner_html)),!(_.is_inline_element||_.is_unformatted)&&(j.type!=="TK_CONTENT"||_.is_content_unformatted)&&C.print_newline(!1),this._calcluate_parent_multiline(C,_)},x.prototype._calcluate_parent_multiline=function(C,E){E.parent&&C._output.just_added_newline()&&!((E.is_inline_element||E.is_unformatted)&&E.parent.is_inline_element)&&(E.parent.multiline_content=!0)};var h=["address","article","aside","blockquote","details","div","dl","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hr","main","nav","ol","p","pre","section","table","ul"],f=["a","audio","del","ins","map","noscript","video"];x.prototype._do_optional_end_element=function(C){var E=null;if(C.is_empty_element||!C.is_start_tag||!C.parent)return;if(C.tag_name==="body")E=E||this._tag_stack.try_pop("head");else if(C.tag_name==="li")E=E||this._tag_stack.try_pop("li",["ol","ul"]);else if(C.tag_name==="dd"||C.tag_name==="dt")E=E||this._tag_stack.try_pop("dt",["dl"]),E=E||this._tag_stack.try_pop("dd",["dl"]);else if(C.parent.tag_name==="p"&&h.indexOf(C.tag_name)!==-1){var _=C.parent.parent;(!_||f.indexOf(_.tag_name)===-1)&&(E=E||this._tag_stack.try_pop("p"))}else C.tag_name==="rp"||C.tag_name==="rt"?(E=E||this._tag_stack.try_pop("rt",["ruby","rtc"]),E=E||this._tag_stack.try_pop("rp",["ruby","rtc"])):C.tag_name==="optgroup"?E=E||this._tag_stack.try_pop("optgroup",["select"]):C.tag_name==="option"?E=E||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):C.tag_name==="colgroup"?E=E||this._tag_stack.try_pop("caption",["table"]):C.tag_name==="thead"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"])):C.tag_name==="tbody"||C.tag_name==="tfoot"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("thead",["table"]),E=E||this._tag_stack.try_pop("tbody",["table"])):C.tag_name==="tr"?(E=E||this._tag_stack.try_pop("caption",["table"]),E=E||this._tag_stack.try_pop("colgroup",["table"]),E=E||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(C.tag_name==="th"||C.tag_name==="td")&&(E=E||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),E=E||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return C.parent=this._tag_stack.get_parser_token(),E},m.exports.Beautifier=x},function(m,g,p){var a=p(6).Options;function c(s){a.call(this,s,"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"])}c.prototype=new a,m.exports.Options=c},function(m,g,p){var a=p(9).Tokenizer,c=p(9).TOKEN,s=p(13).Directives,i=p(14).TemplatablePattern,t=p(12).Pattern,u={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:c.START,RAW:c.RAW,EOF:c.EOF},o=new s(/<\!--/,/-->/),R=function(T,S){a.call(this,T,S),this._current_tag_name="";var A=new i(this._input).read_options(this._options),I=new t(this._input);if(this.__patterns={word:A.until(/[\n\r\t <]/),single_quote:A.until_after(/'/),double_quote:A.until_after(/"/),attribute:A.until(/[\n\r\t =>]|\/>/),element_name:A.until(/[\n\r\t >\/]/),handlebars_comment:I.starting_with(/{{!--/).until_after(/--}}/),handlebars:I.starting_with(/{{/).until_after(/}}/),handlebars_open:I.until(/[\n\r\t }]/),handlebars_raw_close:I.until(/}}/),comment:I.starting_with(/<!--/).until_after(/-->/),cdata:I.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:I.starting_with(/<!\[/).until_after(/]>/),processing:I.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 x=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=I.matching(x).until_after(x)}};R.prototype=new a,R.prototype._is_comment=function(T){return!1},R.prototype._is_opening=function(T){return T.type===u.TAG_OPEN},R.prototype._is_closing=function(T,S){return T.type===u.TAG_CLOSE&&S&&((T.text===">"||T.text==="/>")&&S.text[0]==="<"||T.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},R.prototype._reset=function(){this._current_tag_name=""},R.prototype._get_next_token=function(T,S){var A=null;this._readWhitespace();var I=this._input.peek();return I===null?this._create_token(u.EOF,""):(A=A||this._read_open_handlebars(I,S),A=A||this._read_attribute(I,T,S),A=A||this._read_close(I,S),A=A||this._read_raw_content(I,T,S),A=A||this._read_content_word(I),A=A||this._read_comment_or_cdata(I),A=A||this._read_processing(I),A=A||this._read_open(I,S),A=A||this._create_token(u.UNKNOWN,this._input.next()),A)},R.prototype._read_comment_or_cdata=function(T){var S=null,A=null,I=null;if(T==="<"){var x=this._input.peek(1);x==="!"&&(A=this.__patterns.comment.read(),A?(I=o.get_directives(A),I&&I.ignore==="start"&&(A+=o.readIgnored(this._input))):A=this.__patterns.cdata.read()),A&&(S=this._create_token(u.COMMENT,A),S.directives=I)}return S},R.prototype._read_processing=function(T){var S=null,A=null,I=null;if(T==="<"){var x=this._input.peek(1);(x==="!"||x==="?")&&(A=this.__patterns.conditional_comment.read(),A=A||this.__patterns.processing.read()),A&&(S=this._create_token(u.COMMENT,A),S.directives=I)}return S},R.prototype._read_open=function(T,S){var A=null,I=null;return S||T==="<"&&(A=this._input.next(),this._input.peek()==="/"&&(A+=this._input.next()),A+=this.__patterns.element_name.read(),I=this._create_token(u.TAG_OPEN,A)),I},R.prototype._read_open_handlebars=function(T,S){var A=null,I=null;return S||this._options.indent_handlebars&&T==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(A=this.__patterns.handlebars_comment.read(),A=A||this.__patterns.handlebars.read(),I=this._create_token(u.COMMENT,A)):(A=this.__patterns.handlebars_open.read(),I=this._create_token(u.TAG_OPEN,A))),I},R.prototype._read_close=function(T,S){var A=null,I=null;return S&&(S.text[0]==="<"&&(T===">"||T==="/"&&this._input.peek(1)===">")?(A=this._input.next(),T==="/"&&(A+=this._input.next()),I=this._create_token(u.TAG_CLOSE,A)):S.text[0]==="{"&&T==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),I=this._create_token(u.TAG_CLOSE,"}}"))),I},R.prototype._read_attribute=function(T,S,A){var I=null,x="";if(A&&A.text[0]==="<")if(T==="=")I=this._create_token(u.EQUALS,this._input.next());else if(T==='"'||T==="'"){var b=this._input.next();T==='"'?b+=this.__patterns.double_quote.read():b+=this.__patterns.single_quote.read(),I=this._create_token(u.VALUE,b)}else x=this.__patterns.attribute.read(),x&&(S.type===u.EQUALS?I=this._create_token(u.VALUE,x):I=this._create_token(u.ATTRIBUTE,x));return I},R.prototype._is_content_unformatted=function(T){return this._options.void_elements.indexOf(T)===-1&&(this._options.content_unformatted.indexOf(T)!==-1||this._options.unformatted.indexOf(T)!==-1)},R.prototype._read_raw_content=function(T,S,A){var I="";if(A&&A.text[0]==="{")I=this.__patterns.handlebars_raw_close.read();else if(S.type===u.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var x=S.opened.text.substr(1).toLowerCase();if(x==="script"||x==="style"){var b=this._read_comment_or_cdata(T);if(b)return b.type=u.TEXT,b;I=this._input.readUntil(new RegExp("</"+x+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(x)&&(I=this._input.readUntil(new RegExp("</"+x+"[\\n\\r\\t ]*?>","ig")))}return I?this._create_token(u.TEXT,I):null},R.prototype._read_content_word=function(T){var S="";if(this._options.unformatted_content_delimiter&&(T===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(u.TEXT,S)},m.exports.Tokenizer=R,m.exports.TOKEN=u}],z={};function r(m){var g=z[m];if(g!==void 0)return g.exports;var p=z[m]={exports:{}};return $[m](p,p.exports,r),p.exports}var D=r(18);B=D})();var J=B;if(!0)!(te=[U,U("6UM0"),U("TXwP")],Q=function($){var z=U("6UM0"),r=U("TXwP");return{html_beautify:function(D,m){return J(D,m,z.js_beautify,r.css_beautify)}}}.apply(Oe,te),Q!==void 0&&(It.exports=Q));else var K,N})()},"rAM+":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return Q});var te=U("Qw5x");function Q(B,J){var K;if(typeof Symbol=="undefined"||B[Symbol.iterator]==null){if(Array.isArray(B)||(K=Object(te.a)(B))||J&&B&&typeof B.length=="number"){K&&(B=K);var N=0,$=function(){};return{s:$,n:function(){return N>=B.length?{done:!0}:{done:!1,value:B[N++]}},e:function(g){throw g},f:$}}throw new TypeError(`Invalid attempt to iterate non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var z=!0,r=!1,D;return{s:function(){K=B[Symbol.iterator]()},n:function(){var g=K.next();return z=g.done,g},e:function(g){r=!0,D=g},f:function(){try{!z&&K.return!=null&&K.return()}finally{if(r)throw D}}}}},rUJ1:function(It,Oe){const U=/[&<>"']/,te=/[&<>"']/g,Q=/[<>"']|&(?!#?\w+;)/,B=/[<>"']|&(?!#?\w+;)/g,J={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},K=I=>J[I];function N(I,x){if(x){if(U.test(I))return I.replace(te,K)}else if(Q.test(I))return I.replace(B,K);return I}const $=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function z(I){return I.replace($,(x,b)=>(b=b.toLowerCase(),b==="colon"?":":b.charAt(0)==="#"?b.charAt(1)==="x"?String.fromCharCode(parseInt(b.substring(2),16)):String.fromCharCode(+b.substring(1)):""))}const r=/(^|[^\[])\^/g;function D(I,x){I=I.source||I,x=x||"";const b={replace:(h,f)=>(f=f.source||f,f=f.replace(r,"$1"),I=I.replace(h,f),b),getRegex:()=>new RegExp(I,x)};return b}const m=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function p(I,x,b){if(I){let h;try{h=decodeURIComponent(z(b)).replace(m,"").toLowerCase()}catch(f){return null}if(h.indexOf("javascript:")===0||h.indexOf("vbscript:")===0||h.indexOf("data:")===0)return null}x&&!g.test(b)&&(b=t(x,b));try{b=encodeURI(b).replace(/%25/g,"%")}catch(h){return null}return b}const a={},c=/^[^:]+:\/*[^/]*$/,s=/^([^:]+:)[\s\S]*$/,i=/^([^:]+:\/*[^/]*)[\s\S]*$/;function t(I,x){a[" "+I]||(c.test(I)?a[" "+I]=I+"/":a[" "+I]=T(I,"/",!0)),I=a[" "+I];const b=I.indexOf(":")===-1;return x.substring(0,2)==="//"?b?x:I.replace(s,"$1")+x:x.charAt(0)==="/"?b?x:I.replace(i,"$1")+x:I+x}const u={exec:function(){}};function o(I){let x=1,b,h;for(;x<arguments.length;x++){b=arguments[x];for(h in b)Object.prototype.hasOwnProperty.call(b,h)&&(I[h]=b[h])}return I}function R(I,x){const b=I.replace(/\|/g,(C,E,_)=>{let W=!1,j=E;for(;--j>=0&&_[j]==="\\";)W=!W;return W?"|":" |"}),h=b.split(/ \|/);let f=0;if(h.length>x)h.splice(x);else for(;h.length<x;)h.push("");for(;f<h.length;f++)h[f]=h[f].trim().replace(/\\\|/g,"|");return h}function T(I,x,b){const h=I.length;if(h===0)return"";let f=0;for(;f<h;){const C=I.charAt(h-f-1);if(C===x&&!b)f++;else if(C!==x&&b)f++;else break}return I.substr(0,h-f)}function S(I,x){if(I.indexOf(x[1])===-1)return-1;const b=I.length;let h=0,f=0;for(;f<b;f++)if(I[f]==="\\")f++;else if(I[f]===x[0])h++;else if(I[f]===x[1]&&(h--,h<0))return f;return-1}function A(I){I&&I.sanitize&&!I.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")}It.exports={escape:N,unescape:z,edit:D,cleanUrl:p,resolveUrl:t,noopTest:u,merge:o,splitCells:R,rtrim:T,findClosingBracket:S,checkSanitizeDeprecation:A}},sR1s:function(It,Oe,U){"use strict";U.d(Oe,"b",function(){return J}),U.d(Oe,"a",function(){return K}),U.d(Oe,"c",function(){return N}),U.d(Oe,"d",function(){return $});var te=U("U8pU"),Q="RC_TABLE_KEY";function B(z){return z==null?[]:Array.isArray(z)?z:[z]}function J(z,r){if(!r&&typeof r!="number")return z;for(var D=B(r),m=z,g=0;g<D.length;g+=1){if(!m)return null;var p=D[g];m=m[p]}return m}function K(z){var r=[],D={};return z.forEach(function(m){for(var g=m||{},p=g.key,a=g.dataIndex,c=p||B(a).join("-")||Q;D[c];)c="".concat(c,"_next");D[c]=!0,r.push(c)}),r}function N(){var z={};function r(p,a){a&&Object.keys(a).forEach(function(c){var s=a[c];s&&Object(te.a)(s)==="object"?(p[c]=p[c]||{},r(p[c],s)):p[c]=s})}for(var D=arguments.length,m=new Array(D),g=0;g<D;g++)m[g]=arguments[g];return m.forEach(function(p){r(z,p)}),z}function $(z){return z!=null}},sZF6:function(It,Oe,U){"use strict";var te=U("2qtc"),Q=U("kLXV"),B=U("DZo9"),J=U("8z0m"),K=U("+L6B"),N=U("2/Rp"),$=U("tJVT"),z=U("q1tI"),r=U.n(z),D=U("xvlK"),m=U("m3rI"),g=U("1vsH"),p=U("Ty5D"),a=U("69hG"),c=U.n(a),s=function(t){var u=t.visible,o=t.onOk,R=t.onCancel,T=Object(z.useState)([]),S=Object($.a)(T,2),A=S[0],I=S[1],x=Object(z.useState)(!1),b=Object($.a)(x,2),h=b[0],f=b[1],C=Object(p.i)();Object(z.useEffect)(function(){u||(I([]),f(!1))},[u]);var E=function(){f(!0),o(A,function(){f(!1)})},_=function(){R()},W=function(){console.log(C,444);var P="".concat(m.a.API_SERVER,"/api/courses/").concat(C.coursesId,"/exercises/down_template");Object(g.x)(null,P)},j=function(P){var v={name:P.name,uid:P.uid,file:P};return I([v]),!1},w=function(){I([])};return r.a.createElement(Q.a,{title:"\u6279\u91CF\u5BFC\u5165\u8BD5\u9898",visible:u,onOk:E,centered:!0,wrapClassName:c.a.customModal,onCancel:_,width:"680px",okText:"\u786E\u8BA4",cancelText:"\u53D6\u6D88",confirmLoading:h},r.a.createElement("div",{className:c.a.content},r.a.createElement("aside",null,r.a.createElement("div",null,"\u6B65\u9AA41\uFF1A"),r.a.createElement("ul",null,r.a.createElement("li",null,"\u4E0B\u8F7D\xA0",r.a.createElement("span",{style:{color:"#0152d9",cursor:"pointer"},onClick:W},"\u8003\u8BD5\u8BD5\u9898\u6A21\u677F"),",\xA0\u6279\u91CF\u5BFC\u5165\u8BD5\u9898\u3002"),r.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"))),r.a.createElement("aside",{className:"mt30"},r.a.createElement("div",null,"\u6B65\u9AA42\uFF1A"),r.a.createElement("ul",{style:{flex:1}},r.a.createElement("li",null,"\u4E0A\u4F20\u586B\u5199\u597D\u7684\u8BD5\u9898\u8868"),u&&r.a.createElement(J.a,{action:"".concat(m.a.API_SERVER,"/api/attachments.json"),beforeUpload:j,onRemove:w,withCredentials:!0,fileList:A,accept:".xls,.xlsx"},r.a.createElement(N.a,{className:c.a.upload,type:"primary",icon:r.a.createElement(D.a,null)},"\u9009\u62E9\u6587\u4EF6"))))))};Oe.a=s},sboe:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return B});var te=U("q1tI"),Q=U.n(te),B=te.createContext(null)},t23M:function(It,Oe,U){"use strict";var te=U("VTBJ"),Q=U("1OyB"),B=U("vuIU"),J=U("Ji7U"),K=U("LK+K"),N=U("q1tI"),$=U.n(N),z=U("m+aA"),r=U("Zm9Q"),D=U("Kwbf"),m=U("c+Xe"),g=U("bdgK"),p="rc-observer-key",a=function(c){Object(J.a)(i,c);var s=Object(K.a)(i);function i(){var t;return Object(Q.a)(this,i),t=s.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(u){var o=t.props.onResize,R=u[0].target,T=R.getBoundingClientRect(),S=T.width,A=T.height,I=R.offsetWidth,x=R.offsetHeight,b=Math.floor(S),h=Math.floor(A);if(t.state.width!==b||t.state.height!==h||t.state.offsetWidth!==I||t.state.offsetHeight!==x){var f={width:b,height:h,offsetWidth:I,offsetHeight:x};t.setState(f),o&&Promise.resolve().then(function(){o(Object(te.a)(Object(te.a)({},f),{},{offsetWidth:I,offsetHeight:x}))})}},t.setChildNode=function(u){t.childNode=u},t}return Object(B.a)(i,[{key:"componentDidMount",value:function(){this.onComponentUpdated()}},{key:"componentDidUpdate",value:function(){this.onComponentUpdated()}},{key:"componentWillUnmount",value:function(){this.destroyObserver()}},{key:"onComponentUpdated",value:function(){var u=this.props.disabled;if(u){this.destroyObserver();return}var o=Object(z.a)(this.childNode||this),R=o!==this.currentElement;R&&(this.destroyObserver(),this.currentElement=o),!this.resizeObserver&&o&&(this.resizeObserver=new g.default(this.onResize),this.resizeObserver.observe(o))}},{key:"destroyObserver",value:function(){this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null)}},{key:"render",value:function(){var u=this.props.children,o=Object(r.a)(u);if(o.length>1)Object(D.a)(!1,"Find more than one child node with `children` in ResizeObserver. Will only observe first one.");else if(o.length===0)return Object(D.a)(!1,"`children` of ResizeObserver is empty. Nothing is in observe."),null;var R=o[0];if(N.isValidElement(R)&&Object(m.c)(R)){var T=R.ref;o[0]=N.cloneElement(R,{ref:Object(m.a)(T,this.setChildNode)})}return o.length===1?o[0]:o.map(function(S,A){return!N.isValidElement(S)||"key"in S&&S.key!==null?S:N.cloneElement(S,{key:"".concat(p,"-").concat(A)})})}}]),i}(N.Component);a.displayName="ResizeObserver",Oe.a=a},t9D7:function(It,Oe,U){"use strict";U.d(Oe,"b",function(){return $}),U.d(Oe,"g",function(){return r}),U.d(Oe,"d",function(){return D}),U.d(Oe,"e",function(){return m}),U.d(Oe,"a",function(){return g}),U.d(Oe,"f",function(){return c}),U.d(Oe,"c",function(){return s});var te=U("Vhoy"),Q=U("MI8n"),B=U("pmY6"),J=U("Cg/j"),K=U("ic2d"),N=U("nEHx");const $=Object(J.c)("themeService");var z;(function(i){function t(u){return u&&typeof u=="object"&&typeof u.id=="string"}i.isThemeColor=t})(z||(z={}));function r(i){return{id:i}}var D;(function(i){function t(A){return A&&typeof A=="object"&&typeof A.id=="string"&&(typeof A.color=="undefined"||z.isThemeColor(A.color))}i.isThemeIcon=t;const u=new RegExp(`^\\$\\((${te.a.iconNameExpression}(?:${te.a.iconModifierExpression})?)\\)$`);function o(A){const I=u.exec(A);if(!I)return;let[,x]=I;return{id:x}}i.fromString=o;function R(A,I){let x=A.id;const b=x.lastIndexOf("~");return b!==-1&&(x=x.substring(0,b)),I&&(x=`${x}~${I}`),{id:x}}i.modify=R;function T(A,I){var x,b;return A.id===I.id&&((x=A.color)===null||x===void 0?void 0:x.id)===((b=I.color)===null||b===void 0?void 0:b.id)}i.isEqual=T;function S(A,I){return{id:A.id,color:I?r(I):void 0}}i.asThemeIcon=S,i.asClassNameArray=te.a.asClassNameArray,i.asClassName=te.a.asClassName,i.asCSSSelector=te.a.asCSSSelector})(D||(D={}));function m(i){switch(i){case N.a.DARK:return"vs-dark";case N.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const g={ThemingContribution:"base.contributions.theming"};class p{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new Q.b}onColorThemeChange(i){return this.themingParticipants.push(i),this.onThemingParticipantAddedEmitter.fire(i),Object(B.i)(()=>{const t=this.themingParticipants.indexOf(i);this.themingParticipants.splice(t,1)})}getThemingParticipants(){return this.themingParticipants}}let a=new p;K.a.add(g.ThemingContribution,a);function c(i){return a.onColorThemeChange(i)}class s extends B.a{constructor(i){super();this.themeService=i,this.theme=i.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(t=>this.onThemeChange(t)))}onThemeChange(i){this.theme=i,this.updateStyles()}updateStyles(){}}},u2Z1:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return T});var te=U("miYZ"),Q=U("tsqr"),B=U("9og8"),J=U("5NDa"),K=U("5rEg"),N=U("2qtc"),$=U("kLXV"),z=U("oBTY"),r=U("tJVT"),D=U("OaEy"),m=U("2fM7"),g=U("WmNS"),p=U.n(g),a=U("q1tI"),c=U.n(a),s=U("ErOA"),i=U("i58Z"),t=U.n(i),u=U("T1X5"),o=U.n(u),R=m.a.Option,T=function(A){var I=A.subId,x=A.value,b=A.selectvalues,h=A.disabled,f=A.knowledgeOptions,C=f===void 0?[]:f,E=A.onChange,_=E===void 0?function(){}:E,W=A.onAddKnowledgeFinish,j=W===void 0?function(){}:W,w=Object(a.useRef)(),F=Object(a.useState)([]),P=Object(r.a)(F,2),v=P[0],H=P[1];x=x||[];var Y=function(he,xe){he?(H([xe.key]),_([xe.key])):(H([]),_([]))};Object(a.useEffect)(function(){(b==null?void 0:b.length)>0&&(H(Object(z.a)(b)),_(Object(z.a)(b)))},[C]),Object(a.useEffect)(function(){var le;((le=x)===null||le===void 0?void 0:le.length)>0&&_(Object(z.a)(x))},[C]);var ie=function(he){he.preventDefault(),w.current="",$.a.confirm({centered:!0,width:700,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",icon:null,title:"\u65B0\u5EFA\u77E5\u8BC6\u70B9",className:"custom-modal-divider",content:c.a.createElement("div",{className:"font14"},c.a.createElement("div",{style:{display:"flex",marginTop:"48px",marginBottom:"36px"}},c.a.createElement("img",{src:o.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",c.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",c.a.createElement("br",null),"\u8BF7\u8BA4\u771F\u586B\u5199\u4E0E\u6559\u5B66\u5185\u5BB9\u76F8\u5173\u7684\u771F\u5B9E\u77E5\u8BC6\u70B9 ",c.a.createElement("br",null)),c.a.createElement(K.a,{className:"mt5",maxLength:20,style:{marginBottom:"42px"},placeholder:"\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0",defaultValue:w.current,onChange:function(Le){w.current=Le.target.value}})),onOk:function(){return new Promise(function(){var Le=Object(B.a)(p.a.mark(function we(Ae,pe){var be,ne;return p.a.wrap(function(_e){for(;;)switch(_e.prev=_e.next){case 0:if(w.current){_e.next=3;break}return Q.b.warn("\u8BF7\u8F93\u5165\u77E5\u8BC6\u70B9\u540D\u79F0"),_e.abrupt("return",pe());case 3:if(!(w.current.length>20)){_e.next=6;break}return Q.b.warn("\u8BF7\u8F93\u5165\u4E0D\u8D85\u8FC720\u5B57\u7684\u77E5\u8BC6\u70B9\u540D\u79F0"),_e.abrupt("return",pe());case 6:return _e.next=8,Object(s.a)("/api/tag_disciplines.json",{method:"post",body:{name:w.current,sub_discipline_id:I}});case 8:return be=_e.sent,(be==null?void 0:be.status)===0&&(j({id:be.tag_discipline_id,name:w.current,type:"personal"}),ne=[],ne.push(be.tag_discipline_id),_([].concat(ne)),H([be.tag_discipline_id]),_([].concat(ne))),_e.abrupt("return",Ae());case 11:case"end":return _e.stop()}},we)}));return function(we,Ae){return Le.apply(this,arguments)}}())}})};return c.a.createElement("div",{className:t.a.wrap},c.a.createElement(m.a,{disabled:!I||h,className:"mr5",style:{width:"242px"},onChange:Y,showSearch:!0,allowClear:!0,value:C==null?void 0:C.filter(function(le){return(v==null?void 0:v.includes(le==null?void 0:le.id))||(v==null?void 0:v.includes((le==null?void 0:le.id)+""))}).map(function(le){return le.name})},C==null?void 0:C.map(function(le){return c.a.createElement(R,{key:le.id,value:le.name},c.a.createElement("div",{style:{display:"flex",justifyContent:"space-between"}},c.a.createElement("span",{style:{overflow:"hidden",whiteSpace:"nowrap",textOverflow:"ellipsis"}},le.name),c.a.createElement("span",null,le.type==="personal"?"\uFF08\u81EA\u7528\uFF09":"")))})),c.a.createElement("button",{disabled:!I,className:"".concat(t.a.addKnowledge," ").concat(I?"":t.a.disabled),onClick:ie},"\u65B0\u5EFA\u77E5\u8BC6\u70B9"))}},uK0f:function(It,Oe,U){(function(te,Q){It.exports=Q()})(this,function(){"use strict";function te(Q,B,J){J=J||{},J.childrenKeyName=J.childrenKeyName||"children";var K=Q||[],N=[],$=0;do{var z=K.filter(function(r){return B(r,$)})[0];if(!z)break;N.push(z),K=z[J.childrenKeyName]||[],$+=1}while(K.length>0);return N}return te})},ulZh:function(It,Oe,U){typeof window!="undefined"&&function(Q,B){It.exports=B()}(this,function(){return function(te){var Q={};function B(J){if(Q[J])return Q[J].exports;var K=Q[J]={i:J,l:!1,exports:{}};return te[J].call(K.exports,K,K.exports,B),K.l=!0,K.exports}return B.m=te,B.c=Q,B.d=function(J,K,N){B.o(J,K)||Object.defineProperty(J,K,{enumerable:!0,get:N})},B.r=function(J){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(J,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(J,"__esModule",{value:!0})},B.t=function(J,K){if(K&1&&(J=B(J)),K&8)return J;if(K&4&&typeof J=="object"&&J&&J.__esModule)return J;var N=Object.create(null);if(B.r(N),Object.defineProperty(N,"default",{enumerable:!0,value:J}),K&2&&typeof J!="string")for(var $ in J)B.d(N,$,function(z){return J[z]}.bind(null,$));return N},B.n=function(J){var K=J&&J.__esModule?function(){return J.default}:function(){return J};return B.d(K,"a",K),K},B.o=function(J,K){return Object.prototype.hasOwnProperty.call(J,K)},B.p="/dist/",B(B.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(te,Q,B){"use strict";var J=Object.prototype.hasOwnProperty,K="~";function N(){}Object.create&&(N.prototype=Object.create(null),new N().__proto__||(K=!1));function $(m,g,p){this.fn=m,this.context=g,this.once=p||!1}function z(m,g,p,a,c){if(typeof p!="function")throw new TypeError("The listener must be a function");var s=new $(p,a||m,c),i=K?K+g:g;return m._events[i]?m._events[i].fn?m._events[i]=[m._events[i],s]:m._events[i].push(s):(m._events[i]=s,m._eventsCount++),m}function r(m,g){--m._eventsCount===0?m._events=new N:delete m._events[g]}function D(){this._events=new N,this._eventsCount=0}D.prototype.eventNames=function(){var g=[],p,a;if(this._eventsCount===0)return g;for(a in p=this._events)J.call(p,a)&&g.push(K?a.slice(1):a);return Object.getOwnPropertySymbols?g.concat(Object.getOwnPropertySymbols(p)):g},D.prototype.listeners=function(g){var p=K?K+g:g,a=this._events[p];if(!a)return[];if(a.fn)return[a.fn];for(var c=0,s=a.length,i=new Array(s);c<s;c++)i[c]=a[c].fn;return i},D.prototype.listenerCount=function(g){var p=K?K+g:g,a=this._events[p];return a?a.fn?1:a.length:0},D.prototype.emit=function(g,p,a,c,s,i){var t=K?K+g:g;if(!this._events[t])return!1;var u=this._events[t],o=arguments.length,R,T;if(u.fn){u.once&&this.removeListener(g,u.fn,void 0,!0);switch(o){case 1:return u.fn.call(u.context),!0;case 2:return u.fn.call(u.context,p),!0;case 3:return u.fn.call(u.context,p,a),!0;case 4:return u.fn.call(u.context,p,a,c),!0;case 5:return u.fn.call(u.context,p,a,c,s),!0;case 6:return u.fn.call(u.context,p,a,c,s,i),!0}for(T=1,R=new Array(o-1);T<o;T++)R[T-1]=arguments[T];u.fn.apply(u.context,R)}else{var S=u.length,A;for(T=0;T<S;T++){u[T].once&&this.removeListener(g,u[T].fn,void 0,!0);switch(o){case 1:u[T].fn.call(u[T].context);break;case 2:u[T].fn.call(u[T].context,p);break;case 3:u[T].fn.call(u[T].context,p,a);break;case 4:u[T].fn.call(u[T].context,p,a,c);break;default:if(!R)for(A=1,R=new Array(o-1);A<o;A++)R[A-1]=arguments[A];u[T].fn.apply(u[T].context,R)}}}return!0},D.prototype.on=function(g,p,a){return z(this,g,p,a,!1)},D.prototype.once=function(g,p,a){return z(this,g,p,a,!0)},D.prototype.removeListener=function(g,p,a,c){var s=K?K+g:g;if(!this._events[s])return this;if(!p)return r(this,s),this;var i=this._events[s];if(i.fn)i.fn===p&&(!c||i.once)&&(!a||i.context===a)&&r(this,s);else{for(var t=0,u=[],o=i.length;t<o;t++)(i[t].fn!==p||c&&!i[t].once||a&&i[t].context!==a)&&u.push(i[t]);u.length?this._events[s]=u.length===1?u[0]:u:r(this,s)}return this},D.prototype.removeAllListeners=function(g){var p;return g?(p=K?K+g:g,this._events[p]&&r(this,p)):(this._events=new N,this._eventsCount=0),this},D.prototype.off=D.prototype.removeListener,D.prototype.addListener=D.prototype.on,D.prefixed=K,D.EventEmitter=D,te.exports=D},"./node_modules/url-toolkit/src/url-toolkit.js":function(te,Q,B){(function(J){var K=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,N=/^([^\/?#]*)([^]*)$/,$=/(?:\/|^)\.(?=\/)/g,z=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,r={buildAbsoluteURL:function(D,m,g){if(g=g||{},D=D.trim(),m=m.trim(),!m){if(!g.alwaysNormalize)return D;var p=r.parseURL(D);if(!p)throw new Error("Error trying to parse base URL.");return p.path=r.normalizePath(p.path),r.buildURLFromParts(p)}var a=r.parseURL(m);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return g.alwaysNormalize?(a.path=r.normalizePath(a.path),r.buildURLFromParts(a)):m;var c=r.parseURL(D);if(!c)throw new Error("Error trying to parse base URL.");if(!c.netLoc&&c.path&&c.path[0]!=="/"){var s=N.exec(c.path);c.netLoc=s[1],c.path=s[2]}c.netLoc&&!c.path&&(c.path="/");var i={scheme:c.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(i.netLoc=c.netLoc,a.path[0]!=="/"))if(!a.path)i.path=c.path,a.params||(i.params=c.params,a.query||(i.query=c.query));else{var t=c.path,u=t.substring(0,t.lastIndexOf("/")+1)+a.path;i.path=r.normalizePath(u)}return i.path===null&&(i.path=g.alwaysNormalize?r.normalizePath(a.path):a.path),r.buildURLFromParts(i)},parseURL:function(D){var m=K.exec(D);return m?{scheme:m[1]||"",netLoc:m[2]||"",path:m[3]||"",params:m[4]||"",query:m[5]||"",fragment:m[6]||""}:null},normalizePath:function(D){for(D=D.split("").reverse().join("").replace($,"");D.length!==(D=D.replace(z,"")).length;);return D.split("").reverse().join("")},buildURLFromParts:function(D){return D.scheme+D.netLoc+D.path+D.params+D.query+D.fragment}};te.exports=r})(this)},"./node_modules/webworkify-webpack/index.js":function(te,Q,B){function J(g){var p={};function a(s){if(p[s])return p[s].exports;var i=p[s]={i:s,l:!1,exports:{}};return g[s].call(i.exports,i,i.exports,a),i.l=!0,i.exports}a.m=g,a.c=p,a.i=function(s){return s},a.d=function(s,i,t){a.o(s,i)||Object.defineProperty(s,i,{configurable:!1,enumerable:!0,get:t})},a.r=function(s){Object.defineProperty(s,"__esModule",{value:!0})},a.n=function(s){var i=s&&s.__esModule?function(){return s.default}:function(){return s};return a.d(i,"a",i),i},a.o=function(s,i){return Object.prototype.hasOwnProperty.call(s,i)},a.p="/",a.oe=function(s){throw console.error(s),s};var c=a(a.s=ENTRY_MODULE);return c.default||c}var K="[\\.|\\-|\\+|\\w|/|@]+",N="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+K+").*?\\)";function $(g){return(g+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function z(g){return!isNaN(1*g)}function r(g,p,a){var c={};c[a]=[];var s=p.toString(),i=s.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!i)return c;for(var t=i[1],u=new RegExp("(\\\\n|\\W)"+$(t)+N,"g"),o;o=u.exec(s);){if(o[3]==="dll-reference")continue;c[a].push(o[3])}for(u=new RegExp("\\("+$(t)+'\\("(dll-reference\\s('+K+'))"\\)\\)'+N,"g");o=u.exec(s);)g[o[2]]||(c[a].push(o[1]),g[o[2]]=B(o[1]).m),c[o[2]]=c[o[2]]||[],c[o[2]].push(o[4]);for(var R=Object.keys(c),T=0;T<R.length;T++)for(var S=0;S<c[R[T]].length;S++)z(c[R[T]][S])&&(c[R[T]][S]=1*c[R[T]][S]);return c}function D(g){var p=Object.keys(g);return p.reduce(function(a,c){return a||g[c].length>0},!1)}function m(g,p){for(var a={main:[p]},c={main:[]},s={main:{}};D(a);)for(var i=Object.keys(a),t=0;t<i.length;t++){var u=i[t],o=a[u],R=o.pop();if(s[u]=s[u]||{},s[u][R]||!g[u][R])continue;s[u][R]=!0,c[u]=c[u]||[],c[u].push(R);for(var T=r(g,g[u][R],u),S=Object.keys(T),A=0;A<S.length;A++)a[S[A]]=a[S[A]]||[],a[S[A]]=a[S[A]].concat(T[S[A]])}return c}te.exports=function(g,p){p=p||{};var a={main:B.m},c=p.all?{main:Object.keys(a.main)}:m(a,g),s="";Object.keys(c).filter(function(R){return R!=="main"}).forEach(function(R){for(var T=0;c[R][T];)T++;c[R].push(T),a[R][T]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",s=s+"var "+R+" = ("+J.toString().replace("ENTRY_MODULE",JSON.stringify(T))+")({"+c[R].map(function(S){return""+JSON.stringify(S)+": "+a[R][S].toString()}).join(",")+`});
`}),s=s+"new (("+J.toString().replace("ENTRY_MODULE",JSON.stringify(g))+")({"+c.main.map(function(R){return""+JSON.stringify(R)+": "+a.main[R].toString()}).join(",")+"}))(self);";var i=new window.Blob([s],{type:"text/javascript"});if(p.bare)return i;var t=window.URL||window.webkitURL||window.mozURL||window.msURL,u=t.createObjectURL(i),o=new window.Worker(u);return o.objectURL=u,o}},"./src/config.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"hlsDefaultConfig",function(){return A}),B.d(Q,"mergeConfig",function(){return x}),B.d(Q,"enableStreamingMode",function(){return b});var J=B("./src/controller/abr-controller.ts"),K=B("./src/controller/audio-stream-controller.ts"),N=B("./src/controller/audio-track-controller.ts"),$=B("./src/controller/subtitle-stream-controller.ts"),z=B("./src/controller/subtitle-track-controller.ts"),r=B("./src/controller/buffer-controller.ts"),D=B("./src/controller/timeline-controller.ts"),m=B("./src/controller/cap-level-controller.ts"),g=B("./src/controller/fps-controller.ts"),p=B("./src/controller/eme-controller.ts"),a=B("./src/controller/cmcd-controller.ts"),c=B("./src/utils/xhr-loader.ts"),s=B("./src/utils/fetch-loader.ts"),i=B("./src/utils/cues.ts"),t=B("./src/utils/mediakeys-helper.ts"),u=B("./src/utils/logger.ts");function o(){return o=Object.assign||function(h){for(var f=1;f<arguments.length;f++){var C=arguments[f];for(var E in C)Object.prototype.hasOwnProperty.call(C,E)&&(h[E]=C[E])}return h},o.apply(this,arguments)}function R(h,f){var C=Object.keys(h);if(Object.getOwnPropertySymbols){var E=Object.getOwnPropertySymbols(h);f&&(E=E.filter(function(_){return Object.getOwnPropertyDescriptor(h,_).enumerable})),C.push.apply(C,E)}return C}function T(h){for(var f=1;f<arguments.length;f++){var C=arguments[f]!=null?arguments[f]:{};f%2?R(Object(C),!0).forEach(function(E){S(h,E,C[E])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(C)):R(Object(C)).forEach(function(E){Object.defineProperty(h,E,Object.getOwnPropertyDescriptor(C,E))})}return h}function S(h,f,C){return f in h?Object.defineProperty(h,f,{value:C,enumerable:!0,configurable:!0,writable:!0}):h[f]=C,h}var A=T(T({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:c.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:J.default,bufferController:r.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},I()),{},{subtitleStreamController:$.SubtitleStreamController,subtitleTrackController:z.default,timelineController:D.TimelineController,audioStreamController:K.default,audioTrackController:N.default,emeController:p.default,cmcdController:a.default});function I(){return{cueHandler:i.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function x(h,f){if((f.liveSyncDurationCount||f.liveMaxLatencyDurationCount)&&(f.liveSyncDuration||f.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(f.liveMaxLatencyDurationCount!==void 0&&(f.liveSyncDurationCount===void 0||f.liveMaxLatencyDurationCount<=f.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(f.liveMaxLatencyDuration!==void 0&&(f.liveSyncDuration===void 0||f.liveMaxLatencyDuration<=f.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return o({},h,f)}function b(h){var f=h.loader;if(f!==s.default&&f!==c.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1;else{var C=Object(s.fetchSupported)();C&&(h.loader=s.default,h.progressive=!0,h.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/polyfills/number.ts"),K=B("./src/utils/ewma-bandwidth-estimator.ts"),N=B("./src/events.ts"),$=B("./src/utils/buffer-helper.ts"),z=B("./src/errors.ts"),r=B("./src/types/loader.ts"),D=B("./src/utils/logger.ts");function m(a,c){for(var s=0;s<c.length;s++){var i=c[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function g(a,c,s){return c&&m(a.prototype,c),s&&m(a,s),a}var p=function(){function a(s){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=s;var i=s.config;this.bwEstimator=new K.default(i.abrEwmaSlowVoD,i.abrEwmaFastVoD,i.abrEwmaDefaultEstimate),this.registerListeners()}var c=a.prototype;return c.registerListeners=function(){var i=this.hls;i.on(N.Events.FRAG_LOADING,this.onFragLoading,this),i.on(N.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.on(N.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var i=this.hls;i.off(N.Events.FRAG_LOADING,this.onFragLoading,this),i.off(N.Events.FRAG_LOADED,this.onFragLoaded,this),i.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),i.off(N.Events.ERROR,this.onError,this)},c.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},c.onFragLoading=function(i,t){var u=t.frag;if(u.type===r.PlaylistLevelType.MAIN&&!this.timer){var o;this.fragCurrent=u,this.partCurrent=(o=t.part)!=null?o:null,this.timer=self.setInterval(this.onCheck,100)}},c.onLevelLoaded=function(i,t){var u=this.hls.config;t.details.live?this.bwEstimator.update(u.abrEwmaSlowLive,u.abrEwmaFastLive):this.bwEstimator.update(u.abrEwmaSlowVoD,u.abrEwmaFastVoD)},c._abandonRulesCheck=function(){var i=this.fragCurrent,t=this.partCurrent,u=this.hls,o=u.autoLevelEnabled,R=u.config,T=u.media;if(!i||!T)return;var S=t?t.stats:i.stats,A=t?t.duration:i.duration;if(S.aborted){D.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!o||T.paused||!T.playbackRate||!T.readyState)return;var I=performance.now()-S.loading.start,x=Math.abs(T.playbackRate);if(I<=500*A/x)return;var b=u.levels,h=u.minAutoLevel,f=b[i.level],C=S.total||Math.max(S.loaded,Math.round(A*f.maxBitrate/8)),E=Math.max(1,S.bwEstimate?S.bwEstimate/8:S.loaded*1e3/I),_=(C-S.loaded)/E,W=T.currentTime,j=($.BufferHelper.bufferInfo(T,W,R.maxBufferHole).end-W)/x;if(j>=2*A/x||_<=j)return;var w=Number.POSITIVE_INFINITY,F;for(F=i.level-1;F>h;F--){var P=b[F].maxBitrate;if(w=A*P/(8*.8*E),w<j)break}if(w>=_)return;var v=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+i.sn+(t?" part "+t.index:"")+" of level "+i.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+F+`
Current BW estimate: `+(Object(J.isFiniteNumber)(v)?(v/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+_.toFixed(3)+` s
Estimated load time for the next fragment: `+w.toFixed(3)+` s
Time to underbuffer: `+j.toFixed(3)+" s"),u.nextLoadLevel=F,this.bwEstimator.sample(I,S.loaded),this.clearTimer(),i.loader&&(this.fragCurrent=this.partCurrent=null,i.loader.abort()),u.trigger(N.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:i,part:t,stats:S})},c.onFragLoaded=function(i,t){var u=t.frag,o=t.part;if(u.type===r.PlaylistLevelType.MAIN&&Object(J.isFiniteNumber)(u.sn)){var R=o?o.stats:u.stats,T=o?o.duration:u.duration;if(this.clearTimer(),this.lastLoadedFragLevel=u.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[u.level],A=(S.loaded?S.loaded.bytes:0)+R.loaded,I=(S.loaded?S.loaded.duration:0)+T;S.loaded={bytes:A,duration:I},S.realBitrate=Math.round(8*A/I)}if(u.bitrateTest){var x={stats:R,frag:u,part:o,id:u.type};this.onFragBuffered(N.Events.FRAG_BUFFERED,x),u.bitrateTest=!1}}},c.onFragBuffered=function(i,t){var u=t.frag,o=t.part,R=o?o.stats:u.stats;if(R.aborted)return;if(u.type!==r.PlaylistLevelType.MAIN||u.sn==="initSegment")return;var T=R.parsing.end-R.loading.start;this.bwEstimator.sample(T,R.loaded),R.bwEstimate=this.bwEstimator.getEstimate(),u.bitrateTest?this.bitrateTestDelay=T/1e3:this.bitrateTestDelay=0},c.onError=function(i,t){switch(t.details){case z.ErrorDetails.FRAG_LOAD_ERROR:case z.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},c.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},c.getNextABRAutoLevel=function(){var i=this.fragCurrent,t=this.partCurrent,u=this.hls,o=u.maxAutoLevel,R=u.config,T=u.minAutoLevel,S=u.media,A=t?t.duration:i?i.duration:0,I=S?S.currentTime:0,x=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,b=this.bwEstimator?this.bwEstimator.getEstimate():R.abrEwmaDefaultEstimate,h=($.BufferHelper.bufferInfo(S,I,R.maxBufferHole).end-I)/x,f=this.findBestLevel(b,T,o,h,R.abrBandWidthFactor,R.abrBandWidthUpFactor);if(f>=0)return f;D.logger.trace((h?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var C=A?Math.min(A,R.maxStarvationDelay):R.maxStarvationDelay,E=R.abrBandWidthFactor,_=R.abrBandWidthUpFactor;if(!h){var W=this.bitrateTestDelay;if(W){var j=A?Math.min(A,R.maxLoadingDelay):R.maxLoadingDelay;C=j-W,D.logger.trace("bitrate test took "+Math.round(1e3*W)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*C)+" ms"),E=_=1}}return f=this.findBestLevel(b,T,o,h+C,E,_),Math.max(f,0)},c.findBestLevel=function(i,t,u,o,R,T){for(var S,A=this.fragCurrent,I=this.partCurrent,x=this.lastLoadedFragLevel,b=this.hls.levels,h=b[x],f=!!(h!=null&&(S=h.details)!==null&&S!==void 0&&S.live),C=h==null?void 0:h.codecSet,E=I?I.duration:A?A.duration:0,_=u;_>=t;_--){var W=b[_];if(!W||C&&W.codecSet!==C)continue;var j=W.details,w=(I?j==null?void 0:j.partTarget:j==null?void 0:j.averagetargetduration)||E,F=void 0;_<=x?F=R*i:F=T*i;var P=b[_].maxBitrate,v=P*w/F;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+_+"/"+Math.round(F)+"/"+P+"/"+w+"/"+o+"/"+v),F>P&&(!v||f&&!this.bitrateTestDelay||v<o))return _}return-1},g(a,[{key:"nextAutoLevel",get:function(){var i=this._nextAutoLevel,t=this.bwEstimator;if(i!==-1&&(!t||!t.canEstimate()))return i;var u=this.getNextABRAutoLevel();return i!==-1&&(u=Math.min(i,u)),u},set:function(i){this._nextAutoLevel=i}}]),a}();Q.default=p},"./src/controller/audio-stream-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/polyfills/number.ts"),K=B("./src/controller/base-stream-controller.ts"),N=B("./src/events.ts"),$=B("./src/utils/buffer-helper.ts"),z=B("./src/controller/fragment-tracker.ts"),r=B("./src/types/level.ts"),D=B("./src/types/loader.ts"),m=B("./src/loader/fragment.ts"),g=B("./src/demux/chunk-cache.ts"),p=B("./src/demux/transmuxer-interface.ts"),a=B("./src/types/transmuxer.ts"),c=B("./src/controller/fragment-finders.ts"),s=B("./src/utils/discontinuities.ts"),i=B("./src/errors.ts"),t=B("./src/utils/logger.ts");function u(){return u=Object.assign||function(A){for(var I=1;I<arguments.length;I++){var x=arguments[I];for(var b in x)Object.prototype.hasOwnProperty.call(x,b)&&(A[b]=x[b])}return A},u.apply(this,arguments)}function o(A,I){A.prototype=Object.create(I.prototype),A.prototype.constructor=A,R(A,I)}function R(A,I){return R=Object.setPrototypeOf||function(b,h){return b.__proto__=h,b},R(A,I)}var T=100,S=function(A){o(I,A);function I(b,h){var f;return f=A.call(this,b,h,"[audio-stream-controller]")||this,f.videoBuffer=null,f.videoTrackCC=-1,f.waitingVideoCC=-1,f.audioSwitch=!1,f.trackId=-1,f.waitingData=null,f.mainDetails=null,f.bufferFlushed=!1,f._registerListeners(),f}var x=I.prototype;return x.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},x._registerListeners=function(){var h=this.hls;h.on(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(N.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.on(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.on(N.Events.ERROR,this.onError,this),h.on(N.Events.BUFFER_RESET,this.onBufferReset,this),h.on(N.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.on(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x._unregisterListeners=function(){var h=this.hls;h.off(N.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(N.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(N.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(N.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(N.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),h.off(N.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(N.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),h.off(N.Events.ERROR,this.onError,this),h.off(N.Events.BUFFER_RESET,this.onBufferReset,this),h.off(N.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(N.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(N.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),h.off(N.Events.FRAG_BUFFERED,this.onFragBuffered,this)},x.onInitPtsFound=function(h,f){var C=f.frag,E=f.id,_=f.initPTS;if(E==="main"){var W=C.cc;this.initPTS[C.cc]=_,this.log("InitPTS for cc: "+W+" found from main: "+_),this.videoTrackCC=W,this.state===K.State.WAITING_INIT_PTS&&this.tick()}},x.startLoad=function(h){if(!this.levels){this.startPosition=h,this.state=K.State.STOPPED;return}var f=this.lastCurrentTime;this.stopLoad(),this.setInterval(T),this.fragLoadError=0,f>0&&h===-1?(this.log("Override startPosition with lastCurrentTime @"+f.toFixed(3)),this.state=K.State.IDLE):(this.loadedmetadata=!1,this.state=K.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()},x.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_TRACK:{var h,f=this.levels,C=this.trackId,E=f==null||((h=f[C])===null||h===void 0)?void 0:h.details;if(E){if(this.waitForCdnTuneIn(E))break;this.state=K.State.WAITING_INIT_PTS}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var _,W=performance.now(),j=this.retryDate;(!j||W>=j||(_=this.media)!==null&&_!==void 0&&_.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=K.State.IDLE);break}case K.State.WAITING_INIT_PTS:{var w=this.waitingData;if(w){var F=w.frag,P=w.part,v=w.cache,H=w.complete;if(this.initPTS[F.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.FRAG_LOADING;var Y=v.flush(),ie={frag:F,part:P,payload:Y,networkDetails:null};this._handleFragmentLoadProgress(ie),H&&A.prototype._handleFragmentLoadComplete.call(this,ie)}else if(this.videoTrackCC!==this.waitingVideoCC)t.logger.log("Waiting fragment cc ("+F.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var le=this.getLoadPosition(),he=$.BufferHelper.bufferInfo(this.mediaBuffer,le,this.config.maxBufferHole),xe=Object(c.fragmentWithinToleranceTest)(he.end,this.config.maxFragLookUpTolerance,F);xe<0&&(t.logger.log("Waiting fragment cc ("+F.cc+") @ "+F.start+" cancelled because another fragment at "+he.end+" is needed"),this.clearWaitingFragment())}}else this.state=K.State.IDLE}}this.onTickEnd()},x.clearWaitingFragment=function(){var h=this.waitingData;h&&(this.fragmentTracker.removeFragment(h.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=K.State.IDLE)},x.onTickEnd=function(){var h=this.media;if(!h||!h.readyState)return;var f=this.mediaBuffer?this.mediaBuffer:h,C=f.buffered;!this.loadedmetadata&&C.length&&(this.loadedmetadata=!0),this.lastCurrentTime=h.currentTime},x.doTickIdle=function(){var h,f,C=this.hls,E=this.levels,_=this.media,W=this.trackId,j=C.config;if(!E||!E[W])return;if(!_&&(this.startFragRequested||!j.startFragPrefetch))return;var w=E[W],F=w.details;if(!F||F.live&&this.levelLastLoaded!==W||this.waitForCdnTuneIn(F)){this.state=K.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 v=P.len,H=this.getMaxBufferLength(),Y=this.audioSwitch;if(v>=H&&!Y)return;if(!Y&&this._streamEnded(P,F)){C.trigger(N.Events.BUFFER_EOS,{type:"audio"}),this.state=K.State.ENDED;return}var ie=F.fragments,le=ie[0].start,he=P.end;if(Y){var xe=this.getLoadPosition();he=xe,F.PTSKnown&&xe<le&&((P.end>le||P.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),_.currentTime=le+.05))}var Le=this.getNextFragment(he,F);if(!Le){this.bufferFlushed=!0;return}((h=Le.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((f=Le.decryptdata)!==null&&f!==void 0&&f.key)?this.loadKey(Le,F):this.loadFragment(Le,F,he)},x.getMaxBufferLength=function(){var h=A.prototype.getMaxBufferLength.call(this),f=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return f===null?h:Math.max(h,f.len)},x.onMediaDetaching=function(){this.videoBuffer=null,A.prototype.onMediaDetaching.call(this)},x.onAudioTracksUpdated=function(h,f){var C=f.audioTracks;this.resetTransmuxer(),this.levels=C.map(function(E){return new r.Level(E)})},x.onAudioTrackSwitching=function(h,f){var C=!!f.url;this.trackId=f.id;var E=this.fragCurrent;E!=null&&E.loader&&E.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),C?this.setInterval(T):this.resetTransmuxer(),C?(this.audioSwitch=!0,this.state=K.State.IDLE):this.state=K.State.STOPPED,this.tick()},x.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},x.onLevelLoaded=function(h,f){this.mainDetails=f.details},x.onAudioTrackLoaded=function(h,f){var C,E=this.levels,_=f.details,W=f.id;if(!E){this.warn("Audio tracks were reset while loading level "+W);return}this.log("Track "+W+" loaded ["+_.startSN+","+_.endSN+"],duration:"+_.totalduration);var j=E[W],w=0;if(_.live||(C=j.details)!==null&&C!==void 0&&C.live){var F=this.mainDetails;if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed||!F)return;!j.details&&_.hasProgramDateTime&&F.hasProgramDateTime?(Object(s.alignMediaPlaylistByPDT)(_,F),w=_.fragments[0].start):w=this.alignPlaylists(_,j.details)}j.details=_,this.levelLastLoaded=W,!this.startFragRequested&&(this.mainDetails||!_.live)&&this.setStartPosition(j.details,w),this.state===K.State.WAITING_TRACK&&!this.waitForCdnTuneIn(_)&&(this.state=K.State.IDLE),this.tick()},x._handleFragmentLoadProgress=function(h){var f,C=h.frag,E=h.part,_=h.payload,W=this.config,j=this.trackId,w=this.levels;if(!w){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+C.sn+" of level "+C.level+" will not be buffered");return}var F=w[j];console.assert(F,"Audio track is defined on fragment load progress");var P=F.details;console.assert(P,"Audio track details are defined on fragment load progress");var v=W.defaultAudioCodec||F.audioCodec||"mp4a.40.2",H=this.transmuxer;H||(H=this.transmuxer=new p.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Y=this.initPTS[C.cc],ie=(f=C.initSegment)===null||f===void 0?void 0:f.data;if(Y!==void 0){var le=!1,he=E?E.index:-1,xe=he!==-1,Le=new a.ChunkMetadata(C.level,C.sn,C.stats.chunkCount,_.byteLength,he,xe);H.push(_,ie,v,"",C,E,P.totalduration,le,Le,Y)}else{t.logger.log("Unknown video PTS for cc "+C.cc+", waiting for video PTS before demuxing audio frag "+C.sn+" of ["+P.startSN+" ,"+P.endSN+"],track "+j);var we=this.waitingData=this.waitingData||{frag:C,part:E,cache:new g.default,complete:!1},Ae=we.cache;Ae.push(new Uint8Array(_)),this.waitingVideoCC=this.videoTrackCC,this.state=K.State.WAITING_INIT_PTS}},x._handleFragmentLoadComplete=function(h){if(this.waitingData){this.waitingData.complete=!0;return}A.prototype._handleFragmentLoadComplete.call(this,h)},x.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},x.onBufferCreated=function(h,f){var C=f.tracks.audio;C&&(this.mediaBuffer=C.buffer),f.tracks.video&&(this.videoBuffer=f.tracks.video.buffer)},x.onFragBuffered=function(h,f){var C=f.frag,E=f.part;if(C.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(C)){this.warn("Fragment "+C.sn+(E?" p: "+E.index:"")+" of level "+C.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}C.sn!=="initSegment"&&(this.fragPrevious=C,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(N.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(C,E)},x.onError=function(h,f){switch(f.details){case i.ErrorDetails.FRAG_LOAD_ERROR:case i.ErrorDetails.FRAG_LOAD_TIMEOUT:case i.ErrorDetails.KEY_LOAD_ERROR:case i.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.AUDIO,f);break;case i.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case i.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==K.State.ERROR&&this.state!==K.State.STOPPED&&(this.state=f.fatal?K.State.ERROR:K.State.IDLE,this.warn(f.details+" while loading frag, switching to "+this.state+" state"));break;case i.ErrorDetails.BUFFER_FULL_ERROR:if(f.parent==="audio"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var C=!0,E=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);E&&E.len>.5&&(C=!this.reduceMaxBufferLength(E.len)),C&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},x.onBufferFlushed=function(h,f){var C=f.type;C===m.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},x._handleTransmuxComplete=function(h){var f,C="audio",E=this.hls,_=h.remuxResult,W=h.chunkMeta,j=this.getCurrentContext(W);if(!j){this.warn("The loading context changed while buffering fragment "+W.sn+" of level "+W.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(W.level);return}var w=j.frag,F=j.part,P=_.audio,v=_.text,H=_.id3,Y=_.initSegment;if(this.fragContextChanged(w))return;if(this.state=K.State.PARSING,this.audioSwitch&&P&&this.completeAudioSwitch(),Y!=null&&Y.tracks&&(this._bufferInitSegment(Y.tracks,w,W),E.trigger(N.Events.FRAG_PARSING_INIT_SEGMENT,{frag:w,id:C,tracks:Y.tracks})),P){var ie=P.startPTS,le=P.endPTS,he=P.startDTS,xe=P.endDTS;F&&(F.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:ie,endPTS:le,startDTS:he,endDTS:xe}),w.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,ie,le,he,xe),this.bufferFragmentData(P,w,F,W)}if(H!=null&&(f=H.samples)!==null&&f!==void 0&&f.length){var Le=u({frag:w,id:C},H);E.trigger(N.Events.FRAG_PARSING_METADATA,Le)}if(v){var we=u({frag:w,id:C},v);E.trigger(N.Events.FRAG_PARSING_USERDATA,we)}},x._bufferInitSegment=function(h,f,C){if(this.state!==K.State.PARSING)return;h.video&&delete h.video;var E=h.audio;if(!E)return;E.levelCodec=E.codec,E.id="audio",this.log("Init audio buffer, container:"+E.container+", codecs[parsed]=["+E.codec+"]"),this.hls.trigger(N.Events.BUFFER_CODECS,h);var _=E.initSegment;if(_!=null&&_.byteLength){var W={type:"audio",frag:f,part:null,chunkMeta:C,parent:f.type,data:_};this.hls.trigger(N.Events.BUFFER_APPENDING,W)}this.tick()},x.loadFragment=function(h,f,C){var E=this.fragmentTracker.getState(h);this.fragCurrent=h,(this.audioSwitch||E===z.FragmentState.NOT_LOADED||E===z.FragmentState.PARTIAL)&&(h.sn==="initSegment"?this._loadInitSegment(h):f.live&&!Object(J.isFiniteNumber)(this.initPTS[h.cc])?(this.log("Waiting for video PTS in continuity counter "+h.cc+" of live stream before loading audio fragment "+h.sn+" of level "+this.trackId),this.state=K.State.WAITING_INIT_PTS):(this.startFragRequested=!0,A.prototype.loadFragment.call(this,h,f,C)))},x.completeAudioSwitch=function(){var h=this.hls,f=this.media,C=this.trackId;f&&(this.log("Switching audio track : flushing all audio"),A.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,h.trigger(N.Events.AUDIO_TRACK_SWITCHED,{id:C})},I}(K.default);Q.default=S},"./src/controller/audio-track-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts"),K=B("./src/errors.ts"),N=B("./src/controller/base-playlist-controller.ts"),$=B("./src/types/loader.ts");function z(p,a){for(var c=0;c<a.length;c++){var s=a[c];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(p,s.key,s)}}function r(p,a,c){return a&&z(p.prototype,a),c&&z(p,c),p}function D(p,a){p.prototype=Object.create(a.prototype),p.prototype.constructor=p,m(p,a)}function m(p,a){return m=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},m(p,a)}var g=function(p){D(a,p);function a(s){var i;return i=p.call(this,s,"[audio-track-controller]")||this,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.trackName="",i.selectDefaultTrack=!0,i.registerListeners(),i}var c=a.prototype;return c.registerListeners=function(){var i=this.hls;i.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(J.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(J.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.on(J.Events.ERROR,this.onError,this)},c.unregisterListeners=function(){var i=this.hls;i.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(J.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(J.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),i.off(J.Events.ERROR,this.onError,this)},c.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},c.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},c.onManifestParsed=function(i,t){this.tracks=t.audioTracks||[]},c.onAudioTrackLoaded=function(i,t){var u=t.id,o=t.details,R=this.tracksInGroup[u];if(!R){this.warn("Invalid audio track id "+u);return}var T=R.details;R.details=t.details,this.log("audioTrack "+u+" loaded ["+o.startSN+"-"+o.endSN+"]"),u===this.trackId&&(this.retryCount=0,this.playlistLoaded(u,t,T))},c.onLevelLoading=function(i,t){this.switchLevel(t.level)},c.onLevelSwitching=function(i,t){this.switchLevel(t.level)},c.switchLevel=function(i){var t=this.hls.levels[i];if(!(t!=null&&t.audioGroupIds))return;var u=t.audioGroupIds[t.urlId];if(this.groupId!==u){this.groupId=u;var o=this.tracks.filter(function(T){return!u||T.groupId===u});this.selectDefaultTrack&&!o.some(function(T){return T.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=o;var R={audioTracks:o};this.log("Updating audio tracks, "+o.length+' track(s) found in "'+u+'" group-id'),this.hls.trigger(J.Events.AUDIO_TRACKS_UPDATED,R),this.selectInitialTrack()}},c.onError=function(i,t){if(p.prototype.onError.call(this,i,t),t.fatal||!t.context)return;t.context.type===$.PlaylistContextType.AUDIO_TRACK&&t.context.id===this.trackId&&t.context.groupId===this.groupId&&this.retryLoadingOrFail(t)},c.setAudioTrack=function(i){var t=this.tracksInGroup;if(i<0||i>=t.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var u=t[this.trackId];this.log("Now switching to audio-track index "+i);var o=t[i],R=o.id,T=o.groupId,S=T===void 0?"":T,A=o.name,I=o.type,x=o.url;if(this.trackId=i,this.trackName=A,this.selectDefaultTrack=!1,this.hls.trigger(J.Events.AUDIO_TRACK_SWITCHING,{id:R,groupId:S,name:A,type:I,url:x}),o.details&&!o.details.live)return;var b=this.switchParams(o.url,u==null?void 0:u.details);this.loadPlaylist(b)},c.selectInitialTrack=function(){var i=this.tracksInGroup;console.assert(i.length,"Initial audio track should be selected when tracks are known");var t=this.trackName,u=this.findTrackId(t)||this.findTrackId();u!==-1?this.setAudioTrack(u):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},c.findTrackId=function(i){for(var t=this.tracksInGroup,u=0;u<t.length;u++){var o=t[u];if((!this.selectDefaultTrack||o.default)&&(!i||i===o.name))return o.id}return-1},c.loadPlaylist=function(i){var t=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(t)){var u=t.id,o=t.groupId,R=t.url;if(i)try{R=i.addDirectives(R)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("loading audio-track playlist for id: "+u),this.clearTimer(),this.hls.trigger(J.Events.AUDIO_TRACK_LOADING,{url:R,id:u,groupId:o,deliveryDirectives:i||null})}},r(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1,this.setAudioTrack(i)}}]),a}(N.default);Q.default=g},"./src/controller/base-playlist-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return r});var J=B("./src/polyfills/number.ts"),K=B("./src/types/level.ts"),N=B("./src/controller/level-helper.ts"),$=B("./src/utils/logger.ts"),z=B("./src/errors.ts"),r=function(){function D(g,p){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=$.logger.log.bind($.logger,p+":"),this.warn=$.logger.warn.bind($.logger,p+":"),this.hls=g}var m=D.prototype;return m.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},m.onError=function(p,a){a.fatal&&a.type===z.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(p,a){var c=a==null?void 0:a.renditionReports;if(c)for(var s=0;s<c.length;s++){var i=c[s],t=""+i.URI;if(t===p.substr(-t.length)){var u=parseInt(i["LAST-MSN"]),o=parseInt(i["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var R=Math.min(a.age-a.partTarget,a.targetduration);o!==void 0&&R>a.partTarget&&(o+=1)}if(Object(J.isFiniteNumber)(u))return new K.HlsUrlParameters(u,Object(J.isFiniteNumber)(o)?o:void 0,K.HlsSkip.No)}}},m.loadPlaylist=function(p){},m.shouldLoadTrack=function(p){return this.canLoad&&p&&!!p.url&&(!p.details||p.details.live)},m.playlistLoaded=function(p,a,c){var s=this,i=a.details,t=a.stats,u=t.loading.end?Math.max(0,self.performance.now()-t.loading.end):0;if(i.advancedDateTime=Date.now()-u,i.live||c!=null&&c.live){if(i.reloaded(c),c&&this.log("live playlist "+p+" "+(i.advanced?"REFRESHED "+i.lastPartSn+"-"+i.lastPartIndex:"MISSED")),c&&i.fragments.length>0&&Object(N.mergeDetails)(c,i),!this.canLoad||!i.live)return;var o,R=void 0,T=void 0;if(i.canBlockReload&&i.endSN&&i.advanced){var S=this.hls.config.lowLatencyMode,A=i.lastPartSn,I=i.endSN,x=i.lastPartIndex,b=x!==-1,h=A===I,f=S?0:x;b?(R=h?I+1:A,T=h?f:x+1):R=I+1;var C=i.age,E=C+i.ageHeader,_=Math.min(E-i.partTarget,i.targetduration*1.5);if(_>0){if(c&&_>c.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+c.tuneInGoal+" to: "+_+" with playlist age: "+i.age),_=0;else{var W=Math.floor(_/i.targetduration);if(R+=W,T!==void 0){var j=Math.round(_%i.targetduration/i.partTarget);T+=j}this.log("CDN Tune-in age: "+i.ageHeader+"s last advanced "+C.toFixed(2)+"s goal: "+_+" skip sn "+W+" to part "+T)}i.tuneInGoal=_}if(o=this.getDeliveryDirectives(i,a.deliveryDirectives,R,T),S||!h){this.loadPlaylist(o);return}}else o=this.getDeliveryDirectives(i,a.deliveryDirectives,R,T);var w=Object(N.computeReloadInterval)(i,t);R!==void 0&&i.canBlockReload&&(w-=i.partTarget||1),this.log("reload live playlist "+p+" in "+Math.round(w)+" ms"),this.timer=self.setTimeout(function(){return s.loadPlaylist(o)},w)}else this.clearTimer()},m.getDeliveryDirectives=function(p,a,c,s){var i=Object(K.getSkipValue)(p,c);return a!=null&&a.skip&&p.deltaUpdateFailed&&(c=a.msn,s=a.part,i=K.HlsSkip.No),new K.HlsUrlParameters(c,s,i)},m.retryLoadingOrFail=function(p){var a=this,c=this.hls.config,s=this.retryCount<c.levelLoadingMaxRetry;if(s){var i;if(this.retryCount++,p.details.indexOf("LoadTimeOut")>-1&&(i=p.context)!==null&&i!==void 0&&i.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+p.details+'"'),this.loadPlaylist();else{var t=Math.min(Math.pow(2,this.retryCount)*c.levelLoadingRetryDelay,c.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},t),this.warn("retry playlist loading #"+this.retryCount+" in "+t+' ms after "'+p.details+'"')}}else this.warn('cannot recover from error "'+p.details+'"'),this.clearTimer(),p.fatal=!0;return s},D}()},"./src/controller/base-stream-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"State",function(){return I}),B.d(Q,"default",function(){return x});var J=B("./src/polyfills/number.ts"),K=B("./src/task-loop.ts"),N=B("./src/controller/fragment-tracker.ts"),$=B("./src/utils/buffer-helper.ts"),z=B("./src/utils/logger.ts"),r=B("./src/events.ts"),D=B("./src/errors.ts"),m=B("./src/types/transmuxer.ts"),g=B("./src/utils/mp4-tools.ts"),p=B("./src/utils/discontinuities.ts"),a=B("./src/controller/fragment-finders.ts"),c=B("./src/controller/level-helper.ts"),s=B("./src/loader/fragment-loader.ts"),i=B("./src/crypt/decrypter.ts"),t=B("./src/utils/time-ranges.ts"),u=B("./src/types/loader.ts");function o(b,h){for(var f=0;f<h.length;f++){var C=h[f];C.enumerable=C.enumerable||!1,C.configurable=!0,"value"in C&&(C.writable=!0),Object.defineProperty(b,C.key,C)}}function R(b,h,f){return h&&o(b.prototype,h),f&&o(b,f),b}function T(b){if(b===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return b}function S(b,h){b.prototype=Object.create(h.prototype),b.prototype.constructor=b,A(b,h)}function A(b,h){return A=Object.setPrototypeOf||function(C,E){return C.__proto__=E,C},A(b,h)}var I={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"},x=function(b){S(h,b);function h(C,E,_){var W;return W=b.call(this)||this,W.hls=void 0,W.fragPrevious=null,W.fragCurrent=null,W.fragmentTracker=void 0,W.transmuxer=null,W._state=I.STOPPED,W.media=void 0,W.mediaBuffer=void 0,W.config=void 0,W.bitrateTest=!1,W.lastCurrentTime=0,W.nextLoadPosition=0,W.startPosition=0,W.loadedmetadata=!1,W.fragLoadError=0,W.retryDate=0,W.levels=null,W.fragmentLoader=void 0,W.levelLastLoaded=null,W.startFragRequested=!1,W.decrypter=void 0,W.initPTS=[],W.onvseeking=null,W.onvended=null,W.logPrefix="",W.log=void 0,W.warn=void 0,W.logPrefix=_,W.log=z.logger.log.bind(z.logger,_+":"),W.warn=z.logger.warn.bind(z.logger,_+":"),W.hls=C,W.fragmentLoader=new s.default(C.config),W.fragmentTracker=E,W.config=C.config,W.decrypter=new i.default(C,C.config),C.on(r.Events.KEY_LOADED,W.onKeyLoaded,T(W)),W}var f=h.prototype;return f.doTick=function(){this.onTickEnd()},f.onTickEnd=function(){},f.startLoad=function(E){},f.stopLoad=function(){this.fragmentLoader.abort();var E=this.fragCurrent;E&&this.fragmentTracker.removeFragment(E),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=I.STOPPED},f._streamEnded=function(E,_){var W=this.fragCurrent,j=this.fragmentTracker;if(!_.live&&W&&W.sn===_.endSN&&!E.nextStart){var w=j.getState(W);return w===N.FragmentState.PARTIAL||w===N.FragmentState.OK}return!1},f.onMediaAttached=function(E,_){var W=this.media=this.mediaBuffer=_.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),W.addEventListener("seeking",this.onvseeking),W.addEventListener("ended",this.onvended);var j=this.config;this.levels&&j.autoStartLoad&&this.state===I.STOPPED&&this.startLoad(j.startPosition)},f.onMediaDetaching=function(){var E=this.media;E!=null&&E.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),E&&(E.removeEventListener("seeking",this.onvseeking),E.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},f.onMediaSeeking=function(){var E=this.config,_=this.fragCurrent,W=this.media,j=this.mediaBuffer,w=this.state,F=W?W.currentTime:0,P=$.BufferHelper.bufferInfo(j||W,F,E.maxBufferHole);if(this.log("media seeking to "+(Object(J.isFiniteNumber)(F)?F.toFixed(3):F)+", state: "+w),w===I.ENDED)this.resetLoadingState();else if(_&&!P.len){var v=E.maxFragLookUpTolerance,H=_.start-v,Y=_.start+_.duration+v,ie=F>Y;(F<H||ie)&&(ie&&_.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),_.loader.abort()),this.resetLoadingState())}W&&(this.lastCurrentTime=F),!this.loadedmetadata&&!P.len&&(this.nextLoadPosition=this.startPosition=F),this.tickImmediate()},f.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},f.onKeyLoaded=function(E,_){if(this.state!==I.KEY_LOADING||_.frag!==this.fragCurrent||!this.levels)return;this.state=I.IDLE;var W=this.levels[_.frag.level].details;W&&this.loadFragment(_.frag,W,_.frag.start)},f.onHandlerDestroying=function(){this.stopLoad(),b.prototype.onHandlerDestroying.call(this)},f.onHandlerDestroyed=function(){this.state=I.STOPPED,this.hls.off(r.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,b.prototype.onHandlerDestroyed.call(this)},f.loadKey=function(E,_){this.log("Loading key for "+E.sn+" of ["+_.startSN+"-"+_.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level),this.state=I.KEY_LOADING,this.fragCurrent=E,this.hls.trigger(r.Events.KEY_LOADING,{frag:E})},f.loadFragment=function(E,_,W){this._loadFragForPlayback(E,_,W)},f._loadFragForPlayback=function(E,_,W){var j=this,w=function(P){if(j.fragContextChanged(E)){j.warn("Fragment "+E.sn+(P.part?" p: "+P.part.index:"")+" of level "+E.level+" was dropped during download."),j.fragmentTracker.removeFragment(E);return}E.stats.chunkCount++,j._handleFragmentLoadProgress(P)};this._doFragLoad(E,_,W,w).then(function(F){if(!F)return;j.fragLoadError=0;var P=j.state;if(j.fragContextChanged(E)){(P===I.FRAG_LOADING||P===I.BACKTRACKING||!j.fragCurrent&&P===I.PARSING)&&(j.fragmentTracker.removeFragment(E),j.state=I.IDLE);return}if("payload"in F&&(j.log("Loaded fragment "+E.sn+" of level "+E.level),j.hls.trigger(r.Events.FRAG_LOADED,F),j.state===I.BACKTRACKING)){j.fragmentTracker.backtrack(E,F),j.resetFragmentLoading(E);return}j._handleFragmentLoadComplete(F)}).catch(function(F){j.warn(F),j.resetFragmentLoading(E)})},f.flushMainBuffer=function(E,_,W){if(W===void 0&&(W=null),!(E-_))return;var j={startOffset:E,endOffset:_,type:W};this.fragLoadError=0,this.hls.trigger(r.Events.BUFFER_FLUSHING,j)},f._loadInitSegment=function(E){var _=this;this._doFragLoad(E).then(function(W){if(!W||_.fragContextChanged(E)||!_.levels)throw new Error("init load aborted");return W}).then(function(W){var j=_.hls,w=W.payload,F=E.decryptdata;if(w&&w.byteLength>0&&F&&F.key&&F.iv&&F.method==="AES-128"){var P=self.performance.now();return _.decrypter.webCryptoDecrypt(new Uint8Array(w),F.key.buffer,F.iv.buffer).then(function(v){var H=self.performance.now();return j.trigger(r.Events.FRAG_DECRYPTED,{frag:E,payload:v,stats:{tstart:P,tdecrypt:H}}),W.payload=v,W})}return W}).then(function(W){var j=_.fragCurrent,w=_.hls,F=_.levels;if(!F)throw new Error("init load aborted, missing levels");var P=F[E.level].details;console.assert(P,"Level details are defined when init segment is loaded");var v=E.stats;_.state=I.IDLE,_.fragLoadError=0,E.data=new Uint8Array(W.payload),v.parsing.start=v.buffering.start=self.performance.now(),v.parsing.end=v.buffering.end=self.performance.now(),W.frag===j&&w.trigger(r.Events.FRAG_BUFFERED,{stats:v,frag:j,part:null,id:E.type}),_.tick()}).catch(function(W){_.warn(W),_.resetFragmentLoading(E)})},f.fragContextChanged=function(E){var _=this.fragCurrent;return!E||!_||E.level!==_.level||E.sn!==_.sn||E.urlId!==_.urlId},f.fragBufferedComplete=function(E,_){var W=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+E.type+" sn: "+E.sn+(_?" part: "+_.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+E.level+" "+t.default.toString($.BufferHelper.getBuffered(W))),this.state=I.IDLE,this.tick()},f._handleFragmentLoadComplete=function(E){var _=this.transmuxer;if(!_)return;var W=E.frag,j=E.part,w=E.partsLoaded,F=!w||w.length===0||w.some(function(v){return!v}),P=new m.ChunkMetadata(W.level,W.sn,W.stats.chunkCount+1,0,j?j.index:-1,!F);_.flush(P)},f._handleFragmentLoadProgress=function(E){},f._doFragLoad=function(E,_,W,j){var w=this;if(W===void 0&&(W=null),!this.levels)throw new Error("frag load aborted, missing levels");if(W=Math.max(E.start,W||0),this.config.lowLatencyMode&&_){var F=_.partList;if(F&&j){W>E.end&&_.fragmentHint&&(E=_.fragmentHint);var P=this.getNextPart(F,E,W);if(P>-1){var v=F[P];return this.log("Loading part sn: "+E.sn+" p: "+v.index+" cc: "+E.cc+" of playlist ["+_.startSN+"-"+_.endSN+"] parts [0-"+P+"-"+(F.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(W.toFixed(3))),this.nextLoadPosition=v.start+v.duration,this.state=I.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:E,part:F[P],targetBufferTime:W}),this.doFragPartsLoad(E,F,P,j).catch(function(H){return w.handleFragLoadError(H)})}else if(!E.url||this.loadedEndOfParts(F,W))return Promise.resolve(null)}}return this.log("Loading fragment "+E.sn+" cc: "+E.cc+" "+(_?"of ["+_.startSN+"-"+_.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+E.level+", target: "+parseFloat(W.toFixed(3))),Object(J.isFiniteNumber)(E.sn)&&!this.bitrateTest&&(this.nextLoadPosition=E.start+E.duration),this.state=I.FRAG_LOADING,this.hls.trigger(r.Events.FRAG_LOADING,{frag:E,targetBufferTime:W}),this.fragmentLoader.load(E,j).catch(function(H){return w.handleFragLoadError(H)})},f.doFragPartsLoad=function(E,_,W,j){var w=this;return new Promise(function(F,P){var v=[],H=function Y(ie){var le=_[ie];w.fragmentLoader.loadPart(E,le,j).then(function(he){v[le.index]=he;var xe=he.part;w.hls.trigger(r.Events.FRAG_LOADED,he);var Le=_[ie+1];if(Le&&Le.fragment===E)Y(ie+1);else return F({frag:E,part:xe,partsLoaded:v})}).catch(P)};H(W)})},f.handleFragLoadError=function(E){var _=E.data;return _&&_.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(_.frag,_.part):this.hls.trigger(r.Events.ERROR,_),null},f._handleTransmuxerFlush=function(E){var _=this.getCurrentContext(E);if(!_||this.state!==I.PARSING){this.fragCurrent||(this.state=I.IDLE);return}var W=_.frag,j=_.part,w=_.level,F=self.performance.now();W.stats.parsing.end=F,j&&(j.stats.parsing.end=F),this.updateLevelTiming(W,j,w,E.partial)},f.getCurrentContext=function(E){var _=this.levels,W=E.level,j=E.sn,w=E.part;if(!_||!_[W])return this.warn("Levels object was unset while buffering fragment "+j+" of level "+W+". The current chunk will not be buffered."),null;var F=_[W],P=w>-1?Object(c.getPartWith)(F,j,w):null,v=P?P.fragment:Object(c.getFragmentWithSN)(F,j,this.fragCurrent);return v?{frag:v,part:P,level:F}:null},f.bufferFragmentData=function(E,_,W,j){if(!E||this.state!==I.PARSING)return;var w=E.data1,F=E.data2,P=w;if(w&&F&&(P=Object(g.appendUint8Array)(w,F)),!P||!P.length)return;var v={type:E.type,frag:_,part:W,chunkMeta:j,parent:_.type,data:P};this.hls.trigger(r.Events.BUFFER_APPENDING,v),E.dropped&&E.independent&&!W&&this.flushBufferGap(_)},f.flushBufferGap=function(E){var _=this.media;if(!_)return;if(!$.BufferHelper.isBuffered(_,_.currentTime)){this.flushMainBuffer(0,E.start);return}var W=_.currentTime,j=$.BufferHelper.bufferInfo(_,W,0),w=E.duration,F=Math.min(this.config.maxFragLookUpTolerance*2,w*.25),P=Math.max(Math.min(E.start-F,j.end-F),W+F);E.start-P>F&&this.flushMainBuffer(P,E.start)},f.getFwdBufferInfo=function(E,_){var W=this.config,j=this.getLoadPosition();if(!Object(J.isFiniteNumber)(j))return null;var w=$.BufferHelper.bufferInfo(E,j,W.maxBufferHole);if(w.len===0&&w.nextStart!==void 0){var F=this.fragmentTracker.getBufferedFrag(j,_);if(F&&w.nextStart<F.end)return $.BufferHelper.bufferInfo(E,j,Math.max(w.nextStart,W.maxBufferHole))}return w},f.getMaxBufferLength=function(E){var _=this.config,W;return E?W=Math.max(8*_.maxBufferSize/E,_.maxBufferLength):W=_.maxBufferLength,Math.min(W,_.maxMaxBufferLength)},f.reduceMaxBufferLength=function(E){var _=this.config,W=E||_.maxBufferLength;return _.maxMaxBufferLength>=W?(_.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+_.maxMaxBufferLength+"s"),!0):!1},f.getNextFragment=function(E,_){var W,j,w=_.fragments,F=w.length;if(!F)return null;var P=this.config,v=w[0].start,H;if(_.live){var Y=P.initialLiveManifestSize;if(F<Y)return this.warn("Not enough fragments to start playback (have: "+F+", need: "+Y+")"),null;!_.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(H=this.getInitialLiveFragment(_,w),this.startPosition=H?this.hls.liveSyncPosition||H.start:E)}else E<=v&&(H=w[0]);if(!H){var ie=P.lowLatencyMode?_.partEnd:_.fragmentEnd;H=this.getFragmentAtPosition(E,ie,_)}return(W=H)!==null&&W!==void 0&&W.initSegment&&!((j=H)!==null&&j!==void 0&&j.initSegment.data)&&!this.bitrateTest&&(H=H.initSegment),H},f.getNextPart=function(E,_,W){for(var j=-1,w=!1,F=!0,P=0,v=E.length;P<v;P++){var H=E[P];if(F=F&&!H.independent,j>-1&&W<H.start)break;var Y=H.loaded;!Y&&(w||H.independent||F)&&H.fragment===_&&(j=P),w=Y}return j},f.loadedEndOfParts=function(E,_){var W=E[E.length-1];return W&&_>W.start&&W.loaded},f.getInitialLiveFragment=function(E,_){var W=this.fragPrevious,j=null;if(W){if(E.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+W.programDateTime),j=Object(a.findFragmentByPDT)(_,W.endProgramDateTime,this.config.maxFragLookUpTolerance)),!j){var w=W.sn+1;if(w>=E.startSN&&w<=E.endSN){var F=_[w-E.startSN];W.cc===F.cc&&(j=F,this.log("Live playlist, switching playlist, load frag with next SN: "+j.sn))}j||(j=Object(a.findFragWithCC)(_,W.cc),j&&this.log("Live playlist, switching playlist, load frag with same CC: "+j.sn))}}else{var P=this.hls.liveSyncPosition;P!==null&&(j=this.getFragmentAtPosition(P,this.bitrateTest?E.fragmentEnd:E.edge,E))}return j},f.getFragmentAtPosition=function(E,_,W){var j=this.config,w=this.fragPrevious,F=W.fragments,P=W.endSN,v=W.fragmentHint,H=j.maxFragLookUpTolerance,Y=!!(j.lowLatencyMode&&W.partList&&v);Y&&v&&!this.bitrateTest&&(F=F.concat(v),P=v.sn);var ie;if(E<_){var le=E>_-H?0:H;ie=Object(a.findFragmentByPTS)(w,F,E,le)}else ie=F[F.length-1];if(ie){var he=ie.sn-W.startSN,xe=w&&ie.level===w.level,Le=F[he+1],we=this.fragmentTracker.getState(ie);if(we===N.FragmentState.BACKTRACKED){ie=null;for(var Ae=he;F[Ae]&&this.fragmentTracker.getState(F[Ae])===N.FragmentState.BACKTRACKED;)w?ie=F[Ae--]:ie=F[--Ae];ie||(ie=Le)}else w&&ie.sn===w.sn&&!Y&&(xe&&(ie.sn<P&&this.fragmentTracker.getState(Le)!==N.FragmentState.OK?(this.log("SN "+ie.sn+" just loaded, load next one: "+Le.sn),ie=Le):ie=null))}return ie},f.synchronizeToLiveEdge=function(E){var _=this.config,W=this.media;if(!W)return;var j=this.hls.liveSyncPosition,w=W.currentTime,F=E.fragments[0].start,P=E.edge,v=w>=F-_.maxFragLookUpTolerance&&w<=P;if(j!==null&&W.duration>j&&(w<j||!v)){var H=_.liveMaxLatencyDuration!==void 0?_.liveMaxLatencyDuration:_.liveMaxLatencyDurationCount*E.targetduration;(!v&&W.readyState<4||w<P-H)&&(this.loadedmetadata||(this.nextLoadPosition=j),W.readyState&&(this.warn("Playback: "+w.toFixed(3)+" is located too far from the end of live sliding playlist: "+P+", reset currentTime to : "+j.toFixed(3)),W.currentTime=j))}},f.alignPlaylists=function(E,_){var W=this.levels,j=this.levelLastLoaded,w=this.fragPrevious,F=j!==null?W[j]:null,P=E.fragments.length;if(!P)return this.warn("No fragments in live playlist"),0;var v=E.fragments[0].start,H=!_,Y=E.alignedSliding&&Object(J.isFiniteNumber)(v);if(H||!Y&&!v){Object(p.alignStream)(w,F,E);var ie=E.fragments[0].start;return this.log("Live playlist sliding: "+ie.toFixed(2)+" start-sn: "+(_?_.startSN:"na")+"->"+E.startSN+" prev-sn: "+(w?w.sn:"na")+" fragments: "+P),ie}return v},f.waitForCdnTuneIn=function(E){var _=3;return E.live&&E.canBlockReload&&E.tuneInGoal>Math.max(E.partHoldBack,E.partTarget*_)},f.setStartPosition=function(E,_){var W=this.startPosition;if(W<_&&(W=-1),W===-1||this.lastCurrentTime===-1){var j=E.startTimeOffset;Object(J.isFiniteNumber)(j)?(W=_+j,j<0&&(W+=E.totalduration),W=Math.min(Math.max(_,W),_+E.totalduration),this.log("Start time offset "+j+" found in playlist, adjust startPosition to "+W),this.startPosition=W):E.live?W=this.hls.liveSyncPosition||_:this.startPosition=W=0,this.lastCurrentTime=W}this.nextLoadPosition=W},f.getLoadPosition=function(){var E=this.media,_=0;return this.loadedmetadata&&E?_=E.currentTime:this.nextLoadPosition&&(_=this.nextLoadPosition),_},f.handleFragLoadAborted=function(E,_){this.transmuxer&&E.sn!=="initSegment"&&E.stats.aborted&&(this.warn("Fragment "+E.sn+(_?" part"+_.index:"")+" of level "+E.level+" was aborted"),this.resetFragmentLoading(E))},f.resetFragmentLoading=function(E){(!this.fragCurrent||!this.fragContextChanged(E))&&(this.state=I.IDLE)},f.onFragmentOrKeyLoadError=function(E,_){if(_.fatal)return;var W=_.frag;if(!W||W.type!==E)return;var j=this.fragCurrent;console.assert(j&&W.sn===j.sn&&W.level===j.level&&W.urlId===j.urlId,"Frag load error must match current frag to retry");var w=this.config;if(this.fragLoadError+1<=w.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(W.level))return;var F=Math.min(Math.pow(2,this.fragLoadError)*w.fragLoadingRetryDelay,w.fragLoadingMaxRetryTimeout);this.warn("Fragment "+W.sn+" of "+E+" "+W.level+" failed to load, retrying in "+F+"ms"),this.retryDate=self.performance.now()+F,this.fragLoadError++,this.state=I.FRAG_LOADING_WAITING_RETRY}else _.levelRetry?(E===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=I.IDLE):(z.logger.error(_.details+" reaches max retry, redispatch as fatal ..."),_.fatal=!0,this.hls.stopLoad(),this.state=I.ERROR)},f.afterBufferFlushed=function(E,_,W){if(!E)return;var j=$.BufferHelper.getBuffered(E);this.fragmentTracker.detectEvictedFragments(_,j,W),this.state===I.ENDED&&this.resetLoadingState()},f.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=I.IDLE},f.resetLiveStartWhenNotLoaded=function(E){if(!this.loadedmetadata){this.startFragRequested=!1;var _=this.levels?this.levels[E].details:null;if(_!=null&&_.live)return this.startPosition=-1,this.setStartPosition(_,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},f.updateLevelTiming=function(E,_,W,j){var w=this,F=W.details;console.assert(!!F,"level.details must be defined");var P=Object.keys(E.elementaryStreams).reduce(function(v,H){var Y=E.elementaryStreams[H];if(Y){var ie=Y.endPTS-Y.startPTS;if(ie<=0)return w.warn("Could not parse fragment "+E.sn+" "+H+" duration reliably ("+ie+") resetting transmuxer to fallback to playlist timing"),w.resetTransmuxer(),v||!1;var le=j?0:Object(c.updateFragPTSDTS)(F,E,Y.startPTS,Y.endPTS,Y.startDTS,Y.endDTS);return w.hls.trigger(r.Events.LEVEL_PTS_UPDATED,{details:F,level:W,drift:le,type:H,frag:E,start:Y.startPTS,end:Y.endPTS}),!0}return v},!1);P?(this.state=I.PARSED,this.hls.trigger(r.Events.FRAG_PARSED,{frag:E,part:_})):this.resetLoadingState()},f.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},R(h,[{key:"state",get:function(){return this._state},set:function(E){var _=this._state;_!==E&&(this._state=E,this.log(_+"->"+E))}}]),h}(K.default)},"./src/controller/buffer-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a});var J=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),N=B("./src/utils/logger.ts"),$=B("./src/errors.ts"),z=B("./src/utils/buffer-helper.ts"),r=B("./src/utils/mediasource-helper.ts"),D=B("./src/loader/fragment.ts"),m=B("./src/controller/buffer-operation-queue.ts"),g=Object(r.getMediaSource)(),p=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function c(i){var t=this;this.details=null,this._objectUrl=null,this.operationQueue=void 0,this.listeners=void 0,this.hls=void 0,this.bufferCodecEventsExpected=0,this._bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var u=t.hls,o=t.media,R=t.mediaSource;N.logger.log("[buffer-controller]: Media source opened"),o&&(t.updateMediaElementDuration(),u.trigger(K.Events.MEDIA_ATTACHED,{media:o})),R&&R.removeEventListener("sourceopen",t._onMediaSourceOpen),t.checkPendingTracks()},this._onMediaSourceClose=function(){N.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){N.logger.log("[buffer-controller]: Media source ended")},this.hls=i,this._initSourceBuffer(),this.registerListeners()}var s=c.prototype;return s.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},s.destroy=function(){this.unregisterListeners(),this.details=null},s.registerListeners=function(){var t=this.hls;t.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(K.Events.BUFFER_RESET,this.onBufferReset,this),t.on(K.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.on(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.on(K.Events.BUFFER_EOS,this.onBufferEos,this),t.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.on(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.on(K.Events.FRAG_PARSED,this.onFragParsed,this),t.on(K.Events.FRAG_CHANGED,this.onFragChanged,this)},s.unregisterListeners=function(){var t=this.hls;t.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(K.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(K.Events.BUFFER_RESET,this.onBufferReset,this),t.off(K.Events.BUFFER_APPENDING,this.onBufferAppending,this),t.off(K.Events.BUFFER_CODECS,this.onBufferCodecs,this),t.off(K.Events.BUFFER_EOS,this.onBufferEos,this),t.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),t.off(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),t.off(K.Events.FRAG_PARSED,this.onFragParsed,this),t.off(K.Events.FRAG_CHANGED,this.onFragChanged,this)},s._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new m.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},s.onManifestParsed=function(t,u){var o=2;(u.audio&&!u.video||!u.altAudio)&&(o=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=o,this.details=null,N.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},s.onMediaAttaching=function(t,u){var o=this.media=u.media;if(o&&g){var R=this.mediaSource=new g;R.addEventListener("sourceopen",this._onMediaSourceOpen),R.addEventListener("sourceended",this._onMediaSourceEnded),R.addEventListener("sourceclose",this._onMediaSourceClose),o.src=self.URL.createObjectURL(R),this._objectUrl=o.src}},s.onMediaDetaching=function(){var t=this.media,u=this.mediaSource,o=this._objectUrl;if(u){if(N.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(R){N.logger.warn("[buffer-controller]: onMediaDetaching: "+R.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),t&&(o&&self.URL.revokeObjectURL(o),t.src===o?(t.removeAttribute("src"),t.load()):N.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(K.Events.MEDIA_DETACHED,void 0)},s.onBufferReset=function(){var t=this;this.getSourceBufferTypes().forEach(function(u){var o=t.sourceBuffer[u];try{o&&(t.removeBufferListeners(u),t.mediaSource&&t.mediaSource.removeSourceBuffer(o),t.sourceBuffer[u]=void 0)}catch(R){N.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",R)}}),this._initSourceBuffer()},s.onBufferCodecs=function(t,u){var o=this,R=this.getSourceBufferTypes().length;if(Object.keys(u).forEach(function(T){if(R){var S=o.tracks[T];if(S&&typeof S.buffer.changeType=="function"){var A=u[T],I=A.codec,x=A.levelCodec,b=A.container,h=(S.levelCodec||S.codec).replace(p,"$1"),f=(x||I).replace(p,"$1");if(h!==f){var C=b+";codecs="+(x||I);o.appendChangeType(T,C)}}}else o.pendingTracks[T]=u[T]}),R)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},s.appendChangeType=function(t,u){var o=this,R=this.operationQueue,T={execute:function(){var A=o.sourceBuffer[t];A&&(N.logger.log("[buffer-controller]: changing "+t+" sourceBuffer type to "+u),A.changeType(u)),R.shiftAndExecuteNext(t)},onStart:function(){},onComplete:function(){},onError:function(A){N.logger.warn("[buffer-controller]: Failed to change "+t+" SourceBuffer type",A)}};R.append(T,t)},s.onBufferAppending=function(t,u){var o=this,R=this.hls,T=this.operationQueue,S=this.tracks,A=u.data,I=u.type,x=u.frag,b=u.part,h=u.chunkMeta,f=h.buffering[I],C=self.performance.now();f.start=C;var E=x.stats.buffering,_=b?b.stats.buffering:null;E.start===0&&(E.start=C),_&&_.start===0&&(_.start=C);var W=S.audio,j=I==="audio"&&h.id===1&&(W==null?void 0:W.container)==="audio/mpeg",w={execute:function(){if(f.executeStart=self.performance.now(),j){var P=o.sourceBuffer[I];if(P){var v=x.start-P.timestampOffset;Math.abs(v)>=.1&&(N.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+x.start+" (delta: "+v+") sn: "+x.sn+")"),P.timestampOffset=x.start)}}o.appendExecutor(A,I)},onStart:function(){},onComplete:function(){var P=self.performance.now();f.executeEnd=f.end=P,E.first===0&&(E.first=P),_&&_.first===0&&(_.first=P);var v=o.sourceBuffer,H={};for(var Y in v)H[Y]=z.BufferHelper.getBuffered(v[Y]);o.appendError=0,o.hls.trigger(K.Events.BUFFER_APPENDED,{type:I,frag:x,part:b,chunkMeta:h,parent:x.type,timeRanges:H})},onError:function(P){N.logger.error("[buffer-controller]: Error encountered while trying to append to the "+I+" SourceBuffer",P);var v={type:$.ErrorTypes.MEDIA_ERROR,parent:x.type,details:$.ErrorDetails.BUFFER_APPEND_ERROR,err:P,fatal:!1};P.code===DOMException.QUOTA_EXCEEDED_ERR?v.details=$.ErrorDetails.BUFFER_FULL_ERROR:(o.appendError++,v.details=$.ErrorDetails.BUFFER_APPEND_ERROR,o.appendError>R.config.appendErrorMaxRetry&&(N.logger.error("[buffer-controller]: Failed "+R.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),v.fatal=!0)),R.trigger(K.Events.ERROR,v)}};T.append(w,I)},s.onBufferFlushing=function(t,u){var o=this,R=this.operationQueue,T=function(A){return{execute:o.removeExecutor.bind(o,A,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){o.hls.trigger(K.Events.BUFFER_FLUSHED,{type:A})},onError:function(x){N.logger.warn("[buffer-controller]: Failed to remove from "+A+" SourceBuffer",x)}}};u.type?R.append(T(u.type),u.type):this.getSourceBufferTypes().forEach(function(S){R.append(T(S),S)})},s.onFragParsed=function(t,u){var o=this,R=u.frag,T=u.part,S=[],A=T?T.elementaryStreams:R.elementaryStreams;A[D.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(A[D.ElementaryStreamTypes.AUDIO]&&S.push("audio"),A[D.ElementaryStreamTypes.VIDEO]&&S.push("video"));var I=function(){var b=self.performance.now();R.stats.buffering.end=b,T&&(T.stats.buffering.end=b);var h=T?T.stats:R.stats;o.hls.trigger(K.Events.FRAG_BUFFERED,{frag:R,part:T,stats:h,id:R.type})};S.length===0&&N.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+R.type+" level: "+R.level+" sn: "+R.sn),this.blockBuffers(I,S)},s.onFragChanged=function(t,u){this.flushBackBuffer()},s.onBufferEos=function(t,u){var o=this,R=this.getSourceBufferTypes().reduce(function(T,S){var A=o.sourceBuffer[S];return(!u.type||u.type===S)&&(A&&!A.ended&&(A.ended=!0,N.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),T&&!!(!A||A.ended)},!0);R&&this.blockBuffers(function(){var T=o.mediaSource;if(!T||T.readyState!=="open")return;T.endOfStream()})},s.onLevelUpdated=function(t,u){var o=u.details;if(!o.fragments.length)return;this.details=o,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},s.flushBackBuffer=function(){var t=this.hls,u=this.details,o=this.media,R=this.sourceBuffer;if(!o||u===null)return;var T=this.getSourceBufferTypes();if(!T.length)return;var S=u.live&&t.config.liveBackBufferLength!==null?t.config.liveBackBufferLength:t.config.backBufferLength;if(!Object(J.isFiniteNumber)(S)||S<0)return;var A=o.currentTime,I=u.levelTargetDuration,x=Math.max(S,I),b=Math.floor(A/I)*I-x;T.forEach(function(h){var f=R[h];if(f){var C=z.BufferHelper.getBuffered(f);C.length>0&&b>C.start(0)&&(t.trigger(K.Events.BACK_BUFFER_REACHED,{bufferEnd:b}),u.live&&t.trigger(K.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:b}),t.trigger(K.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:b,type:h}))}})},s.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var t=this.details,u=this.hls,o=this.media,R=this.mediaSource,T=t.fragments[0].start+t.totalduration,S=o.duration,A=Object(J.isFiniteNumber)(R.duration)?R.duration:0;t.live&&u.config.liveDurationInfinity?(N.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),R.duration=Infinity,this.updateSeekableRange(t)):(T>A&&T>S||!Object(J.isFiniteNumber)(S))&&(N.logger.log("[buffer-controller]: Updating Media Source duration to "+T.toFixed(3)),R.duration=T)},s.updateSeekableRange=function(t){var u=this.mediaSource,o=t.fragments,R=o.length;if(R&&t.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var T=Math.max(0,o[0].start),S=Math.max(T,T+t.totalduration);u.setLiveSeekableRange(T,S)}},s.checkPendingTracks=function(){var t=this.bufferCodecEventsExpected,u=this.operationQueue,o=this.pendingTracks,R=Object.keys(o).length;if(R&&!t||R===2){this.createSourceBuffers(o),this.pendingTracks={};var T=this.getSourceBufferTypes();if(T.length===0){this.hls.trigger(K.Events.ERROR,{type:$.ErrorTypes.MEDIA_ERROR,details:$.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}T.forEach(function(S){u.executeNext(S)})}},s.createSourceBuffers=function(t){var u=this.sourceBuffer,o=this.mediaSource;if(!o)throw Error("createSourceBuffers called when mediaSource was null");var R=0;for(var T in t)if(!u[T]){var S=t[T];if(!S)throw Error("source buffer exists for track "+T+", however track does not");var A=S.levelCodec||S.codec,I=S.container+";codecs="+A;N.logger.log("[buffer-controller]: creating sourceBuffer("+I+")");try{var x=u[T]=o.addSourceBuffer(I),b=T;this.addBufferListener(b,"updatestart",this._onSBUpdateStart),this.addBufferListener(b,"updateend",this._onSBUpdateEnd),this.addBufferListener(b,"error",this._onSBUpdateError),this.tracks[T]={buffer:x,codec:A,container:S.container,levelCodec:S.levelCodec,id:S.id},R++}catch(h){N.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+h.message),this.hls.trigger(K.Events.ERROR,{type:$.ErrorTypes.MEDIA_ERROR,details:$.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,mimeType:I})}}R&&this.hls.trigger(K.Events.BUFFER_CREATED,{tracks:this.tracks})},s._onSBUpdateStart=function(t){var u=this.operationQueue,o=u.current(t);o.onStart()},s._onSBUpdateEnd=function(t){var u=this.operationQueue,o=u.current(t);o.onComplete(),u.shiftAndExecuteNext(t)},s._onSBUpdateError=function(t,u){N.logger.error("[buffer-controller]: "+t+" SourceBuffer error",u),this.hls.trigger(K.Events.ERROR,{type:$.ErrorTypes.MEDIA_ERROR,details:$.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var o=this.operationQueue.current(t);o&&o.onError(u)},s.removeExecutor=function(t,u,o){var R=this.media,T=this.mediaSource,S=this.operationQueue,A=this.sourceBuffer,I=A[t];if(!R||!T||!I){N.logger.warn("[buffer-controller]: Attempting to remove from the "+t+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(t);return}var x=Object(J.isFiniteNumber)(R.duration)?R.duration:Infinity,b=Object(J.isFiniteNumber)(T.duration)?T.duration:Infinity,h=Math.max(0,u),f=Math.min(o,x,b);f>h?(N.logger.log("[buffer-controller]: Removing ["+h+","+f+"] from the "+t+" SourceBuffer"),console.assert(!I.updating,t+" sourceBuffer must not be updating"),I.remove(h,f)):S.shiftAndExecuteNext(t)},s.appendExecutor=function(t,u){var o=this.operationQueue,R=this.sourceBuffer,T=R[u];if(!T){N.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),o.shiftAndExecuteNext(u);return}T.ended=!1,console.assert(!T.updating,u+" sourceBuffer must not be updating"),T.appendBuffer(t)},s.blockBuffers=function(t,u){var o=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){N.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(t);return}var R=this.operationQueue,T=u.map(function(S){return R.appendBlocker(S)});Promise.all(T).then(function(){t(),u.forEach(function(S){var A=o.sourceBuffer[S];(!A||!A.updating)&&R.shiftAndExecuteNext(S)})})},s.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},s.addBufferListener=function(t,u,o){var R=this.sourceBuffer[t];if(!R)return;var T=o.bind(this,t);this.listeners[t].push({event:u,listener:T}),R.addEventListener(u,T)},s.removeBufferListeners=function(t){var u=this.sourceBuffer[t];if(!u)return;this.listeners[t].forEach(function(o){u.removeEventListener(o.event,o.listener)})},c}()},"./src/controller/buffer-operation-queue.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return K});var J=B("./src/utils/logger.ts"),K=function(){function N(z){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=z}var $=N.prototype;return $.append=function(r,D){var m=this.queues[D];m.push(r),m.length===1&&this.buffers[D]&&this.executeNext(D)},$.insertAbort=function(r,D){var m=this.queues[D];m.unshift(r),this.executeNext(D)},$.appendBlocker=function(r){var D,m=new Promise(function(p){D=p}),g={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(g,r),m},$.executeNext=function(r){var D=this.buffers,m=this.queues,g=D[r],p=m[r];if(p.length){var a=p[0];try{a.execute()}catch(c){J.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(c),(!g||!g.updating)&&(p.shift(),this.executeNext(r))}}},$.shiftAndExecuteNext=function(r){this.queues[r].shift(),this.executeNext(r)},$.current=function(r){return this.queues[r][0]},N}()},"./src/controller/cap-level-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts");function K(z,r){for(var D=0;D<r.length;D++){var m=r[D];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(z,m.key,m)}}function N(z,r,D){return r&&K(z.prototype,r),D&&K(z,D),z}var $=function(){function z(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 r=z.prototype;return r.setStreamController=function(m){this.streamController=m},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var m=this.hls;m.on(J.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.on(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.on(J.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var m=this.hls;m.off(J.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),m.off(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),m.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),m.off(J.Events.BUFFER_CODECS,this.onBufferCodecs,this),m.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(m,g){z.isLevelAllowed(g.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(g.droppedLevel)},r.onMediaAttaching=function(m,g){this.media=g.media instanceof HTMLVideoElement?g.media:null},r.onManifestParsed=function(m,g){var p=this.hls;this.restrictedLevels=[],this.firstLevel=g.firstLevel,p.config.capLevelToPlayerSize&&g.video&&this.startCapping()},r.onBufferCodecs=function(m,g){var p=this.hls;p.config.capLevelToPlayerSize&&g.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.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}}},r.getMaxLevel=function(m){var g=this,p=this.hls.levels;if(!p.length)return-1;var a=p.filter(function(c,s){return z.isLevelAllowed(s,g.restrictedLevels)&&s<=m});return this.clientRect=null,z.getMaxLevelByMediaSize(a,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){if(this.timer)return;this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize()},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var m=this.media,g={width:0,height:0};if(m){var p=m.getBoundingClientRect();g.width=p.width,g.height=p.height,!g.width&&!g.height&&(g.width=p.right-p.left||m.width||0,g.height=p.bottom-p.top||m.height||0)}return this.clientRect=g,g},z.isLevelAllowed=function(m,g){return g===void 0&&(g=[]),g.indexOf(m)===-1},z.getMaxLevelByMediaSize=function(m,g,p){if(!m||!m.length)return-1;for(var a=function(u,o){return o?u.width!==o.width||u.height!==o.height:!0},c=m.length-1,s=0;s<m.length;s+=1){var i=m[s];if((i.width>=g||i.height>=p)&&a(i,m[s+1])){c=s;break}}return c},N(z,[{key:"mediaWidth",get:function(){return this.getDimensions().width*z.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*z.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var m=1;try{m=self.devicePixelRatio}catch(g){}return m}}]),z}();Q.default=$},"./src/controller/cmcd-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a});var J=B("./src/events.ts"),K=B("./src/types/cmcd.ts"),N=B("./src/utils/buffer-helper.ts"),$=B("./src/utils/logger.ts");function z(c,s){for(var i=0;i<s.length;i++){var t=s[i];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(c,t.key,t)}}function r(c,s,i){return s&&z(c.prototype,s),i&&z(c,i),c}function D(c,s){var i=typeof Symbol!="undefined"&&c[Symbol.iterator]||c["@@iterator"];if(i)return(i=i.call(c)).next.bind(i);if(Array.isArray(c)||(i=m(c))||s&&c&&typeof c.length=="number"){i&&(c=i);var t=0;return function(){return t>=c.length?{done:!0}:{done:!1,value:c[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(c,s){if(!c)return;if(typeof c=="string")return g(c,s);var i=Object.prototype.toString.call(c).slice(8,-1);if(i==="Object"&&c.constructor&&(i=c.constructor.name),i==="Map"||i==="Set")return Array.from(c);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return g(c,s)}function g(c,s){(s==null||s>c.length)&&(s=c.length);for(var i=0,t=new Array(s);i<s;i++)t[i]=c[i];return t}function p(){return p=Object.assign||function(c){for(var s=1;s<arguments.length;s++){var i=arguments[s];for(var t in i)Object.prototype.hasOwnProperty.call(i,t)&&(c[t]=i[t])}return c},p.apply(this,arguments)}var a=function(){function c(i){var t=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){t.initialized&&(t.starved=!0),t.buffering=!0},this.onPlaying=function(){t.initialized||(t.initialized=!0),t.buffering=!1},this.applyPlaylistData=function(R){try{t.apply(R,{ot:K.CMCDObjectType.MANIFEST,su:!t.initialized})}catch(T){$.logger.warn("Could not generate manifest CMCD data.",T)}},this.applyFragmentData=function(R){try{var T=R.frag,S=t.hls.levels[T.level],A=t.getObjectType(T),I={d:T.duration*1e3,ot:A};(A===K.CMCDObjectType.VIDEO||A===K.CMCDObjectType.AUDIO||A==K.CMCDObjectType.MUXED)&&(I.br=S.bitrate/1e3,I.tb=t.getTopBandwidth(A),I.bl=t.getBufferLength(A)),t.apply(R,I)}catch(x){$.logger.warn("Could not generate segment CMCD data.",x)}},this.hls=i;var u=this.config=i.config,o=u.cmcd;o!=null&&(u.pLoader=this.createPlaylistLoader(),u.fLoader=this.createFragmentLoader(),this.sid=o.sessionId||c.uuid(),this.cid=o.contentId,this.useHeaders=o.useHeaders===!0,this.registerListeners())}var s=c.prototype;return s.registerListeners=function(){var t=this.hls;t.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.on(J.Events.BUFFER_CREATED,this.onBufferCreated,this)},s.unregisterListeners=function(){var t=this.hls;t.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),t.off(J.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},s.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},s.onMediaAttached=function(t,u){this.media=u.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},s.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},s.onBufferCreated=function(t,u){var o,R;this.audioBuffer=(o=u.tracks.audio)===null||o===void 0?void 0:o.buffer,this.videoBuffer=(R=u.tracks.video)===null||R===void 0?void 0:R.buffer},s.createData=function(){var t;return{v:K.CMCDVersion,sf:K.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}},s.apply=function(t,u){u===void 0&&(u={}),p(u,this.createData());var o=u.ot===K.CMCDObjectType.INIT||u.ot===K.CMCDObjectType.VIDEO||u.ot===K.CMCDObjectType.MUXED;if(this.starved&&o&&(u.bs=!0,u.su=!0,this.starved=!1),u.su==null&&(u.su=this.buffering),this.useHeaders){var R=c.toHeaders(u);if(!Object.keys(R).length)return;t.headers||(t.headers={}),p(t.headers,R)}else{var T=c.toQuery(u);if(!T)return;t.url=c.appendQueryToUri(t.url,T)}},s.getObjectType=function(t){var u=t.type;return u==="subtitle"?K.CMCDObjectType.TIMED_TEXT:t.sn==="initSegment"?K.CMCDObjectType.INIT:u==="audio"?K.CMCDObjectType.AUDIO:u==="main"?this.hls.audioTracks.length?K.CMCDObjectType.VIDEO:K.CMCDObjectType.MUXED:void 0},s.getTopBandwidth=function(t){for(var u=0,o=t===K.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,R=D(o),T;!(T=R()).done;){var S=T.value;S.bitrate>u&&(u=S.bitrate)}return u>0?u:NaN},s.getBufferLength=function(t){var u=this.hls.media,o=t===K.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!o||!u)return NaN;var R=N.BufferHelper.bufferInfo(o,u.currentTime,this.config.maxBufferHole);return R.len*1e3},s.createPlaylistLoader=function(){var t=this.config.pLoader,u=this.applyPlaylistData,o=t||this.config.loader;return function(){function R(S){this.loader=void 0,this.loader=new o(S)}var T=R.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(A,I,x){u(A),this.loader.load(A,I,x)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},s.createFragmentLoader=function(){var t=this.config.fLoader,u=this.applyFragmentData,o=t||this.config.loader;return function(){function R(S){this.loader=void 0,this.loader=new o(S)}var T=R.prototype;return T.destroy=function(){this.loader.destroy()},T.abort=function(){this.loader.abort()},T.load=function(A,I,x){u(A),this.loader.load(A,I,x)},r(R,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),R}()},c.uuid=function(){var t=URL.createObjectURL(new Blob),u=t.toString();return URL.revokeObjectURL(t),u.substr(u.lastIndexOf("/")+1)},c.serialize=function(t){for(var u=[],o=function(j){return!Number.isNaN(j)&&j!=null&&j!==""&&j!==!1},R=function(j){return Math.round(j)},T=function(j){return R(j/100)*100},S=function(j){return encodeURIComponent(j)},A={br:R,d:R,bl:T,dl:T,mtp:T,nor:S,rtp:T,tb:R},I=Object.keys(t||{}).sort(),x=D(I),b;!(b=x()).done;){var h=b.value,f=t[h];if(!o(f))continue;if(h==="v"&&f===1)continue;if(h=="pr"&&f===1)continue;var C=A[h];C&&(f=C(f));var E=typeof f,_=void 0;h==="ot"||h==="sf"||h==="st"?_=h+"="+f:E==="boolean"?_=h:E==="number"?_=h+"="+f:_=h+"="+JSON.stringify(f),u.push(_)}return u.join(",")},c.toHeaders=function(t){for(var u=Object.keys(t),o={},R=["Object","Request","Session","Status"],T=[{},{},{},{}],S={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},A=0,I=u;A<I.length;A++){var x=I[A],b=S[x]!=null?S[x]:1;T[b][x]=t[x]}for(var h=0;h<T.length;h++){var f=c.serialize(T[h]);f&&(o["CMCD-"+R[h]]=f)}return o},c.toQuery=function(t){return"CMCD="+encodeURIComponent(c.serialize(t))},c.appendQueryToUri=function(t,u){if(!u)return t;var o=t.includes("?")?"&":"?";return""+t+o+u},c}()},"./src/controller/eme-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts"),K=B("./src/errors.ts"),N=B("./src/utils/logger.ts"),$=B("./src/utils/mediakeys-helper.ts");function z(a,c){for(var s=0;s<c.length;s++){var i=c[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function r(a,c,s){return c&&z(a.prototype,c),s&&z(a,s),a}var D=3,m=function(c,s,i){var t={audioCapabilities:[],videoCapabilities:[]};return c.forEach(function(u){t.audioCapabilities.push({contentType:'audio/mp4; codecs="'+u+'"',robustness:i.audioRobustness||""})}),s.forEach(function(u){t.videoCapabilities.push({contentType:'video/mp4; codecs="'+u+'"',robustness:i.videoRobustness||""})}),[t]},g=function(c,s,i,t){switch(c){case $.KeySystems.WIDEVINE:return m(s,i,t);default:throw new Error("Unknown key-system: "+c)}},p=function(){function a(s){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=s,this._config=s.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 c=a.prototype;return c.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},c._registerListeners=function(){this.hls.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c._unregisterListeners=function(){this.hls.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(J.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this)},c.getLicenseServerUrl=function(i){switch(i){case $.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+i+'"')},c._attemptKeySystemAccess=function(i,t,u){var o=this,R=g(i,t,u,this._drmSystemOptions);N.logger.log("Requesting encrypted media key-system access");var T=this.requestMediaKeySystemAccess(i,R);this.mediaKeysPromise=T.then(function(S){return o._onMediaKeySystemAccessObtained(i,S)}),T.catch(function(S){N.logger.error('Failed to obtain key-system "'+i+'" access:',S)})},c._onMediaKeySystemAccessObtained=function(i,t){var u=this;N.logger.log('Access for key-system "'+i+'" obtained');var o={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:t,mediaKeySystemDomain:i};this._mediaKeysList.push(o);var R=Promise.resolve().then(function(){return t.createMediaKeys()}).then(function(T){return o.mediaKeys=T,N.logger.log('Media-keys created for key-system "'+i+'"'),u._onMediaKeysCreated(),T});return R.catch(function(T){N.logger.error("Failed to create media-keys:",T)}),R},c._onMediaKeysCreated=function(){var i=this;this._mediaKeysList.forEach(function(t){t.mediaKeysSession||(t.mediaKeysSession=t.mediaKeys.createSession(),i._onNewMediaKeySession(t.mediaKeysSession))})},c._onNewMediaKeySession=function(i){var t=this;N.logger.log("New key-system session "+i.sessionId),i.addEventListener("message",function(u){t._onKeySessionMessage(i,u.message)},!1)},c._onKeySessionMessage=function(i,t){N.logger.log("Got EME message event, creating license request"),this._requestLicense(t,function(u){N.logger.log("Received license data (length: "+(u&&u.byteLength)+"), updating key-session"),i.update(u)})},c.onMediaEncrypted=function(i){var t=this;if(N.logger.log('Media is encrypted using "'+i.initDataType+'" init data type'),!this.mediaKeysPromise){N.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var u=function(R){if(!t._media)return;t._attemptSetMediaKeys(R),t._generateRequestWithPreferredKeySession(i.initDataType,i.initData)};this.mediaKeysPromise.then(u).catch(u)},c._attemptSetMediaKeys=function(i){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var t=this._mediaKeysList[0];if(!t||!t.mediaKeys){N.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}N.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(t.mediaKeys),this._hasSetMediaKeys=!0}},c._generateRequestWithPreferredKeySession=function(i,t){var u=this,o=this._mediaKeysList[0];if(!o){N.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(o.mediaKeysSessionInitialized){N.logger.warn("Key-Session already initialized but requested again");return}var R=o.mediaKeysSession;if(!R){N.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!t){N.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}N.logger.log('Generating key-session request for "'+i+'" init data type'),o.mediaKeysSessionInitialized=!0,R.generateRequest(i,t).then(function(){N.logger.debug("Key-session generation succeeded")}).catch(function(T){N.logger.error("Error generating key-session request:",T),u.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},c._createLicenseXhr=function(i,t,u){var o=new XMLHttpRequest;o.responseType="arraybuffer",o.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,o,i,t,u);var R=this._licenseXhrSetup;if(R)try{R.call(this.hls,o,i),R=void 0}catch(T){N.logger.error(T)}try{o.readyState||o.open("POST",i,!0),R&&R.call(this.hls,o,i)}catch(T){throw new Error("issue setting up KeySystem license XHR "+T)}return o},c._onLicenseRequestReadyStageChange=function(i,t,u,o){switch(i.readyState){case 4:if(i.status===200){this._requestLicenseFailureCount=0,N.logger.log("License request succeeded");var R=i.response,T=this._licenseResponseCallback;if(T)try{R=T.call(this.hls,i,t)}catch(A){N.logger.error(A)}o(R)}else{if(N.logger.error("License Request XHR failed ("+t+"). Status: "+i.status+" ("+i.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>D){this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=D-this._requestLicenseFailureCount+1;N.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(u,o)}break}},c._generateLicenseRequestChallenge=function(i,t){switch(i.mediaKeySystemDomain){case $.KeySystems.WIDEVINE:return t}throw new Error("unsupported key-system: "+i.mediaKeySystemDomain)},c._requestLicense=function(i,t){N.logger.log("Requesting content license for key-system");var u=this._mediaKeysList[0];if(!u){N.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var o=this.getLicenseServerUrl(u.mediaKeySystemDomain),R=this._createLicenseXhr(o,i,t);N.logger.log("Sending license request to URL: "+o);var T=this._generateLicenseRequestChallenge(u,i);R.send(T)}catch(S){N.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.KEY_SYSTEM_ERROR,details:K.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},c.onMediaAttached=function(i,t){if(!this._emeEnabled)return;var u=t.media;this._media=u,u.addEventListener("encrypted",this._onMediaEncrypted)},c.onMediaDetached=function(){var i=this._media,t=this._mediaKeysList;if(!i)return;i.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(t.map(function(u){if(u.mediaKeysSession)return u.mediaKeysSession.close().catch(function(){})})).then(function(){return i.setMediaKeys(null)}).catch(function(){})},c.onManifestParsed=function(i,t){if(!this._emeEnabled)return;var u=t.levels.map(function(R){return R.audioCodec}).filter(function(R){return!!R}),o=t.levels.map(function(R){return R.videoCodec}).filter(function(R){return!!R});this._attemptKeySystemAccess($.KeySystems.WIDEVINE,u,o)},r(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();Q.default=p},"./src/controller/fps-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts"),K=B("./src/utils/logger.ts"),N=function(){function $(r){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=r,this.registerListeners()}var z=$.prototype;return z.setStreamController=function(D){this.streamController=D},z.registerListeners=function(){this.hls.on(J.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},z.unregisterListeners=function(){this.hls.off(J.Events.MEDIA_ATTACHING,this.onMediaAttaching)},z.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},z.onMediaAttaching=function(D,m){var g=this.hls.config;if(g.capLevelOnFPSDrop){var p=m.media instanceof self.HTMLVideoElement?m.media:null;this.media=p,p&&typeof p.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),g.fpsDroppedMonitoringPeriod)}},z.checkFPS=function(D,m,g){var p=performance.now();if(m){if(this.lastTime){var a=p-this.lastTime,c=g-this.lastDroppedFrames,s=m-this.lastDecodedFrames,i=1e3*c/a,t=this.hls;if(t.trigger(J.Events.FPS_DROP,{currentDropped:c,currentDecoded:s,totalDroppedFrames:g}),i>0&&c>t.config.fpsDroppedMonitoringThreshold*s){var u=t.currentLevel;K.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+u),u>0&&(t.autoLevelCapping===-1||t.autoLevelCapping>=u)&&(u=u-1,t.trigger(J.Events.FPS_DROP_LEVEL_CAPPING,{level:u,droppedLevel:t.currentLevel}),t.autoLevelCapping=u,this.streamController.nextLevelSwitch())}}this.lastTime=p,this.lastDroppedFrames=g,this.lastDecodedFrames=m}},z.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)},$}();Q.default=N},"./src/controller/fragment-finders.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"findFragmentByPDT",function(){return N}),B.d(Q,"findFragmentByPTS",function(){return $}),B.d(Q,"fragmentWithinToleranceTest",function(){return z}),B.d(Q,"pdtWithinToleranceTest",function(){return r}),B.d(Q,"findFragWithCC",function(){return D});var J=B("./src/polyfills/number.ts"),K=B("./src/utils/binary-search.ts");function N(m,g,p){if(g===null||!Array.isArray(m)||!m.length||!Object(J.isFiniteNumber)(g))return null;var a=m[0].programDateTime;if(g<(a||0))return null;var c=m[m.length-1].endProgramDateTime;if(g>=(c||0))return null;p=p||0;for(var s=0;s<m.length;++s){var i=m[s];if(r(g,p,i))return i}return null}function $(m,g,p,a){p===void 0&&(p=0),a===void 0&&(a=0);var c=null;if(m?c=g[m.sn-g[0].sn+1]||null:p===0&&g[0].start===0&&(c=g[0]),c&&z(p,a,c)===0)return c;var s=K.default.search(g,z.bind(null,p,a));return s||c}function z(m,g,p){m===void 0&&(m=0),g===void 0&&(g=0);var a=Math.min(g,p.duration+(p.deltaPTS?p.deltaPTS:0));return p.start+p.duration-a<=m?1:p.start-a>m&&p.start?-1:0}function r(m,g,p){var a=Math.min(g,p.duration+(p.deltaPTS?p.deltaPTS:0))*1e3,c=p.endProgramDateTime||0;return c-a>m}function D(m,g){return K.default.search(m,function(p){return p.cc<g?1:p.cc>g?-1:0})}},"./src/controller/fragment-tracker.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"FragmentState",function(){return N}),B.d(Q,"FragmentTracker",function(){return $});var J=B("./src/events.ts"),K=B("./src/types/loader.ts"),N;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(N||(N={}));var $=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 p=this.hls;p.on(J.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.on(J.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.on(J.Events.FRAG_LOADED,this.onFragLoaded,this)},m._unregisterListeners=function(){var p=this.hls;p.off(J.Events.BUFFER_APPENDED,this.onBufferAppended,this),p.off(J.Events.FRAG_BUFFERED,this.onFragBuffered,this),p.off(J.Events.FRAG_LOADED,this.onFragLoaded,this)},m.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},m.getAppendedFrag=function(p,a){if(a===K.PlaylistLevelType.MAIN){var c=this.activeFragment,s=this.activeParts;if(!c)return null;if(s)for(var i=s.length;i--;){var t=s[i],u=t?t.end:c.appendedPTS;if(t.start<=p&&u!==void 0&&p<=u)return i>9&&(this.activeParts=s.slice(i-9)),t}else if(c.start<=p&&c.appendedPTS!==void 0&&p<=c.appendedPTS)return c}return this.getBufferedFrag(p,a)},m.getBufferedFrag=function(p,a){for(var c=this.fragments,s=Object.keys(c),i=s.length;i--;){var t=c[s[i]];if((t==null?void 0:t.body.type)===a&&t.buffered){var u=t.body;if(u.start<=p&&p<=u.end)return u}}return null},m.detectEvictedFragments=function(p,a,c){var s=this;Object.keys(this.fragments).forEach(function(i){var t=s.fragments[i];if(!t)return;if(!t.buffered){t.body.type===c&&s.removeFragment(t.body);return}var u=t.range[p];if(!u)return;u.time.some(function(o){var R=!s.isTimeBuffered(o.startPTS,o.endPTS,a);return R&&s.removeFragment(t.body),R})})},m.detectPartialFragments=function(p){var a=this,c=this.timeRanges,s=p.frag,i=p.part;if(!c||s.sn==="initSegment")return;var t=r(s),u=this.fragments[t];if(!u)return;Object.keys(c).forEach(function(o){var R=s.elementaryStreams[o];if(!R)return;var T=c[o],S=i!==null||R.partial===!0;u.range[o]=a.getBufferedTimes(s,i,S,T)}),u.backtrack=u.loaded=null,Object.keys(u.range).length?u.buffered=!0:this.removeFragment(u.body)},m.fragBuffered=function(p){var a=r(p),c=this.fragments[a];c&&(c.backtrack=c.loaded=null,c.buffered=!0)},m.getBufferedTimes=function(p,a,c,s){for(var i={time:[],partial:c},t=a?a.start:p.start,u=a?a.end:p.end,o=p.minEndPTS||u,R=p.maxStartPTS||t,T=0;T<s.length;T++){var S=s.start(T)-this.bufferPadding,A=s.end(T)+this.bufferPadding;if(R>=S&&o<=A){i.time.push({startPTS:Math.max(t,s.start(T)),endPTS:Math.min(u,s.end(T))});break}else if(t<A&&u>S)i.partial=!0,i.time.push({startPTS:Math.max(t,s.start(T)),endPTS:Math.min(u,s.end(T))});else if(u<=S)break}return i},m.getPartialFragment=function(p){var a=null,c,s,i,t=0,u=this.bufferPadding,o=this.fragments;return Object.keys(o).forEach(function(R){var T=o[R];if(!T)return;z(T)&&(s=T.body.start-u,i=T.body.end+u,p>=s&&p<=i&&(c=Math.min(p-s,i-p),t<=c&&(a=T.body,t=c)))}),a},m.getState=function(p){var a=r(p),c=this.fragments[a];return c?c.buffered?z(c)?N.PARTIAL:N.OK:c.backtrack?N.BACKTRACKED:N.APPENDING:N.NOT_LOADED},m.backtrack=function(p,a){var c=r(p),s=this.fragments[c];if(!s||s.backtrack)return null;var i=s.backtrack=a||s.loaded;return s.loaded=null,i},m.getBacktrackData=function(p){var a=r(p),c=this.fragments[a];if(c){var s,i=c.backtrack;if(i!=null&&(s=i.payload)!==null&&s!==void 0&&s.byteLength)return i;this.removeFragment(p)}return null},m.isTimeBuffered=function(p,a,c){for(var s,i,t=0;t<c.length;t++){if(s=c.start(t)-this.bufferPadding,i=c.end(t)+this.bufferPadding,p>=s&&a<=i)return!0;if(a<=s)return!1}return!1},m.onFragLoaded=function(p,a){var c=a.frag,s=a.part;if(c.sn==="initSegment"||c.bitrateTest||s)return;var i=r(c);this.fragments[i]={body:c,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},m.onBufferAppended=function(p,a){var c=this,s=a.frag,i=a.part,t=a.timeRanges;if(s.type===K.PlaylistLevelType.MAIN)if(this.activeFragment=s,i){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(i)}else this.activeParts=null;this.timeRanges=t,Object.keys(t).forEach(function(o){var R=t[o];if(c.detectEvictedFragments(o,R),!i)for(var T=0;T<R.length;T++)s.appendedPTS=Math.max(R.end(T),s.appendedPTS||0)})},m.onFragBuffered=function(p,a){this.detectPartialFragments(a)},m.hasFragment=function(p){var a=r(p);return!!this.fragments[a]},m.removeFragmentsInRange=function(p,a,c){var s=this;Object.keys(this.fragments).forEach(function(i){var t=s.fragments[i];if(!t)return;if(t.buffered){var u=t.body;u.type===c&&u.start<a&&u.end>p&&s.removeFragment(u)}})},m.removeFragment=function(p){var a=r(p);p.stats.loaded=0,p.clearElementaryStreamInfo(),delete this.fragments[a]},m.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function z(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 r(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"STALL_MINIMUM_DURATION_MS",function(){return z}),B.d(Q,"MAX_START_GAP_JUMP",function(){return r}),B.d(Q,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),B.d(Q,"SKIP_BUFFER_RANGE_START",function(){return m}),B.d(Q,"default",function(){return g});var J=B("./src/utils/buffer-helper.ts"),K=B("./src/errors.ts"),N=B("./src/events.ts"),$=B("./src/utils/logger.ts"),z=250,r=2,D=.1,m=.05,g=function(){function p(c,s,i,t){this.config=void 0,this.media=void 0,this.fragmentTracker=void 0,this.hls=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.config=c,this.media=s,this.fragmentTracker=i,this.hls=t}var a=p.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(s){var i=this.config,t=this.media,u=this.stalled,o=t.currentTime,R=t.seeking,T=this.seeking&&!R,S=!this.seeking&&R;if(this.seeking=R,o!==s){if(this.moved=!0,u!==null){if(this.stallReported){var A=self.performance.now()-u;$.logger.warn("playback not stuck anymore @"+o+", after "+Math.round(A)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||T)&&(this.stalled=null),t.paused||t.ended||t.playbackRate===0||!J.BufferHelper.getBuffered(t).length)return;var I=J.BufferHelper.bufferInfo(t,o,0),x=I.len>0,b=I.nextStart||0;if(!x&&!b)return;if(R){var h=I.len>r,f=!b||b-o>r&&!this.fragmentTracker.getPartialFragment(o);if(h||f)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var C,E=Math.max(b,I.start||0)-o,_=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,W=_==null||((C=_.details)===null||C===void 0)?void 0:C.live,j=W?_.details.targetduration*2:r;if(E>0&&E<=j){this._trySkipBufferHole(null);return}}var w=self.performance.now();if(u===null){this.stalled=w;return}var F=w-u;!R&&F>=z&&this._reportStall(I.len);var P=J.BufferHelper.bufferInfo(t,o,i.maxBufferHole);this._tryFixBufferStall(P,F)},a._tryFixBufferStall=function(s,i){var t=this.config,u=this.fragmentTracker,o=this.media,R=o.currentTime,T=u.getPartialFragment(R);if(T){var S=this._trySkipBufferHole(T);if(S)return}s.len>t.maxBufferHole&&i>t.highBufferWatchdogPeriod*1e3&&($.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(s){var i=this.hls,t=this.media,u=this.stallReported;u||(this.stallReported=!0,$.logger.warn("Playback stalling at @"+t.currentTime+" due to low buffer (buffer="+s+")"),i.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:s}))},a._trySkipBufferHole=function(s){for(var i=this.config,t=this.hls,u=this.media,o=u.currentTime,R=0,T=J.BufferHelper.getBuffered(u),S=0;S<T.length;S++){var A=T.start(S);if(o+i.maxBufferHole>=R&&o<A){var I=Math.max(A+m,u.currentTime+D);return $.logger.warn("skipping hole, adjusting currentTime from "+o+" to "+I),this.moved=!0,this.stalled=null,u.currentTime=I,s&&t.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+o+" to "+I,frag:s}),I}R=T.end(S)}return 0},a._tryNudgeBuffer=function(){var s=this.config,i=this.hls,t=this.media,u=t.currentTime,o=(this.nudgeRetry||0)+1;if(this.nudgeRetry=o,o<s.nudgeMaxRetry){var R=u+o*s.nudgeOffset;$.logger.warn("Nudging 'currentTime' from "+u+" to "+R),t.currentTime=R,i.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else $.logger.error("Playhead still not moving while enough data buffered @"+u+" after "+s.nudgeMaxRetry+" nudges"),i.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},p}()},"./src/controller/id3-track-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts"),K=B("./src/utils/texttrack-utils.ts"),N=B("./src/demux/id3.ts"),$=.25,z=function(){function r(m){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=m,this._registerListeners()}var D=r.prototype;return D.destroy=function(){this._unregisterListeners()},D._registerListeners=function(){var g=this.hls;g.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(J.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.on(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D._unregisterListeners=function(){var g=this.hls;g.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(J.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),g.off(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},D.onMediaAttached=function(g,p){this.media=p.media},D.onMediaDetaching=function(){if(!this.id3Track)return;Object(K.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},D.getID3Track=function(g){if(!this.media)return;for(var p=0;p<g.length;p++){var a=g[p];if(a.kind==="metadata"&&a.label==="id3")return Object(K.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},D.onFragParsingMetadata=function(g,p){if(!this.media)return;var a=p.frag,c=p.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var s=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,i=0;i<c.length;i++){var t=N.getID3Frames(c[i].data);if(t){var u=c[i].pts,o=i<c.length-1?c[i+1].pts:a.end,R=o-u;R<=0&&(o=u+$);for(var T=0;T<t.length;T++){var S=t[T];if(!N.isTimeStampFrame(S)){var A=new s(u,o,"");A.value=S,this.id3Track.addCue(A)}}}}},D.onBufferFlushing=function(g,p){var a=p.startOffset,c=p.endOffset,s=p.type;if(!s||s==="audio"){var i=this.id3Track;i&&Object(K.removeCuesInRange)(i,a,c)}},r}();Q.default=z},"./src/controller/latency-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return r});var J=B("./src/errors.ts"),K=B("./src/events.ts"),N=B("./src/utils/logger.ts");function $(D,m){for(var g=0;g<m.length;g++){var p=m[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(D,p.key,p)}}function z(D,m,g){return m&&$(D.prototype,m),g&&$(D,g),D}var r=function(){function D(g){var p=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 p.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(K.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(K.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(K.Events.ERROR,this.onError,this)},m.unregisterListeners=function(){this.hls.off(K.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(K.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(K.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(K.Events.ERROR,this.onError)},m.onMediaAttached=function(p,a){this.media=a.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(p,a){var c=a.details;this.levelDetails=c,c.advanced&&this.timeupdate(),!c.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},m.onError=function(p,a){if(a.details!==J.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,N.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},m.timeupdate=function(){var p=this.media,a=this.levelDetails;if(!p||!a)return;this.currentTime=p.currentTime;var c=this.computeLatency();if(c===null)return;this._latency=c;var s=this.config,i=s.lowLatencyMode,t=s.maxLiveSyncPlaybackRate;if(!i||t===1)return;var u=this.targetLatency;if(u===null)return;var o=c-u,R=Math.min(this.maxLatency,u+a.targetduration),T=o<R;if(a.live&&T&&o>.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,t)),A=Math.round(2/(1+Math.exp(-.75*o-this.edgeStalled))*20)/20;p.playbackRate=Math.min(S,Math.max(1,A))}else p.playbackRate!==1&&p.playbackRate!==0&&(p.playbackRate=1)},m.estimateLiveEdge=function(){var p=this.levelDetails;return p===null?null:p.edge+p.age},m.computeLatency=function(){var p=this.estimateLiveEdge();return p===null?null:p-this.currentTime},z(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var p=this.config,a=this.levelDetails;return p.liveMaxLatencyDuration!==void 0?p.liveMaxLatencyDuration:a?p.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var p=this.levelDetails;if(p===null)return null;var a=p.holdBack,c=p.partHoldBack,s=p.targetduration,i=this.config,t=i.liveSyncDuration,u=i.liveSyncDurationCount,o=i.lowLatencyMode,R=this.hls.userConfig,T=o&&c||a;(R.liveSyncDuration||R.liveSyncDurationCount||T===0)&&(T=t!==void 0?t:u*s);var S=s,A=1;return T+Math.min(this.stallCount*A,S)}},{key:"liveSyncPosition",get:function(){var p=this.estimateLiveEdge(),a=this.targetLatency,c=this.levelDetails;if(p===null||a===null||c===null)return null;var s=c.edge,i=p-a-this.edgeStalled,t=s-c.totalduration,u=s-(this.config.lowLatencyMode&&c.partTarget||c.targetduration);return Math.min(Math.max(t,i),u)}},{key:"drift",get:function(){var p=this.levelDetails;return p===null?1:p.drift}},{key:"edgeStalled",get:function(){var p=this.levelDetails;if(p===null)return 0;var a=(this.config.lowLatencyMode&&p.partTarget||p.targetduration)*3;return Math.max(p.age-a,0)}},{key:"forwardBufferLength",get:function(){var p=this.media,a=this.levelDetails;if(!p||!a)return 0;var c=p.buffered.length;return c?p.buffered.end(c-1):a.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return i});var J=B("./src/types/level.ts"),K=B("./src/events.ts"),N=B("./src/errors.ts"),$=B("./src/utils/codecs.ts"),z=B("./src/controller/level-helper.ts"),r=B("./src/controller/base-playlist-controller.ts"),D=B("./src/types/loader.ts");function m(){return m=Object.assign||function(t){for(var u=1;u<arguments.length;u++){var o=arguments[u];for(var R in o)Object.prototype.hasOwnProperty.call(o,R)&&(t[R]=o[R])}return t},m.apply(this,arguments)}function g(t,u){for(var o=0;o<u.length;o++){var R=u[o];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(t,R.key,R)}}function p(t,u,o){return u&&g(t.prototype,u),o&&g(t,o),t}function a(t,u){t.prototype=Object.create(u.prototype),t.prototype.constructor=t,c(t,u)}function c(t,u){return c=Object.setPrototypeOf||function(R,T){return R.__proto__=T,R},c(t,u)}var s=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),i=function(t){a(u,t);function u(R){var T;return T=t.call(this,R,"[level-controller]")||this,T._levels=[],T._firstLevel=-1,T._startLevel=void 0,T.currentLevelIndex=-1,T.manualLevelIndex=-1,T.onParsedComplete=void 0,T._registerListeners(),T}var o=u.prototype;return o._registerListeners=function(){var T=this.hls;T.on(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.on(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.on(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.on(K.Events.FRAG_LOADED,this.onFragLoaded,this),T.on(K.Events.ERROR,this.onError,this)},o._unregisterListeners=function(){var T=this.hls;T.off(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),T.off(K.Events.LEVEL_LOADED,this.onLevelLoaded,this),T.off(K.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),T.off(K.Events.FRAG_LOADED,this.onFragLoaded,this),T.off(K.Events.ERROR,this.onError,this)},o.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,t.prototype.destroy.call(this)},o.startLoad=function(){var T=this._levels;T.forEach(function(S){S.loadError=0}),t.prototype.startLoad.call(this)},o.onManifestLoaded=function(T,S){var A=[],I=[],x=[],b,h={},f,C=!1,E=!1,_=!1;if(S.levels.forEach(function(F){var P=F.attrs;C=C||!!(F.width&&F.height),E=E||!!F.videoCodec,_=_||!!F.audioCodec,s&&F.audioCodec&&F.audioCodec.indexOf("mp4a.40.34")!==-1&&(F.audioCodec=void 0);var v=F.bitrate+"-"+F.attrs.RESOLUTION+"-"+F.attrs.CODECS;f=h[v],f?f.url.push(F.url):(f=new J.Level(F),h[v]=f,A.push(f)),P&&(P.AUDIO&&Object(z.addGroupId)(f,"audio",P.AUDIO),P.SUBTITLES&&Object(z.addGroupId)(f,"text",P.SUBTITLES))}),(C||E)&&_&&(A=A.filter(function(F){var P=F.videoCodec,v=F.width,H=F.height;return!!P||!!(v&&H)})),A=A.filter(function(F){var P=F.audioCodec,v=F.videoCodec;return(!P||Object($.isCodecSupportedInMp4)(P,"audio"))&&(!v||Object($.isCodecSupportedInMp4)(v,"video"))}),S.audioTracks&&(I=S.audioTracks.filter(function(F){return!F.audioCodec||Object($.isCodecSupportedInMp4)(F.audioCodec,"audio")}),Object(z.assignTrackIdsByGroup)(I)),S.subtitles&&(x=S.subtitles,Object(z.assignTrackIdsByGroup)(x)),A.length>0){b=A[0].bitrate,A.sort(function(F,P){return F.bitrate-P.bitrate}),this._levels=A;for(var W=0;W<A.length;W++)if(A[W].bitrate===b){this._firstLevel=W,this.log("manifest loaded, "+A.length+" level(s) found, first bitrate: "+b);break}var j=_&&!E,w={levels:A,audioTracks:I,subtitleTracks:x,firstLevel:this._firstLevel,stats:S.stats,audio:_,video:E,altAudio:!j&&I.some(function(F){return!!F.url})};this.hls.trigger(K.Events.MANIFEST_PARSED,w),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(K.Events.ERROR,{type:N.ErrorTypes.MEDIA_ERROR,details:N.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:S.url,reason:"no level with compatible codecs found in manifest"})},o.onError=function(T,S){if(t.prototype.onError.call(this,T,S),S.fatal)return;var A=S.context,I=this._levels[this.currentLevelIndex];if(A&&(A.type===D.PlaylistContextType.AUDIO_TRACK&&I.audioGroupIds&&A.groupId===I.audioGroupIds[I.urlId]||A.type===D.PlaylistContextType.SUBTITLE_TRACK&&I.textGroupIds&&A.groupId===I.textGroupIds[I.urlId])){this.redundantFailover(this.currentLevelIndex);return}var x=!1,b=!0,h;switch(S.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.ErrorDetails.FRAG_LOAD_TIMEOUT:case N.ErrorDetails.KEY_LOAD_ERROR:case N.ErrorDetails.KEY_LOAD_TIMEOUT:if(S.frag){var f=this._levels[S.frag.level];f?(f.fragmentError++,f.fragmentError>this.hls.config.fragLoadingMaxRetry&&(h=S.frag.level)):h=S.frag.level}break;case N.ErrorDetails.LEVEL_LOAD_ERROR:case N.ErrorDetails.LEVEL_LOAD_TIMEOUT:A&&(A.deliveryDirectives&&(b=!1),h=A.level),x=!0;break;case N.ErrorDetails.REMUX_ALLOC_ERROR:h=S.level,x=!0;break}h!==void 0&&this.recoverLevel(S,h,x,b)},o.recoverLevel=function(T,S,A,I){var x=T.details,b=this._levels[S];if(b.loadError++,A){var h=this.retryLoadingOrFail(T);if(h)T.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(I){var f=b.url.length;if(f>1&&b.loadError<f)T.levelRetry=!0,this.redundantFailover(S);else if(this.manualLevelIndex===-1){var C=S===0?this._levels.length-1:S-1;this.currentLevelIndex!==C&&this._levels[C].loadError===0&&(this.warn(x+": switch to "+C),T.levelRetry=!0,this.hls.nextAutoLevel=C)}}},o.redundantFailover=function(T){var S=this._levels[T],A=S.url.length;if(A>1){var I=(S.urlId+1)%A;this.warn("Switching to redundant URL-id "+I),this._levels.forEach(function(x){x.urlId=I}),this.level=T}},o.onFragLoaded=function(T,S){var A=S.frag;if(A!==void 0&&A.type===D.PlaylistLevelType.MAIN){var I=this._levels[A.level];I!==void 0&&(I.fragmentError=0,I.loadError=0)}},o.onLevelLoaded=function(T,S){var A,I=S.level,x=S.details,b=this._levels[I];if(!b){var h;this.warn("Invalid level index "+I),(h=S.deliveryDirectives)!==null&&h!==void 0&&h.skip&&(x.deltaUpdateFailed=!0);return}I===this.currentLevelIndex?(b.fragmentError===0&&(b.loadError=0,this.retryCount=0),this.playlistLoaded(I,S,b.details)):(A=S.deliveryDirectives)!==null&&A!==void 0&&A.skip&&(x.deltaUpdateFailed=!0)},o.onAudioTrackSwitched=function(T,S){var A=this.hls.levels[this.currentLevelIndex];if(!A)return;if(A.audioGroupIds){for(var I=-1,x=this.hls.audioTracks[S.id].groupId,b=0;b<A.audioGroupIds.length;b++)if(A.audioGroupIds[b]===x){I=b;break}I!==A.urlId&&(A.urlId=I,this.startLoad())}},o.loadPlaylist=function(T){var S=this.currentLevelIndex,A=this._levels[S];if(this.canLoad&&A&&A.url.length>0){var I=A.urlId,x=A.url[I];if(T)try{x=T.addDirectives(x)}catch(b){this.warn("Could not construct new URL with HLS Delivery Directives: "+b)}this.log("Attempt loading level index "+S+(T?" at sn "+T.msn+" part "+T.part:"")+" with URL-id "+I+" "+x),this.clearTimer(),this.hls.trigger(K.Events.LEVEL_LOADING,{url:x,level:S,id:I,deliveryDirectives:T||null})}},o.removeLevel=function(T,S){var A=function(b,h){return h!==S},I=this._levels.filter(function(x,b){return b!==T?!0:x.url.length>1&&S!==void 0?(x.url=x.url.filter(A),x.audioGroupIds&&(x.audioGroupIds=x.audioGroupIds.filter(A)),x.textGroupIds&&(x.textGroupIds=x.textGroupIds.filter(A)),x.urlId=0,!0):!1}).map(function(x,b){var h=x.details;return h!=null&&h.fragments&&h.fragments.forEach(function(f){f.level=b}),x});this._levels=I,this.hls.trigger(K.Events.LEVELS_UPDATED,{levels:I})},p(u,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(T){var S,A=this._levels;if(A.length===0)return;if(this.currentLevelIndex===T&&(S=A[T])!==null&&S!==void 0&&S.details)return;if(T<0||T>=A.length){var I=T<0;if(this.hls.trigger(K.Events.ERROR,{type:N.ErrorTypes.OTHER_ERROR,details:N.ErrorDetails.LEVEL_SWITCH_ERROR,level:T,fatal:I,reason:"invalid level idx"}),I)return;T=Math.min(T,A.length-1)}this.clearTimer();var x=this.currentLevelIndex,b=A[x],h=A[T];this.log("switching to level "+T+" from "+x),this.currentLevelIndex=T;var f=m({},h,{level:T,maxBitrate:h.maxBitrate,uri:h.uri,urlId:h.urlId});delete f._urlId,this.hls.trigger(K.Events.LEVEL_SWITCHING,f);var C=h.details;if(!C||C.live){var E=this.switchParams(h.uri,b==null?void 0:b.details);this.loadPlaylist(E)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(T){this.manualLevelIndex=T,this._startLevel===void 0&&(this._startLevel=T),T!==-1&&(this.level=T)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(T){this._firstLevel=T}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var T=this.hls.config.startLevel;return T!==void 0?T:this._firstLevel}else return this._startLevel},set:function(T){this._startLevel=T}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(T){this.level=T,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=T)}}]),u}(r.default)},"./src/controller/level-helper.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"addGroupId",function(){return N}),B.d(Q,"assignTrackIdsByGroup",function(){return $}),B.d(Q,"updatePTS",function(){return z}),B.d(Q,"updateFragPTSDTS",function(){return D}),B.d(Q,"mergeDetails",function(){return m}),B.d(Q,"mapPartIntersection",function(){return g}),B.d(Q,"mapFragmentIntersection",function(){return p}),B.d(Q,"adjustSliding",function(){return a}),B.d(Q,"addSliding",function(){return c}),B.d(Q,"computeReloadInterval",function(){return s}),B.d(Q,"getFragmentWithSN",function(){return i}),B.d(Q,"getPartWith",function(){return t});var J=B("./src/polyfills/number.ts"),K=B("./src/utils/logger.ts");function N(u,o,R){switch(o){case"audio":u.audioGroupIds||(u.audioGroupIds=[]),u.audioGroupIds.push(R);break;case"text":u.textGroupIds||(u.textGroupIds=[]),u.textGroupIds.push(R);break}}function $(u){var o={};u.forEach(function(R){var T=R.groupId||"";R.id=o[T]=o[T]||0,o[T]++})}function z(u,o,R){var T=u[o],S=u[R];r(T,S)}function r(u,o){var R=o.startPTS;if(Object(J.isFiniteNumber)(R)){var T=0,S;o.sn>u.sn?(T=R-u.start,S=u):(T=u.start-R,S=o),S.duration!==T&&(S.duration=T)}else if(o.sn>u.sn){var A=u.cc===o.cc;A&&u.minEndPTS?o.start=u.start+(u.minEndPTS-u.start):o.start=u.start+u.duration}else o.start=Math.max(u.start-o.duration,0)}function D(u,o,R,T,S,A){var I=T-R;I<=0&&(K.logger.warn("Fragment should have a positive duration",o),T=R+o.duration,A=S+o.duration);var x=R,b=T,h=o.startPTS,f=o.endPTS;if(Object(J.isFiniteNumber)(h)){var C=Math.abs(h-R);Object(J.isFiniteNumber)(o.deltaPTS)?o.deltaPTS=Math.max(C,o.deltaPTS):o.deltaPTS=C,x=Math.max(R,h),R=Math.min(R,h),S=Math.min(S,o.startDTS),b=Math.min(T,f),T=Math.max(T,f),A=Math.max(A,o.endDTS)}o.duration=T-R;var E=R-o.start;o.appendedPTS=T,o.start=o.startPTS=R,o.maxStartPTS=x,o.startDTS=S,o.endPTS=T,o.minEndPTS=b,o.endDTS=A;var _=o.sn;if(!u||_<u.startSN||_>u.endSN)return 0;var W,j=_-u.startSN,w=u.fragments;for(w[j]=o,W=j;W>0;W--)r(w[W],w[W-1]);for(W=j;W<w.length-1;W++)r(w[W],w[W+1]);return u.fragmentHint&&r(w[w.length-1],u.fragmentHint),u.PTSKnown=u.alignedSliding=!0,E}function m(u,o){for(var R=null,T=u.fragments,S=T.length-1;S>=0;S--){var A=T[S].initSegment;if(A){R=A;break}}u.fragmentHint&&delete u.fragmentHint.endPTS;var I=0,x;if(p(u,o,function(W,j){W.relurl&&(I=W.cc-j.cc),Object(J.isFiniteNumber)(W.startPTS)&&Object(J.isFiniteNumber)(W.endPTS)&&(j.start=j.startPTS=W.startPTS,j.startDTS=W.startDTS,j.appendedPTS=W.appendedPTS,j.maxStartPTS=W.maxStartPTS,j.endPTS=W.endPTS,j.endDTS=W.endDTS,j.minEndPTS=W.minEndPTS,j.duration=W.endPTS-W.startPTS,j.duration&&(x=j),o.PTSKnown=o.alignedSliding=!0),j.elementaryStreams=W.elementaryStreams,j.loader=W.loader,j.stats=W.stats,j.urlId=W.urlId,W.initSegment&&(j.initSegment=W.initSegment,R=W.initSegment)}),R){var b=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments;b.forEach(function(W){var j;(!W.initSegment||W.initSegment.relurl===((j=R)===null||j===void 0?void 0:j.relurl))&&(W.initSegment=R)})}if(o.skippedSegments&&(o.deltaUpdateFailed=o.fragments.some(function(W){return!W}),o.deltaUpdateFailed)){K.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=o.skippedSegments;h--;)o.fragments.shift();o.startSN=o.fragments[0].sn,o.startCC=o.fragments[0].cc}var f=o.fragments;if(I){K.logger.warn("discontinuity sliding from playlist, take drift into account");for(var C=0;C<f.length;C++)f[C].cc+=I}o.skippedSegments&&(o.startCC=o.fragments[0].cc),g(u.partList,o.partList,function(W,j){j.elementaryStreams=W.elementaryStreams,j.stats=W.stats}),x?D(o,x,x.startPTS,x.endPTS,x.startDTS,x.endDTS):a(u,o),f.length&&(o.totalduration=o.edge-f[0].start),o.driftStartTime=u.driftStartTime,o.driftStart=u.driftStart;var E=o.advancedDateTime;if(o.advanced&&E){var _=o.edge;o.driftStart||(o.driftStartTime=E,o.driftStart=_),o.driftEndTime=E,o.driftEnd=_}else o.driftEndTime=u.driftEndTime,o.driftEnd=u.driftEnd,o.advancedDateTime=u.advancedDateTime}function g(u,o,R){if(u&&o)for(var T=0,S=0,A=u.length;S<=A;S++){var I=u[S],x=o[S+T];I&&x&&I.index===x.index&&I.fragment.sn===x.fragment.sn?R(I,x):T--}}function p(u,o,R){for(var T=o.skippedSegments,S=Math.max(u.startSN,o.startSN)-o.startSN,A=(u.fragmentHint?1:0)+(T?o.endSN:Math.min(u.endSN,o.endSN))-o.startSN,I=o.startSN-u.startSN,x=o.fragmentHint?o.fragments.concat(o.fragmentHint):o.fragments,b=u.fragmentHint?u.fragments.concat(u.fragmentHint):u.fragments,h=S;h<=A;h++){var f=b[I+h],C=x[h];T&&!C&&h<T&&(C=o.fragments[h]=f),f&&C&&R(f,C)}}function a(u,o){var R=o.startSN+o.skippedSegments-u.startSN,T=u.fragments;if(R<0||R>=T.length)return;c(o,T[R].start)}function c(u,o){if(o){for(var R=u.fragments,T=u.skippedSegments;T<R.length;T++)R[T].start+=o;u.fragmentHint&&(u.fragmentHint.start+=o)}}function s(u,o){var R=1e3*u.levelTargetDuration,T=R/2,S=u.age,A=S>0&&S<R*3,I=o.loading.end-o.loading.start,x,b=u.availabilityDelay;if(u.updated===!1)if(A){var h=333*u.misses;x=Math.max(Math.min(T,I*2),h),u.availabilityDelay=(u.availabilityDelay||0)+x}else x=T;else A?(b=Math.min(b||R/2,S),u.availabilityDelay=b,x=b+R-S):x=R-I;return Math.round(x)}function i(u,o,R){if(!u||!u.details)return null;var T=u.details,S=T.fragments[o-T.startSN];return S||(S=T.fragmentHint,S&&S.sn===o?S:o<T.startSN&&R&&R.sn===o?R:null)}function t(u,o,R){if(!u||!u.details)return null;var T=u.details.partList;if(T)for(var S=T.length;S--;){var A=T[S];if(A.index===R&&A.fragment.sn===o)return A}return null}},"./src/controller/stream-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return T});var J=B("./src/polyfills/number.ts"),K=B("./src/controller/base-stream-controller.ts"),N=B("./src/is-supported.ts"),$=B("./src/events.ts"),z=B("./src/utils/buffer-helper.ts"),r=B("./src/controller/fragment-tracker.ts"),D=B("./src/types/loader.ts"),m=B("./src/loader/fragment.ts"),g=B("./src/demux/transmuxer-interface.ts"),p=B("./src/types/transmuxer.ts"),a=B("./src/controller/gap-controller.ts"),c=B("./src/errors.ts"),s=B("./src/utils/logger.ts");function i(S,A){for(var I=0;I<A.length;I++){var x=A[I];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(S,x.key,x)}}function t(S,A,I){return A&&i(S.prototype,A),I&&i(S,I),S}function u(S,A){S.prototype=Object.create(A.prototype),S.prototype.constructor=S,o(S,A)}function o(S,A){return o=Object.setPrototypeOf||function(x,b){return x.__proto__=b,x},o(S,A)}var R=100,T=function(S){u(A,S);function A(x,b){var h;return h=S.call(this,x,b,"[stream-controller]")||this,h.audioCodecSwap=!1,h.gapController=null,h.level=-1,h._forceStartLoad=!1,h.altAudio=!1,h.audioOnly=!1,h.fragPlaying=null,h.onvplaying=null,h.onvseeked=null,h.fragLastKbps=0,h.stalled=!1,h.couldBacktrack=!1,h.audioCodecSwitch=!1,h.videoBuffer=null,h._registerListeners(),h}var I=A.prototype;return I._registerListeners=function(){var b=this.hls;b.on($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.on($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.on($.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.on($.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.on($.Events.LEVEL_LOADING,this.onLevelLoading,this),b.on($.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.on($.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.on($.Events.ERROR,this.onError,this),b.on($.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.on($.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.on($.Events.BUFFER_CREATED,this.onBufferCreated,this),b.on($.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.on($.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.on($.Events.FRAG_BUFFERED,this.onFragBuffered,this)},I._unregisterListeners=function(){var b=this.hls;b.off($.Events.MEDIA_ATTACHED,this.onMediaAttached,this),b.off($.Events.MEDIA_DETACHING,this.onMediaDetaching,this),b.off($.Events.MANIFEST_LOADING,this.onManifestLoading,this),b.off($.Events.MANIFEST_PARSED,this.onManifestParsed,this),b.off($.Events.LEVEL_LOADED,this.onLevelLoaded,this),b.off($.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),b.off($.Events.ERROR,this.onError,this),b.off($.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),b.off($.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),b.off($.Events.BUFFER_CREATED,this.onBufferCreated,this),b.off($.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),b.off($.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),b.off($.Events.FRAG_BUFFERED,this.onFragBuffered,this)},I.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},I.startLoad=function(b){if(this.levels){var h=this.lastCurrentTime,f=this.hls;if(this.stopLoad(),this.setInterval(R),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var C=f.startLevel;C===-1&&(f.config.testBandwidth?(C=0,this.bitrateTest=!0):C=f.nextAutoLevel),this.level=f.nextLoadLevel=C,this.loadedmetadata=!1}h>0&&b===-1&&(this.log("Override startPosition with lastCurrentTime @"+h.toFixed(3)),b=h),this.state=K.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=b,this.tick()}else this._forceStartLoad=!0,this.state=K.State.STOPPED},I.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},I.doTick=function(){switch(this.state){case K.State.IDLE:this.doTickIdle();break;case K.State.WAITING_LEVEL:{var b,h=this.levels,f=this.level,C=h==null||((b=h[f])===null||b===void 0)?void 0:b.details;if(C&&(!C.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(C))break;this.state=K.State.IDLE;break}break}case K.State.FRAG_LOADING_WAITING_RETRY:{var E,_=self.performance.now(),W=this.retryDate;(!W||_>=W||(E=this.media)!==null&&E!==void 0&&E.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=K.State.IDLE)}break;default:break}this.onTickEnd()},I.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},I.doTickIdle=function(){var b,h,f=this.hls,C=this.levelLastLoaded,E=this.levels,_=this.media,W=f.config,j=f.nextLoadLevel;if(C===null||!_&&(this.startFragRequested||!W.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!E||!E[j])return;var w=E[j];this.level=f.nextLoadLevel=j;var F=w.details;if(!F||this.state===K.State.WAITING_LEVEL||F.live&&this.levelLastLoaded!==j){this.state=K.State.WAITING_LEVEL;return}var P=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:_,D.PlaylistLevelType.MAIN);if(P===null)return;var v=P.len,H=this.getMaxBufferLength(w.maxBitrate);if(v>=H)return;if(this._streamEnded(P,F)){var Y={};this.altAudio&&(Y.type="video"),this.hls.trigger($.Events.BUFFER_EOS,Y),this.state=K.State.ENDED;return}var ie=P.end,le=this.getNextFragment(ie,F);if(this.couldBacktrack&&!this.fragPrevious&&le&&le.sn!=="initSegment"){var he=le.sn-F.startSN;he>1&&(le=F.fragments[he-1],this.fragmentTracker.removeFragment(le))}if(le&&this.fragmentTracker.getState(le)===r.FragmentState.OK&&this.nextLoadPosition>ie){var xe=this.audioOnly&&!this.altAudio?m.ElementaryStreamTypes.AUDIO:m.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(_,xe,D.PlaylistLevelType.MAIN),le=this.getNextFragment(this.nextLoadPosition,F)}if(!le)return;le.initSegment&&!le.initSegment.data&&!this.bitrateTest&&(le=le.initSegment),((b=le.decryptdata)===null||b===void 0?void 0:b.keyFormat)==="identity"&&!((h=le.decryptdata)!==null&&h!==void 0&&h.key)?this.loadKey(le,F):this.loadFragment(le,F,ie)},I.loadFragment=function(b,h,f){var C,E=this.fragmentTracker.getState(b);if(this.fragCurrent=b,E===r.FragmentState.BACKTRACKED){var _=this.fragmentTracker.getBacktrackData(b);if(_){this._handleFragmentLoadProgress(_),this._handleFragmentLoadComplete(_);return}else E=r.FragmentState.NOT_LOADED}E===r.FragmentState.NOT_LOADED||E===r.FragmentState.PARTIAL?b.sn==="initSegment"?this._loadInitSegment(b):this.bitrateTest?(b.bitrateTest=!0,this.log("Fragment "+b.sn+" of level "+b.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(b)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,b,h,f)):E===r.FragmentState.APPENDING?this.reduceMaxBufferLength(b.duration)&&this.fragmentTracker.removeFragment(b):((C=this.media)===null||C===void 0?void 0:C.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},I.getAppendedFrag=function(b){var h=this.fragmentTracker.getAppendedFrag(b,D.PlaylistLevelType.MAIN);return h&&"fragment"in h?h.fragment:h},I.getBufferedFrag=function(b){return this.fragmentTracker.getBufferedFrag(b,D.PlaylistLevelType.MAIN)},I.followingBufferedFrag=function(b){return b?this.getBufferedFrag(b.end+.5):null},I.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},I.nextLevelSwitch=function(){var b=this.levels,h=this.media;if(h!=null&&h.readyState){var f,C=this.getAppendedFrag(h.currentTime);if(C&&C.start>1&&this.flushMainBuffer(0,C.start-1),!h.paused&&b){var E=this.hls.nextLoadLevel,_=b[E],W=this.fragLastKbps;W&&this.fragCurrent?f=this.fragCurrent.duration*_.maxBitrate/(1e3*W)+1:f=0}else f=0;var j=this.getBufferedFrag(h.currentTime+f);if(j){var w=this.followingBufferedFrag(j);if(w){this.abortCurrentFrag();var F=w.maxStartPTS?w.maxStartPTS:w.start,P=w.duration,v=Math.max(j.end,F+Math.min(Math.max(P-this.config.maxFragLookUpTolerance,P*.5),P*.75));this.flushMainBuffer(v,Number.POSITIVE_INFINITY)}}}},I.abortCurrentFrag=function(){var b=this.fragCurrent;this.fragCurrent=null,b!=null&&b.loader&&b.loader.abort(),this.state===K.State.KEY_LOADING&&(this.state=K.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},I.flushMainBuffer=function(b,h){S.prototype.flushMainBuffer.call(this,b,h,this.altAudio?"video":null)},I.onMediaAttached=function(b,h){S.prototype.onMediaAttached.call(this,b,h);var f=h.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),f.addEventListener("playing",this.onvplaying),f.addEventListener("seeked",this.onvseeked),this.gapController=new a.default(this.config,f,this.fragmentTracker,this.hls)},I.onMediaDetaching=function(){var b=this.media;b&&(b.removeEventListener("playing",this.onvplaying),b.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},I.onMediaPlaying=function(){this.tick()},I.onMediaSeeked=function(){var b=this.media,h=b?b.currentTime:null;Object(J.isFiniteNumber)(h)&&this.log("Media seeked to "+h.toFixed(3)),this.tick()},I.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger($.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},I.onManifestParsed=function(b,h){var f=!1,C=!1,E;h.levels.forEach(function(_){E=_.audioCodec,E&&(E.indexOf("mp4a.40.2")!==-1&&(f=!0),E.indexOf("mp4a.40.5")!==-1&&(C=!0))}),this.audioCodecSwitch=f&&C&&!Object(N.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=h.levels,this.startFragRequested=!1},I.onLevelLoading=function(b,h){var f=this.levels;if(!f||this.state!==K.State.IDLE)return;var C=f[h.level];(!C.details||C.details.live&&this.levelLastLoaded!==h.level||this.waitForCdnTuneIn(C.details))&&(this.state=K.State.WAITING_LEVEL)},I.onLevelLoaded=function(b,h){var f,C=this.levels,E=h.level,_=h.details,W=_.totalduration;if(!C){this.warn("Levels were reset while loading level "+E);return}this.log("Level "+E+" loaded ["+_.startSN+","+_.endSN+"], cc ["+_.startCC+", "+_.endCC+"] duration:"+W);var j=this.fragCurrent;j&&(this.state===K.State.FRAG_LOADING||this.state===K.State.FRAG_LOADING_WAITING_RETRY)&&(j.level!==h.level&&j.loader&&(this.state=K.State.IDLE,j.loader.abort()));var w=C[E],F=0;if(_.live||(f=w.details)!==null&&f!==void 0&&f.live){if(_.fragments[0]||(_.deltaUpdateFailed=!0),_.deltaUpdateFailed)return;F=this.alignPlaylists(_,w.details)}if(w.details=_,this.levelLastLoaded=E,this.hls.trigger($.Events.LEVEL_UPDATED,{details:_,level:E}),this.state===K.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(_))return;this.state=K.State.IDLE}this.startFragRequested?_.live&&this.synchronizeToLiveEdge(_):this.setStartPosition(_,F),this.tick()},I._handleFragmentLoadProgress=function(b){var h,f=b.frag,C=b.part,E=b.payload,_=this.levels;if(!_){this.warn("Levels were reset while fragment load was in progress. Fragment "+f.sn+" of level "+f.level+" will not be buffered");return}var W=_[f.level],j=W.details;if(!j){this.warn("Dropping fragment "+f.sn+" of level "+f.level+" after level details were reset");return}var w=W.videoCodec,F=j.PTSKnown||!j.live,P=(h=f.initSegment)===null||h===void 0?void 0:h.data,v=this._getAudioCodec(W),H=this.transmuxer=this.transmuxer||new g.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Y=C?C.index:-1,ie=Y!==-1,le=new p.ChunkMetadata(f.level,f.sn,f.stats.chunkCount,E.byteLength,Y,ie),he=this.initPTS[f.cc];H.push(E,P,v,w,f,C,j.totalduration,F,le,he)},I.onAudioTrackSwitching=function(b,h){var f=this.altAudio,C=!!h.url,E=h.id;if(!C){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var _=this.fragCurrent;_!=null&&_.loader&&(this.log("Switching to main audio track, cancel main fragment load"),_.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var W=this.hls;f&&W.trigger($.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),W.trigger($.Events.AUDIO_TRACK_SWITCHED,{id:E})}},I.onAudioTrackSwitched=function(b,h){var f=h.id,C=!!this.hls.audioTracks[f].url;if(C){var E=this.videoBuffer;E&&this.mediaBuffer!==E&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=E)}this.altAudio=C,this.tick()},I.onBufferCreated=function(b,h){var f=h.tracks,C,E,_=!1;for(var W in f){var j=f[W];if(j.id==="main"){if(E=W,C=j,W==="video"){var w=f[W];w&&(this.videoBuffer=w.buffer)}}else _=!0}_&&C?(this.log("Alternate track found, use "+E+".buffered to schedule main fragment loading"),this.mediaBuffer=C.buffer):this.mediaBuffer=this.media},I.onFragBuffered=function(b,h){var f=h.frag,C=h.part;if(f&&f.type!==D.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(f)){this.warn("Fragment "+f.sn+(C?" p: "+C.index:"")+" of level "+f.level+" finished buffering, but was aborted. state: "+this.state),this.state===K.State.PARSED&&(this.state=K.State.IDLE);return}var E=C?C.stats:f.stats;this.fragLastKbps=Math.round(8*E.total/(E.buffering.end-E.loading.first)),f.sn!=="initSegment"&&(this.fragPrevious=f),this.fragBufferedComplete(f,C)},I.onError=function(b,h){switch(h.details){case c.ErrorDetails.FRAG_LOAD_ERROR:case c.ErrorDetails.FRAG_LOAD_TIMEOUT:case c.ErrorDetails.KEY_LOAD_ERROR:case c.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(D.PlaylistLevelType.MAIN,h);break;case c.ErrorDetails.LEVEL_LOAD_ERROR:case c.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==K.State.ERROR&&(h.fatal?(this.warn(""+h.details),this.state=K.State.ERROR):!h.levelRetry&&this.state===K.State.WAITING_LEVEL&&(this.state=K.State.IDLE));break;case c.ErrorDetails.BUFFER_FULL_ERROR:if(h.parent==="main"&&(this.state===K.State.PARSING||this.state===K.State.PARSED)){var f=!0,C=this.getFwdBufferInfo(this.media,D.PlaylistLevelType.MAIN);C&&C.len>.5&&(f=!this.reduceMaxBufferLength(C.len)),f&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},I.checkBuffer=function(){var b=this.media,h=this.gapController;if(!b||!h||!b.readyState)return;var f=z.BufferHelper.getBuffered(b);!this.loadedmetadata&&f.length?(this.loadedmetadata=!0,this.seekToStartPos()):h.poll(this.lastCurrentTime),this.lastCurrentTime=b.currentTime},I.onFragLoadEmergencyAborted=function(){this.state=K.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},I.onBufferFlushed=function(b,h){var f=h.type;if(f!==m.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var C=(f===m.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(C,f,D.PlaylistLevelType.MAIN)}},I.onLevelsUpdated=function(b,h){this.levels=h.levels},I.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},I.seekToStartPos=function(){var b=this.media,h=b.currentTime,f=this.startPosition;if(f>=0&&h<f){if(b.seeking){s.logger.log("could not seek to "+f+", already seeking at "+h);return}var C=z.BufferHelper.getBuffered(b),E=C.length?C.start(0):0,_=E-f;_>0&&(_<this.config.maxBufferHole||_<this.config.maxFragLookUpTolerance)&&(s.logger.log("adjusting start position by "+_+" to match buffer start"),f+=_,this.startPosition=f),this.log("seek to target start position "+f+" from current time "+h),b.currentTime=f}},I._getAudioCodec=function(b){var h=this.config.defaultAudioCodec||b.audioCodec;return this.audioCodecSwap&&h&&(this.log("Swapping audio codec"),h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5"),h},I._loadBitrateTestFrag=function(b){var h=this;this._doFragLoad(b).then(function(f){var C=h.hls;if(!f||C.nextLoadLevel||h.fragContextChanged(b))return;h.fragLoadError=0,h.state=K.State.IDLE,h.startFragRequested=!1,h.bitrateTest=!1;var E=b.stats;E.parsing.start=E.parsing.end=E.buffering.start=E.buffering.end=self.performance.now(),C.trigger($.Events.FRAG_LOADED,f)})},I._handleTransmuxComplete=function(b){var h,f="main",C=this.hls,E=b.remuxResult,_=b.chunkMeta,W=this.getCurrentContext(_);if(!W){this.warn("The loading context changed while buffering fragment "+_.sn+" of level "+_.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(_.level);return}var j=W.frag,w=W.part,F=W.level,P=E.video,v=E.text,H=E.id3,Y=E.initSegment,ie=this.altAudio?void 0:E.audio;if(this.fragContextChanged(j))return;if(this.state=K.State.PARSING,Y){Y.tracks&&(this._bufferInitSegment(F,Y.tracks,j,_),C.trigger($.Events.FRAG_PARSING_INIT_SEGMENT,{frag:j,id:f,tracks:Y.tracks}));var le=Y.initPTS,he=Y.timescale;Object(J.isFiniteNumber)(le)&&(this.initPTS[j.cc]=le,C.trigger($.Events.INIT_PTS_FOUND,{frag:j,id:f,initPTS:le,timescale:he}))}if(P&&E.independent!==!1){if(F.details){var xe=P.startPTS,Le=P.endPTS,we=P.startDTS,Ae=P.endDTS;if(w)w.elementaryStreams[P.type]={startPTS:xe,endPTS:Le,startDTS:we,endDTS:Ae};else if(P.firstKeyFrame&&P.independent&&(this.couldBacktrack=!0),P.dropped&&P.independent){var pe=this.getLoadPosition()+this.config.maxBufferHole;if(pe<xe){this.backtrack(j);return}j.setElementaryStreamInfo(P.type,j.start,Le,j.start,Ae,!0)}j.setElementaryStreamInfo(P.type,xe,Le,we,Ae),this.bufferFragmentData(P,j,w,_)}}else if(E.independent===!1){this.backtrack(j);return}if(ie){var be=ie.startPTS,ne=ie.endPTS,fe=ie.startDTS,_e=ie.endDTS;w&&(w.elementaryStreams[m.ElementaryStreamTypes.AUDIO]={startPTS:be,endPTS:ne,startDTS:fe,endDTS:_e}),j.setElementaryStreamInfo(m.ElementaryStreamTypes.AUDIO,be,ne,fe,_e),this.bufferFragmentData(ie,j,w,_)}if(H!=null&&(h=H.samples)!==null&&h!==void 0&&h.length){var ke={frag:j,id:f,samples:H.samples};C.trigger($.Events.FRAG_PARSING_METADATA,ke)}if(v){var et={frag:j,id:f,samples:v.samples};C.trigger($.Events.FRAG_PARSING_USERDATA,et)}},I._bufferInitSegment=function(b,h,f,C){var E=this;if(this.state!==K.State.PARSING)return;this.audioOnly=!!h.audio&&!h.video,this.altAudio&&!this.audioOnly&&delete h.audio;var _=h.audio,W=h.video,j=h.audiovideo;if(_){var w=b.audioCodec,F=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(w&&(w.indexOf("mp4a.40.5")!==-1?w="mp4a.40.2":w="mp4a.40.5"),_.metadata.channelCount!==1&&F.indexOf("firefox")===-1&&(w="mp4a.40.5")),F.indexOf("android")!==-1&&_.container!=="audio/mpeg"&&(w="mp4a.40.2",this.log("Android: force audio codec to "+w)),b.audioCodec&&b.audioCodec!==w&&this.log('Swapping manifest audio codec "'+b.audioCodec+'" for "'+w+'"'),_.levelCodec=w,_.id="main",this.log("Init audio buffer, container:"+_.container+", codecs[selected/level/parsed]=["+(w||"")+"/"+(b.audioCodec||"")+"/"+_.codec+"]")}W&&(W.levelCodec=b.videoCodec,W.id="main",this.log("Init video buffer, container:"+W.container+", codecs[level/parsed]=["+(b.videoCodec||"")+"/"+W.codec+"]")),j&&this.log("Init audiovideo buffer, container:"+j.container+", codecs[level/parsed]=["+(b.attrs.CODECS||"")+"/"+j.codec+"]"),this.hls.trigger($.Events.BUFFER_CODECS,h),Object.keys(h).forEach(function(P){var v=h[P],H=v.initSegment;H!=null&&H.byteLength&&E.hls.trigger($.Events.BUFFER_APPENDING,{type:P,data:H,frag:f,part:null,chunkMeta:C,parent:f.type})}),this.tick()},I.backtrack=function(b){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(b);var h=this.fragmentTracker.backtrack(b);this.fragPrevious=null,this.nextLoadPosition=b.start,h?this.resetFragmentLoading(b):this.state=K.State.BACKTRACKING},I.checkFragmentChanged=function(){var b=this.media,h=null;if(b&&b.readyState>1&&b.seeking===!1){var f=b.currentTime;if(z.BufferHelper.isBuffered(b,f)?h=this.getAppendedFrag(f):z.BufferHelper.isBuffered(b,f+.1)&&(h=this.getAppendedFrag(f+.1)),h){var C=this.fragPlaying,E=h.level;(!C||h.sn!==C.sn||C.level!==E||h.urlId!==C.urlId)&&(this.hls.trigger($.Events.FRAG_CHANGED,{frag:h}),(!C||C.level!==E)&&this.hls.trigger($.Events.LEVEL_SWITCHED,{level:E}),this.fragPlaying=h)}}},t(A,[{key:"nextLevel",get:function(){var b=this.nextBufferedFrag;return b?b.level:-1}},{key:"currentLevel",get:function(){var b=this.media;if(b){var h=this.getAppendedFrag(b.currentTime);if(h)return h.level}return-1}},{key:"nextBufferedFrag",get:function(){var b=this.media;if(b){var h=this.getAppendedFrag(b.currentTime);return this.followingBufferedFrag(h)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),A}(K.default)},"./src/controller/subtitle-stream-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"SubtitleStreamController",function(){return u});var J=B("./src/events.ts"),K=B("./src/utils/logger.ts"),N=B("./src/utils/buffer-helper.ts"),$=B("./src/controller/fragment-finders.ts"),z=B("./src/utils/discontinuities.ts"),r=B("./src/controller/level-helper.ts"),D=B("./src/controller/fragment-tracker.ts"),m=B("./src/controller/base-stream-controller.ts"),g=B("./src/types/loader.ts"),p=B("./src/types/level.ts");function a(o,R){for(var T=0;T<R.length;T++){var S=R[T];S.enumerable=S.enumerable||!1,S.configurable=!0,"value"in S&&(S.writable=!0),Object.defineProperty(o,S.key,S)}}function c(o,R,T){return R&&a(o.prototype,R),T&&a(o,T),o}function s(o,R){o.prototype=Object.create(R.prototype),o.prototype.constructor=o,i(o,R)}function i(o,R){return i=Object.setPrototypeOf||function(S,A){return S.__proto__=A,S},i(o,R)}var t=500,u=function(o){s(R,o);function R(S,A){var I;return I=o.call(this,S,A,"[subtitle-stream-controller]")||this,I.levels=[],I.currentTrackId=-1,I.tracksBuffered=[],I.mainDetails=null,I._registerListeners(),I}var T=R.prototype;return T.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},T._registerListeners=function(){var A=this.hls;A.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.on(J.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.on(J.Events.ERROR,this.onError,this),A.on(J.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.on(J.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.on(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.on(J.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.on(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T._unregisterListeners=function(){var A=this.hls;A.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),A.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),A.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),A.off(J.Events.LEVEL_LOADED,this.onLevelLoaded,this),A.off(J.Events.ERROR,this.onError,this),A.off(J.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),A.off(J.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),A.off(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),A.off(J.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),A.off(J.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},T.startLoad=function(){this.stopLoad(),this.state=m.State.IDLE,this.setInterval(t),this.tick()},T.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},T.onLevelLoaded=function(A,I){this.mainDetails=I.details},T.onSubtitleFragProcessed=function(A,I){var x=I.frag,b=I.success;if(this.fragPrevious=x,this.state=m.State.IDLE,!b)return;var h=this.tracksBuffered[this.currentTrackId];if(!h)return;for(var f,C=x.start,E=0;E<h.length;E++)if(C>=h[E].start&&C<=h[E].end){f=h[E];break}var _=x.start+x.duration;f?f.end=_:(f={start:C,end:_},h.push(f)),this.fragmentTracker.fragBuffered(x)},T.onBufferFlushing=function(A,I){var x=I.startOffset,b=I.endOffset;if(x===0&&b!==Number.POSITIVE_INFINITY){var h=this.currentTrackId,f=this.levels;if(!f.length||!f[h]||!f[h].details)return;var C=f[h].details,E=C.targetduration,_=b-E;if(_<=0)return;I.endOffsetSubtitles=Math.max(0,_),this.tracksBuffered.forEach(function(W){for(var j=0;j<W.length;){if(W[j].end<=_){W.shift();continue}else if(W[j].start<_)W[j].start=_;else break;j++}}),this.fragmentTracker.removeFragmentsInRange(x,_,g.PlaylistLevelType.SUBTITLE)}},T.onError=function(A,I){var x,b=I.frag;if(!b||b.type!==g.PlaylistLevelType.SUBTITLE)return;(x=this.fragCurrent)!==null&&x!==void 0&&x.loader&&this.fragCurrent.loader.abort(),this.state=m.State.IDLE},T.onSubtitleTracksUpdated=function(A,I){var x=this,b=I.subtitleTracks;this.tracksBuffered=[],this.levels=b.map(function(h){return new p.Level(h)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(h){x.tracksBuffered[h.id]=[]}),this.mediaBuffer=null},T.onSubtitleTrackSwitch=function(A,I){if(this.currentTrackId=I.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var x=this.levels[this.currentTrackId];x!=null&&x.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,x&&this.setInterval(t)},T.onSubtitleTrackLoaded=function(A,I){var x,b=I.details,h=I.id,f=this.currentTrackId,C=this.levels;if(!C.length)return;var E=C[f];if(h>=C.length||h!==f||!E)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,b.live||(x=E.details)!==null&&x!==void 0&&x.live){var _=this.mainDetails;if(b.deltaUpdateFailed||!_)return;var W=_.fragments[0];if(!E.details)b.hasProgramDateTime&&_.hasProgramDateTime?Object(z.alignMediaPlaylistByPDT)(b,_):W&&Object(r.addSliding)(b,W.start);else{var j=this.alignPlaylists(b,E.details);j===0&&W&&Object(r.addSliding)(b,W.start)}}if(E.details=b,this.levelLastLoaded=h,this.tick(),b.live&&!this.fragCurrent&&this.media&&this.state===m.State.IDLE){var w=Object($.findFragmentByPTS)(null,b.fragments,this.media.currentTime,0);w||(this.warn("Subtitle playlist not aligned with playback"),E.details=void 0)}},T._handleFragmentLoadComplete=function(A){var I=A.frag,x=A.payload,b=I.decryptdata,h=this.hls;if(this.fragContextChanged(I))return;if(x&&x.byteLength>0&&b&&b.key&&b.iv&&b.method==="AES-128"){var f=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(x),b.key.buffer,b.iv.buffer).then(function(C){var E=performance.now();h.trigger(J.Events.FRAG_DECRYPTED,{frag:I,payload:C,stats:{tstart:f,tdecrypt:E}})})}},T.doTick=function(){if(!this.media){this.state=m.State.IDLE;return}if(this.state===m.State.IDLE){var A,I=this.currentTrackId,x=this.levels;if(!x.length||!x[I]||!x[I].details)return;var b=x[I].details,h=b.targetduration,f=this.config,C=this.media,E=N.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,C.currentTime-h,f.maxBufferHole),_=E.end,W=E.len,j=this.getMaxBufferLength()+h;if(W>j)return;console.assert(b,"Subtitle track details are defined on idle subtitle stream controller tick");var w=b.fragments,F=w.length,P=b.edge,v,H=this.fragPrevious;if(_<P){var Y=f.maxFragLookUpTolerance;H&&b.hasProgramDateTime&&(v=Object($.findFragmentByPDT)(w,H.endProgramDateTime,Y)),v||(v=Object($.findFragmentByPTS)(H,w,_,Y),!v&&H&&H.start<w[0].start&&(v=w[0]))}else v=w[F-1];(A=v)!==null&&A!==void 0&&A.encrypted?(K.logger.log("Loading key for "+v.sn),this.state=m.State.KEY_LOADING,this.hls.trigger(J.Events.KEY_LOADING,{frag:v})):v&&this.fragmentTracker.getState(v)===D.FragmentState.NOT_LOADED&&this.loadFragment(v,b,_)}},T.loadFragment=function(A,I,x){this.fragCurrent=A,o.prototype.loadFragment.call(this,A,I,x)},c(R,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),R}(m.default)},"./src/controller/subtitle-track-controller.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/events.ts"),K=B("./src/utils/texttrack-utils.ts"),N=B("./src/controller/base-playlist-controller.ts"),$=B("./src/types/loader.ts");function z(a,c){for(var s=0;s<c.length;s++){var i=c[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function r(a,c,s){return c&&z(a.prototype,c),s&&z(a,s),a}function D(a,c){a.prototype=Object.create(c.prototype),a.prototype.constructor=a,m(a,c)}function m(a,c){return m=Object.setPrototypeOf||function(i,t){return i.__proto__=t,i},m(a,c)}var g=function(a){D(c,a);function c(i){var t;return t=a.call(this,i,"[subtitle-track-controller]")||this,t.media=null,t.tracks=[],t.groupId=null,t.tracksInGroup=[],t.trackId=-1,t.selectDefaultTrack=!0,t.queuedDefaultTrack=-1,t.trackChangeListener=function(){return t.onTextTracksChanged()},t.asyncPollTrackChange=function(){return t.pollTrackChange(0)},t.useTextTrackPolling=!1,t.subtitlePollingInterval=-1,t.subtitleDisplay=!0,t.registerListeners(),t}var s=c.prototype;return s.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},s.registerListeners=function(){var t=this.hls;t.on(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.on(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.on(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.on(J.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.on(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.on(J.Events.ERROR,this.onError,this)},s.unregisterListeners=function(){var t=this.hls;t.off(J.Events.MEDIA_ATTACHED,this.onMediaAttached,this),t.off(J.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(J.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(J.Events.MANIFEST_PARSED,this.onManifestParsed,this),t.off(J.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(J.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),t.off(J.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),t.off(J.Events.ERROR,this.onError,this)},s.onMediaAttached=function(t,u){if(this.media=u.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)},s.pollTrackChange=function(t){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,t)},s.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=p(this.media.textTracks);t.forEach(function(u){Object(K.clearCurrentCues)(u)}),this.subtitleTrack=-1,this.media=null},s.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},s.onManifestParsed=function(t,u){this.tracks=u.subtitleTracks},s.onSubtitleTrackLoaded=function(t,u){var o=u.id,R=u.details,T=this.trackId,S=this.tracksInGroup[T];if(!S){this.warn("Invalid subtitle track id "+o);return}var A=S.details;S.details=u.details,this.log("subtitle track "+o+" loaded ["+R.startSN+"-"+R.endSN+"]"),o===this.trackId&&(this.retryCount=0,this.playlistLoaded(o,u,A))},s.onLevelLoading=function(t,u){this.switchLevel(u.level)},s.onLevelSwitching=function(t,u){this.switchLevel(u.level)},s.switchLevel=function(t){var u=this.hls.levels[t];if(!(u!=null&&u.textGroupIds))return;var o=u.textGroupIds[u.urlId];if(this.groupId!==o){var R=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,T=this.tracks.filter(function(I){return!o||I.groupId===o});this.tracksInGroup=T;var S=this.findTrackId(R==null?void 0:R.name)||this.findTrackId();this.groupId=o;var A={subtitleTracks:T};this.log("Updating subtitle tracks, "+T.length+' track(s) found in "'+o+'" group-id'),this.hls.trigger(J.Events.SUBTITLE_TRACKS_UPDATED,A),S!==-1&&this.setSubtitleTrack(S,R)}},s.findTrackId=function(t){for(var u=this.tracksInGroup,o=0;o<u.length;o++){var R=u[o];if((!this.selectDefaultTrack||R.default)&&(!t||t===R.name))return R.id}return-1},s.onError=function(t,u){if(a.prototype.onError.call(this,t,u),u.fatal||!u.context)return;u.context.type===$.PlaylistContextType.SUBTITLE_TRACK&&u.context.id===this.trackId&&u.context.groupId===this.groupId&&this.retryLoadingOrFail(u)},s.loadPlaylist=function(t){var u=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(u)){var o=u.id,R=u.groupId,T=u.url;if(t)try{T=t.addDirectives(T)}catch(S){this.warn("Could not construct new URL with HLS Delivery Directives: "+S)}this.log("Loading subtitle playlist for id "+o),this.hls.trigger(J.Events.SUBTITLE_TRACK_LOADING,{url:T,id:o,groupId:R,deliveryDirectives:t||null})}},s.toggleTrackModes=function(t){var u=this,o=this.media,R=this.subtitleDisplay,T=this.trackId;if(!o)return;var S=p(o.textTracks),A=S.filter(function(b){return b.groupId===u.groupId});if(t===-1)[].slice.call(S).forEach(function(b){b.mode="disabled"});else{var I=A[T];I&&(I.mode="disabled")}var x=A[t];x&&(x.mode=R?"showing":"hidden")},s.setSubtitleTrack=function(t,u){var o,R=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=t;return}if(this.trackId!==t&&this.toggleTrackModes(t),this.trackId===t&&(t===-1||(o=R[t])!==null&&o!==void 0&&o.details)||t<-1||t>=R.length)return;this.clearTimer();var T=R[t];if(this.log("Switching to subtitle track "+t),this.trackId=t,T){var S=T.id,A=T.groupId,I=A===void 0?"":A,x=T.name,b=T.type,h=T.url;this.hls.trigger(J.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:I,name:x,type:b,url:h});var f=this.switchParams(T.url,u==null?void 0:u.details);this.loadPlaylist(f)}else this.hls.trigger(J.Events.SUBTITLE_TRACK_SWITCH,{id:t})},s.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var t=-1,u=p(this.media.textTracks),o=0;o<u.length;o++)if(u[o].mode==="hidden")t=o;else if(u[o].mode==="showing"){t=o;break}this.subtitleTrack!==t&&(this.subtitleTrack=t)},r(c,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(t){this.selectDefaultTrack=!1;var u=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(t,u)}}]),c}(N.default);function p(a){for(var c=[],s=0;s<a.length;s++){var i=a[s];i.kind==="subtitles"&&i.label&&c.push(a[s])}return c}Q.default=g},"./src/controller/timeline-controller.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"TimelineController",function(){return p});var J=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),N=B("./src/utils/cea-608-parser.ts"),$=B("./src/utils/output-filter.ts"),z=B("./src/utils/webvtt-parser.ts"),r=B("./src/utils/texttrack-utils.ts"),D=B("./src/utils/imsc1-ttml-parser.ts"),m=B("./src/types/loader.ts"),g=B("./src/utils/logger.ts"),p=function(){function i(u){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=s(),this.captionsProperties=void 0,this.hls=u,this.config=u.config,this.Cues=u.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 o=new $.default(this,"textTrack1"),R=new $.default(this,"textTrack2"),T=new $.default(this,"textTrack3"),S=new $.default(this,"textTrack4");this.cea608Parser1=new N.default(1,o,R),this.cea608Parser2=new N.default(3,T,S)}u.on(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),u.on(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),u.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),u.on(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),u.on(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),u.on(K.Events.FRAG_LOADING,this.onFragLoading,this),u.on(K.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(K.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),u.on(K.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),u.on(K.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),u.on(K.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),u.on(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var t=i.prototype;return t.destroy=function(){var o=this.hls;o.off(K.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(K.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(K.Events.MANIFEST_LOADED,this.onManifestLoaded,this),o.off(K.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),o.off(K.Events.FRAG_LOADING,this.onFragLoading,this),o.off(K.Events.FRAG_LOADED,this.onFragLoaded,this),o.off(K.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),o.off(K.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),o.off(K.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),o.off(K.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),o.off(K.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},t.addCues=function(o,R,T,S,A){for(var I=!1,x=A.length;x--;){var b=A[x],h=c(b[0],b[1],R,T);if(h>=0&&(b[0]=Math.min(b[0],R),b[1]=Math.max(b[1],T),I=!0,h/(T-R)>.5))return}if(I||A.push([R,T]),this.config.renderTextTracksNatively){var f=this.captionsTracks[o];this.Cues.newCue(f,R,T,S)}else{var C=this.Cues.newCue(null,R,T,S);this.hls.trigger(K.Events.CUES_PARSED,{type:"captions",cues:C,track:o})}},t.onInitPtsFound=function(o,R){var T=this,S=R.frag,A=R.id,I=R.initPTS,x=R.timescale,b=this.unparsedVttFrags;A==="main"&&(this.initPTS[S.cc]=I,this.timescale[S.cc]=x),b.length&&(this.unparsedVttFrags=[],b.forEach(function(h){T.onFragLoaded(K.Events.FRAG_LOADED,h)}))},t.getExistingTrack=function(o){var R=this.media;if(R)for(var T=0;T<R.textTracks.length;T++){var S=R.textTracks[T];if(S[o])return S}return null},t.createCaptionsTrack=function(o){this.config.renderTextTracksNatively?this.createNativeTrack(o):this.createNonNativeTrack(o)},t.createNativeTrack=function(o){if(this.captionsTracks[o])return;var R=this.captionsProperties,T=this.captionsTracks,S=this.media,A=R[o],I=A.label,x=A.languageCode,b=this.getExistingTrack(o);if(b)T[o]=b,Object(r.clearCurrentCues)(T[o]),Object(r.sendAddTrackEvent)(T[o],S);else{var h=this.createTextTrack("captions",I,x);h&&(h[o]=!0,T[o]=h)}},t.createNonNativeTrack=function(o){if(this.nonNativeCaptionsTracks[o])return;var R=this.captionsProperties[o];if(!R)return;var T=R.label,S={_id:o,label:T,kind:"captions",default:R.media?!!R.media.default:!1,closedCaptions:R.media};this.nonNativeCaptionsTracks[o]=S,this.hls.trigger(K.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[S]})},t.createTextTrack=function(o,R,T){var S=this.media;return S?S.addTextTrack(o,R,T):void 0},t.onMediaAttaching=function(o,R){this.media=R.media,this._cleanTracks()},t.onMediaDetaching=function(){var o=this.captionsTracks;Object.keys(o).forEach(function(R){Object(r.clearCurrentCues)(o[R]),delete o[R]}),this.nonNativeCaptionsTracks={}},t.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=s(),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 o=this.media;if(!o)return;var R=o.textTracks;if(R)for(var T=0;T<R.length;T++)Object(r.clearCurrentCues)(R[T])},t.onSubtitleTracksUpdated=function(o,R){var T=this;this.textTracks=[];var S=R.subtitleTracks||[],A=S.some(function(h){return h.textCodec===D.IMSC1_CODEC});if(this.config.enableWebVTT||A&&this.config.enableIMSC1){var I=this.tracks&&S&&this.tracks.length===S.length;if(this.tracks=S||[],this.config.renderTextTracksNatively){var x=this.media?this.media.textTracks:[];this.tracks.forEach(function(h,f){var C;if(f<x.length){for(var E=null,_=0;_<x.length;_++)if(a(x[_],h)){E=x[_];break}E&&(C=E)}C?Object(r.clearCurrentCues)(C):(C=T.createTextTrack("subtitles",h.name,h.lang),C&&(C.mode="disabled")),C&&(C.groupId=h.groupId,T.textTracks.push(C))})}else if(!I&&this.tracks&&this.tracks.length){var b=this.tracks.map(function(h){return{label:h.name,kind:h.type.toLowerCase(),default:h.default,subtitleTrack:h}});this.hls.trigger(K.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:b})}}},t.onManifestLoaded=function(o,R){var T=this;this.config.enableCEA708Captions&&R.captions&&R.captions.forEach(function(S){var A=/(?:CC|SERVICE)([1-4])/.exec(S.instreamId);if(!A)return;var I="textTrack"+A[1],x=T.captionsProperties[I];if(!x)return;x.label=S.name,S.lang&&(x.languageCode=S.lang),x.media=S})},t.onFragLoading=function(o,R){var T=this.cea608Parser1,S=this.cea608Parser2,A=this.lastSn,I=this.lastPartIndex;if(!this.enabled||!(T&&S))return;if(R.frag.type===m.PlaylistLevelType.MAIN){var x,b,h=R.frag.sn,f=(x=R==null||((b=R.part)===null||b===void 0)?void 0:b.index)!=null?x:-1;h===A+1||h===A&&f===I+1||(T.reset(),S.reset()),this.lastSn=h,this.lastPartIndex=f}},t.onFragLoaded=function(o,R){var T=R.frag,S=R.payload,A=this.initPTS,I=this.unparsedVttFrags;if(T.type===m.PlaylistLevelType.SUBTITLE)if(S.byteLength){if(!Object(J.isFiniteNumber)(A[T.cc])){I.push(R),A.length&&this.hls.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Missing initial subtitle PTS")});return}var x=T.decryptdata;if(x==null||x.key==null||x.method!=="AES-128"){var b=this.tracks[T.level],h=this.vttCCs;h[T.cc]||(h[T.cc]={start:T.start,prevCC:this.prevCC,new:!0},this.prevCC=T.cc),b&&b.textCodec===D.IMSC1_CODEC?this._parseIMSC1(T,S):this._parseVTTs(T,S,h)}}else this.hls.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:T,error:new Error("Empty subtitle payload")})},t._parseIMSC1=function(o,R){var T=this,S=this.hls;Object(D.parseIMSC1)(R,this.initPTS[o.cc],this.timescale[o.cc],function(A){T._appendCues(A,o.level),S.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(A){g.logger.log("Failed to parse IMSC1: "+A),S.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:A})})},t._parseVTTs=function(o,R,T){var S=this,A=this.hls;Object(z.parseWebVTT)(R,this.initPTS[o.cc],this.timescale[o.cc],T,o.cc,o.start,function(I){S._appendCues(I,o.level),A.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:o})},function(I){S._fallbackToIMSC1(o,R),g.logger.log("Failed to parse VTT cue: "+I),A.trigger(K.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:o,error:I})})},t._fallbackToIMSC1=function(o,R){var T=this,S=this.tracks[o.level];S.textCodec||Object(D.parseIMSC1)(R,this.initPTS[o.cc],this.timescale[o.cc],function(){S.textCodec=D.IMSC1_CODEC,T._parseIMSC1(o,R)},function(){S.textCodec="wvtt"})},t._appendCues=function(o,R){var T=this.hls;if(this.config.renderTextTracksNatively){var S=this.textTracks[R];if(S.mode==="disabled")return;o.forEach(function(x){return Object(r.addCueToTrack)(S,x)})}else{var A=this.tracks[R],I=A.default?"default":"subtitles"+R;T.trigger(K.Events.CUES_PARSED,{type:"subtitles",cues:o,track:I})}},t.onFragDecrypted=function(o,R){var T=R.frag;if(T.type===m.PlaylistLevelType.SUBTITLE){if(!Object(J.isFiniteNumber)(this.initPTS[T.cc])){this.unparsedVttFrags.push(R);return}this.onFragLoaded(K.Events.FRAG_LOADED,R)}},t.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},t.onFragParsingUserdata=function(o,R){var T=this.cea608Parser1,S=this.cea608Parser2;if(!this.enabled||!(T&&S))return;for(var A=0;A<R.samples.length;A++){var I=R.samples[A].bytes;if(I){var x=this.extractCea608Data(I);T.addData(R.samples[A].pts,x[0]),S.addData(R.samples[A].pts,x[1])}}},t.onBufferFlushing=function(o,R){var T=R.startOffset,S=R.endOffset,A=R.endOffsetSubtitles,I=R.type,x=this.media;if(!x||x.currentTime<S)return;if(!I||I==="video"){var b=this.captionsTracks;Object.keys(b).forEach(function(f){return Object(r.removeCuesInRange)(b[f],T,S)})}if(this.config.renderTextTracksNatively&&(T===0&&A!==void 0)){var h=this.textTracks;Object.keys(h).forEach(function(f){return Object(r.removeCuesInRange)(h[f],T,A)})}},t.extractCea608Data=function(o){for(var R=o[0]&31,T=2,S=[[],[]],A=0;A<R;A++){var I=o[T++],x=127&o[T++],b=127&o[T++],h=(4&I)!==0,f=3&I;if(x===0&&b===0)continue;h&&((f===0||f===1)&&(S[f].push(x),S[f].push(b)))}return S},i}();function a(i,t){return i&&i.label===t.name&&!(i.textTrack1||i.textTrack2)}function c(i,t,u,o){return Math.min(t,o)-Math.max(i,u)}function s(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return J});var J=function(){function K($,z){this.subtle=void 0,this.aesIV=void 0,this.subtle=$,this.aesIV=z}var N=K.prototype;return N.decrypt=function(z,r){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},r,z)},K}()},"./src/crypt/aes-decryptor.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"removePadding",function(){return K}),B.d(Q,"default",function(){return N});var J=B("./src/utils/typed-array.ts");function K($){var z=$.byteLength,r=z&&new DataView($.buffer).getUint8(z-1);return r?Object(J.sliceUint8)($,0,z-r):$}var N=function(){function $(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var z=$.prototype;return z.uint8ArrayToUint32Array_=function(D){for(var m=new DataView(D),g=new Uint32Array(4),p=0;p<4;p++)g[p]=m.getUint32(p*4);return g},z.initTable=function(){var D=this.sBox,m=this.invSBox,g=this.subMix,p=g[0],a=g[1],c=g[2],s=g[3],i=this.invSubMix,t=i[0],u=i[1],o=i[2],R=i[3],T=new Uint32Array(256),S=0,A=0,I=0;for(I=0;I<256;I++)I<128?T[I]=I<<1:T[I]=I<<1^283;for(I=0;I<256;I++){var x=A^A<<1^A<<2^A<<3^A<<4;x=x>>>8^x&255^99,D[S]=x,m[x]=S;var b=T[S],h=T[b],f=T[h],C=T[x]*257^x*16843008;p[S]=C<<24|C>>>8,a[S]=C<<16|C>>>16,c[S]=C<<8|C>>>24,s[S]=C,C=f*16843009^h*65537^b*257^S*16843008,t[x]=C<<24|C>>>8,u[x]=C<<16|C>>>16,o[x]=C<<8|C>>>24,R[x]=C,S?(S=b^T[T[T[f^b]]],A^=T[T[A]]):S=A=1}},z.expandKey=function(D){for(var m=this.uint8ArrayToUint32Array_(D),g=!0,p=0;p<m.length&&g;)g=m[p]===this.key[p],p++;if(g)return;this.key=m;var a=this.keySize=m.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var c=this.ksRows=(a+6+1)*4,s,i,t=this.keySchedule=new Uint32Array(c),u=this.invKeySchedule=new Uint32Array(c),o=this.sBox,R=this.rcon,T=this.invSubMix,S=T[0],A=T[1],I=T[2],x=T[3],b,h;for(s=0;s<c;s++){if(s<a){b=t[s]=m[s];continue}h=b,s%a===0?(h=h<<8|h>>>24,h=o[h>>>24]<<24|o[h>>>16&255]<<16|o[h>>>8&255]<<8|o[h&255],h^=R[s/a|0]<<24):a>6&&s%a===4&&(h=o[h>>>24]<<24|o[h>>>16&255]<<16|o[h>>>8&255]<<8|o[h&255]),t[s]=b=(t[s-a]^h)>>>0}for(i=0;i<c;i++)s=c-i,i&3?h=t[s]:h=t[s-4],i<4||s<=4?u[i]=h:u[i]=S[o[h>>>24]]^A[o[h>>>16&255]]^I[o[h>>>8&255]]^x[o[h&255]],u[i]=u[i]>>>0},z.networkToHostOrderSwap=function(D){return D<<24|(D&65280)<<8|(D&16711680)>>8|D>>>24},z.decrypt=function(D,m,g){for(var p=this.keySize+6,a=this.invKeySchedule,c=this.invSBox,s=this.invSubMix,i=s[0],t=s[1],u=s[2],o=s[3],R=this.uint8ArrayToUint32Array_(g),T=R[0],S=R[1],A=R[2],I=R[3],x=new Int32Array(D),b=new Int32Array(x.length),h,f,C,E,_,W,j,w,F,P,v,H,Y,ie,le=this.networkToHostOrderSwap;m<x.length;){for(F=le(x[m]),P=le(x[m+1]),v=le(x[m+2]),H=le(x[m+3]),_=F^a[0],W=H^a[1],j=v^a[2],w=P^a[3],Y=4,ie=1;ie<p;ie++)h=i[_>>>24]^t[W>>16&255]^u[j>>8&255]^o[w&255]^a[Y],f=i[W>>>24]^t[j>>16&255]^u[w>>8&255]^o[_&255]^a[Y+1],C=i[j>>>24]^t[w>>16&255]^u[_>>8&255]^o[W&255]^a[Y+2],E=i[w>>>24]^t[_>>16&255]^u[W>>8&255]^o[j&255]^a[Y+3],_=h,W=f,j=C,w=E,Y=Y+4;h=c[_>>>24]<<24^c[W>>16&255]<<16^c[j>>8&255]<<8^c[w&255]^a[Y],f=c[W>>>24]<<24^c[j>>16&255]<<16^c[w>>8&255]<<8^c[_&255]^a[Y+1],C=c[j>>>24]<<24^c[w>>16&255]<<16^c[_>>8&255]<<8^c[W&255]^a[Y+2],E=c[w>>>24]<<24^c[_>>16&255]<<16^c[W>>8&255]<<8^c[j&255]^a[Y+3],b[m]=le(h^T),b[m+1]=le(E^S),b[m+2]=le(C^A),b[m+3]=le(f^I),T=F,S=P,A=v,I=H,m=m+4}return b.buffer},$}()},"./src/crypt/decrypter.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return m});var J=B("./src/crypt/aes-crypto.ts"),K=B("./src/crypt/fast-aes-key.ts"),N=B("./src/crypt/aes-decryptor.ts"),$=B("./src/utils/logger.ts"),z=B("./src/utils/mp4-tools.ts"),r=B("./src/utils/typed-array.ts"),D=16,m=function(){function g(a,c,s){var i=s===void 0?{}:s,t=i.removePKCS7Padding,u=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=a,this.config=c,this.removePKCS7Padding=u,u)try{var o=self.crypto;o&&(this.subtle=o.subtle||o.webkitSubtle)}catch(R){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var p=g.prototype;return p.destroy=function(){this.observer=null},p.isSync=function(){return this.config.enableSoftwareAES},p.flush=function(){var c=this.currentResult;if(!c){this.reset();return}var s=new Uint8Array(c);return this.reset(),this.removePKCS7Padding?Object(N.removePadding)(s):s},p.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},p.decrypt=function(c,s,i,t){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(c),s,i);var u=this.flush();u&&t(u.buffer)}else this.webCryptoDecrypt(new Uint8Array(c),s,i).then(t)},p.softwareDecrypt=function(c,s,i){var t=this.currentIV,u=this.currentResult,o=this.remainderData;this.logOnce("JS AES decrypt"),o&&(c=Object(z.appendUint8Array)(o,c),this.remainderData=null);var R=this.getValidChunk(c);if(!R.length)return null;t&&(i=t);var T=this.softwareDecrypter;T||(T=this.softwareDecrypter=new N.default),T.expandKey(s);var S=u;return this.currentResult=T.decrypt(R.buffer,0,i),this.currentIV=Object(r.sliceUint8)(R,-16).buffer,S||null},p.webCryptoDecrypt=function(c,s,i){var t=this,u=this.subtle;return(this.key!==s||!this.fastAesKey)&&(this.key=s,this.fastAesKey=new K.default(u,s)),this.fastAesKey.expandKey().then(function(o){if(!u)return Promise.reject(new Error("web crypto not initialized"));var R=new J.default(u,i);return R.decrypt(c.buffer,o)}).catch(function(o){return t.onWebCryptoError(o,c,s,i)})},p.onWebCryptoError=function(c,s,i,t){return $.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",c),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(s,i,t)},p.getValidChunk=function(c){var s=c,i=c.length-c.length%D;return i!==c.length&&(s=Object(r.sliceUint8)(c,0,i),this.remainderData=Object(r.sliceUint8)(c,i)),s},p.logOnce=function(c){if(!this.logEnabled)return;$.logger.log("[decrypter.ts]: "+c),this.logEnabled=!1},g}()},"./src/crypt/fast-aes-key.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return J});var J=function(){function K($,z){this.subtle=void 0,this.key=void 0,this.subtle=$,this.key=z}var N=K.prototype;return N.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},K}()},"./src/demux/aacdemuxer.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/demux/base-audio-demuxer.ts"),K=B("./src/demux/adts.ts"),N=B("./src/utils/logger.ts"),$=B("./src/demux/id3.ts");function z(m,g){m.prototype=Object.create(g.prototype),m.prototype.constructor=m,r(m,g)}function r(m,g){return r=Object.setPrototypeOf||function(a,c){return a.__proto__=c,a},r(m,g)}var D=function(m){z(g,m);function g(a,c){var s;return s=m.call(this)||this,s.observer=void 0,s.config=void 0,s.observer=a,s.config=c,s}var p=g.prototype;return p.resetInitSegment=function(c,s,i){m.prototype.resetInitSegment.call(this,c,s,i),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:c,duration:i,inputTimeScale:9e4,dropped:0}},g.probe=function(c){if(!c)return!1;for(var s=$.getID3Data(c,0)||[],i=s.length,t=c.length;i<t;i++)if(K.probe(c,i))return N.logger.log("ADTS sync word found !"),!0;return!1},p.canParse=function(c,s){return K.canParse(c,s)},p.appendFrame=function(c,s,i){K.initTrackConfig(c,this.observer,s,i,c.manifestCodec);var t=K.appendFrame(c,s,i,this.initPTS,this.frameIndex);if(t&&t.missing===0)return t},g}(J.default);D.minProbeByteLength=9,Q.default=D},"./src/demux/adts.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"getAudioConfig",function(){return $}),B.d(Q,"isHeaderPattern",function(){return z}),B.d(Q,"getHeaderLength",function(){return r}),B.d(Q,"getFullFrameLength",function(){return D}),B.d(Q,"canGetFrameLength",function(){return m}),B.d(Q,"isHeader",function(){return g}),B.d(Q,"canParse",function(){return p}),B.d(Q,"probe",function(){return a}),B.d(Q,"initTrackConfig",function(){return c}),B.d(Q,"getFrameDuration",function(){return s}),B.d(Q,"parseFrameHeader",function(){return i}),B.d(Q,"appendFrame",function(){return t});var J=B("./src/utils/logger.ts"),K=B("./src/errors.ts"),N=B("./src/events.ts");function $(u,o,R,T){var S,A,I,x,b=navigator.userAgent.toLowerCase(),h=T,f=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];S=((o[R+2]&192)>>>6)+1;var C=(o[R+2]&60)>>>2;if(C>f.length-1){u.trigger(N.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+C});return}return I=(o[R+2]&1)<<2,I|=(o[R+3]&192)>>>6,J.logger.log("manifest codec:"+T+", ADTS type:"+S+", samplingIndex:"+C),/firefox/i.test(b)?C>=6?(S=5,x=new Array(4),A=C-3):(S=2,x=new Array(2),A=C):b.indexOf("android")!==-1?(S=2,x=new Array(2),A=C):(S=5,x=new Array(4),T&&(T.indexOf("mp4a.40.29")!==-1||T.indexOf("mp4a.40.5")!==-1)||!T&&C>=6?A=C-3:((T&&T.indexOf("mp4a.40.2")!==-1&&(C>=6&&I===1||/vivaldi/i.test(b))||!T&&I===1)&&(S=2,x=new Array(2)),A=C)),x[0]=S<<3,x[0]|=(C&14)>>1,x[1]|=(C&1)<<7,x[1]|=I<<3,S===5&&(x[1]|=(A&14)>>1,x[2]=(A&1)<<7,x[2]|=2<<2,x[3]=0),{config:x,samplerate:f[C],channelCount:I,codec:"mp4a.40."+S,manifestCodec:h}}function z(u,o){return u[o]===255&&(u[o+1]&246)===240}function r(u,o){return u[o+1]&1?7:9}function D(u,o){return(u[o+3]&3)<<11|u[o+4]<<3|(u[o+5]&224)>>>5}function m(u,o){return o+5<u.length}function g(u,o){return o+1<u.length&&z(u,o)}function p(u,o){return m(u,o)&&z(u,o)&&D(u,o)<=u.length-o}function a(u,o){if(g(u,o)){var R=r(u,o);if(o+R>=u.length)return!1;var T=D(u,o);if(T<=R)return!1;var S=o+T;return S===u.length||g(u,S)}return!1}function c(u,o,R,T,S){if(!u.samplerate){var A=$(o,R,T,S);if(!A)return;u.config=A.config,u.samplerate=A.samplerate,u.channelCount=A.channelCount,u.codec=A.codec,u.manifestCodec=A.manifestCodec,J.logger.log("parsed codec:"+u.codec+", rate:"+A.samplerate+", channels:"+A.channelCount)}}function s(u){return 1024*9e4/u}function i(u,o,R,T,S){var A=r(u,o),I=D(u,o);if(I-=A,I>0){var x=R+T*S;return{headerLength:A,frameLength:I,stamp:x}}}function t(u,o,R,T,S){var A=s(u.samplerate),I=i(o,R,T,S,A);if(I){var x=I.frameLength,b=I.headerLength,h=I.stamp,f=b+x,C=Math.max(0,R+f-o.length),E;C?(E=new Uint8Array(f-b),E.set(o.subarray(R+b,o.length),0)):E=o.subarray(R+b,R+f);var _={unit:E,pts:h};return C||u.samples.push(_),{sample:_,length:f,missing:C}}}},"./src/demux/base-audio-demuxer.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"initPTSFn",function(){return D});var J=B("./src/polyfills/number.ts"),K=B("./src/demux/id3.ts"),N=B("./src/demux/dummy-demuxed-track.ts"),$=B("./src/utils/mp4-tools.ts"),z=B("./src/utils/typed-array.ts"),r=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(a,c,s){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},g.resetTimeStamp=function(){},g.resetContiguity=function(){},g.canParse=function(a,c){return!1},g.appendFrame=function(a,c,s){},g.demux=function(a,c){this.cachedData&&(a=Object($.appendUint8Array)(this.cachedData,a),this.cachedData=null);var s=K.getID3Data(a,0),i=s?s.length:0,t,u,o=this._audioTrack,R=this._id3Track,T=s?K.getTimeStamp(s):void 0,S=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(T,c)),s&&s.length>0&&R.samples.push({pts:this.initPTS,dts:this.initPTS,data:s}),u=this.initPTS;i<S;){if(this.canParse(a,i)){var A=this.appendFrame(o,a,i);A?(this.frameIndex++,u=A.sample.pts,i+=A.length,t=i):i=S}else K.canParse(a,i)?(s=K.getID3Data(a,i),R.samples.push({pts:u,dts:u,data:s}),i+=s.length,t=i):i++;if(i===S&&t!==S){var I=Object(z.sliceUint8)(a,t);this.cachedData?this.cachedData=Object($.appendUint8Array)(this.cachedData,I):this.cachedData=I}}return{audioTrack:o,avcTrack:Object(N.dummyTrack)(),id3Track:R,textTrack:Object(N.dummyTrack)()}},g.demuxSampleAes=function(a,c,s){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},g.flush=function(a){var c=this.cachedData;return c&&(this.cachedData=null,this.demux(c,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(N.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(N.dummyTrack)()}},g.destroy=function(){},m}(),D=function(g,p){return Object(J.isFiniteNumber)(g)?g*90:p*9e4};Q.default=r},"./src/demux/chunk-cache.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return J});var J=function(){function N(){this.chunks=[],this.dataLength=0}var $=N.prototype;return $.push=function(r){this.chunks.push(r),this.dataLength+=r.length},$.flush=function(){var r=this.chunks,D=this.dataLength,m;if(r.length)r.length===1?m=r[0]:m=K(r,D);else return new Uint8Array(0);return this.reset(),m},$.reset=function(){this.chunks.length=0,this.dataLength=0},N}();function K(N,$){for(var z=new Uint8Array($),r=0,D=0;D<N.length;D++){var m=N[D];z.set(m,r),r+=m.length}return z}},"./src/demux/dummy-demuxed-track.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"dummyTrack",function(){return J});function J(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/utils/logger.ts"),K=function(){function N(z){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=z,this.bytesAvailable=z.byteLength,this.word=0,this.bitsAvailable=0}var $=N.prototype;return $.loadWord=function(){var r=this.data,D=this.bytesAvailable,m=r.byteLength-D,g=new Uint8Array(4),p=Math.min(4,D);if(p===0)throw new Error("no bytes available");g.set(r.subarray(m,m+p)),this.word=new DataView(g.buffer).getUint32(0),this.bitsAvailable=p*8,this.bytesAvailable-=p},$.skipBits=function(r){var D;this.bitsAvailable>r?(this.word<<=r,this.bitsAvailable-=r):(r-=this.bitsAvailable,D=r>>3,r-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=r,this.bitsAvailable-=r)},$.readBits=function(r){var D=Math.min(this.bitsAvailable,r),m=this.word>>>32-D;return r>32&&J.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=r-D,D>0&&this.bitsAvailable?m<<D|this.readBits(D):m},$.skipLZ=function(){var r;for(r=0;r<this.bitsAvailable;++r)if((this.word&2147483648>>>r)!==0)return this.word<<=r,this.bitsAvailable-=r,r;return this.loadWord(),r+this.skipLZ()},$.skipUEG=function(){this.skipBits(1+this.skipLZ())},$.skipEG=function(){this.skipBits(1+this.skipLZ())},$.readUEG=function(){var r=this.skipLZ();return this.readBits(r+1)-1},$.readEG=function(){var r=this.readUEG();return 1&r?1+r>>>1:-1*(r>>>1)},$.readBoolean=function(){return this.readBits(1)===1},$.readUByte=function(){return this.readBits(8)},$.readUShort=function(){return this.readBits(16)},$.readUInt=function(){return this.readBits(32)},$.skipScalingList=function(r){for(var D=8,m=8,g,p=0;p<r;p++)m!==0&&(g=this.readEG(),m=(D+g+256)%256),D=m===0?D:m},$.readSPS=function(){var r=0,D=0,m=0,g=0,p,a,c,s=this.readUByte.bind(this),i=this.readBits.bind(this),t=this.readUEG.bind(this),u=this.readBoolean.bind(this),o=this.skipBits.bind(this),R=this.skipEG.bind(this),T=this.skipUEG.bind(this),S=this.skipScalingList.bind(this);s();var A=s();if(i(5),o(3),s(),T(),A===100||A===110||A===122||A===244||A===44||A===83||A===86||A===118||A===128){var I=t();if(I===3&&o(1),T(),T(),o(1),u())for(a=I!==3?8:12,c=0;c<a;c++)u()&&(c<6?S(16):S(64))}T();var x=t();if(x===0)t();else if(x===1)for(o(1),R(),R(),p=t(),c=0;c<p;c++)R();T(),o(1);var b=t(),h=t(),f=i(1);f===0&&o(1),o(1),u()&&(r=t(),D=t(),m=t(),g=t());var C=[1,1];if(u()&&u()){var E=s();switch(E){case 1:C=[1,1];break;case 2:C=[12,11];break;case 3:C=[10,11];break;case 4:C=[16,11];break;case 5:C=[40,33];break;case 6:C=[24,11];break;case 7:C=[20,11];break;case 8:C=[32,11];break;case 9:C=[80,33];break;case 10:C=[18,11];break;case 11:C=[15,11];break;case 12:C=[64,33];break;case 13:C=[160,99];break;case 14:C=[4,3];break;case 15:C=[3,2];break;case 16:C=[2,1];break;case 255:{C=[s()<<8|s(),s()<<8|s()];break}}}return{width:Math.ceil((b+1)*16-r*2-D*2),height:(2-f)*(h+1)*16-(f?2:4)*(m+g),pixelRatio:C}},$.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},N}();Q.default=K},"./src/demux/id3.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"isHeader",function(){return J}),B.d(Q,"isFooter",function(){return K}),B.d(Q,"getID3Data",function(){return N}),B.d(Q,"canParse",function(){return z}),B.d(Q,"getTimeStamp",function(){return r}),B.d(Q,"isTimeStampFrame",function(){return D}),B.d(Q,"getID3Frames",function(){return g}),B.d(Q,"decodeFrame",function(){return p}),B.d(Q,"utf8ArrayToStr",function(){return t}),B.d(Q,"testables",function(){return u});var J=function(S,A){return A+10<=S.length&&(S[A]===73&&S[A+1]===68&&S[A+2]===51&&(S[A+3]<255&&S[A+4]<255&&(S[A+6]<128&&S[A+7]<128&&S[A+8]<128&&S[A+9]<128)))},K=function(S,A){return A+10<=S.length&&(S[A]===51&&S[A+1]===68&&S[A+2]===73&&(S[A+3]<255&&S[A+4]<255&&(S[A+6]<128&&S[A+7]<128&&S[A+8]<128&&S[A+9]<128)))},N=function(S,A){for(var I=A,x=0;J(S,A);){x+=10;var b=$(S,A+6);x+=b,K(S,A+10)&&(x+=10),A+=x}return x>0?S.subarray(I,I+x):void 0},$=function(S,A){var I=0;return I=(S[A]&127)<<21,I|=(S[A+1]&127)<<14,I|=(S[A+2]&127)<<7,I|=S[A+3]&127,I},z=function(S,A){return J(S,A)&&$(S,A+6)+10<=S.length-A},r=function(S){for(var A=g(S),I=0;I<A.length;I++){var x=A[I];if(D(x))return i(x)}return},D=function(S){return S&&S.key==="PRIV"&&S.info==="com.apple.streaming.transportStreamTimestamp"},m=function(S){var A=String.fromCharCode(S[0],S[1],S[2],S[3]),I=$(S,4),x=10;return{type:A,size:I,data:S.subarray(x,x+I)}},g=function(S){for(var A=0,I=[];J(S,A);){var x=$(S,A+6);A+=10;for(var b=A+x;A+8<b;){var h=m(S.subarray(A)),f=p(h);f&&I.push(f),A+=h.size+10}K(S,A)&&(A+=10)}return I},p=function(S){return S.type==="PRIV"?a(S):S.type[0]==="W"?s(S):c(S)},a=function(S){if(S.size<2)return;var A=t(S.data,!0),I=new Uint8Array(S.data.subarray(A.length+1));return{key:S.type,info:A,data:I.buffer}},c=function(S){if(S.size<2)return;if(S.type==="TXXX"){var A=1,I=t(S.data.subarray(A),!0);A+=I.length+1;var x=t(S.data.subarray(A));return{key:S.type,info:I,data:x}}var b=t(S.data.subarray(1));return{key:S.type,data:b}},s=function(S){if(S.type==="WXXX"){if(S.size<2)return;var A=1,I=t(S.data.subarray(A),!0);A+=I.length+1;var x=t(S.data.subarray(A));return{key:S.type,info:I,data:x}}var b=t(S.data);return{key:S.type,data:b}},i=function(S){if(S.data.byteLength===8){var A=new Uint8Array(S.data),I=A[3]&1,x=(A[4]<<23)+(A[5]<<15)+(A[6]<<7)+A[7];return x/=45,I&&(x+=4772185884e-2),Math.round(x)}return},t=function(S,A){A===void 0&&(A=!1);var I=R();if(I){var x=I.decode(S);if(A){var b=x.indexOf("\0");return b!==-1?x.substring(0,b):x}return x.replace(/\0/g,"")}for(var h=S.length,f,C,E,_="",W=0;W<h;){if(f=S[W++],f===0&&A)return _;if(f===0||f===3)continue;switch(f>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:_+=String.fromCharCode(f);break;case 12:case 13:C=S[W++],_+=String.fromCharCode((f&31)<<6|C&63);break;case 14:C=S[W++],E=S[W++],_+=String.fromCharCode((f&15)<<12|(C&63)<<6|(E&63)<<0);break;default:}}return _},u={decodeTextFrame:c},o;function R(){return!o&&typeof self.TextDecoder!="undefined"&&(o=new self.TextDecoder("utf-8")),o}},"./src/demux/mp3demuxer.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/demux/base-audio-demuxer.ts"),K=B("./src/demux/id3.ts"),N=B("./src/utils/logger.ts"),$=B("./src/demux/mpegaudio.ts");function z(m,g){m.prototype=Object.create(g.prototype),m.prototype.constructor=m,r(m,g)}function r(m,g){return r=Object.setPrototypeOf||function(a,c){return a.__proto__=c,a},r(m,g)}var D=function(m){z(g,m);function g(){return m.apply(this,arguments)||this}var p=g.prototype;return p.resetInitSegment=function(c,s,i){m.prototype.resetInitSegment.call(this,c,s,i),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:c,duration:i,inputTimeScale:9e4,dropped:0}},g.probe=function(c){if(!c)return!1;for(var s=K.getID3Data(c,0)||[],i=s.length,t=c.length;i<t;i++)if($.probe(c,i))return N.logger.log("MPEG Audio sync word found !"),!0;return!1},p.canParse=function(c,s){return $.canParse(c,s)},p.appendFrame=function(c,s,i){return this.initPTS===null?void 0:$.appendFrame(c,s,i,this.initPTS,this.frameIndex)},g}(J.default);D.minProbeByteLength=4,Q.default=D},"./src/demux/mp4demuxer.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/utils/mp4-tools.ts"),K=B("./src/demux/dummy-demuxed-track.ts"),N=function(){function $(r,D){this.remainderData=null,this.config=void 0,this.config=D}var z=$.prototype;return z.resetTimeStamp=function(){},z.resetInitSegment=function(){},z.resetContiguity=function(){},$.probe=function(D){return Object(J.findBox)({data:D,start:0,end:Math.min(D.length,16384)},["moof"]).length>0},z.demux=function(D){var m=D,g=Object(K.dummyTrack)();if(this.config.progressive){this.remainderData&&(m=Object(J.appendUint8Array)(this.remainderData,D));var p=Object(J.segmentValidRange)(m);this.remainderData=p.remainder,g.samples=p.valid||new Uint8Array}else g.samples=m;return{audioTrack:Object(K.dummyTrack)(),avcTrack:g,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},z.flush=function(){var D=Object(K.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(K.dummyTrack)(),avcTrack:D,id3Track:Object(K.dummyTrack)(),textTrack:Object(K.dummyTrack)()}},z.demuxSampleAes=function(D,m,g){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},z.destroy=function(){},$}();N.minProbeByteLength=1024,Q.default=N},"./src/demux/mpegaudio.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"appendFrame",function(){return r}),B.d(Q,"parseHeader",function(){return D}),B.d(Q,"isHeaderPattern",function(){return m}),B.d(Q,"isHeader",function(){return g}),B.d(Q,"canParse",function(){return p}),B.d(Q,"probe",function(){return a});var J=null,K=[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],N=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],$=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],z=[0,1,1,4];function r(c,s,i,t,u){if(i+24>s.length)return;var o=D(s,i);if(o&&i+o.frameLength<=s.length){var R=o.samplesPerFrame*9e4/o.sampleRate,T=t+u*R,S={unit:s.subarray(i,i+o.frameLength),pts:T,dts:T};return c.config=[],c.channelCount=o.channelCount,c.samplerate=o.sampleRate,c.samples.push(S),{sample:S,length:o.frameLength,missing:0}}}function D(c,s){var i=c[s+1]>>3&3,t=c[s+1]>>1&3,u=c[s+2]>>4&15,o=c[s+2]>>2&3;if(i!==1&&u!==0&&u!==15&&o!==3){var R=c[s+2]>>1&1,T=c[s+3]>>6,S=i===3?3-t:t===3?3:4,A=K[S*14+u-1]*1e3,I=i===3?0:i===2?1:2,x=N[I*3+o],b=T===3?1:2,h=$[i][t],f=z[t],C=h*8*f,E=Math.floor(h*A/x+R)*f;if(J===null){var _=navigator.userAgent||"",W=_.match(/Chrome\/(\d+)/i);J=W?parseInt(W[1]):0}var j=!!J&&J<=87;return j&&t===2&&A>=224e3&&T===0&&(c[s+3]=c[s+3]|128),{sampleRate:x,channelCount:b,frameLength:E,samplesPerFrame:C}}}function m(c,s){return c[s]===255&&(c[s+1]&224)===224&&(c[s+1]&6)!==0}function g(c,s){return s+1<c.length&&m(c,s)}function p(c,s){var i=4;return m(c,s)&&i<=c.length-s}function a(c,s){if(s+1<c.length&&m(c,s)){var i=4,t=D(c,s),u=i;t!=null&&t.frameLength&&(u=t.frameLength);var o=s+u;return o===c.length||g(c,o)}return!1}},"./src/demux/sample-aes.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/crypt/decrypter.ts"),K=B("./src/demux/tsdemuxer.ts"),N=function(){function $(r,D,m){this.keyData=void 0,this.decrypter=void 0,this.keyData=m,this.decrypter=new J.default(r,D,{removePKCS7Padding:!1})}var z=$.prototype;return z.decryptBuffer=function(D,m){this.decrypter.decrypt(D,this.keyData.key.buffer,this.keyData.iv.buffer,m)},z.decryptAacSample=function(D,m,g,p){var a=D[m].unit,c=a.subarray(16,a.length-a.length%16),s=c.buffer.slice(c.byteOffset,c.byteOffset+c.length),i=this;this.decryptBuffer(s,function(t){var u=new Uint8Array(t);a.set(u,16),p||i.decryptAacSamples(D,m+1,g)})},z.decryptAacSamples=function(D,m,g){for(;;m++){if(m>=D.length){g();return}if(D[m].unit.length<32)continue;var p=this.decrypter.isSync();if(this.decryptAacSample(D,m,g,p),!p)return}},z.getAvcEncryptedData=function(D){for(var m=Math.floor((D.length-48)/160)*16+16,g=new Int8Array(m),p=0,a=32;a<=D.length-16;a+=160,p+=16)g.set(D.subarray(a,a+16),p);return g},z.getAvcDecryptedUnit=function(D,m){for(var g=new Uint8Array(m),p=0,a=32;a<=D.length-16;a+=160,p+=16)D.set(g.subarray(p,p+16),a);return D},z.decryptAvcSample=function(D,m,g,p,a,c){var s=Object(K.discardEPB)(a.data),i=this.getAvcEncryptedData(s),t=this;this.decryptBuffer(i.buffer,function(u){a.data=t.getAvcDecryptedUnit(s,u),c||t.decryptAvcSamples(D,m,g+1,p)})},z.decryptAvcSamples=function(D,m,g,p){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;m++,g=0){if(m>=D.length){p();return}for(var a=D[m].units;!(g>=a.length);g++){var c=a[g];if(c.data.length<=48||c.type!==1&&c.type!==5)continue;var s=this.decrypter.isSync();if(this.decryptAvcSample(D,m,g,p,c,s),!s)return}}},$}();Q.default=N},"./src/demux/transmuxer-interface.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a});var J=B("./node_modules/webworkify-webpack/index.js"),K=B.n(J),N=B("./src/events.ts"),$=B("./src/demux/transmuxer.ts"),z=B("./src/utils/logger.ts"),r=B("./src/errors.ts"),D=B("./src/utils/mediasource-helper.ts"),m=B("./node_modules/eventemitter3/index.js"),g=B.n(m),p=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function c(i,t,u,o){var R=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.hls=i,this.id=t,this.onTransmuxComplete=u,this.onFlush=o;var T=i.config,S=function(h,f){f=f||{},f.frag=R.frag,f.id=R.id,i.trigger(h,f)};this.observer=new m.EventEmitter,this.observer.on(N.Events.FRAG_DECRYPTED,S),this.observer.on(N.Events.ERROR,S);var A={mp4:p.isTypeSupported("video/mp4"),mpeg:p.isTypeSupported("audio/mpeg"),mp3:p.isTypeSupported('audio/mp4; codecs="mp3"')},I=navigator.vendor;if(T.enableWorker&&typeof Worker!="undefined"){z.logger.log("demuxing in webworker");var x;try{x=this.worker=J("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),x.addEventListener("message",this.onwmsg),x.onerror=function(b){i.trigger(N.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(b.message+" ("+b.filename+":"+b.lineno+")")})},x.postMessage({cmd:"init",typeSupported:A,vendor:I,id:t,config:JSON.stringify(T)})}catch(b){z.logger.warn("Error in worker:",b),z.logger.error("Error while initializing DemuxerWorker, fallback to inline"),x&&self.URL.revokeObjectURL(x.objectURL),this.transmuxer=new $.default(this.observer,A,T,I,t),this.worker=null}}else this.transmuxer=new $.default(this.observer,A,T,I,t)}var s=c.prototype;return s.destroy=function(){var t=this.worker;if(t)t.removeEventListener("message",this.onwmsg),t.terminate(),this.worker=null;else{var u=this.transmuxer;u&&(u.destroy(),this.transmuxer=null)}var o=this.observer;o&&o.removeAllListeners(),this.observer=null},s.push=function(t,u,o,R,T,S,A,I,x,b){var h=this;x.transmuxing.start=self.performance.now();var f=this.transmuxer,C=this.worker,E=S?S.start:T.start,_=T.decryptdata,W=this.frag,j=!(W&&T.cc===W.cc),w=!(W&&x.level===W.level),F=W?x.sn-W.sn:-1,P=this.part?x.part-this.part.index:1,v=!w&&(F===1||F===0&&P===1),H=self.performance.now();(w||F||T.stats.parsing.start===0)&&(T.stats.parsing.start=H),S&&(P||!v)&&(S.stats.parsing.start=H);var Y=new $.TransmuxState(j,v,I,w,E);if(!v||j){z.logger.log("[transmuxer-interface, "+T.type+"]: Starting new transmux session for sn: "+x.sn+" p: "+x.part+" level: "+x.level+" id: "+x.id+`
discontinuity: `+j+`
trackSwitch: `+w+`
contiguous: `+v+`
accurateTimeOffset: `+I+`
timeOffset: `+E);var ie=new $.TransmuxConfig(o,R,u,A,b);this.configureTransmuxer(ie)}if(this.frag=T,this.part=S,C)C.postMessage({cmd:"demux",data:t,decryptdata:_,chunkMeta:x,state:Y},t instanceof ArrayBuffer?[t]:[]);else if(f){var le=f.push(t,_,x,Y);Object($.isPromise)(le)?le.then(function(he){h.handleTransmuxComplete(he)}):this.handleTransmuxComplete(le)}},s.flush=function(t){var u=this;t.transmuxing.start=self.performance.now();var o=this.transmuxer,R=this.worker;if(R)R.postMessage({cmd:"flush",chunkMeta:t});else if(o){var T=o.flush(t);Object($.isPromise)(T)?T.then(function(S){u.handleFlushResult(S,t)}):this.handleFlushResult(T,t)}},s.handleFlushResult=function(t,u){var o=this;t.forEach(function(R){o.handleTransmuxComplete(R)}),this.onFlush(u)},s.onWorkerMessage=function(t){var u=t.data,o=this.hls;switch(u.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(u.data);break}case"flush":{this.onFlush(u.data);break}default:{u.data=u.data||{},u.data.frag=this.frag,u.data.id=this.id,o.trigger(u.event,u.data);break}}},s.configureTransmuxer=function(t){var u=this.worker,o=this.transmuxer;u?u.postMessage({cmd:"configure",config:t}):o&&o.configure(t)},s.handleTransmuxComplete=function(t){t.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(t)},c}()},"./src/demux/transmuxer-worker.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return r});var J=B("./src/demux/transmuxer.ts"),K=B("./src/events.ts"),N=B("./src/utils/logger.ts"),$=B("./node_modules/eventemitter3/index.js"),z=B.n($);function r(a){var c=new $.EventEmitter,s=function(t,u){a.postMessage({event:t,data:u})};c.on(K.Events.FRAG_DECRYPTED,s),c.on(K.Events.ERROR,s),a.addEventListener("message",function(i){var t=i.data;switch(t.cmd){case"init":{var u=JSON.parse(t.config);a.transmuxer=new J.default(c,t.typeSupported,u,t.vendor,t.id),Object(N.enableLogs)(u.debug),s("init",null);break}case"configure":{a.transmuxer.configure(t.config);break}case"demux":{var o=a.transmuxer.push(t.data,t.decryptdata,t.chunkMeta,t.state);Object(J.isPromise)(o)?o.then(function(S){D(a,S)}):D(a,o);break}case"flush":{var R=t.chunkMeta,T=a.transmuxer.flush(R);Object(J.isPromise)(T)?T.then(function(S){g(a,S,R)}):g(a,T,R);break}default:break}})}function D(a,c){if(p(c.remuxResult))return;var s=[],i=c.remuxResult,t=i.audio,u=i.video;t&&m(s,t),u&&m(s,u),a.postMessage({event:"transmuxComplete",data:c},s)}function m(a,c){c.data1&&a.push(c.data1.buffer),c.data2&&a.push(c.data2.buffer)}function g(a,c,s){c.forEach(function(i){D(a,i)}),a.postMessage({event:"flush",data:s})}function p(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return u}),B.d(Q,"isPromise",function(){return T}),B.d(Q,"TransmuxConfig",function(){return S}),B.d(Q,"TransmuxState",function(){return A});var J=B("./src/events.ts"),K=B("./src/errors.ts"),N=B("./src/crypt/decrypter.ts"),$=B("./src/demux/aacdemuxer.ts"),z=B("./src/demux/mp4demuxer.ts"),r=B("./src/demux/tsdemuxer.ts"),D=B("./src/demux/mp3demuxer.ts"),m=B("./src/remux/mp4-remuxer.ts"),g=B("./src/remux/passthrough-remuxer.ts"),p=B("./src/demux/chunk-cache.ts"),a=B("./src/utils/mp4-tools.ts"),c=B("./src/utils/logger.ts"),s;try{s=self.performance.now.bind(self.performance)}catch(I){c.logger.debug("Unable to use Performance API on this environment"),s=self.Date.now}var i=[{demux:r.default,remux:m.default},{demux:z.default,remux:g.default},{demux:$.default,remux:m.default},{demux:D.default,remux:m.default}],t=1024;i.forEach(function(I){var x=I.demux;t=Math.max(t,x.minProbeByteLength)});var u=function(){function I(b,h,f,C,E){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 p.default,this.observer=b,this.typeSupported=h,this.config=f,this.vendor=C,this.id=E}var x=I.prototype;return x.configure=function(h){this.transmuxConfig=h,this.decrypter&&this.decrypter.reset()},x.push=function(h,f,C,E){var _=this,W=C.transmuxing;W.executeStart=s();var j=new Uint8Array(h),w=this.cache,F=this.config,P=this.currentTransmuxState,v=this.transmuxConfig;E&&(this.currentTransmuxState=E);var H=o(j,f);if(H&&H.method==="AES-128"){var Y=this.getDecrypter();if(F.enableSoftwareAES){var ie=Y.softwareDecrypt(j,H.key.buffer,H.iv.buffer);if(!ie)return W.executeEnd=s(),R(C);j=new Uint8Array(ie)}else return this.decryptionPromise=Y.webCryptoDecrypt(j,H.key.buffer,H.iv.buffer).then(function(ot){var _t=_.push(ot,null,C);return _.decryptionPromise=null,_t}),this.decryptionPromise}var le=E||P,he=le.contiguous,xe=le.discontinuity,Le=le.trackSwitch,we=le.accurateTimeOffset,Ae=le.timeOffset,pe=v.audioCodec,be=v.videoCodec,ne=v.defaultInitPts,fe=v.duration,_e=v.initSegmentData;if((xe||Le)&&this.resetInitSegment(_e,pe,be,fe),xe&&this.resetInitialTimestamp(ne),he||this.resetContiguity(),this.needsProbing(j,xe,Le)){if(w.dataLength){var ke=w.flush();j=Object(a.appendUint8Array)(ke,j)}this.configureTransmuxer(j,v)}var et=this.transmux(j,H,Ae,we,C),je=this.currentTransmuxState;return je.contiguous=!0,je.discontinuity=!1,je.trackSwitch=!1,W.executeEnd=s(),et},x.flush=function(h){var f=this,C=h.transmuxing;C.executeStart=s();var E=this.decrypter,_=this.cache,W=this.currentTransmuxState,j=this.decryptionPromise;if(j)return j.then(function(){return f.flush(h)});var w=[],F=W.timeOffset;if(E){var P=E.flush();P&&w.push(this.push(P,null,h))}var v=_.dataLength;_.reset();var H=this.demuxer,Y=this.remuxer;if(!H||!Y)return v>=t&&this.observer.emit(J.Events.ERROR,J.Events.ERROR,{type:K.ErrorTypes.MEDIA_ERROR,details:K.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),C.executeEnd=s(),[R(h)];var ie=H.flush(F);return T(ie)?ie.then(function(le){return f.flushRemux(w,le,h),w}):(this.flushRemux(w,ie,h),w)},x.flushRemux=function(h,f,C){var E=f.audioTrack,_=f.avcTrack,W=f.id3Track,j=f.textTrack,w=this.currentTransmuxState,F=w.accurateTimeOffset,P=w.timeOffset;c.logger.log("[transmuxer.ts]: Flushed fragment "+C.sn+(C.part>-1?" p: "+C.part:"")+" of level "+C.level);var v=this.remuxer.remux(E,_,W,j,P,F,!0,this.id);h.push({remuxResult:v,chunkMeta:C}),C.transmuxing.executeEnd=s()},x.resetInitialTimestamp=function(h){var f=this.demuxer,C=this.remuxer;if(!f||!C)return;f.resetTimeStamp(h),C.resetTimeStamp(h)},x.resetContiguity=function(){var h=this.demuxer,f=this.remuxer;if(!h||!f)return;h.resetContiguity(),f.resetNextTimestamp()},x.resetInitSegment=function(h,f,C,E){var _=this.demuxer,W=this.remuxer;if(!_||!W)return;_.resetInitSegment(f,C,E),W.resetInitSegment(h,f,C)},x.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},x.transmux=function(h,f,C,E,_){var W;return f&&f.method==="SAMPLE-AES"?W=this.transmuxSampleAes(h,f,C,E,_):W=this.transmuxUnencrypted(h,C,E,_),W},x.transmuxUnencrypted=function(h,f,C,E){var _=this.demuxer.demux(h,f,!1,!this.config.progressive),W=_.audioTrack,j=_.avcTrack,w=_.id3Track,F=_.textTrack,P=this.remuxer.remux(W,j,w,F,f,C,!1,this.id);return{remuxResult:P,chunkMeta:E}},x.transmuxSampleAes=function(h,f,C,E,_){var W=this;return this.demuxer.demuxSampleAes(h,f,C).then(function(j){var w=W.remuxer.remux(j.audioTrack,j.avcTrack,j.id3Track,j.textTrack,C,E,!1,W.id);return{remuxResult:w,chunkMeta:_}})},x.configureTransmuxer=function(h,f){for(var C=this.config,E=this.observer,_=this.typeSupported,W=this.vendor,j=f.audioCodec,w=f.defaultInitPts,F=f.duration,P=f.initSegmentData,v=f.videoCodec,H,Y=0,ie=i.length;Y<ie;Y++)if(i[Y].demux.probe(h)){H=i[Y];break}H||(c.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),H={demux:z.default,remux:g.default});var le=this.demuxer,he=this.remuxer,xe=H.remux,Le=H.demux;(!he||!(he instanceof xe))&&(this.remuxer=new xe(E,C,_,W)),(!le||!(le instanceof Le))&&(this.demuxer=new Le(E,C,_),this.probe=Le.probe),this.resetInitSegment(P,j,v,F),this.resetInitialTimestamp(w)},x.needsProbing=function(h,f,C){return!this.demuxer||!this.remuxer||f||C},x.getDecrypter=function(){var h=this.decrypter;return h||(h=this.decrypter=new N.default(this.observer,this.config)),h},I}();function o(I,x){var b=null;return I.byteLength>0&&x!=null&&x.key!=null&&x.iv!==null&&x.method!=null&&(b=x),b}var R=function(x){return{remuxResult:{},chunkMeta:x}};function T(I){return"then"in I&&I.then instanceof Function}var S=function(x,b,h,f,C){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=x,this.videoCodec=b,this.initSegmentData=h,this.duration=f,this.defaultInitPts=C},A=function(x,b,h,f,C){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=x,this.contiguous=b,this.accurateTimeOffset=h,this.trackSwitch=f,this.timeOffset=C}},"./src/demux/tsdemuxer.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"discardEPB",function(){return R});var J=B("./src/demux/adts.ts"),K=B("./src/demux/mpegaudio.ts"),N=B("./src/demux/exp-golomb.ts"),$=B("./src/demux/id3.ts"),z=B("./src/demux/sample-aes.ts"),r=B("./src/events.ts"),D=B("./src/utils/mp4-tools.ts"),m=B("./src/utils/logger.ts"),g=B("./src/errors.ts"),p={video:1,audio:2,id3:3,text:4},a=function(){function T(A,I,x){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=A,this.config=I,this.typeSupported=x}T.probe=function(I){var x=T.syncOffset(I);return x<0?!1:(x&&m.logger.warn("MPEG2-TS detected but first sync word found @ offset "+x+", junk ahead ?"),!0)},T.syncOffset=function(I){for(var x=Math.min(1e3,I.length-3*188),b=0;b<x;){if(I[b]===71&&I[b+188]===71&&I[b+2*188]===71)return b;b++}return-1},T.createTrack=function(I,x){return{container:I==="video"||I==="audio"?"video/mp2t":void 0,type:I,id:p[I],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:I==="audio"?x:void 0}};var S=T.prototype;return S.resetInitSegment=function(I,x,b){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=T.createTrack("video",b),this._audioTrack=T.createTrack("audio",b),this._id3Track=T.createTrack("id3",b),this._txtTrack=T.createTrack("text",b),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=I,this.videoCodec=x,this._duration=b},S.resetTimeStamp=function(){},S.resetContiguity=function(){var I=this._audioTrack,x=this._avcTrack,b=this._id3Track;I&&(I.pesData=null),x&&(x.pesData=null),b&&(b.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},S.demux=function(I,x,b,h){b===void 0&&(b=!1),h===void 0&&(h=!1),b||(this.sampleAes=null);var f,C=this._avcTrack,E=this._audioTrack,_=this._id3Track,W=C.pid,j=C.pesData,w=E.pid,F=_.pid,P=E.pesData,v=_.pesData,H=!1,Y=this.pmtParsed,ie=this._pmtId,le=I.length;if(this.remainderData&&(I=Object(D.appendUint8Array)(this.remainderData,I),le=I.length,this.remainderData=null),le<188&&!h)return this.remainderData=I,{audioTrack:E,avcTrack:C,id3Track:_,textTrack:this._txtTrack};var he=Math.max(0,T.syncOffset(I));le-=(le+he)%188,le<I.byteLength&&!h&&(this.remainderData=new Uint8Array(I.buffer,le,I.buffer.byteLength-le));for(var xe=he;xe<le;xe+=188)if(I[xe]===71){var Le=!!(I[xe+1]&64),we=((I[xe+1]&31)<<8)+I[xe+2],Ae=(I[xe+3]&48)>>4,pe=void 0;if(Ae>1){if(pe=xe+5+I[xe+4],pe===xe+188)continue}else pe=xe+4;switch(we){case W:Le&&(j&&(f=t(j))&&this.parseAVCPES(f,!1),j={data:[],size:0}),j&&(j.data.push(I.subarray(pe,xe+188)),j.size+=xe+188-pe);break;case w:Le&&(P&&(f=t(P))&&(E.isAAC?this.parseAACPES(f):this.parseMPEGPES(f)),P={data:[],size:0}),P&&(P.data.push(I.subarray(pe,xe+188)),P.size+=xe+188-pe);break;case F:Le&&(v&&(f=t(v))&&this.parseID3PES(f),v={data:[],size:0}),v&&(v.data.push(I.subarray(pe,xe+188)),v.size+=xe+188-pe);break;case 0:Le&&(pe+=I[pe]+1),ie=this._pmtId=s(I,pe);break;case ie:{Le&&(pe+=I[pe]+1);var be=i(I,pe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,b);W=be.avc,W>0&&(C.pid=W),w=be.audio,w>0&&(E.pid=w,E.isAAC=be.isAAC),F=be.id3,F>0&&(_.pid=F),H&&!Y&&(m.logger.log("reparse from beginning"),H=!1,xe=he-188),Y=this.pmtParsed=!0;break}case 17:case 8191:break;default:H=!0;break}}else this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});C.pesData=j,E.pesData=P,_.pesData=v;var ne={audioTrack:E,avcTrack:C,id3Track:_,textTrack:this._txtTrack};return h&&this.extractRemainingSamples(ne),ne},S.flush=function(){var I=this.remainderData;this.remainderData=null;var x;return I?x=this.demux(I,-1,!1,!0):x={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(x),this.sampleAes?this.decrypt(x,this.sampleAes):x},S.extractRemainingSamples=function(I){var x=I.audioTrack,b=I.avcTrack,h=I.id3Track,f=b.pesData,C=x.pesData,E=h.pesData,_;f&&(_=t(f))?(this.parseAVCPES(_,!0),b.pesData=null):b.pesData=f,C&&(_=t(C))?(x.isAAC?this.parseAACPES(_):this.parseMPEGPES(_),x.pesData=null):(C!=null&&C.size&&m.logger.log("last AAC PES packet truncated,might overlap between fragments"),x.pesData=C),E&&(_=t(E))?(this.parseID3PES(_),h.pesData=null):h.pesData=E},S.demuxSampleAes=function(I,x,b){var h=this.demux(I,b,!0,!this.config.progressive),f=this.sampleAes=new z.default(this.observer,this.config,x);return this.decrypt(h,f)},S.decrypt=function(I,x){return new Promise(function(b){var h=I.audioTrack,f=I.avcTrack;h.samples&&h.isAAC?x.decryptAacSamples(h.samples,0,function(){f.samples?x.decryptAvcSamples(f.samples,0,0,function(){b(I)}):b(I)}):f.samples&&x.decryptAvcSamples(f.samples,0,0,function(){b(I)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(I,x){var b=this,h=this._avcTrack,f=this.parseAVCNALu(I.data),C=!1,E=this.avcSample,_,W=!1;I.data=null,E&&f.length&&!h.audFound&&(u(E,h),E=this.avcSample=c(!1,I.pts,I.dts,"")),f.forEach(function(j){switch(j.type){case 1:{_=!0,E||(E=b.avcSample=c(!0,I.pts,I.dts,"")),C&&(E.debug+="NDR "),E.frame=!0;var w=j.data;if(W&&w.length>4){var F=new N.default(w).readSliceType();(F===2||F===4||F===7||F===9)&&(E.key=!0)}break}case 5:_=!0,E||(E=b.avcSample=c(!0,I.pts,I.dts,"")),C&&(E.debug+="IDR "),E.key=!0,E.frame=!0;break;case 6:{_=!0,C&&E&&(E.debug+="SEI ");var P=new N.default(R(j.data));P.readUByte();for(var v=0,H=0,Y=!1,ie=0;!Y&&P.bytesAvailable>1;){v=0;do ie=P.readUByte(),v+=ie;while(ie===255);H=0;do ie=P.readUByte(),H+=ie;while(ie===255);if(v===4&&P.bytesAvailable!==0){Y=!0;var le=P.readUByte();if(le===181){var he=P.readUShort();if(he===49){var xe=P.readUInt();if(xe===1195456820){var Le=P.readUByte();if(Le===3){for(var we=P.readUByte(),Ae=P.readUByte(),pe=31&we,be=[we,Ae],ne=0;ne<pe;ne++)be.push(P.readUByte()),be.push(P.readUByte()),be.push(P.readUByte());o(b._txtTrack.samples,{type:3,pts:I.pts,bytes:be})}}}}}else if(v===5&&P.bytesAvailable!==0){if(Y=!0,H>16){for(var fe=[],_e=0;_e<16;_e++)fe.push(P.readUByte().toString(16)),(_e===3||_e===5||_e===7||_e===9)&&fe.push("-");for(var ke=H-16,et=new Uint8Array(ke),je=0;je<ke;je++)et[je]=P.readUByte();o(b._txtTrack.samples,{pts:I.pts,payloadType:v,uuid:fe.join(""),userData:Object($.utf8ArrayToStr)(et),userDataBytes:et})}}else if(H<P.bytesAvailable)for(var ot=0;ot<H;ot++)P.readUByte()}break}case 7:if(_=!0,W=!0,C&&E&&(E.debug+="SPS "),!h.sps){var _t=new N.default(j.data),Re=_t.readSPS();h.width=Re.width,h.height=Re.height,h.pixelRatio=Re.pixelRatio,h.sps=[j.data],h.duration=b._duration;for(var Be=j.data.subarray(1,4),Qe="avc1.",Ve=0;Ve<3;Ve++){var Et=Be[Ve].toString(16);Et.length<2&&(Et="0"+Et),Qe+=Et}h.codec=Qe}break;case 8:_=!0,C&&E&&(E.debug+="PPS "),h.pps||(h.pps=[j.data]);break;case 9:_=!1,h.audFound=!0,E&&u(E,h),E=b.avcSample=c(!1,I.pts,I.dts,C?"AUD ":"");break;case 12:_=!1;break;default:_=!1,E&&(E.debug+="unknown NAL "+j.type+" ");break}if(E&&_){var kt=E.units;kt.push(j)}}),x&&E&&(u(E,h),this.avcSample=null)},S.getLastNalUnit=function(){var I,x=this.avcSample,b;if(!x||x.units.length===0){var h=this._avcTrack.samples;x=h[h.length-1]}if((I=x)!==null&&I!==void 0&&I.units){var f=x.units;b=f[f.length-1]}return b},S.parseAVCNALu=function(I){var x=I.byteLength,b=this._avcTrack,h=b.naluState||0,f=h,C=[],E=0,_,W,j,w=-1,F=0;for(h===-1&&(w=0,F=I[0]&31,h=0,E=1);E<x;){if(_=I[E++],!h){h=_?0:1;continue}if(h===1){h=_?0:2;continue}if(!_)h=3;else if(_===1){if(w>=0){var P={data:I.subarray(w,E-h-1),type:F};C.push(P)}else{var v=this.getLastNalUnit();if(v&&(f&&E<=4-f&&(v.state&&(v.data=v.data.subarray(0,v.data.byteLength-f))),W=E-h-1,W>0)){var H=new Uint8Array(v.data.byteLength+W);H.set(v.data,0),H.set(I.subarray(0,W),v.data.byteLength),v.data=H,v.state=0}}E<x?(j=I[E]&31,w=E,F=j,h=0):h=-1}else h=0}if(w>=0&&h>=0){var Y={data:I.subarray(w,x),type:F,state:h};C.push(Y)}if(C.length===0){var ie=this.getLastNalUnit();if(ie){var le=new Uint8Array(ie.data.byteLength+I.byteLength);le.set(ie.data,0),le.set(I,ie.data.byteLength),ie.data=le}}return b.naluState=h,C},S.parseAACPES=function(I){var x=0,b=this._audioTrack,h=this.aacOverFlow,f=I.data;if(h){this.aacOverFlow=null;var C=h.sample.unit.byteLength,E=Math.min(h.missing,C),_=C-E;h.sample.unit.set(f.subarray(0,E),_),b.samples.push(h.sample),x=h.missing}var W,j;for(W=x,j=f.length;W<j-1&&!J.isHeader(f,W);W++);if(W!==x){var w,F;if(W<j-1?(w="AAC PES did not start with ADTS header,offset:"+W,F=!1):(w="no ADTS header found in AAC PES",F=!0),m.logger.warn("parsing error:"+w),this.observer.emit(r.Events.ERROR,r.Events.ERROR,{type:g.ErrorTypes.MEDIA_ERROR,details:g.ErrorDetails.FRAG_PARSING_ERROR,fatal:F,reason:w}),F)return}J.initTrackConfig(b,this.observer,f,W,this.audioCodec);var P;if(I.pts!==void 0)P=I.pts;else if(h){var v=J.getFrameDuration(b.samplerate);P=h.sample.pts+v}else{m.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var H=0;W<j;)if(J.isHeader(f,W)){if(W+5<j){var Y=J.appendFrame(b,f,W,P,H);if(Y)if(Y.missing)this.aacOverFlow=Y;else{W+=Y.length,H++;continue}}break}else W++},S.parseMPEGPES=function(I){var x=I.data,b=x.length,h=0,f=0,C=I.pts;if(C===void 0){m.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;f<b;)if(K.isHeader(x,f)){var E=K.appendFrame(this._audioTrack,x,f,C,h);if(E)f+=E.length,h++;else break}else f++},S.parseID3PES=function(I){if(I.pts===void 0){m.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(I)},T}();a.minProbeByteLength=188;function c(T,S,A,I){return{key:T,frame:!1,pts:S,dts:A,units:[],debug:I,length:0}}function s(T,S){return(T[S+10]&31)<<8|T[S+11]}function i(T,S,A,I){var x={audio:-1,avc:-1,id3:-1,isAAC:!0},b=(T[S+1]&15)<<8|T[S+2],h=S+3+b-4,f=(T[S+10]&15)<<8|T[S+11];for(S+=12+f;S<h;){var C=(T[S+1]&31)<<8|T[S+2];switch(T[S]){case 207:if(!I){m.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:x.audio===-1&&(x.audio=C);break;case 21:x.id3===-1&&(x.id3=C);break;case 219:if(!I){m.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:x.avc===-1&&(x.avc=C);break;case 3:case 4:A?x.audio===-1&&(x.audio=C,x.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}S+=((T[S+3]&15)<<8|T[S+4])+5}return x}function t(T){var S=0,A,I,x,b,h,f=T.data;if(!T||T.size===0)return null;for(;f[0].length<19&&f.length>1;){var C=new Uint8Array(f[0].length+f[1].length);C.set(f[0]),C.set(f[1],f[0].length),f[0]=C,f.splice(1,1)}A=f[0];var E=(A[0]<<16)+(A[1]<<8)+A[2];if(E===1){if(I=(A[4]<<8)+A[5],I&&I>T.size-6)return null;var _=A[7];_&192&&(b=(A[9]&14)*536870912+(A[10]&255)*4194304+(A[11]&254)*16384+(A[12]&255)*128+(A[13]&254)/2,_&64?(h=(A[14]&14)*536870912+(A[15]&255)*4194304+(A[16]&254)*16384+(A[17]&255)*128+(A[18]&254)/2,b-h>60*9e4&&(m.logger.warn(Math.round((b-h)/9e4)+"s delta between PTS and DTS, align them"),b=h)):h=b),x=A[8];var W=x+9;if(T.size<=W)return null;T.size-=W;for(var j=new Uint8Array(T.size),w=0,F=f.length;w<F;w++){A=f[w];var P=A.byteLength;if(W)if(W>P){W-=P;continue}else A=A.subarray(W),P-=W,W=0;j.set(A,S),S+=P}return I&&(I-=x+3),{data:j,pts:b,dts:h,len:I}}return null}function u(T,S){if(T.units.length&&T.frame){if(T.pts===void 0){var A=S.samples,I=A.length;if(I){var x=A[I-1];T.pts=x.pts,T.dts=x.dts}else{S.dropped++;return}}S.samples.push(T)}T.debug.length&&m.logger.log(T.pts+"/"+T.dts+":"+T.debug)}function o(T,S){var A=T.length;if(A>0){if(S.pts>=T[A-1].pts)T.push(S);else for(var I=A-1;I>=0;I--)if(S.pts<T[I].pts){T.splice(I,0,S);break}}else T.push(S)}function R(T){for(var S=T.byteLength,A=[],I=1;I<S-2;)T[I]===0&&T[I+1]===0&&T[I+2]===3?(A.push(I+2),I+=2):I++;if(A.length===0)return T;var x=S-A.length,b=new Uint8Array(x),h=0;for(I=0;I<x;h++,I++)h===A[0]&&(h++,A.shift()),b[I]=T[h];return b}Q.default=a},"./src/errors.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"ErrorTypes",function(){return J}),B.d(Q,"ErrorDetails",function(){return K});var J;(function(N){N.NETWORK_ERROR="networkError",N.MEDIA_ERROR="mediaError",N.KEY_SYSTEM_ERROR="keySystemError",N.MUX_ERROR="muxError",N.OTHER_ERROR="otherError"})(J||(J={}));var K;(function(N){N.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",N.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",N.KEY_SYSTEM_NO_SESSION="keySystemNoSession",N.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",N.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",N.MANIFEST_LOAD_ERROR="manifestLoadError",N.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",N.MANIFEST_PARSING_ERROR="manifestParsingError",N.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",N.LEVEL_EMPTY_ERROR="levelEmptyError",N.LEVEL_LOAD_ERROR="levelLoadError",N.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",N.LEVEL_SWITCH_ERROR="levelSwitchError",N.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",N.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",N.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",N.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",N.FRAG_LOAD_ERROR="fragLoadError",N.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",N.FRAG_DECRYPT_ERROR="fragDecryptError",N.FRAG_PARSING_ERROR="fragParsingError",N.REMUX_ALLOC_ERROR="remuxAllocError",N.KEY_LOAD_ERROR="keyLoadError",N.KEY_LOAD_TIMEOUT="keyLoadTimeOut",N.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",N.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",N.BUFFER_APPEND_ERROR="bufferAppendError",N.BUFFER_APPENDING_ERROR="bufferAppendingError",N.BUFFER_STALLED_ERROR="bufferStalledError",N.BUFFER_FULL_ERROR="bufferFullError",N.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",N.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",N.INTERNAL_EXCEPTION="internalException",N.INTERNAL_ABORTED="aborted",N.UNKNOWN="unknown"})(K||(K={}))},"./src/events.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"Events",function(){return J});var J;(function(K){K.MEDIA_ATTACHING="hlsMediaAttaching",K.MEDIA_ATTACHED="hlsMediaAttached",K.MEDIA_DETACHING="hlsMediaDetaching",K.MEDIA_DETACHED="hlsMediaDetached",K.BUFFER_RESET="hlsBufferReset",K.BUFFER_CODECS="hlsBufferCodecs",K.BUFFER_CREATED="hlsBufferCreated",K.BUFFER_APPENDING="hlsBufferAppending",K.BUFFER_APPENDED="hlsBufferAppended",K.BUFFER_EOS="hlsBufferEos",K.BUFFER_FLUSHING="hlsBufferFlushing",K.BUFFER_FLUSHED="hlsBufferFlushed",K.MANIFEST_LOADING="hlsManifestLoading",K.MANIFEST_LOADED="hlsManifestLoaded",K.MANIFEST_PARSED="hlsManifestParsed",K.LEVEL_SWITCHING="hlsLevelSwitching",K.LEVEL_SWITCHED="hlsLevelSwitched",K.LEVEL_LOADING="hlsLevelLoading",K.LEVEL_LOADED="hlsLevelLoaded",K.LEVEL_UPDATED="hlsLevelUpdated",K.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",K.LEVELS_UPDATED="hlsLevelsUpdated",K.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",K.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",K.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",K.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",K.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",K.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",K.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",K.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",K.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",K.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",K.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",K.CUES_PARSED="hlsCuesParsed",K.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",K.INIT_PTS_FOUND="hlsInitPtsFound",K.FRAG_LOADING="hlsFragLoading",K.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",K.FRAG_LOADED="hlsFragLoaded",K.FRAG_DECRYPTED="hlsFragDecrypted",K.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",K.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",K.FRAG_PARSING_METADATA="hlsFragParsingMetadata",K.FRAG_PARSED="hlsFragParsed",K.FRAG_BUFFERED="hlsFragBuffered",K.FRAG_CHANGED="hlsFragChanged",K.FPS_DROP="hlsFpsDrop",K.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",K.ERROR="hlsError",K.DESTROYING="hlsDestroying",K.KEY_LOADING="hlsKeyLoading",K.KEY_LOADED="hlsKeyLoaded",K.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",K.BACK_BUFFER_REACHED="hlsBackBufferReached"})(J||(J={}))},"./src/hls.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return T});var J=B("./node_modules/url-toolkit/src/url-toolkit.js"),K=B.n(J),N=B("./src/loader/playlist-loader.ts"),$=B("./src/loader/key-loader.ts"),z=B("./src/controller/id3-track-controller.ts"),r=B("./src/controller/latency-controller.ts"),D=B("./src/controller/level-controller.ts"),m=B("./src/controller/fragment-tracker.ts"),g=B("./src/controller/stream-controller.ts"),p=B("./src/is-supported.ts"),a=B("./src/utils/logger.ts"),c=B("./src/config.ts"),s=B("./node_modules/eventemitter3/index.js"),i=B.n(s),t=B("./src/events.ts"),u=B("./src/errors.ts");function o(S,A){for(var I=0;I<A.length;I++){var x=A[I];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(S,x.key,x)}}function R(S,A,I){return A&&o(S.prototype,A),I&&o(S,I),S}var T=function(){S.isSupported=function(){return Object(p.isSupported)()};function S(I){I===void 0&&(I={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new s.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 x=this.config=Object(c.mergeConfig)(S.DefaultConfig,I);this.userConfig=I,Object(a.enableLogs)(x.debug),this._autoLevelCapping=-1,x.progressive&&Object(c.enableStreamingMode)(x);var b=x.abrController,h=x.bufferController,f=x.capLevelController,C=x.fpsController,E=this.abrController=new b(this),_=this.bufferController=new h(this),W=this.capLevelController=new f(this),j=new C(this),w=new N.default(this),F=new $.default(this),P=new z.default(this),v=this.levelController=new D.default(this),H=new m.FragmentTracker(this),Y=this.streamController=new g.default(this,H);W.setStreamController(Y),j.setStreamController(Y);var ie=[v,Y];this.networkControllers=ie;var le=[w,F,E,_,W,j,P,H];this.audioTrackController=this.createController(x.audioTrackController,null,ie),this.createController(x.audioStreamController,H,ie),this.subtitleTrackController=this.createController(x.subtitleTrackController,null,ie),this.createController(x.subtitleStreamController,H,ie),this.createController(x.timelineController,null,le),this.emeController=this.createController(x.emeController,null,le),this.cmcdController=this.createController(x.cmcdController,null,le),this.latencyController=this.createController(r.default,null,le),this.coreComponents=le}var A=S.prototype;return A.createController=function(x,b,h){if(x){var f=b?new x(this,b):new x(this);return h&&h.push(f),f}return null},A.on=function(x,b,h){h===void 0&&(h=this),this._emitter.on(x,b,h)},A.once=function(x,b,h){h===void 0&&(h=this),this._emitter.once(x,b,h)},A.removeAllListeners=function(x){this._emitter.removeAllListeners(x)},A.off=function(x,b,h,f){h===void 0&&(h=this),this._emitter.off(x,b,h,f)},A.listeners=function(x){return this._emitter.listeners(x)},A.emit=function(x,b,h){return this._emitter.emit(x,b,h)},A.trigger=function(x,b){if(this.config.debug)return this.emit(x,x,b);try{return this.emit(x,x,b)}catch(h){a.logger.error("An internal error happened while handling event "+x+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(t.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:x,error:h})}return!1},A.listenerCount=function(x){return this._emitter.listenerCount(x)},A.destroy=function(){a.logger.log("destroy"),this.trigger(t.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(x){return x.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(x){return x.destroy()}),this.coreComponents.length=0},A.attachMedia=function(x){a.logger.log("attachMedia"),this._media=x,this.trigger(t.Events.MEDIA_ATTACHING,{media:x})},A.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(t.Events.MEDIA_DETACHING,void 0),this._media=null},A.loadSource=function(x){this.stopLoad();var b=this.media,h=this.url,f=this.url=J.buildAbsoluteURL(self.location.href,x,{alwaysNormalize:!0});a.logger.log("loadSource:"+f),b&&h&&h!==f&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(b)),this.trigger(t.Events.MANIFEST_LOADING,{url:x})},A.startLoad=function(x){x===void 0&&(x=-1),a.logger.log("startLoad("+x+")"),this.networkControllers.forEach(function(b){b.startLoad(x)})},A.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(x){x.stopLoad()})},A.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},A.recoverMediaError=function(){a.logger.log("recoverMediaError");var x=this._media;this.detachMedia(),x&&this.attachMedia(x)},A.removeLevel=function(x,b){b===void 0&&(b=0),this.levelController.removeLevel(x,b)},R(S,[{key:"levels",get:function(){var x=this.levelController.levels;return x||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(x){a.logger.log("set currentLevel:"+x),this.loadLevel=x,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(x){a.logger.log("set nextLevel:"+x),this.levelController.manualLevel=x,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(x){a.logger.log("set loadLevel:"+x),this.levelController.manualLevel=x}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(x){this.levelController.nextLoadLevel=x}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(x){a.logger.log("set firstLevel:"+x),this.levelController.firstLevel=x}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(x){a.logger.log("set startLevel:"+x),x!==-1&&(x=Math.max(x,this.minAutoLevel)),this.levelController.startLevel=x}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(x){var b=!!x;b!==this.config.capLevelToPlayerSize&&(b?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=b)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(x){this._autoLevelCapping!==x&&(a.logger.log("set autoLevelCapping:"+x),this._autoLevelCapping=x)}},{key:"bandwidthEstimate",get:function(){var x=this.abrController.bwEstimator;return x?x.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var x=this.levels,b=this.config.minAutoBitrate;if(!x)return 0;for(var h=x.length,f=0;f<h;f++)if(x[f].maxBitrate>b)return f;return 0}},{key:"maxAutoLevel",get:function(){var x=this.levels,b=this.autoLevelCapping,h;return b===-1&&x&&x.length?h=x.length-1:h=b,h}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(x){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,x)}},{key:"audioTracks",get:function(){var x=this.audioTrackController;return x?x.audioTracks:[]}},{key:"audioTrack",get:function(){var x=this.audioTrackController;return x?x.audioTrack:-1},set:function(x){var b=this.audioTrackController;b&&(b.audioTrack=x)}},{key:"subtitleTracks",get:function(){var x=this.subtitleTrackController;return x?x.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var x=this.subtitleTrackController;return x?x.subtitleTrack:-1},set:function(x){var b=this.subtitleTrackController;b&&(b.subtitleTrack=x)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var x=this.subtitleTrackController;return x?x.subtitleDisplay:!1},set:function(x){var b=this.subtitleTrackController;b&&(b.subtitleDisplay=x)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(x){this.config.lowLatencyMode=x}},{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 u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:c.hlsDefaultConfig},set:function(x){S.defaultConfig=x}}]),S}();T.defaultConfig=void 0},"./src/is-supported.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"isSupported",function(){return N}),B.d(Q,"changeTypeSupported",function(){return $});var J=B("./src/utils/mediasource-helper.ts");function K(){return self.SourceBuffer||self.WebKitSourceBuffer}function N(){var z=Object(J.getMediaSource)();if(!z)return!1;var r=K(),D=z&&typeof z.isTypeSupported=="function"&&z.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),m=!r||r.prototype&&typeof r.prototype.appendBuffer=="function"&&typeof r.prototype.remove=="function";return!!D&&!!m}function $(){var z,r=K();return typeof(r==null||((z=r.prototype)===null||z===void 0)?void 0:z.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return a}),B.d(Q,"LoadError",function(){return s});var J=B("./src/polyfills/number.ts"),K=B("./src/errors.ts");function N(i,t){i.prototype=Object.create(t.prototype),i.prototype.constructor=i,m(i,t)}function $(i){var t=typeof Map=="function"?new Map:void 0;return $=function(o){if(o===null||!D(o))return o;if(typeof o!="function")throw new TypeError("Super expression must either be null or a function");if(typeof t!="undefined"){if(t.has(o))return t.get(o);t.set(o,R)}function R(){return z(o,arguments,g(this).constructor)}return R.prototype=Object.create(o.prototype,{constructor:{value:R,enumerable:!1,writable:!0,configurable:!0}}),m(R,o)},$(i)}function z(i,t,u){return r()?z=Reflect.construct:z=function(R,T,S){var A=[null];A.push.apply(A,T);var I=Function.bind.apply(R,A),x=new I;return S&&m(x,S.prototype),x},z.apply(null,arguments)}function r(){if(typeof Reflect=="undefined"||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(i){return!1}}function D(i){return Function.toString.call(i).indexOf("[native code]")!==-1}function m(i,t){return m=Object.setPrototypeOf||function(o,R){return o.__proto__=R,o},m(i,t)}function g(i){return g=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},g(i)}var p=Math.pow(2,17),a=function(){function i(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var t=i.prototype;return t.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},t.abort=function(){this.loader&&this.loader.abort()},t.load=function(o,R){var T=this,S=o.url;if(!S)return Promise.reject(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var A=this.config,I=A.fLoader,x=A.loader;return new Promise(function(b,h){T.loader&&T.loader.destroy();var f=T.loader=o.loader=I?new I(A):new x(A),C=c(o),E={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:p};o.stats=f.stats,f.load(C,E,{onSuccess:function(W,j,w,F){T.resetLoader(o,f),b({frag:o,part:null,payload:W.data,networkDetails:F})},onError:function(W,j,w){T.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,response:W,networkDetails:w}))},onAbort:function(W,j,w){T.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,networkDetails:w}))},onTimeout:function(W,j,w){T.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,networkDetails:w}))},onProgress:function(W,j,w,F){R&&R({frag:o,part:null,payload:w,networkDetails:F})}})})},t.loadPart=function(o,R,T){var S=this;this.abort();var A=this.config,I=A.fLoader,x=A.loader;return new Promise(function(b,h){S.loader&&S.loader.destroy();var f=S.loader=o.loader=I?new I(A):new x(A),C=c(o,R),E={timeout:A.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:A.fragLoadingMaxRetryTimeout,highWaterMark:p};R.stats=f.stats,f.load(C,E,{onSuccess:function(W,j,w,F){S.resetLoader(o,f),S.updateStatsFromPart(o,R);var P={frag:o,part:R,payload:W.data,networkDetails:F};T(P),b(P)},onError:function(W,j,w){S.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:o,part:R,response:W,networkDetails:w}))},onAbort:function(W,j,w){o.stats.aborted=R.stats.aborted,S.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:o,part:R,networkDetails:w}))},onTimeout:function(W,j,w){S.resetLoader(o,f),h(new s({type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:o,part:R,networkDetails:w}))}})})},t.updateStatsFromPart=function(o,R){var T=o.stats,S=R.stats,A=S.total;if(T.loaded+=S.loaded,A){var I=Math.round(o.duration/R.duration),x=Math.min(Math.round(T.loaded/A),I),b=I-x,h=b*Math.round(T.loaded/x);T.total=T.loaded+h}else T.total=Math.max(T.loaded,T.total);var f=T.loading,C=S.loading;f.start?f.first+=C.first-C.start:(f.start=C.start,f.first=C.first),f.end=C.end},t.resetLoader=function(o,R){o.loader=null,this.loader===R&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),R.destroy()},i}();function c(i,t){t===void 0&&(t=null);var u=t||i,o={frag:i,part:t,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},R=u.byteRangeStartOffset,T=u.byteRangeEndOffset;return Object(J.isFiniteNumber)(R)&&Object(J.isFiniteNumber)(T)&&(o.rangeStart=R,o.rangeEnd=T),o}var s=function(i){N(t,i);function t(u){for(var o,R=arguments.length,T=new Array(R>1?R-1:0),S=1;S<R;S++)T[S-1]=arguments[S];return o=i.call.apply(i,[this].concat(T))||this,o.data=void 0,o.data=u,o}return t}($(Error))},"./src/loader/fragment.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"ElementaryStreamTypes",function(){return a}),B.d(Q,"BaseSegment",function(){return c}),B.d(Q,"Fragment",function(){return s}),B.d(Q,"Part",function(){return i});var J=B("./src/polyfills/number.ts"),K=B("./node_modules/url-toolkit/src/url-toolkit.js"),N=B.n(K),$=B("./src/utils/logger.ts"),z=B("./src/loader/level-key.ts"),r=B("./src/loader/load-stats.ts");function D(t,u){t.prototype=Object.create(u.prototype),t.prototype.constructor=t,m(t,u)}function m(t,u){return m=Object.setPrototypeOf||function(R,T){return R.__proto__=T,R},m(t,u)}function g(t,u){for(var o=0;o<u.length;o++){var R=u[o];R.enumerable=R.enumerable||!1,R.configurable=!0,"value"in R&&(R.writable=!0),Object.defineProperty(t,R.key,R)}}function p(t,u,o){return u&&g(t.prototype,u),o&&g(t,o),t}var a;(function(t){t.AUDIO="audio",t.VIDEO="video",t.AUDIOVIDEO="audiovideo"})(a||(a={}));var c=function(){function t(o){var R;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(R={},R[a.AUDIO]=null,R[a.VIDEO]=null,R[a.AUDIOVIDEO]=null,R),this.baseurl=o}var u=t.prototype;return u.setByteRange=function(R,T){var S=R.split("@",2),A=[];S.length===1?A[0]=T?T.byteRangeEndOffset:0:A[0]=parseInt(S[1]),A[1]=parseInt(S[0])+A[0],this._byteRange=A},p(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(K.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(R){this._url=R}}]),t}(),s=function(t){D(u,t);function u(R,T){var S;return S=t.call(this,T)||this,S._decryptdata=null,S.rawProgramDateTime=null,S.programDateTime=null,S.tagList=[],S.duration=0,S.sn=0,S.levelkey=void 0,S.type=void 0,S.loader=null,S.level=-1,S.cc=0,S.startPTS=void 0,S.endPTS=void 0,S.appendedPTS=void 0,S.startDTS=void 0,S.endDTS=void 0,S.start=0,S.deltaPTS=void 0,S.maxStartPTS=void 0,S.minEndPTS=void 0,S.stats=new r.LoadStats,S.urlId=0,S.data=void 0,S.bitrateTest=!1,S.title=null,S.initSegment=null,S.type=R,S}var o=u.prototype;return o.createInitializationVector=function(T){for(var S=new Uint8Array(16),A=12;A<16;A++)S[A]=T>>8*(15-A)&255;return S},o.setDecryptDataFromLevelKey=function(T,S){var A=T;return(T==null?void 0:T.method)==="AES-128"&&T.uri&&!T.iv&&(A=z.LevelKey.fromURI(T.uri),A.method=T.method,A.iv=this.createInitializationVector(S),A.keyFormat="identity"),A},o.setElementaryStreamInfo=function(T,S,A,I,x,b){b===void 0&&(b=!1);var h=this.elementaryStreams,f=h[T];if(!f){h[T]={startPTS:S,endPTS:A,startDTS:I,endDTS:x,partial:b};return}f.startPTS=Math.min(f.startPTS,S),f.endPTS=Math.max(f.endPTS,A),f.startDTS=Math.min(f.startDTS,I),f.endDTS=Math.max(f.endDTS,x)},o.clearElementaryStreamInfo=function(){var T=this.elementaryStreams;T[a.AUDIO]=null,T[a.VIDEO]=null,T[a.AUDIOVIDEO]=null},p(u,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var T=this.sn;typeof T!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&$.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),T=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,T)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(J.isFiniteNumber)(this.programDateTime))return null;var T=Object(J.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+T*1e3}},{key:"encrypted",get:function(){var T;return!!((T=this.decryptdata)!==null&&T!==void 0&&T.keyFormat&&this.decryptdata.uri)}}]),u}(c),i=function(t){D(u,t);function u(o,R,T,S,A){var I;I=t.call(this,T)||this,I.fragOffset=0,I.duration=0,I.gap=!1,I.independent=!1,I.relurl=void 0,I.fragment=void 0,I.index=void 0,I.stats=new r.LoadStats,I.duration=o.decimalFloatingPoint("DURATION"),I.gap=o.bool("GAP"),I.independent=o.bool("INDEPENDENT"),I.relurl=o.enumeratedString("URI"),I.fragment=R,I.index=S;var x=o.enumeratedString("BYTERANGE");return x&&I.setByteRange(x,A),A&&(I.fragOffset=A.fragOffset+A.duration),I}return p(u,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var R=this.elementaryStreams;return!!(R.audio||R.video||R.audiovideo)}}]),u}(c)},"./src/loader/key-loader.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return $});var J=B("./src/events.ts"),K=B("./src/errors.ts"),N=B("./src/utils/logger.ts"),$=function(){function z(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var r=z.prototype;return r._registerListeners=function(){this.hls.on(J.Events.KEY_LOADING,this.onKeyLoading,this)},r._unregisterListeners=function(){this.hls.off(J.Events.KEY_LOADING,this.onKeyLoading)},r.destroy=function(){this._unregisterListeners();for(var m in this.loaders){var g=this.loaders[m];g&&g.destroy()}this.loaders={}},r.onKeyLoading=function(m,g){var p=g.frag,a=p.type,c=this.loaders[a];if(!p.decryptdata){N.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var s=p.decryptdata.uri;if(s!==this.decrypturl||this.decryptkey===null){var i=this.hls.config;if(c&&(N.logger.warn("abort previous key loader for type:"+a),c.abort()),!s){N.logger.warn("key uri is falsy");return}var t=i.loader,u=p.loader=this.loaders[a]=new t(i);this.decrypturl=s,this.decryptkey=null;var o={url:s,frag:p,responseType:"arraybuffer"},R={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},T={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};u.load(o,R,T)}else this.decryptkey&&(p.decryptdata.key=this.decryptkey,this.hls.trigger(J.Events.KEY_LOADED,{frag:p}))},r.loadsuccess=function(m,g,p){var a=p.frag;if(!a.decryptdata){N.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(m.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(J.Events.KEY_LOADED,{frag:a})},r.loaderror=function(m,g){var p=g.frag,a=p.loader;a&&a.abort(),delete this.loaders[p.type],this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:p,response:m})},r.loadtimeout=function(m,g){var p=g.frag,a=p.loader;a&&a.abort(),delete this.loaders[p.type],this.hls.trigger(J.Events.ERROR,{type:K.ErrorTypes.NETWORK_ERROR,details:K.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:p})},z}()},"./src/loader/level-details.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"LevelDetails",function(){return z});var J=B("./src/polyfills/number.ts");function K(r,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(r,g.key,g)}}function N(r,D,m){return D&&K(r.prototype,D),m&&K(r,m),r}var $=10,z=function(){function r(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=r.prototype;return D.reloaded=function(g){if(!g){this.advanced=!0,this.updated=!0;return}var p=this.lastPartSn-g.lastPartSn,a=this.lastPartIndex-g.lastPartIndex;this.updated=this.endSN!==g.endSN||!!a||!!p,this.advanced=this.endSN>g.endSN||p>0||p===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(g.misses*.6):this.misses=g.misses+1,this.availabilityDelay=g.availabilityDelay},N(r,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(J.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||$}},{key:"drift",get:function(){var g=this.driftEndTime-this.driftStartTime;if(g>0){var p=this.driftEnd-this.driftStart;return p*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}}]),r}()},"./src/loader/level-key.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"LevelKey",function(){return z});var J=B("./node_modules/url-toolkit/src/url-toolkit.js"),K=B.n(J);function N(r,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(r,g.key,g)}}function $(r,D,m){return D&&N(r.prototype,D),m&&N(r,m),r}var z=function(){r.fromURL=function(m,g){return new r(m,g)},r.fromURI=function(m){return new r(m)};function r(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(J.buildAbsoluteURL)(D,m,{alwaysNormalize:!0}):this._uri=D}return $(r,[{key:"uri",get:function(){return this._uri}}]),r}()},"./src/loader/load-stats.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"LoadStats",function(){return J});var J=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(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return u});var J=B("./src/polyfills/number.ts"),K=B("./node_modules/url-toolkit/src/url-toolkit.js"),N=B.n(K),$=B("./src/loader/fragment.ts"),z=B("./src/loader/level-details.ts"),r=B("./src/loader/level-key.ts"),D=B("./src/utils/attr-list.ts"),m=B("./src/utils/logger.ts"),g=B("./src/utils/codecs.ts"),p=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,a=/#EXT-X-MEDIA:(.*)/g,c=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),s=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),i=/\.(mp4|m4s|m4v|m4a)$/i;function t(A){var I,x;return i.test((I=(x=K.parseURL(A))===null||x===void 0?void 0:x.path)!=null?I:"")}var u=function(){function A(){}return A.findGroup=function(x,b){for(var h=0;h<x.length;h++){var f=x[h];if(f.id===b)return f}},A.convertAVC1ToAVCOTI=function(x){var b=x.split(".");if(b.length>2){var h=b.shift()+".";return h+=parseInt(b.shift()).toString(16),h+=("000"+parseInt(b.shift()).toString(16)).substr(-4),h}return x},A.resolve=function(x,b){return K.buildAbsoluteURL(b,x,{alwaysNormalize:!0})},A.parseMasterPlaylist=function(x,b){var h=[],f={},C=!1;p.lastIndex=0;for(var E;(E=p.exec(x))!=null;)if(E[1]){var _=new D.AttrList(E[1]),W={attrs:_,bitrate:_.decimalInteger("AVERAGE-BANDWIDTH")||_.decimalInteger("BANDWIDTH"),name:_.NAME,url:A.resolve(E[2],b)},j=_.decimalResolution("RESOLUTION");j&&(W.width=j.width,W.height=j.height),o((_.CODECS||"").split(/[ ,]+/).filter(function(F){return F}),W),W.videoCodec&&W.videoCodec.indexOf("avc1")!==-1&&(W.videoCodec=A.convertAVC1ToAVCOTI(W.videoCodec)),h.push(W)}else if(E[3]){var w=new D.AttrList(E[3]);w["DATA-ID"]&&(C=!0,f[w["DATA-ID"]]=w)}return{levels:h,sessionData:C?f:null}},A.parseMasterPlaylistMedia=function(x,b,h,f){f===void 0&&(f=[]);var C,E=[],_=0;for(a.lastIndex=0;(C=a.exec(x))!==null;){var W=new D.AttrList(C[1]);if(W.TYPE===h){var j={attrs:W,bitrate:0,id:_++,groupId:W["GROUP-ID"],instreamId:W["INSTREAM-ID"],name:W.NAME||W.LANGUAGE||"",type:h,default:W.bool("DEFAULT"),autoselect:W.bool("AUTOSELECT"),forced:W.bool("FORCED"),lang:W.LANGUAGE,url:W.URI?A.resolve(W.URI,b):""};if(f.length){var w=A.findGroup(f,j.groupId)||f[0];R(j,w,"audioCodec"),R(j,w,"textCodec")}E.push(j)}}return E},A.parseLevelPlaylist=function(x,b,h,f,C){var E=new z.LevelDetails(b),_=E.fragments,W=null,j=0,w=0,F=0,P=0,v=null,H=new $.Fragment(f,b),Y,ie,le,he=-1,xe=!1;for(c.lastIndex=0,E.m3u8=x;(Y=c.exec(x))!==null;){xe&&(xe=!1,H=new $.Fragment(f,b),H.start=F,H.sn=j,H.cc=P,H.level=h,W&&(H.initSegment=W,H.rawProgramDateTime=W.rawProgramDateTime));var Le=Y[1];if(Le){H.duration=parseFloat(Le);var we=(" "+Y[2]).slice(1);H.title=we||null,H.tagList.push(we?["INF",Le,we]:["INF",Le])}else if(Y[3])Object(J.isFiniteNumber)(H.duration)&&(H.start=F,le&&(H.levelkey=le),H.sn=j,H.level=h,H.cc=P,H.urlId=C,_.push(H),H.relurl=(" "+Y[3]).slice(1),S(H,v),v=H,F+=H.duration,j++,w=0,xe=!0);else if(Y[4]){var Ae=(" "+Y[4]).slice(1);v?H.setByteRange(Ae,v):H.setByteRange(Ae)}else if(Y[5])H.rawProgramDateTime=(" "+Y[5]).slice(1),H.tagList.push(["PROGRAM-DATE-TIME",H.rawProgramDateTime]),he===-1&&(he=_.length);else{if(Y=Y[0].match(s),!Y){m.logger.warn("No matches on slow regex match for level playlist!");continue}for(ie=1;ie<Y.length&&!(typeof Y[ie]!="undefined");ie++);var pe=(" "+Y[ie]).slice(1),be=(" "+Y[ie+1]).slice(1),ne=Y[ie+2]?(" "+Y[ie+2]).slice(1):"";switch(pe){case"PLAYLIST-TYPE":E.type=be.toUpperCase();break;case"MEDIA-SEQUENCE":j=E.startSN=parseInt(be);break;case"SKIP":{var fe=new D.AttrList(be),_e=fe.decimalInteger("SKIPPED-SEGMENTS");if(Object(J.isFiniteNumber)(_e)){E.skippedSegments=_e;for(var ke=_e;ke--;)_.unshift(null);j+=_e}var et=fe.enumeratedString("RECENTLY-REMOVED-DATERANGES");et&&(E.recentlyRemovedDateranges=et.split(" "));break}case"TARGETDURATION":E.targetduration=parseFloat(be);break;case"VERSION":E.version=parseInt(be);break;case"EXTM3U":break;case"ENDLIST":E.live=!1;break;case"#":(be||ne)&&H.tagList.push(ne?[be,ne]:[be]);break;case"DIS":P++;case"GAP":H.tagList.push([pe]);break;case"BITRATE":H.tagList.push([pe,be]);break;case"DISCONTINUITY-SEQ":P=parseInt(be);break;case"KEY":{var je,ot=new D.AttrList(be),_t=ot.enumeratedString("METHOD"),Re=ot.URI,Be=ot.hexadecimalInteger("IV"),Qe=ot.enumeratedString("KEYFORMATVERSIONS"),Ve=ot.enumeratedString("KEYID"),Et=(je=ot.enumeratedString("KEYFORMAT"))!=null?je:"identity",kt=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(kt.indexOf(Et)>-1){m.logger.warn("Keyformat "+Et+" is not supported from the manifest");continue}else if(Et!=="identity")continue;_t&&(le=r.LevelKey.fromURL(b,Re),Re&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(_t)>=0&&(le.method=_t,le.keyFormat=Et,Ve&&(le.keyID=Ve),Qe&&(le.keyFormatVersions=Qe),le.iv=Be));break}case"START":{var Vt=new D.AttrList(be),Qt=Vt.decimalFloatingPoint("TIME-OFFSET");Object(J.isFiniteNumber)(Qt)&&(E.startTimeOffset=Qt);break}case"MAP":{var an=new D.AttrList(be);H.relurl=an.URI,an.BYTERANGE&&H.setByteRange(an.BYTERANGE),H.level=h,H.sn="initSegment",le&&(H.levelkey=le),H.initSegment=null,W=H,xe=!0;break}case"SERVER-CONTROL":{var sn=new D.AttrList(be);E.canBlockReload=sn.bool("CAN-BLOCK-RELOAD"),E.canSkipUntil=sn.optionalFloat("CAN-SKIP-UNTIL",0),E.canSkipDateRanges=E.canSkipUntil>0&&sn.bool("CAN-SKIP-DATERANGES"),E.partHoldBack=sn.optionalFloat("PART-HOLD-BACK",0),E.holdBack=sn.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var qe=new D.AttrList(be);E.partTarget=qe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ze=E.partList;Ze||(Ze=E.partList=[]);var Ct=w>0?Ze[Ze.length-1]:void 0,At=w++,ct=new $.Part(new D.AttrList(be),H,b,At,Ct);Ze.push(ct),H.duration+=ct.duration;break}case"PRELOAD-HINT":{var ft=new D.AttrList(be);E.preloadHint=ft;break}case"RENDITION-REPORT":{var He=new D.AttrList(be);E.renditionReports=E.renditionReports||[],E.renditionReports.push(He);break}default:m.logger.warn("line parsed but not handled: "+Y);break}}}v&&!v.relurl?(_.pop(),F-=v.duration,E.partList&&(E.fragmentHint=v)):E.partList&&(S(H,v),H.cc=P,E.fragmentHint=H);var Ne=_.length,Ue=_[0],ge=_[Ne-1];if(F+=E.skippedSegments*E.targetduration,F>0&&Ne&&ge){E.averagetargetduration=F/Ne;var Ee=ge.sn;E.endSN=Ee!=="initSegment"?Ee:0,Ue&&(E.startCC=Ue.cc,Ue.initSegment||E.fragments.every(function(De){return De.relurl&&t(De.relurl)})&&(m.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),H=new $.Fragment(f,b),H.relurl=ge.relurl,H.level=h,H.sn="initSegment",Ue.initSegment=H,E.needSidxRanges=!0))}else E.endSN=0,E.startCC=0;return E.fragmentHint&&(F+=E.fragmentHint.duration),E.totalduration=F,E.endCC=P,he>0&&T(_,he),E},A}();function o(A,I){["video","audio","text"].forEach(function(x){var b=A.filter(function(f){return Object(g.isCodecType)(f,x)});if(b.length){var h=b.filter(function(f){return f.lastIndexOf("avc1",0)===0||f.lastIndexOf("mp4a",0)===0});I[x+"Codec"]=h.length>0?h[0]:b[0],A=A.filter(function(f){return b.indexOf(f)===-1})}}),I.unknownCodecs=A}function R(A,I,x){var b=I[x];b&&(A[x]=b)}function T(A,I){for(var x=A[I],b=I;b--;){var h=A[b];if(!h)return;h.programDateTime=x.programDateTime-h.duration*1e3,x=h}}function S(A,I){A.rawProgramDateTime?A.programDateTime=Date.parse(A.rawProgramDateTime):I!=null&&I.programDateTime&&(A.programDateTime=I.endProgramDateTime),Object(J.isFiniteNumber)(A.programDateTime)||(A.programDateTime=null,A.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/polyfills/number.ts"),K=B("./src/events.ts"),N=B("./src/errors.ts"),$=B("./src/utils/logger.ts"),z=B("./src/utils/mp4-tools.ts"),r=B("./src/loader/m3u8-parser.ts"),D=B("./src/types/loader.ts"),m=B("./src/utils/attr-list.ts");function g(c){var s=c.type;switch(s){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function p(c,s){var i=c.url;return(i===void 0||i.indexOf("data:")===0)&&(i=s.url),i}var a=function(){function c(i){this.hls=void 0,this.loaders=Object.create(null),this.hls=i,this.registerListeners()}var s=c.prototype;return s.registerListeners=function(){var t=this.hls;t.on(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.on(K.Events.LEVEL_LOADING,this.onLevelLoading,this),t.on(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.on(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.unregisterListeners=function(){var t=this.hls;t.off(K.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(K.Events.LEVEL_LOADING,this.onLevelLoading,this),t.off(K.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),t.off(K.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},s.createInternalLoader=function(t){var u=this.hls.config,o=u.pLoader,R=u.loader,T=o||R,S=new T(u);return t.loader=S,this.loaders[t.type]=S,S},s.getInternalLoader=function(t){return this.loaders[t.type]},s.resetInternalLoader=function(t){this.loaders[t]&&delete this.loaders[t]},s.destroyInternalLoaders=function(){for(var t in this.loaders){var u=this.loaders[t];u&&u.destroy(),this.resetInternalLoader(t)}},s.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},s.onManifestLoading=function(t,u){var o=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:o,deliveryDirectives:null})},s.onLevelLoading=function(t,u){var o=u.id,R=u.level,T=u.url,S=u.deliveryDirectives;this.load({id:o,groupId:null,level:R,responseType:"text",type:D.PlaylistContextType.LEVEL,url:T,deliveryDirectives:S})},s.onAudioTrackLoading=function(t,u){var o=u.id,R=u.groupId,T=u.url,S=u.deliveryDirectives;this.load({id:o,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:T,deliveryDirectives:S})},s.onSubtitleTrackLoading=function(t,u){var o=u.id,R=u.groupId,T=u.url,S=u.deliveryDirectives;this.load({id:o,groupId:R,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:T,deliveryDirectives:S})},s.load=function(t){var u,o=this.hls.config,R=this.getInternalLoader(t);if(R){var T=R.context;if(T&&T.url===t.url){$.logger.trace("[playlist-loader]: playlist request ongoing");return}$.logger.log("[playlist-loader]: aborting previous loader for type: "+t.type),R.abort()}var S,A,I,x;switch(t.type){case D.PlaylistContextType.MANIFEST:S=o.manifestLoadingMaxRetry,A=o.manifestLoadingTimeOut,I=o.manifestLoadingRetryDelay,x=o.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:S=0,A=o.levelLoadingTimeOut;break;default:S=o.levelLoadingMaxRetry,A=o.levelLoadingTimeOut,I=o.levelLoadingRetryDelay,x=o.levelLoadingMaxRetryTimeout;break}if(R=this.createInternalLoader(t),(u=t.deliveryDirectives)!==null&&u!==void 0&&u.part){var b;if(t.type===D.PlaylistContextType.LEVEL&&t.level!==null?b=this.hls.levels[t.level].details:t.type===D.PlaylistContextType.AUDIO_TRACK&&t.id!==null?b=this.hls.audioTracks[t.id].details:t.type===D.PlaylistContextType.SUBTITLE_TRACK&&t.id!==null&&(b=this.hls.subtitleTracks[t.id].details),b){var h=b.partTarget,f=b.targetduration;h&&f&&(A=Math.min(Math.max(h*3,f*.8)*1e3,A))}}var C={timeout:A,maxRetry:S,retryDelay:I,maxRetryDelay:x,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};R.load(t,C,E)},s.loadsuccess=function(t,u,o,R){if(R===void 0&&(R=null),o.isSidxRequest){this.handleSidxRequest(t,o),this.handlePlaylistLoaded(t,u,o,R);return}this.resetInternalLoader(o.type);var T=t.data;if(T.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(t,o,"no EXTM3U delimiter",R);return}u.parsing.start=performance.now(),T.indexOf("#EXTINF:")>0||T.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(t,u,o,R):this.handleMasterPlaylist(t,u,o,R)},s.loaderror=function(t,u,o){o===void 0&&(o=null),this.handleNetworkError(u,o,!1,t)},s.loadtimeout=function(t,u,o){o===void 0&&(o=null),this.handleNetworkError(u,o,!0)},s.handleMasterPlaylist=function(t,u,o,R){var T=this.hls,S=t.data,A=p(t,o),I=r.default.parseMasterPlaylist(S,A),x=I.levels,b=I.sessionData;if(!x.length){this.handleManifestParsingError(t,o,"no level found in manifest",R);return}var h=x.map(function(j){return{id:j.attrs.AUDIO,audioCodec:j.audioCodec}}),f=x.map(function(j){return{id:j.attrs.SUBTITLES,textCodec:j.textCodec}}),C=r.default.parseMasterPlaylistMedia(S,A,"AUDIO",h),E=r.default.parseMasterPlaylistMedia(S,A,"SUBTITLES",f),_=r.default.parseMasterPlaylistMedia(S,A,"CLOSED-CAPTIONS");if(C.length){var W=C.some(function(j){return!j.url});!W&&x[0].audioCodec&&!x[0].attrs.AUDIO&&($.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),C.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new m.AttrList({}),bitrate:0,url:""}))}T.trigger(K.Events.MANIFEST_LOADED,{levels:x,audioTracks:C,subtitles:E,captions:_,url:A,stats:u,networkDetails:R,sessionData:b})},s.handleTrackOrLevelPlaylist=function(t,u,o,R){var T=this.hls,S=o.id,A=o.level,I=o.type,x=p(t,o),b=Object(J.isFiniteNumber)(S)?S:0,h=Object(J.isFiniteNumber)(A)?A:b,f=g(o),C=r.default.parseLevelPlaylist(t.data,x,h,f,b);if(!C.fragments.length){T.trigger(K.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:x,reason:"no fragments found in level",level:typeof o.level=="number"?o.level:void 0});return}if(I===D.PlaylistContextType.MANIFEST){var E={attrs:new m.AttrList({}),bitrate:0,details:C,name:"",url:x};T.trigger(K.Events.MANIFEST_LOADED,{levels:[E],audioTracks:[],url:x,stats:u,networkDetails:R,sessionData:null})}if(u.parsing.end=performance.now(),C.needSidxRanges){var _,W=(_=C.fragments[0].initSegment)===null||_===void 0?void 0:_.url;this.load({url:W,isSidxRequest:!0,type:I,level:A,levelDetails:C,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}o.levelDetails=C,this.handlePlaylistLoaded(t,u,o,R)},s.handleSidxRequest=function(t,u){var o=Object(z.parseSegmentIndex)(new Uint8Array(t.data));if(!o)return;var R=o.references,T=u.levelDetails;R.forEach(function(S,A){var I=S.info,x=T.fragments[A];x.byteRange.length===0&&x.setByteRange(String(1+I.end-I.start)+"@"+String(I.start)),x.initSegment&&x.initSegment.setByteRange(String(o.moovEndOffset)+"@0")})},s.handleManifestParsingError=function(t,u,o,R){this.hls.trigger(K.Events.ERROR,{type:N.ErrorTypes.NETWORK_ERROR,details:N.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===D.PlaylistContextType.MANIFEST,url:t.url,reason:o,response:t,context:u,networkDetails:R})},s.handleNetworkError=function(t,u,o,R){o===void 0&&(o=!1),$.logger.warn("[playlist-loader]: A network "+(o?"timeout":"error")+" occurred while loading "+t.type+" level: "+t.level+" id: "+t.id+' group-id: "'+t.groupId+'"');var T=N.ErrorDetails.UNKNOWN,S=!1,A=this.getInternalLoader(t);switch(t.type){case D.PlaylistContextType.MANIFEST:T=o?N.ErrorDetails.MANIFEST_LOAD_TIMEOUT:N.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case D.PlaylistContextType.LEVEL:T=o?N.ErrorDetails.LEVEL_LOAD_TIMEOUT:N.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.AUDIO_TRACK:T=o?N.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:N.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:T=o?N.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:N.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}A&&this.resetInternalLoader(t.type);var I={type:N.ErrorTypes.NETWORK_ERROR,details:T,fatal:S,url:t.url,loader:A,context:t,networkDetails:u};R&&(I.response=R),this.hls.trigger(K.Events.ERROR,I)},s.handlePlaylistLoaded=function(t,u,o,R){var T=o.type,S=o.level,A=o.id,I=o.groupId,x=o.loader,b=o.levelDetails,h=o.deliveryDirectives;if(!(b!=null&&b.targetduration)){this.handleManifestParsingError(t,o,"invalid target duration",R);return}if(!x)return;b.live&&(x.getCacheAge&&(b.ageHeader=x.getCacheAge()||0),(!x.getCacheAge||isNaN(b.ageHeader))&&(b.ageHeader=0));switch(T){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(K.Events.LEVEL_LOADED,{details:b,level:S||0,id:A||0,stats:u,networkDetails:R,deliveryDirectives:h});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(K.Events.AUDIO_TRACK_LOADED,{details:b,id:A||0,groupId:I||"",stats:u,networkDetails:R,deliveryDirectives:h});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(K.Events.SUBTITLE_TRACK_LOADED,{details:b,id:A||0,groupId:I||"",stats:u,networkDetails:R,deliveryDirectives:h});break}},c}();Q.default=a},"./src/polyfills/number.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"isFiniteNumber",function(){return J}),B.d(Q,"MAX_SAFE_INTEGER",function(){return K});var J=Number.isFinite||function(N){return typeof N=="number"&&isFinite(N)},K=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(te,Q,B){"use strict";B.r(Q);var J=function(){function K(){}return K.getSilentFrame=function($,z){switch($){case"mp4a.40.2":if(z===1)return new Uint8Array([0,200,0,128,35,128]);if(z===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(z===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(z===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(z===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(z===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(z===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(z===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(z===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},K}();Q.default=J},"./src/remux/mp4-generator.ts":function(te,Q,B){"use strict";B.r(Q);var J=Math.pow(2,32)-1,K=function(){function N(){}return N.init=function(){N.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 z;for(z in N.types)N.types.hasOwnProperty(z)&&(N.types[z]=[z.charCodeAt(0),z.charCodeAt(1),z.charCodeAt(2),z.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),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]);N.HDLR_TYPES={video:r,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]);N.STTS=N.STSC=N.STCO=g,N.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),N.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),N.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),N.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var p=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);N.FTYP=N.box(N.types.ftyp,p,c,p,a),N.DINF=N.box(N.types.dinf,N.box(N.types.dref,m))},N.box=function(z){for(var r=8,D=arguments.length,m=new Array(D>1?D-1:0),g=1;g<D;g++)m[g-1]=arguments[g];for(var p=m.length,a=p;p--;)r+=m[p].byteLength;var c=new Uint8Array(r);for(c[0]=r>>24&255,c[1]=r>>16&255,c[2]=r>>8&255,c[3]=r&255,c.set(z,4),p=0,r=8;p<a;p++)c.set(m[p],r),r+=m[p].byteLength;return c},N.hdlr=function(z){return N.box(N.types.hdlr,N.HDLR_TYPES[z])},N.mdat=function(z){return N.box(N.types.mdat,z)},N.mdhd=function(z,r){r*=z;var D=Math.floor(r/(J+1)),m=Math.floor(r%(J+1));return N.box(N.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,z>>24&255,z>>16&255,z>>8&255,z&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]))},N.mdia=function(z){return N.box(N.types.mdia,N.mdhd(z.timescale,z.duration),N.hdlr(z.type),N.minf(z))},N.mfhd=function(z){return N.box(N.types.mfhd,new Uint8Array([0,0,0,0,z>>24,z>>16&255,z>>8&255,z&255]))},N.minf=function(z){return z.type==="audio"?N.box(N.types.minf,N.box(N.types.smhd,N.SMHD),N.DINF,N.stbl(z)):N.box(N.types.minf,N.box(N.types.vmhd,N.VMHD),N.DINF,N.stbl(z))},N.moof=function(z,r,D){return N.box(N.types.moof,N.mfhd(z),N.traf(D,r))},N.moov=function(z){for(var r=z.length,D=[];r--;)D[r]=N.trak(z[r]);return N.box.apply(null,[N.types.moov,N.mvhd(z[0].timescale,z[0].duration)].concat(D).concat(N.mvex(z)))},N.mvex=function(z){for(var r=z.length,D=[];r--;)D[r]=N.trex(z[r]);return N.box.apply(null,[N.types.mvex].concat(D))},N.mvhd=function(z,r){r*=z;var D=Math.floor(r/(J+1)),m=Math.floor(r%(J+1)),g=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,z>>24&255,z>>16&255,z>>8&255,z&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 N.box(N.types.mvhd,g)},N.sdtp=function(z){var r=z.samples||[],D=new Uint8Array(4+r.length),m,g;for(m=0;m<r.length;m++)g=r[m].flags,D[m+4]=g.dependsOn<<4|g.isDependedOn<<2|g.hasRedundancy;return N.box(N.types.sdtp,D)},N.stbl=function(z){return N.box(N.types.stbl,N.stsd(z),N.box(N.types.stts,N.STTS),N.box(N.types.stsc,N.STSC),N.box(N.types.stsz,N.STSZ),N.box(N.types.stco,N.STCO))},N.avc1=function(z){var r=[],D=[],m,g,p;for(m=0;m<z.sps.length;m++)g=z.sps[m],p=g.byteLength,r.push(p>>>8&255),r.push(p&255),r=r.concat(Array.prototype.slice.call(g));for(m=0;m<z.pps.length;m++)g=z.pps[m],p=g.byteLength,D.push(p>>>8&255),D.push(p&255),D=D.concat(Array.prototype.slice.call(g));var a=N.box(N.types.avcC,new Uint8Array([1,r[3],r[4],r[5],252|3,224|z.sps.length].concat(r).concat([z.pps.length]).concat(D))),c=z.width,s=z.height,i=z.pixelRatio[0],t=z.pixelRatio[1];return N.box(N.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,c>>8&255,c&255,s>>8&255,s&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]),a,N.box(N.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),N.box(N.types.pasp,new Uint8Array([i>>24,i>>16&255,i>>8&255,i&255,t>>24,t>>16&255,t>>8&255,t&255])))},N.esds=function(z){var r=z.config.length;return new Uint8Array([0,0,0,0,3,23+r,0,1,0,4,15+r,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([r]).concat(z.config).concat([6,1,2]))},N.mp4a=function(z){var r=z.samplerate;return N.box(N.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,z.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]),N.box(N.types.esds,N.esds(z)))},N.mp3=function(z){var r=z.samplerate;return N.box(N.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,z.channelCount,0,16,0,0,0,0,r>>8&255,r&255,0,0]))},N.stsd=function(z){return z.type==="audio"?!z.isAAC&&z.codec==="mp3"?N.box(N.types.stsd,N.STSD,N.mp3(z)):N.box(N.types.stsd,N.STSD,N.mp4a(z)):N.box(N.types.stsd,N.STSD,N.avc1(z))},N.tkhd=function(z){var r=z.id,D=z.duration*z.timescale,m=z.width,g=z.height,p=Math.floor(D/(J+1)),a=Math.floor(D%(J+1));return N.box(N.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,r>>24&255,r>>16&255,r>>8&255,r&255,0,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,a>>24,a>>16&255,a>>8&255,a&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]))},N.traf=function(z,r){var D=N.sdtp(z),m=z.id,g=Math.floor(r/(J+1)),p=Math.floor(r%(J+1));return N.box(N.types.traf,N.box(N.types.tfhd,new Uint8Array([0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255])),N.box(N.types.tfdt,new Uint8Array([1,0,0,0,g>>24,g>>16&255,g>>8&255,g&255,p>>24,p>>16&255,p>>8&255,p&255])),N.trun(z,D.length+16+20+8+16+8+8),D)},N.trak=function(z){return z.duration=z.duration||4294967295,N.box(N.types.trak,N.tkhd(z),N.mdia(z))},N.trex=function(z){var r=z.id;return N.box(N.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},N.trun=function(z,r){var D=z.samples||[],m=D.length,g=12+16*m,p=new Uint8Array(g),a,c,s,i,t,u;for(r+=8+g,p.set([0,0,15,1,m>>>24&255,m>>>16&255,m>>>8&255,m&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255],0),a=0;a<m;a++)c=D[a],s=c.duration,i=c.size,t=c.flags,u=c.cts,p.set([s>>>24&255,s>>>16&255,s>>>8&255,s&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,t.isLeading<<2|t.dependsOn,t.isDependedOn<<6|t.hasRedundancy<<4|t.paddingValue<<1|t.isNonSync,t.degradPrio&240<<8,t.degradPrio&15,u>>>24&255,u>>>16&255,u>>>8&255,u&255],12+16*a);return N.box(N.types.trun,p)},N.initSegment=function(z){N.types||N.init();var r=N.moov(z),D=new Uint8Array(N.FTYP.byteLength+r.byteLength);return D.set(N.FTYP),D.set(r,N.FTYP.byteLength),D},N}();K.types=void 0,K.HDLR_TYPES=void 0,K.STTS=void 0,K.STSC=void 0,K.STCO=void 0,K.STSZ=void 0,K.VMHD=void 0,K.SMHD=void 0,K.STSD=void 0,K.FTYP=void 0,K.DINF=void 0,Q.default=K},"./src/remux/mp4-remuxer.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return u}),B.d(Q,"normalizePts",function(){return o});var J=B("./src/polyfills/number.ts"),K=B("./src/remux/aac-helper.ts"),N=B("./src/remux/mp4-generator.ts"),$=B("./src/events.ts"),z=B("./src/errors.ts"),r=B("./src/utils/logger.ts"),D=B("./src/types/loader.ts"),m=B("./src/utils/timescale-conversion.ts");function g(){return g=Object.assign||function(A){for(var I=1;I<arguments.length;I++){var x=arguments[I];for(var b in x)Object.prototype.hasOwnProperty.call(x,b)&&(A[b]=x[b])}return A},g.apply(this,arguments)}var p=10*1e3,a=1024,c=1152,s=null,i=null,t=!1,u=function(){function A(x,b,h,f){if(f===void 0&&(f=""),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=x,this.config=b,this.typeSupported=h,this.ISGenerated=!1,s===null){var C=navigator.userAgent||"",E=C.match(/Chrome\/(\d+)/i);s=E?parseInt(E[1]):0}if(i===null){var _=navigator.userAgent.match(/Safari\/(\d+)/i);i=_?parseInt(_[1]):0}t=!!s&&s<75||!!i&&i<600}var I=A.prototype;return I.destroy=function(){},I.resetTimeStamp=function(b){r.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=b},I.resetNextTimestamp=function(){r.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},I.resetInitSegment=function(){r.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},I.getVideoStartPts=function(b){var h=!1,f=b.reduce(function(C,E){var _=E.pts-C;return _<-4294967296?(h=!0,o(C,E.pts)):_>0?C:E.pts},b[0].pts);return h&&r.logger.debug("PTS rollover detected"),f},I.remux=function(b,h,f,C,E,_,W,j){var w,F,P,v,H,Y,ie=E,le=E,he=b.pid>-1,xe=h.pid>-1,Le=h.samples.length,we=b.samples.length>0,Ae=Le>1,pe=(!he||we)&&(!xe||Ae)||this.ISGenerated||W;if(pe){this.ISGenerated||(P=this.generateIS(b,h,E));var be=this.isVideoContiguous,ne=-1;if(Ae&&(ne=R(h.samples),!be&&this.config.forceKeyFrameOnDiscontinuity))if(Y=!0,ne>0){r.logger.warn("[mp4-remuxer]: Dropped "+ne+" out of "+Le+" video samples due to a missing keyframe");var fe=this.getVideoStartPts(h.samples);h.samples=h.samples.slice(ne),h.dropped+=ne,le+=(h.samples[0].pts-fe)/(h.timescale||9e4)}else ne===-1&&(r.logger.warn("[mp4-remuxer]: No keyframe found out of "+Le+" video samples"),Y=!1);if(this.ISGenerated){if(we&&Ae){var _e=this.getVideoStartPts(h.samples),ke=o(b.samples[0].pts,_e)-_e,et=ke/h.inputTimeScale;ie+=Math.max(0,et),le+=Math.max(0,-et)}if(we){if(b.samplerate||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),P=this.generateIS(b,h,E)),F=this.remuxAudio(b,ie,this.isAudioContiguous,_,xe||Ae||j===D.PlaylistLevelType.AUDIO?le:void 0),Ae){var je=F?F.endPTS-F.startPTS:0;h.inputTimeScale||(r.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),P=this.generateIS(b,h,E)),w=this.remuxVideo(h,le,be,je)}}else Ae&&(w=this.remuxVideo(h,le,be,0));w&&(w.firstKeyFrame=ne,w.independent=ne!==-1)}}return this.ISGenerated&&(f.samples.length&&(H=this.remuxID3(f,E)),C.samples.length&&(v=this.remuxText(C,E))),{audio:F,video:w,initSegment:P,independent:Y,text:v,id3:H}},I.generateIS=function(b,h,f){var C=b.samples,E=h.samples,_=this.typeSupported,W={},j=!Object(J.isFiniteNumber)(this._initPTS),w="audio/mp4",F,P,v;if(j&&(F=P=Infinity),b.config&&C.length&&(b.timescale=b.samplerate,b.isAAC||(_.mpeg?(w="audio/mpeg",b.codec=""):_.mp3&&(b.codec="mp3")),W.audio={id:"audio",container:w,codec:b.codec,initSegment:!b.isAAC&&_.mpeg?new Uint8Array(0):N.default.initSegment([b]),metadata:{channelCount:b.channelCount}},j&&(v=b.inputTimeScale,F=P=C[0].pts-Math.round(v*f))),h.sps&&h.pps&&E.length&&(h.timescale=h.inputTimeScale,W.video={id:"main",container:"video/mp4",codec:h.codec,initSegment:N.default.initSegment([h]),metadata:{width:h.width,height:h.height}},j)){v=h.inputTimeScale;var H=this.getVideoStartPts(E),Y=Math.round(v*f);P=Math.min(P,o(E[0].dts,H)-Y),F=Math.min(F,H-Y)}if(Object.keys(W).length)return this.ISGenerated=!0,j&&(this._initPTS=F,this._initDTS=P),{tracks:W,initPTS:F,timescale:v}},I.remuxVideo=function(b,h,f,C){var E=b.inputTimeScale,_=b.samples,W=[],j=_.length,w=this._initPTS,F=this.nextAvcDts,P=8,v,H,Y,ie=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,he=0,xe=!1;if(!f||F===null){var Le=h*E,we=_[0].pts-o(_[0].dts,_[0].pts);F=Le-we}for(var Ae=0;Ae<j;Ae++){var pe=_[Ae];if(pe.pts=o(pe.pts-w,F),pe.dts=o(pe.dts-w,F),pe.dts>pe.pts){var be=9e4*.2;he=Math.max(Math.min(he,pe.pts-pe.dts),-1*be)}pe.dts<_[Ae>0?Ae-1:Ae].dts&&(xe=!0)}xe&&_.sort(function($n,vn){var ln=$n.dts-vn.dts,hn=$n.pts-vn.pts;return ln||hn}),H=_[0].dts,Y=_[_.length-1].dts;var ne=Math.round((Y-H)/(j-1));if(he<0){if(he<ne*-2){r.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(m.toMsFromMpegTsClock)(-ne,!0)+" ms");for(var fe=he,_e=0;_e<j;_e++)_[_e].dts=fe=Math.max(fe,_[_e].pts-ne),_[_e].pts=Math.max(fe,_[_e].pts)}else{r.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(m.toMsFromMpegTsClock)(he,!0)+" ms to overcome this issue");for(var ke=0;ke<j;ke++)_[ke].dts=_[ke].dts+he}H=_[0].dts}if(f){var et=H-F,je=et>ne,ot=et<-1;if(je||ot){je?r.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(et,!0)+" ms ("+et+"dts) hole between fragments detected, filling it"):r.logger.warn("AVC: "+Object(m.toMsFromMpegTsClock)(-et,!0)+" ms ("+et+"dts) overlapping between fragments detected"),H=F;var _t=_[0].pts-et;_[0].dts=H,_[0].pts=_t,r.logger.log("Video: First PTS/DTS adjusted: "+Object(m.toMsFromMpegTsClock)(_t,!0)+"/"+Object(m.toMsFromMpegTsClock)(H,!0)+", delta: "+Object(m.toMsFromMpegTsClock)(et,!0)+" ms")}}t&&(H=Math.max(0,H));for(var Re=0,Be=0,Qe=0;Qe<j;Qe++){for(var Ve=_[Qe],Et=Ve.units,kt=Et.length,Vt=0,Qt=0;Qt<kt;Qt++)Vt+=Et[Qt].data.length;Be+=Vt,Re+=kt,Ve.length=Vt,Ve.dts=Math.max(Ve.dts,H),Ve.pts=Math.max(Ve.pts,Ve.dts,0),ie=Math.min(Ve.pts,ie),le=Math.max(Ve.pts,le)}Y=_[j-1].dts;var an=Be+4*Re+8,sn;try{sn=new Uint8Array(an)}catch($n){this.observer.emit($.Events.ERROR,$.Events.ERROR,{type:z.ErrorTypes.MUX_ERROR,details:z.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:an,reason:"fail allocating video mdat "+an});return}var qe=new DataView(sn.buffer);qe.setUint32(0,an),sn.set(N.default.types.mdat,4);for(var Ze=0;Ze<j;Ze++){for(var Ct=_[Ze],At=Ct.units,ct=0,ft=0,He=At.length;ft<He;ft++){var Ne=At[ft],Ue=Ne.data,ge=Ne.data.byteLength;qe.setUint32(P,ge),P+=4,sn.set(Ue,P),P+=ge,ct+=4+ge}if(Ze<j-1)v=_[Ze+1].dts-Ct.dts;else{var Ee=this.config,De=Ct.dts-_[Ze>0?Ze-1:Ze].dts;if(Ee.stretchShortVideoTrack&&this.nextAudioPts!==null){var ue=Math.floor(Ee.maxBufferHole*E),Fe=(C?ie+C*E:this.nextAudioPts)-Ct.pts;Fe>ue?(v=Fe-De,v<0&&(v=De),r.logger.log("[mp4-remuxer]: It is approximately "+Fe/90+" ms to the next segment; using duration "+v/90+" ms for the last video frame.")):v=De}else v=De}var at=Math.round(Ct.pts-Ct.dts);W.push(new T(Ct.key,v,ct,at))}if(W.length&&s&&s<70){var xt=W[0].flags;xt.dependsOn=2,xt.isNonSync=0}console.assert(v!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=F=Y+v,this.isVideoContiguous=!0;var Kt=N.default.moof(b.sequenceNumber++,H,g({},b,{samples:W})),Xt="video",$t={data1:Kt,data2:sn,startPTS:ie/E,endPTS:(le+v)/E,startDTS:H/E,endDTS:F/E,type:Xt,hasAudio:!1,hasVideo:!0,nb:W.length,dropped:b.dropped};return b.samples=[],b.dropped=0,console.assert(sn.length,"MDAT length must not be zero"),$t},I.remuxAudio=function(b,h,f,C,E){var _=b.inputTimeScale,W=b.samplerate?b.samplerate:_,j=_/W,w=b.isAAC?a:c,F=w*j,P=this._initPTS,v=!b.isAAC&&this.typeSupported.mpeg,H=[],Y=b.samples,ie=v?0:8,le=this.nextAudioPts||-1,he=h*_;if(this.isAudioContiguous=f=f||Y.length&&le>0&&(C&&Math.abs(he-le)<9e3||Math.abs(o(Y[0].pts-P,he)-le)<20*F),Y.forEach(function(Ue){Ue.pts=o(Ue.pts-P,he)}),!f||le<0){if(Y=Y.filter(function(Ue){return Ue.pts>=0}),!Y.length)return;E===0?le=0:C?le=Math.max(0,he):le=Y[0].pts}if(b.isAAC)for(var xe=E!==void 0,Le=this.config.maxAudioFramesDrift,we=0,Ae=le;we<Y.length;we++){var pe=Y[we],be=pe.pts,ne=be-Ae,fe=Math.abs(1e3*ne/_);if(ne<=-Le*F&&xe)we===0&&(r.logger.warn("Audio frame @ "+(be/_).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ne/_)+" ms."),this.nextAudioPts=le=Ae=be);else if(ne>=Le*F&&fe<p&&xe){var _e=Math.round(ne/F);Ae=be-_e*F,Ae<0&&(_e--,Ae+=F),we===0&&(this.nextAudioPts=le=Ae),r.logger.warn("[mp4-remuxer]: Injecting "+_e+" audio frame @ "+(Ae/_).toFixed(3)+"s due to "+Math.round(1e3*ne/_)+" ms gap.");for(var ke=0;ke<_e;ke++){var et=Math.max(Ae,0),je=K.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);je||(r.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),je=pe.unit.subarray()),Y.splice(we,0,{unit:je,pts:et}),Ae+=F,we++}}pe.pts=Ae,Ae+=F}for(var ot=null,_t=null,Re,Be=0,Qe=Y.length;Qe--;)Be+=Y[Qe].unit.byteLength;for(var Ve=0,Et=Y.length;Ve<Et;Ve++){var kt=Y[Ve],Vt=kt.unit,Qt=kt.pts;if(_t!==null){var an=H[Ve-1];an.duration=Math.round((Qt-_t)/j)}else if(f&&b.isAAC&&(Qt=le),ot=Qt,Be>0){Be+=ie;try{Re=new Uint8Array(Be)}catch(Ue){this.observer.emit($.Events.ERROR,$.Events.ERROR,{type:z.ErrorTypes.MUX_ERROR,details:z.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Be,reason:"fail allocating audio mdat "+Be});return}if(!v){var sn=new DataView(Re.buffer);sn.setUint32(0,Be),Re.set(N.default.types.mdat,4)}}else return;Re.set(Vt,ie);var qe=Vt.byteLength;ie+=qe,H.push(new T(!0,w,qe,0)),_t=Qt}var Ze=H.length;if(!Ze)return;var Ct=H[H.length-1];this.nextAudioPts=le=_t+j*Ct.duration;var At=v?new Uint8Array(0):N.default.moof(b.sequenceNumber++,ot/j,g({},b,{samples:H}));b.samples=[];var ct=ot/_,ft=le/_,He="audio",Ne={data1:At,data2:Re,startPTS:ct,endPTS:ft,startDTS:ct,endDTS:ft,type:He,hasAudio:!0,hasVideo:!1,nb:Ze};return this.isAudioContiguous=!0,console.assert(Re.length,"MDAT length must not be zero"),Ne},I.remuxEmptyAudio=function(b,h,f,C){var E=b.inputTimeScale,_=b.samplerate?b.samplerate:E,W=E/_,j=this.nextAudioPts,w=(j!==null?j:C.startDTS*E)+this._initDTS,F=C.endDTS*E+this._initDTS,P=W*a,v=Math.ceil((F-w)/P),H=K.default.getSilentFrame(b.manifestCodec||b.codec,b.channelCount);if(r.logger.warn("[mp4-remuxer]: remux empty Audio"),!H){r.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Y=[],ie=0;ie<v;ie++){var le=w+ie*P;Y.push({unit:H,pts:le,dts:le})}return b.samples=Y,this.remuxAudio(b,h,f,!1)},I.remuxID3=function(b,h){var f=b.samples.length;if(!f)return;for(var C=b.inputTimeScale,E=this._initPTS,_=this._initDTS,W=0;W<f;W++){var j=b.samples[W];j.pts=o(j.pts-E,h*C)/C,j.dts=o(j.dts-_,h*C)/C}var w=b.samples;return b.samples=[],{samples:w}},I.remuxText=function(b,h){var f=b.samples.length;if(!f)return;for(var C=b.inputTimeScale,E=this._initPTS,_=0;_<f;_++){var W=b.samples[_];W.pts=o(W.pts-E,h*C)/C}b.samples.sort(function(w,F){return w.pts-F.pts});var j=b.samples;return b.samples=[],{samples:j}},A}();function o(A,I){var x;if(I===null)return A;for(I<A?x=-8589934592:x=8589934592;Math.abs(A-I)>4294967296;)A+=x;return A}function R(A){for(var I=0;I<A.length;I++)if(A[I].key)return I;return-1}var T=function(I,x,b,h){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=x,this.size=b,this.cts=h,this.flags=new S(I)},S=function(I){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=I?2:1,this.isNonSync=I?0:1}},"./src/remux/passthrough-remuxer.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/polyfills/number.ts"),K=B("./src/utils/mp4-tools.ts"),N=B("./src/loader/fragment.ts"),$=B("./src/utils/logger.ts"),z=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(a){this.initPTS=a,this.lastEndDTS=null},g.resetNextTimestamp=function(){this.lastEndDTS=null},g.resetInitSegment=function(a,c,s){this.audioCodec=c,this.videoCodec=s,this.generateInitSegment(a),this.emitInitSegment=!0},g.generateInitSegment=function(a){var c=this.audioCodec,s=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var i=this.initData=Object(K.parseInitSegment)(a);c||(c=D(i.audio,N.ElementaryStreamTypes.AUDIO)),s||(s=D(i.video,N.ElementaryStreamTypes.VIDEO));var t={};i.audio&&i.video?t.audiovideo={container:"video/mp4",codec:c+","+s,initSegment:a,id:"main"}:i.audio?t.audio={container:"audio/mp4",codec:c,initSegment:a,id:"audio"}:i.video?t.video={container:"video/mp4",codec:s,initSegment:a,id:"main"}:$.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=t},g.remux=function(a,c,s,i,t){var u=this.initPTS,o=this.lastEndDTS,R={audio:void 0,video:void 0,text:i,id3:s,initSegment:void 0};Object(J.isFiniteNumber)(o)||(o=this.lastEndDTS=t||0);var T=c.samples;if(!T||!T.length)return R;var S={initPTS:void 0,timescale:1},A=this.initData;if((!A||!A.length)&&(this.generateInitSegment(T),A=this.initData),!A||!A.length)return $.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),R;this.emitInitSegment&&(S.tracks=this.initTracks,this.emitInitSegment=!1),Object(J.isFiniteNumber)(u)||(this.initPTS=S.initPTS=u=r(A,T,o));var I=Object(K.getDuration)(T,A),x=o,b=I+x;Object(K.offsetStartDTS)(A,T,u),I>0?this.lastEndDTS=b:($.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!A.audio,f=!!A.video,C="";h&&(C+="audio"),f&&(C+="video");var E={data1:T,startPTS:x,startDTS:x,endPTS:b,endDTS:b,type:C,hasAudio:h,hasVideo:f,nb:1,dropped:0};return R.audio=E.type==="audio"?E:void 0,R.video=E.type!=="audio"?E:void 0,R.text=i,R.id3=s,R.initSegment=S,R},m}(),r=function(g,p,a){return Object(K.getStartDTS)(g,p)-a};function D(m,g){var p=m==null?void 0:m.codec;return p&&p.length>4?p:p==="hvc1"?"hvc1.1.c.L120.90":p==="av01"?"av01.0.04M.08":p==="avc1"||g===N.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}Q.default=z},"./src/task-loop.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return J});var J=function(){function K(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var N=K.prototype;return N.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},N.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},N.onHandlerDestroyed=function(){},N.hasInterval=function(){return!!this._tickInterval},N.hasNextTick=function(){return!!this._tickTimer},N.setInterval=function(z){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,z),!0)},N.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},N.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},N.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},N.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},N.doTick=function(){},K}()},"./src/types/cmcd.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"CMCDVersion",function(){return J}),B.d(Q,"CMCDObjectType",function(){return K}),B.d(Q,"CMCDStreamingFormat",function(){return N}),B.d(Q,"CMCDStreamType",function(){return $});var J=1,K;(function(z){z.MANIFEST="m",z.AUDIO="a",z.VIDEO="v",z.MUXED="av",z.INIT="i",z.CAPTION="c",z.TIMED_TEXT="tt",z.KEY="k",z.OTHER="o"})(K||(K={}));var N;(function(z){z.DASH="d",z.HLS="h",z.SMOOTH="s",z.OTHER="o"})(N||(N={}));var $;(function(z){z.VOD="v",z.LIVE="l"})($||($={}))},"./src/types/level.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"HlsSkip",function(){return N}),B.d(Q,"getSkipValue",function(){return $}),B.d(Q,"HlsUrlParameters",function(){return z}),B.d(Q,"Level",function(){return r});function J(D,m){for(var g=0;g<m.length;g++){var p=m[g];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(D,p.key,p)}}function K(D,m,g){return m&&J(D.prototype,m),g&&J(D,g),D}var N;(function(D){D.No="",D.Yes="YES",D.v2="v2"})(N||(N={}));function $(D,m){var g=D.canSkipUntil,p=D.canSkipDateRanges,a=D.endSN,c=m!==void 0?m-a:0;return g&&c<g?p?N.v2:N.Yes:N.No}var z=function(){function D(g,p,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=g,this.part=p,this.skip=a}var m=D.prototype;return m.addDirectives=function(p){var a=new self.URL(p);return this.msn!==void 0&&a.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&a.searchParams.set("_HLS_part",this.part.toString()),this.skip&&a.searchParams.set("_HLS_skip",this.skip),a.toString()},D}(),r=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 K(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 p=g%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),D}()},"./src/types/loader.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"PlaylistContextType",function(){return J}),B.d(Q,"PlaylistLevelType",function(){return K});var J;(function(N){N.MANIFEST="manifest",N.LEVEL="level",N.AUDIO_TRACK="audioTrack",N.SUBTITLE_TRACK="subtitleTrack"})(J||(J={}));var K;(function(N){N.MAIN="main",N.AUDIO="audio",N.SUBTITLE="subtitle"})(K||(K={}))},"./src/types/transmuxer.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"ChunkMetadata",function(){return J});var J=function($,z,r,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=K(),this.buffering={audio:K(),video:K(),audiovideo:K()},this.level=$,this.sn=z,this.id=r,this.size=D,this.part=m,this.partial=g};function K(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"AttrList",function(){return N});var J=/^(\d+)x(\d+)$/,K=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,N=function(){function $(r){typeof r=="string"&&(r=$.parseAttrList(r));for(var D in r)r.hasOwnProperty(D)&&(this[D]=r[D])}var z=$.prototype;return z.decimalInteger=function(D){var m=parseInt(this[D],10);return m>Number.MAX_SAFE_INTEGER?Infinity:m},z.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),p=0;p<m.length/2;p++)g[p]=parseInt(m.slice(p*2,p*2+2),16);return g}else return null},z.hexadecimalIntegerAsNumber=function(D){var m=parseInt(this[D],16);return m>Number.MAX_SAFE_INTEGER?Infinity:m},z.decimalFloatingPoint=function(D){return parseFloat(this[D])},z.optionalFloat=function(D,m){var g=this[D];return g?parseFloat(g):m},z.enumeratedString=function(D){return this[D]},z.bool=function(D){return this[D]==="YES"},z.decimalResolution=function(D){var m=J.exec(this[D]);return m===null?void 0:{width:parseInt(m[1],10),height:parseInt(m[2],10)}},$.parseAttrList=function(D){var m,g={},p='"';for(K.lastIndex=0;(m=K.exec(D))!==null;){var a=m[2];a.indexOf(p)===0&&a.lastIndexOf(p)===a.length-1&&(a=a.slice(1,-1)),g[m[1]]=a}return g},$}()},"./src/utils/binary-search.ts":function(te,Q,B){"use strict";B.r(Q);var J={search:function(N,$){for(var z=0,r=N.length-1,D=null,m=null;z<=r;){D=(z+r)/2|0,m=N[D];var g=$(m);if(g>0)z=D+1;else if(g<0)r=D-1;else return m}return null}};Q.default=J},"./src/utils/buffer-helper.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"BufferHelper",function(){return N});var J=B("./src/utils/logger.ts"),K={length:0,start:function(){return 0},end:function(){return 0}},N=function(){function $(){}return $.isBuffered=function(r,D){try{if(r){for(var m=$.getBuffered(r),g=0;g<m.length;g++)if(D>=m.start(g)&&D<=m.end(g))return!0}}catch(p){}return!1},$.bufferInfo=function(r,D,m){try{if(r){var g=$.getBuffered(r),p=[],a;for(a=0;a<g.length;a++)p.push({start:g.start(a),end:g.end(a)});return this.bufferedInfo(p,D,m)}}catch(c){}return{len:0,start:D,end:D,nextStart:void 0}},$.bufferedInfo=function(r,D,m){D=Math.max(0,D),r.sort(function(S,A){var I=S.start-A.start;return I||A.end-S.end});var g=[];if(m)for(var p=0;p<r.length;p++){var a=g.length;if(a){var c=g[a-1].end;r[p].start-c<m?r[p].end>c&&(g[a-1].end=r[p].end):g.push(r[p])}else g.push(r[p])}else g=r;for(var s=0,i,t=D,u=D,o=0;o<g.length;o++){var R=g[o].start,T=g[o].end;if(D+m>=R&&D<T)t=R,u=T,s=u-D;else if(D+m<R){i=R;break}}return{len:s,start:t||0,end:u||0,nextStart:i}},$.getBuffered=function(r){try{return r.buffered}catch(D){return J.logger.log("failed to get media.buffered",D),K}},$}()},"./src/utils/cea-608-parser.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"Row",function(){return u}),B.d(Q,"CaptionScreen",function(){return o});var J=B("./src/utils/logger.ts"),K={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},N=function(b){var h=b;return K.hasOwnProperty(b)&&(h=K[b]),String.fromCharCode(h)},$=15,z=100,r={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},p=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(x){x[x.ERROR=0]="ERROR",x[x.TEXT=1]="TEXT",x[x.WARNING=2]="WARNING",x[x.INFO=2]="INFO",x[x.DEBUG=3]="DEBUG",x[x.DATA=3]="DATA"})(a||(a={}));var c=function(){function x(){this.time=null,this.verboseLevel=a.ERROR}var b=x.prototype;return b.log=function(f,C){this.verboseLevel>=f&&J.logger.log(this.time+" ["+f+"] "+C)},x}(),s=function(b){for(var h=[],f=0;f<b.length;f++)h.push(b[f].toString(16));return h},i=function(){function x(h,f,C,E,_){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=h||"white",this.underline=f||!1,this.italics=C||!1,this.background=E||"black",this.flash=_||!1}var b=x.prototype;return b.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},b.setStyles=function(f){for(var C=["foreground","underline","italics","background","flash"],E=0;E<C.length;E++){var _=C[E];f.hasOwnProperty(_)&&(this[_]=f[_])}},b.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},b.equals=function(f){return this.foreground===f.foreground&&this.underline===f.underline&&this.italics===f.italics&&this.background===f.background&&this.flash===f.flash},b.copy=function(f){this.foreground=f.foreground,this.underline=f.underline,this.italics=f.italics,this.background=f.background,this.flash=f.flash},b.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},x}(),t=function(){function x(h,f,C,E,_,W){this.uchar=void 0,this.penState=void 0,this.uchar=h||" ",this.penState=new i(f,C,E,_,W)}var b=x.prototype;return b.reset=function(){this.uchar=" ",this.penState.reset()},b.setChar=function(f,C){this.uchar=f,this.penState.copy(C)},b.setPenState=function(f){this.penState.copy(f)},b.equals=function(f){return this.uchar===f.uchar&&this.penState.equals(f.penState)},b.copy=function(f){this.uchar=f.uchar,this.penState.copy(f.penState)},b.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},x}(),u=function(){function x(h){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var f=0;f<z;f++)this.chars.push(new t);this.logger=h,this.pos=0,this.currPenState=new i}var b=x.prototype;return b.equals=function(f){for(var C=!0,E=0;E<z;E++)if(!this.chars[E].equals(f.chars[E])){C=!1;break}return C},b.copy=function(f){for(var C=0;C<z;C++)this.chars[C].copy(f.chars[C])},b.isEmpty=function(){for(var f=!0,C=0;C<z;C++)if(!this.chars[C].isEmpty()){f=!1;break}return f},b.setCursor=function(f){this.pos!==f&&(this.pos=f),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>z&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=z)},b.moveCursor=function(f){var C=this.pos+f;if(f>1)for(var E=this.pos+1;E<C+1;E++)this.chars[E].setPenState(this.currPenState);this.setCursor(C)},b.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},b.insertChar=function(f){f>=144&&this.backSpace();var C=N(f);if(this.pos>=z){this.logger.log(a.ERROR,"Cannot insert "+f.toString(16)+" ("+C+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(C,this.currPenState),this.moveCursor(1)},b.clearFromPos=function(f){var C;for(C=f;C<z;C++)this.chars[C].reset()},b.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},b.clearToEndOfRow=function(){this.clearFromPos(this.pos)},b.getTextString=function(){for(var f=[],C=!0,E=0;E<z;E++){var _=this.chars[E].uchar;_!==" "&&(C=!1),f.push(_)}return C?"":f.join("")},b.setPenStyles=function(f){this.currPenState.setStyles(f);var C=this.chars[this.pos];C.setPenState(this.currPenState)},x}(),o=function(){function x(h){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var f=0;f<$;f++)this.rows.push(new u(h));this.logger=h,this.currRow=$-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var b=x.prototype;return b.reset=function(){for(var f=0;f<$;f++)this.rows[f].clear();this.currRow=$-1},b.equals=function(f){for(var C=!0,E=0;E<$;E++)if(!this.rows[E].equals(f.rows[E])){C=!1;break}return C},b.copy=function(f){for(var C=0;C<$;C++)this.rows[C].copy(f.rows[C])},b.isEmpty=function(){for(var f=!0,C=0;C<$;C++)if(!this.rows[C].isEmpty()){f=!1;break}return f},b.backSpace=function(){var f=this.rows[this.currRow];f.backSpace()},b.clearToEndOfRow=function(){var f=this.rows[this.currRow];f.clearToEndOfRow()},b.insertChar=function(f){var C=this.rows[this.currRow];C.insertChar(f)},b.setPen=function(f){var C=this.rows[this.currRow];C.setPenStyles(f)},b.moveCursor=function(f){var C=this.rows[this.currRow];C.moveCursor(f)},b.setCursor=function(f){this.logger.log(a.INFO,"setCursor: "+f);var C=this.rows[this.currRow];C.setCursor(f)},b.setPAC=function(f){this.logger.log(a.INFO,"pacData = "+JSON.stringify(f));var C=f.row-1;if(this.nrRollUpRows&&C<this.nrRollUpRows-1&&(C=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==C){for(var E=0;E<$;E++)this.rows[E].clear();var _=this.currRow+1-this.nrRollUpRows,W=this.lastOutputScreen;if(W){var j=W.rows[_].cueStartTime,w=this.logger.time;if(j&&w!==null&&j<w)for(var F=0;F<this.nrRollUpRows;F++)this.rows[C-this.nrRollUpRows+F+1].copy(W.rows[_+F])}}this.currRow=C;var P=this.rows[this.currRow];if(f.indent!==null){var v=f.indent,H=Math.max(v-1,0);P.setCursor(f.indent),f.color=P.chars[H].penState.foreground}var Y={foreground:f.color,underline:f.underline,italics:f.italics,background:"black",flash:!1};this.setPen(Y)},b.setBkgData=function(f){this.logger.log(a.INFO,"bkgData = "+JSON.stringify(f)),this.backSpace(),this.setPen(f),this.insertChar(32)},b.setRollUpRows=function(f){this.nrRollUpRows=f},b.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var f=this.currRow+1-this.nrRollUpRows,C=this.rows.splice(f,1)[0];C.clear(),this.rows.splice(this.currRow,0,C),this.logger.log(a.INFO,"Rolling up")},b.getDisplayText=function(f){f=f||!1;for(var C=[],E="",_=-1,W=0;W<$;W++){var j=this.rows[W].getTextString();j&&(_=W+1,f?C.push("Row "+_+": '"+j+"'"):C.push(j.trim()))}return C.length>0&&(f?E="["+C.join(" | ")+"]":E=C.join(`
`)),E},b.getTextAndFormat=function(){return this.rows},x}(),R=function(){function x(h,f,C){this.chNr=void 0,this.outputFilter=void 0,this.mode=void 0,this.verbose=void 0,this.displayedMemory=void 0,this.nonDisplayedMemory=void 0,this.lastOutputScreen=void 0,this.currRollUpRow=void 0,this.writeScreen=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chNr=h,this.outputFilter=f,this.mode=null,this.verbose=0,this.displayedMemory=new o(C),this.nonDisplayedMemory=new o(C),this.lastOutputScreen=new o(C),this.currRollUpRow=this.displayedMemory.rows[$-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=C}var b=x.prototype;return b.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[$-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},b.getHandler=function(){return this.outputFilter},b.setHandler=function(f){this.outputFilter=f},b.setPAC=function(f){this.writeScreen.setPAC(f)},b.setBkgData=function(f){this.writeScreen.setBkgData(f)},b.setMode=function(f){if(f===this.mode)return;this.mode=f,this.logger.log(a.INFO,"MODE="+f),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=f},b.insertChars=function(f){for(var C=0;C<f.length;C++)this.writeScreen.insertChar(f[C]);var E=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,E+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},b.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},b.ccBS=function(){if(this.logger.log(a.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},b.ccAOF=function(){},b.ccAON=function(){},b.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},b.ccRU=function(f){this.logger.log(a.INFO,"RU("+f+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(f)},b.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},b.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},b.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},b.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},b.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},b.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},b.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},b.ccEOC=function(){if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var f=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=f,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},b.ccTO=function(f){this.logger.log(a.INFO,"TO("+f+") - Tab Offset"),this.writeScreen.moveCursor(f)},b.ccMIDROW=function(f){var C={flash:!1};if(C.underline=f%2===1,C.italics=f>=46,C.italics)C.foreground="white";else{var E=Math.floor(f/2)-16,_=["white","green","blue","cyan","red","yellow","magenta"];C.foreground=_[E]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(C)),this.writeScreen.setPen(C)},b.outputDataUpdate=function(f){f===void 0&&(f=!1);var C=this.logger.time;if(C===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=C:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,C,this.lastOutputScreen),f&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:C),this.lastOutputScreen.copy(this.displayedMemory))},b.cueSplitAtTime=function(f){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,f,this.displayedMemory),this.cueStartTime=f))},x}(),T=function(){function x(h,f,C){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var E=new c;this.channels=[null,new R(h,f,E),new R(h+1,C,E)],this.cmdHistory=I(),this.logger=E}var b=x.prototype;return b.getHandler=function(f){return this.channels[f].getHandler()},b.setHandler=function(f,C){this.channels[f].setHandler(C)},b.addData=function(f,C){var E,_,W,j=!1;this.logger.time=f;for(var w=0;w<C.length;w+=2){if(_=C[w]&127,W=C[w+1]&127,_===0&&W===0)continue;if(this.logger.log(a.DATA,"["+s([C[w],C[w+1]])+"] -> ("+s([_,W])+")"),E=this.parseCmd(_,W),E||(E=this.parseMidrow(_,W)),E||(E=this.parsePAC(_,W)),E||(E=this.parseBackgroundAttributes(_,W)),!E&&(j=this.parseChars(_,W),j)){var F=this.currentChannel;if(F&&F>0){var P=this.channels[F];P.insertChars(j)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!E&&!j&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+s([_,W])+" orig: "+s([C[w],C[w+1]]))}},b.parseCmd=function(f,C){var E=this.cmdHistory,_=(f===20||f===28||f===21||f===29)&&C>=32&&C<=47,W=(f===23||f===31)&&C>=33&&C<=35;if(!(_||W))return!1;if(A(f,C,E))return S(null,null,E),this.logger.log(a.DEBUG,"Repeated command ("+s([f,C])+") is dropped"),!0;var j=f===20||f===21||f===23?1:2,w=this.channels[j];return f===20||f===21||f===28||f===29?C===32?w.ccRCL():C===33?w.ccBS():C===34?w.ccAOF():C===35?w.ccAON():C===36?w.ccDER():C===37?w.ccRU(2):C===38?w.ccRU(3):C===39?w.ccRU(4):C===40?w.ccFON():C===41?w.ccRDC():C===42?w.ccTR():C===43?w.ccRTD():C===44?w.ccEDM():C===45?w.ccCR():C===46?w.ccENM():C===47&&w.ccEOC():w.ccTO(C-32),S(f,C,E),this.currentChannel=j,!0},b.parseMidrow=function(f,C){var E=0;if((f===17||f===25)&&C>=32&&C<=47){if(f===17?E=1:E=2,E!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var _=this.channels[E];return _?(_.ccMIDROW(C),this.logger.log(a.DEBUG,"MIDROW ("+s([f,C])+")"),!0):!1}return!1},b.parsePAC=function(f,C){var E,_=this.cmdHistory,W=(f>=17&&f<=23||f>=25&&f<=31)&&C>=64&&C<=127,j=(f===16||f===24)&&C>=64&&C<=95;if(!(W||j))return!1;if(A(f,C,_))return S(null,null,_),!0;var w=f<=23?1:2;C>=64&&C<=95?E=w===1?r[f]:m[f]:E=w===1?D[f]:g[f];var F=this.channels[w];return F?(F.setPAC(this.interpretPAC(E,C)),S(f,C,_),this.currentChannel=w,!0):!1},b.interpretPAC=function(f,C){var E,_={color:null,italics:!1,indent:null,underline:!1,row:f};return C>95?E=C-96:E=C-64,_.underline=(E&1)===1,E<=13?_.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(E/2)]:E<=15?(_.italics=!0,_.color="white"):_.indent=Math.floor((E-16)/2)*4,_},b.parseChars=function(f,C){var E,_=null,W=null;if(f>=25?(E=2,W=f-8):(E=1,W=f),W>=17&&W<=19){var j;W===17?j=C+80:W===18?j=C+112:j=C+144,this.logger.log(a.INFO,"Special char '"+N(j)+"' in channel "+E),_=[j]}else f>=32&&f<=127&&(_=C===0?[f]:[f,C]);if(_){var w=s(_);this.logger.log(a.DEBUG,"Char codes = "+w.join(",")),S(f,C,this.cmdHistory)}return _},b.parseBackgroundAttributes=function(f,C){var E=(f===16||f===24)&&C>=32&&C<=47,_=(f===23||f===31)&&C>=45&&C<=47;if(!(E||_))return!1;var W,j={};f===16||f===24?(W=Math.floor((C-32)/2),j.background=p[W],C%2===1&&(j.background=j.background+"_semi")):C===45?j.background="transparent":(j.foreground="black",C===47&&(j.underline=!0));var w=f<=23?1:2,F=this.channels[w];return F.setBkgData(j),S(f,C,this.cmdHistory),!0},b.reset=function(){for(var f=0;f<Object.keys(this.channels).length;f++){var C=this.channels[f];C&&C.reset()}this.cmdHistory=I()},b.cueSplitAtTime=function(f){for(var C=0;C<this.channels.length;C++){var E=this.channels[C];E&&E.cueSplitAtTime(f)}},x}();function S(x,b,h){h.a=x,h.b=b}function A(x,b,h){return h.a===x&&h.b===b}function I(){return{a:null,b:null}}Q.default=T},"./src/utils/codecs.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"isCodecType",function(){return K}),B.d(Q,"isCodecSupportedInMp4",function(){return N});var J={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 K($,z){var r=J[z];return!!r&&r[$.slice(0,4)]===!0}function N($,z){return MediaSource.isTypeSupported((z||"video")+'/mp4;codecs="'+$+'"')}},"./src/utils/cues.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/utils/vttparser.ts"),K=B("./src/utils/webvtt-parser.ts"),N=B("./src/utils/texttrack-utils.ts"),$=/\s/,z={newCue:function(D,m,g,p){for(var a=[],c,s,i,t,u,o=self.VTTCue||self.TextTrackCue,R=0;R<p.rows.length;R++)if(c=p.rows[R],i=!0,t=0,u="",!c.isEmpty()){for(var T=0;T<c.chars.length;T++)$.test(c.chars[T].uchar)&&i?t++:(u+=c.chars[T].uchar,i=!1);c.cueStartTime=m,m===g&&(g+=1e-4),t>=16?t--:t++;var S=Object(J.fixLineBreaks)(u.trim()),A=Object(K.generateCueId)(m,g,S);(!D||!D.cues||!D.cues.getCueById(A))&&(s=new o(m,g,S),s.id=A,s.line=R+1,s.align="left",s.position=10+Math.min(80,Math.floor(t*8/32)*10),a.push(s))}return D&&a.length&&(a.sort(function(I,x){return I.line==="auto"||x.line==="auto"?0:I.line>8&&x.line>8?x.line-I.line:I.line-x.line}),a.forEach(function(I){return Object(N.addCueToTrack)(D,I)})),a}};Q.default=z},"./src/utils/discontinuities.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"findFirstFragWithCC",function(){return $}),B.d(Q,"shouldAlignOnDiscontinuities",function(){return z}),B.d(Q,"findDiscontinuousReferenceFrag",function(){return r}),B.d(Q,"adjustSlidingStart",function(){return m}),B.d(Q,"alignStream",function(){return g}),B.d(Q,"alignPDT",function(){return a}),B.d(Q,"alignFragmentByPDTDelta",function(){return c}),B.d(Q,"alignMediaPlaylistByPDT",function(){return s});var J=B("./src/polyfills/number.ts"),K=B("./src/utils/logger.ts"),N=B("./src/controller/level-helper.ts");function $(i,t){for(var u=null,o=0,R=i.length;o<R;o++){var T=i[o];if(T&&T.cc===t){u=T;break}}return u}function z(i,t,u){return!!(t.details&&(u.endCC>u.startCC||i&&i.cc<u.startCC))}function r(i,t){var u=i.fragments,o=t.fragments;if(!o.length||!u.length){K.logger.log("No fragments to align");return}var R=$(u,o[0].cc);if(!R||R&&!R.startPTS){K.logger.log("No frag in previous level to align on");return}return R}function D(i,t){if(i){var u=i.start+t;i.start=i.startPTS=u,i.endPTS=u+i.duration}}function m(i,t){for(var u=t.fragments,o=0,R=u.length;o<R;o++)D(u[o],i);t.fragmentHint&&D(t.fragmentHint,i),t.alignedSliding=!0}function g(i,t,u){if(!t)return;p(i,u,t),!u.alignedSliding&&t.details&&a(u,t.details),!u.alignedSliding&&t.details&&!u.skippedSegments&&Object(N.adjustSliding)(t.details,u)}function p(i,t,u){if(z(i,u,t)){var o=r(u.details,t);o&&Object(J.isFiniteNumber)(o.start)&&(K.logger.log("Adjusting PTS using last level due to CC increase within current level "+t.url),m(o.start,t))}}function a(i,t){if(!t.fragments.length||!i.hasProgramDateTime||!t.hasProgramDateTime)return;var u=t.fragments[0].programDateTime,o=i.fragments[0].programDateTime,R=(o-u)/1e3+t.fragments[0].start;R&&Object(J.isFiniteNumber)(R)&&(K.logger.log("Adjusting PTS using programDateTime delta "+(o-u)+"ms, sliding:"+R.toFixed(3)+" "+i.url+" "),m(R,i))}function c(i,t){var u=i.programDateTime;if(!u)return;var o=(u-t)/1e3;i.start=i.startPTS=o,i.endPTS=o+i.duration}function s(i,t){if(!t.fragments.length||!i.hasProgramDateTime||!t.hasProgramDateTime)return;var u=t.fragments[0].programDateTime,o=t.fragments[0].start,R=u-o*1e3;i.fragments.forEach(function(T){c(T,R)}),i.fragmentHint&&c(i.fragmentHint,R),i.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/utils/ewma.ts"),K=function(){function N(z,r,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 J.default(z),this.fast_=new J.default(r)}var $=N.prototype;return $.update=function(r,D){var m=this.slow_,g=this.fast_;this.slow_.halfLife!==r&&(this.slow_=new J.default(r,m.getEstimate(),m.getTotalWeight())),this.fast_.halfLife!==D&&(this.fast_=new J.default(D,g.getEstimate(),g.getTotalWeight()))},$.sample=function(r,D){r=Math.max(r,this.minDelayMs_);var m=8*D,g=r/1e3,p=m/g;this.fast_.sample(g,p),this.slow_.sample(g,p)},$.canEstimate=function(){var r=this.fast_;return r&&r.getTotalWeight()>=this.minWeight_},$.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},$.destroy=function(){},N}();Q.default=K},"./src/utils/ewma.ts":function(te,Q,B){"use strict";B.r(Q);var J=function(){function K($,z,r){z===void 0&&(z=0),r===void 0&&(r=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=$,this.alpha_=$?Math.exp(Math.log(.5)/$):0,this.estimate_=z,this.totalWeight_=r}var N=K.prototype;return N.sample=function(z,r){var D=Math.pow(this.alpha_,z);this.estimate_=r*(1-D)+D*this.estimate_,this.totalWeight_+=z},N.getTotalWeight=function(){return this.totalWeight_},N.getEstimate=function(){if(this.alpha_){var z=1-Math.pow(this.alpha_,this.totalWeight_);if(z)return this.estimate_/z}return this.estimate_},K}();Q.default=J},"./src/utils/fetch-loader.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"fetchSupported",function(){return c});var J=B("./src/polyfills/number.ts"),K=B("./src/loader/load-stats.ts"),N=B("./src/demux/chunk-cache.ts");function $(o,R){o.prototype=Object.create(R.prototype),o.prototype.constructor=o,g(o,R)}function z(o){var R=typeof Map=="function"?new Map:void 0;return z=function(S){if(S===null||!m(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof R!="undefined"){if(R.has(S))return R.get(S);R.set(S,A)}function A(){return r(S,arguments,p(this).constructor)}return A.prototype=Object.create(S.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),g(A,S)},z(o)}function r(o,R,T){return D()?r=Reflect.construct:r=function(A,I,x){var b=[null];b.push.apply(b,I);var h=Function.bind.apply(A,b),f=new h;return x&&g(f,x.prototype),f},r.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(o){return!1}}function m(o){return Function.toString.call(o).indexOf("[native code]")!==-1}function g(o,R){return g=Object.setPrototypeOf||function(S,A){return S.__proto__=A,S},g(o,R)}function p(o){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(T){return T.__proto__||Object.getPrototypeOf(T)},p(o)}function a(){return a=Object.assign||function(o){for(var R=1;R<arguments.length;R++){var T=arguments[R];for(var S in T)Object.prototype.hasOwnProperty.call(T,S)&&(o[S]=T[S])}return o},a.apply(this,arguments)}function c(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(o){}return!1}var s=function(){function o(T){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=T.fetchSetup||t,this.controller=new self.AbortController,this.stats=new K.LoadStats}var R=o.prototype;return R.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},R.abortInternal=function(){var S=this.response;(!S||!S.ok)&&(this.stats.aborted=!0,this.controller.abort())},R.abort=function(){var S;this.abortInternal(),(S=this.callbacks)!==null&&S!==void 0&&S.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},R.load=function(S,A,I){var x=this,b=this.stats;if(b.loading.start)throw new Error("Loader can only be used once.");b.loading.start=self.performance.now();var h=i(S,this.controller.signal),f=I.onProgress,C=S.responseType==="arraybuffer",E=C?"byteLength":"length";this.context=S,this.config=A,this.callbacks=I,this.request=this.fetchSetup(S,h),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){x.abortInternal(),I.onTimeout(b,S,x.response)},A.timeout),self.fetch(this.request).then(function(_){if(x.response=x.loader=_,!_.ok){var W=_.status,j=_.statusText;throw new u(j||"fetch, bad network response",W,_)}return b.loading.first=Math.max(self.performance.now(),b.loading.start),b.total=parseInt(_.headers.get("Content-Length")||"0"),f&&Object(J.isFiniteNumber)(A.highWaterMark)?x.loadProgressively(_,b,S,A.highWaterMark,f):C?_.arrayBuffer():_.text()}).then(function(_){var W=x.response;self.clearTimeout(x.requestTimeout),b.loading.end=Math.max(self.performance.now(),b.loading.first),b.loaded=b.total=_[E];var j={url:W.url,data:_};f&&!Object(J.isFiniteNumber)(A.highWaterMark)&&f(b,S,_,W),I.onSuccess(j,b,S,W)}).catch(function(_){if(self.clearTimeout(x.requestTimeout),b.aborted)return;var W=_.code||0;I.onError({code:W,text:_.message},S,_.details)})},R.getCacheAge=function(){var S=null;if(this.response){var A=this.response.headers.get("age");S=A?parseFloat(A):null}return S},R.loadProgressively=function(S,A,I,x,b){x===void 0&&(x=0);var h=new N.default,f=S.body.getReader(),C=function E(){return f.read().then(function(_){if(_.done)return h.dataLength&&b(A,I,h.flush(),S),Promise.resolve(new ArrayBuffer(0));var W=_.value,j=W.length;return A.loaded+=j,j<x||h.dataLength?(h.push(W),h.dataLength>=x&&b(A,I,h.flush(),S)):b(A,I,W,S),E()}).catch(function(){return Promise.reject()})};return C()},o}();function i(o,R){var T={method:"GET",mode:"cors",credentials:"same-origin",signal:R,headers:new self.Headers(a({},o.headers))};return o.rangeEnd&&T.headers.set("Range","bytes="+o.rangeStart+"-"+String(o.rangeEnd-1)),T}function t(o,R){return new self.Request(o.url,R)}var u=function(o){$(R,o);function R(T,S,A){var I;return I=o.call(this,T)||this,I.code=void 0,I.details=void 0,I.code=S,I.details=A,I}return R}(z(Error));Q.default=s},"./src/utils/imsc1-ttml-parser.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"IMSC1_CODEC",function(){return m}),B.d(Q,"parseIMSC1",function(){return c});var J=B("./src/utils/mp4-tools.ts"),K=B("./src/utils/vttparser.ts"),N=B("./src/utils/vttcue.ts"),$=B("./src/demux/id3.ts"),z=B("./src/utils/timescale-conversion.ts"),r=B("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(x){for(var b=1;b<arguments.length;b++){var h=arguments[b];for(var f in h)Object.prototype.hasOwnProperty.call(h,f)&&(x[f]=h[f])}return x},D.apply(this,arguments)}var m="stpp.ttml.im1t",g=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,p=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function c(x,b,h,f,C){var E=Object(J.findBox)(new Uint8Array(x),["mdat"]);if(E.length===0){C(new Error("Could not parse IMSC1 mdat"));return}var _=E[0],W=Object($.utf8ArrayToStr)(new Uint8Array(x,_.start,_.end-_.start)),j=Object(z.toTimescaleFromScale)(b,1,h);try{f(s(W,j))}catch(w){C(w)}}function s(x,b){var h=new DOMParser,f=h.parseFromString(x,"text/xml"),C=f.getElementsByTagName("tt")[0];if(!C)throw new Error("Invalid ttml");var E={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},_=Object.keys(E).reduce(function(P,v){return P[v]=C.getAttribute("ttp:"+v)||E[v],P},{}),W=C.getAttribute("xml:space")!=="preserve",j=t(i(C,"styling","style")),w=t(i(C,"layout","region")),F=i(C,"body","[begin]");return[].map.call(F,function(P){var v=u(P,W);if(!v||!P.hasAttribute("begin"))return null;var H=S(P.getAttribute("begin"),_),Y=S(P.getAttribute("dur"),_),ie=S(P.getAttribute("end"),_);if(H===null)throw T(P);if(ie===null){if(Y===null)throw T(P);ie=H+Y}var le=new N.default(H-b,ie-b,v);le.id=Object(r.generateCueId)(le.startTime,le.endTime,le.text);var he=w[P.getAttribute("region")],xe=j[P.getAttribute("style")];le.position=10,le.size=80;var Le=o(he,xe),we=Le.textAlign;if(we){var Ae=a[we];Ae&&(le.lineAlign=Ae),le.align=we}return D(le,Le),le}).filter(function(P){return P!==null})}function i(x,b,h){var f=x.getElementsByTagName(b)[0];return f?[].slice.call(f.querySelectorAll(h)):[]}function t(x){return x.reduce(function(b,h){var f=h.getAttribute("xml:id");return f&&(b[f]=h),b},{})}function u(x,b){return[].slice.call(x.childNodes).reduce(function(h,f,C){var E;return f.nodeName==="br"&&C?h+`
`:(E=f.childNodes)!==null&&E!==void 0&&E.length?u(f,b):b?h+f.textContent.trim().replace(/\s+/g," "):h+f.textContent},"")}function o(x,b){var h="http://www.w3.org/ns/ttml#styling",f=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return f.reduce(function(C,E){var _=R(b,h,E)||R(x,h,E);return _&&(C[E]=_),C},{})}function R(x,b,h){return x.hasAttributeNS(b,h)?x.getAttributeNS(b,h):null}function T(x){return new Error("Could not parse ttml timestamp "+x)}function S(x,b){if(!x)return null;var h=Object(K.parseTimeStamp)(x);return h===null&&(g.test(x)?h=A(x,b):p.test(x)&&(h=I(x,b))),h}function A(x,b){var h=g.exec(x),f=(h[4]|0)+(h[5]|0)/b.subFrameRate;return(h[1]|0)*3600+(h[2]|0)*60+(h[3]|0)+f/b.frameRate}function I(x,b){var h=p.exec(x),f=Number(h[1]),C=h[2];switch(C){case"h":return f*3600;case"m":return f*60;case"ms":return f*1e3;case"f":return f/b.frameRate;case"t":return f/b.tickRate}return f}},"./src/utils/logger.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"enableLogs",function(){return r}),B.d(Q,"logger",function(){return D});var J=function(){},K={trace:J,debug:J,log:J,warn:J,info:J,error:J},N=K;function $(m){var g=self.console[m];return g?g.bind(self.console,"["+m+"] >"):J}function z(m){for(var g=arguments.length,p=new Array(g>1?g-1:0),a=1;a<g;a++)p[a-1]=arguments[a];p.forEach(function(c){N[c]=m[c]?m[c].bind(m):$(c)})}function r(m){if(self.console&&m===!0||typeof m=="object"){z(m,"debug","log","info","warn","error");try{N.log()}catch(g){N=K}}else N=K}var D=N},"./src/utils/mediakeys-helper.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"KeySystems",function(){return J}),B.d(Q,"requestMediaKeySystemAccess",function(){return K});var J;(function(N){N.WIDEVINE="com.widevine.alpha",N.PLAYREADY="com.microsoft.playready"})(J||(J={}));var K=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"getMediaSource",function(){return J});function J(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"bin2str",function(){return z}),B.d(Q,"readUint16",function(){return r}),B.d(Q,"readUint32",function(){return D}),B.d(Q,"writeUint32",function(){return m}),B.d(Q,"findBox",function(){return g}),B.d(Q,"parseSegmentIndex",function(){return p}),B.d(Q,"parseInitSegment",function(){return a}),B.d(Q,"getStartDTS",function(){return c}),B.d(Q,"getDuration",function(){return s}),B.d(Q,"computeRawDurationFromSamples",function(){return i}),B.d(Q,"offsetStartDTS",function(){return t}),B.d(Q,"segmentValidRange",function(){return u}),B.d(Q,"appendUint8Array",function(){return o});var J=B("./src/utils/typed-array.ts"),K=B("./src/loader/fragment.ts"),N=Math.pow(2,32)-1,$=[].push;function z(R){return String.fromCharCode.apply(null,R)}function r(R,T){"data"in R&&(T+=R.start,R=R.data);var S=R[T]<<8|R[T+1];return S<0?65536+S:S}function D(R,T){"data"in R&&(T+=R.start,R=R.data);var S=R[T]<<24|R[T+1]<<16|R[T+2]<<8|R[T+3];return S<0?4294967296+S:S}function m(R,T,S){"data"in R&&(T+=R.start,R=R.data),R[T]=S>>24,R[T+1]=S>>16&255,R[T+2]=S>>8&255,R[T+3]=S&255}function g(R,T){var S=[];if(!T.length)return S;var A,I,x;"data"in R?(A=R.data,I=R.start,x=R.end):(A=R,I=0,x=A.byteLength);for(var b=I;b<x;){var h=D(A,b),f=z(A.subarray(b+4,b+8)),C=h>1?b+h:x;if(f===T[0])if(T.length===1)S.push({data:A,start:b+8,end:C});else{var E=g({data:A,start:b+8,end:C},T.slice(1));E.length&&$.apply(S,E)}b=C}return S}function p(R){var T=g(R,["moov"]),S=T[0],A=S?S.end:null,I=g(R,["sidx"]);if(!I||!I[0])return null;var x=[],b=I[0],h=b.data[0],f=h===0?8:16,C=D(b,f);f+=4;var E=0,_=0;h===0?f+=8:f+=16,f+=2;var W=b.end+_,j=r(b,f);f+=2;for(var w=0;w<j;w++){var F=f,P=D(b,F);F+=4;var v=P&2147483647,H=(P&2147483648)>>>31;if(H===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Y=D(b,F);F+=4,x.push({referenceSize:v,subsegmentDuration:Y,info:{duration:Y/C,start:W,end:W+v-1}}),W+=v,F+=4,f=F}return{earliestPresentationTime:E,timescale:C,version:h,referencesCount:j,references:x,moovEndOffset:A}}function a(R){for(var T=[],S=g(R,["moov","trak"]),A=0;A<S.length;A++){var I=S[A],x=g(I,["tkhd"])[0];if(x){var b=x.data[x.start],h=b===0?12:20,f=D(x,h),C=g(I,["mdia","mdhd"])[0];if(C){b=C.data[C.start],h=b===0?12:20;var E=D(C,h),_=g(I,["mdia","hdlr"])[0];if(_){var W=z(_.data.subarray(_.start+8,_.start+12)),j={soun:K.ElementaryStreamTypes.AUDIO,vide:K.ElementaryStreamTypes.VIDEO}[W];if(j){var w=g(I,["mdia","minf","stbl","stsd"])[0],F=void 0;w&&(F=z(w.data.subarray(w.start+12,w.start+16))),T[f]={timescale:E,type:j},T[j]={timescale:E,id:f,codec:F}}}}}}var P=g(R,["moov","mvex","trex"]);return P.forEach(function(v){var H=D(v,4),Y=T[H];Y&&(Y.default={duration:D(v,12),flags:D(v,20)})}),T}function c(R,T){return g(T,["moof","traf"]).reduce(function(S,A){var I=g(A,["tfdt"])[0],x=I.data[I.start],b=g(A,["tfhd"]).reduce(function(h,f){var C=D(f,4),E=R[C];if(E){var _=D(I,4);x===1&&(_*=Math.pow(2,32),_+=D(I,8));var W=E.timescale||9e4,j=_/W;if(isFinite(j)&&(h===null||j<h))return j}return h},null);return b!==null&&isFinite(b)&&(S===null||b<S)?b:S},null)||0}function s(R,T){for(var S=0,A=0,I=0,x=g(R,["moof","traf"]),b=0;b<x.length;b++){var h=x[b],f=g(h,["tfhd"])[0],C=D(f,4),E=T[C];if(!E)continue;var _=E.default,W=D(f,0)|(_==null?void 0:_.flags),j=_==null?void 0:_.duration;W&8&&(W&2?j=D(f,12):j=D(f,8));for(var w=E.timescale||9e4,F=g(h,["trun"]),P=0;P<F.length;P++){if(j){var v=D(F[P],4);S=j*v}else S=i(F[P]);E.type===K.ElementaryStreamTypes.VIDEO?A+=S/w:E.type===K.ElementaryStreamTypes.AUDIO&&(I+=S/w)}}if(A===0&&I===0){var H=p(R);if(H!=null&&H.references)return H.references.reduce(function(Y,ie){return Y+ie.info.duration||0},0)}return A||I}function i(R){var T=D(R,0),S=8;T&1&&(S+=4),T&4&&(S+=4);for(var A=0,I=D(R,4),x=0;x<I;x++){if(T&256){var b=D(R,S);A+=b,S+=4}T&512&&(S+=4),T&1024&&(S+=4),T&2048&&(S+=4)}return A}function t(R,T,S){g(T,["moof","traf"]).forEach(function(A){g(A,["tfhd"]).forEach(function(I){var x=D(I,4),b=R[x];if(!b)return;var h=b.timescale||9e4;g(A,["tfdt"]).forEach(function(f){var C=f.data[f.start],E=D(f,4);if(C===0)m(f,4,E-S*h);else{E*=Math.pow(2,32),E+=D(f,8),E-=S*h,E=Math.max(E,0);var _=Math.floor(E/(N+1)),W=Math.floor(E%(N+1));m(f,4,_),m(f,8,W)}})})})}function u(R){var T={valid:null,remainder:null},S=g(R,["moof"]);if(S){if(S.length<2)return T.remainder=R,T}else return T;var A=S[S.length-1];return T.valid=Object(J.sliceUint8)(R,0,A.start-8),T.remainder=Object(J.sliceUint8)(R,A.start-8),T}function o(R,T){var S=new Uint8Array(R.length+T.length);return S.set(R),S.set(T,R.length),S}},"./src/utils/output-filter.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"default",function(){return J});var J=function(){function K($,z){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=$,this.trackName=z}var N=K.prototype;return N.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},N.newCue=function(z,r,D){(this.startTime===null||this.startTime>z)&&(this.startTime=z),this.endTime=r,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},N.reset=function(){this.cueRanges=[]},K}()},"./src/utils/texttrack-utils.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"sendAddTrackEvent",function(){return K}),B.d(Q,"addCueToTrack",function(){return N}),B.d(Q,"clearCurrentCues",function(){return $}),B.d(Q,"removeCuesInRange",function(){return z}),B.d(Q,"getCuesInRange",function(){return D});var J=B("./src/utils/logger.ts");function K(m,g){var p;try{p=new Event("addtrack")}catch(a){p=document.createEvent("Event"),p.initEvent("addtrack",!1,!1)}p.track=m,g.dispatchEvent(p)}function N(m,g){var p=m.mode;if(p==="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(c){J.logger.debug("[texttrack-utils]: "+c);var a=new self.TextTrackCue(g.startTime,g.endTime,g.text);a.id=g.id,m.addCue(a)}p==="disabled"&&(m.mode=p)}function $(m){var g=m.mode;if(g==="disabled"&&(m.mode="hidden"),m.cues)for(var p=m.cues.length;p--;)m.removeCue(m.cues[p]);g==="disabled"&&(m.mode=g)}function z(m,g,p){var a=m.mode;if(a==="disabled"&&(m.mode="hidden"),m.cues&&m.cues.length>0)for(var c=D(m.cues,g,p),s=0;s<c.length;s++)m.removeCue(c[s]);a==="disabled"&&(m.mode=a)}function r(m,g){if(g<m[0].startTime)return 0;var p=m.length-1;if(g>m[p].endTime)return-1;for(var a=0,c=p;a<=c;){var s=Math.floor((c+a)/2);if(g<m[s].startTime)c=s-1;else if(g>m[s].startTime&&a<p)a=s+1;else return s}return m[a].startTime-g<g-m[c].startTime?a:c}function D(m,g,p){var a=[],c=r(m,g);if(c>-1)for(var s=c,i=m.length;s<i;s++){var t=m[s];if(t.startTime>=g&&t.endTime<=p)a.push(t);else if(t.startTime>p)return a}return a}},"./src/utils/time-ranges.ts":function(te,Q,B){"use strict";B.r(Q);var J={toString:function(N){for(var $="",z=N.length,r=0;r<z;r++)$+="["+N.start(r).toFixed(3)+","+N.end(r).toFixed(3)+"]";return $}};Q.default=J},"./src/utils/timescale-conversion.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"toTimescaleFromBase",function(){return K}),B.d(Q,"toTimescaleFromScale",function(){return N}),B.d(Q,"toMsFromMpegTsClock",function(){return $}),B.d(Q,"toMpegTsClockFromTimescale",function(){return z});var J=9e4;function K(r,D,m,g){m===void 0&&(m=1),g===void 0&&(g=!1);var p=r*D*m;return g?Math.round(p):p}function N(r,D,m,g){return m===void 0&&(m=1),g===void 0&&(g=!1),K(r,D,1/m,g)}function $(r,D){return D===void 0&&(D=!1),K(r,1e3,1/J,D)}function z(r,D){return D===void 0&&(D=1),K(r,J,1/D)}},"./src/utils/typed-array.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"sliceUint8",function(){return J});function J(K,N,$){return Uint8Array.prototype.slice?K.slice(N,$):new Uint8Array(Array.prototype.slice.call(K,N,$))}},"./src/utils/vttcue.ts":function(te,Q,B){"use strict";B.r(Q),Q.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var J=["","lr","rl"],K=["start","middle","end","left","right"];function N(m,g){if(typeof g!="string")return!1;if(!Array.isArray(m))return!1;var p=g.toLowerCase();return~m.indexOf(p)?p:!1}function $(m){return N(J,m)}function z(m){return N(K,m)}function r(m){for(var g=arguments.length,p=new Array(g>1?g-1:0),a=1;a<g;a++)p[a-1]=arguments[a];for(var c=1;c<arguments.length;c++){var s=arguments[c];for(var i in s)m[i]=s[i]}return m}function D(m,g,p){var a=this,c={enumerable:!0};a.hasBeenReset=!1;var s="",i=!1,t=m,u=g,o=p,R=null,T="",S=!0,A="auto",I="start",x=50,b="middle",h=50,f="middle";Object.defineProperty(a,"id",r({},c,{get:function(){return s},set:function(E){s=""+E}})),Object.defineProperty(a,"pauseOnExit",r({},c,{get:function(){return i},set:function(E){i=!!E}})),Object.defineProperty(a,"startTime",r({},c,{get:function(){return t},set:function(E){if(typeof E!="number")throw new TypeError("Start time must be set to a number.");t=E,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",r({},c,{get:function(){return u},set:function(E){if(typeof E!="number")throw new TypeError("End time must be set to a number.");u=E,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",r({},c,{get:function(){return o},set:function(E){o=""+E,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",r({},c,{get:function(){return R},set:function(E){R=E,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",r({},c,{get:function(){return T},set:function(E){var _=$(E);if(_===!1)throw new SyntaxError("An invalid or illegal string was specified.");T=_,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",r({},c,{get:function(){return S},set:function(E){S=!!E,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",r({},c,{get:function(){return A},set:function(E){if(typeof E!="number"&&E!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");A=E,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",r({},c,{get:function(){return I},set:function(E){var _=z(E);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");I=_,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",r({},c,{get:function(){return x},set:function(E){if(E<0||E>100)throw new Error("Position must be between 0 and 100.");x=E,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",r({},c,{get:function(){return b},set:function(E){var _=z(E);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");b=_,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",r({},c,{get:function(){return h},set:function(E){if(E<0||E>100)throw new Error("Size must be between 0 and 100.");h=E,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",r({},c,{get:function(){return f},set:function(E){var _=z(E);if(!_)throw new SyntaxError("An invalid or illegal string was specified.");f=_,this.hasBeenReset=!0}})),a.displayState=void 0}return D.prototype.getCueAsHTML=function(){var m=self.WebVTT;return m.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"parseTimeStamp",function(){return N}),B.d(Q,"fixLineBreaks",function(){return g}),B.d(Q,"VTTParser",function(){return p});var J=B("./src/utils/vttcue.ts"),K=function(){function a(){}var c=a.prototype;return c.decode=function(i,t){if(!i)return"";if(typeof i!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(i))},a}();function N(a){function c(i,t,u,o){return(i|0)*3600+(t|0)*60+(u|0)+parseFloat(o||0)}var s=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return s?parseFloat(s[2])>59?c(s[2],s[3],0,s[4]):c(s[1],s[2],s[3],s[4]):null}var $=function(){function a(){this.values=Object.create(null)}var c=a.prototype;return c.set=function(i,t){!this.get(i)&&t!==""&&(this.values[i]=t)},c.get=function(i,t,u){return u?this.has(i)?this.values[i]:t[u]:this.has(i)?this.values[i]:t},c.has=function(i){return i in this.values},c.alt=function(i,t,u){for(var o=0;o<u.length;++o)if(t===u[o]){this.set(i,t);break}},c.integer=function(i,t){/^-?\d+$/.test(t)&&this.set(i,parseInt(t,10))},c.percent=function(i,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){var u=parseFloat(t);if(u>=0&&u<=100)return this.set(i,u),!0}return!1},a}();function z(a,c,s,i){var t=i?a.split(i):[a];for(var u in t){if(typeof t[u]!="string")continue;var o=t[u].split(s);if(o.length!==2)continue;var R=o[0],T=o[1];c(R,T)}}var r=new J.default(0,0,""),D=r.align==="middle"?"middle":"center";function m(a,c,s){var i=a;function t(){var R=N(a);if(R===null)throw new Error("Malformed timestamp: "+i);return a=a.replace(/^[^\sa-zA-Z-]+/,""),R}function u(R,T){var S=new $;z(R,function(x,b){var h;switch(x){case"region":for(var f=s.length-1;f>=0;f--)if(s[f].id===b){S.set(x,s[f].region);break}break;case"vertical":S.alt(x,b,["rl","lr"]);break;case"line":h=b.split(","),S.integer(x,h[0]),S.percent(x,h[0])&&S.set("snapToLines",!1),S.alt(x,h[0],["auto"]),h.length===2&&S.alt("lineAlign",h[1],["start",D,"end"]);break;case"position":h=b.split(","),S.percent(x,h[0]),h.length===2&&S.alt("positionAlign",h[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":S.percent(x,b);break;case"align":S.alt(x,b,["start",D,"end","left","right"]);break}},/:/,/\s/),T.region=S.get("region",null),T.vertical=S.get("vertical","");var A=S.get("line","auto");A==="auto"&&r.line===-1&&(A=-1),T.line=A,T.lineAlign=S.get("lineAlign","start"),T.snapToLines=S.get("snapToLines",!0),T.size=S.get("size",100),T.align=S.get("align",D);var I=S.get("position","auto");I==="auto"&&r.position===50&&(I=T.align==="start"||T.align==="left"?0:T.align==="end"||T.align==="right"?100:50),T.position=I}function o(){a=a.replace(/^\s+/,"")}if(o(),c.startTime=t(),o(),a.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+i);a=a.substr(3),o(),c.endTime=t(),o(),u(a,c)}function g(a){return a.replace(/<br(?: \/)?>/gi,`
`)}var p=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new K,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var c=a.prototype;return c.parse=function(i){var t=this;i&&(t.buffer+=t.decoder.decode(i,{stream:!0}));function u(){var I=t.buffer,x=0;for(I=g(I);x<I.length&&I[x]!=="\r"&&I[x]!==`
`;)++x;var b=I.substr(0,x);return I[x]==="\r"&&++x,I[x]===`
`&&++x,t.buffer=I.substr(x),b}function o(I){z(I,function(x,b){},/:/)}try{var R="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;R=u();var T=R.match(/^()?WEBVTT([ \t].*)?$/);if(!T||!T[0])throw new Error("Malformed WebVTT signature.");t.state="HEADER"}for(var S=!1;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;S?S=!1:R=u();switch(t.state){case"HEADER":/:/.test(R)?o(R):R||(t.state="ID");continue;case"NOTE":R||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(R)){t.state="NOTE";break}if(!R)continue;if(t.cue=new J.default(0,0,""),t.state="CUE",R.indexOf("-->")===-1){t.cue.id=R;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{m(R,t.cue,t.regionList)}catch(I){t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{var A=R.indexOf("-->")!==-1;if(!R||A&&(S=!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+=R}continue;case"BADCUE":R||(t.state="ID")}}}catch(I){t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},c.flush=function(){var i=this;try{if((i.cue||i.state==="HEADER")&&(i.buffer+=`
`,i.parse()),i.state==="INITIAL"||i.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){i.onparsingerror&&i.onparsingerror(t)}return i.onflush&&i.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(te,Q,B){"use strict";B.r(Q),B.d(Q,"generateCueId",function(){return p}),B.d(Q,"parseWebVTT",function(){return c});var J=B("./src/polyfills/number.ts"),K=B("./src/utils/vttparser.ts"),N=B("./src/demux/id3.ts"),$=B("./src/utils/timescale-conversion.ts"),z=B("./src/remux/mp4-remuxer.ts"),r=/\r\n|\n\r|\n|\r/g,D=function(i,t,u){return u===void 0&&(u=0),i.substr(u,t.length)===t},m=function(i){var t=parseInt(i.substr(-3)),u=parseInt(i.substr(-6,2)),o=parseInt(i.substr(-9,2)),R=i.length>9?parseInt(i.substr(0,i.indexOf(":"))):0;if(!Object(J.isFiniteNumber)(t)||!Object(J.isFiniteNumber)(u)||!Object(J.isFiniteNumber)(o)||!Object(J.isFiniteNumber)(R))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+i);return t+=1e3*u,t+=60*1e3*o,t+=60*60*1e3*R,t},g=function(i){for(var t=5381,u=i.length;u;)t=t*33^i.charCodeAt(--u);return(t>>>0).toString()};function p(s,i,t){return g(s.toString())+g(i.toString())+g(t)}var a=function(i,t,u){var o=i[t],R=i[o.prevCC];if(!R||!R.new&&o.new){i.ccOffset=i.presentationOffset=o.start,o.new=!1;return}for(;(T=R)!==null&&T!==void 0&&T.new;){var T;i.ccOffset+=o.start-R.start,o.new=!1,o=R,R=i[o.prevCC]}i.presentationOffset=u};function c(s,i,t,u,o,R,T,S){var A=new K.VTTParser,I=Object(N.utf8ArrayToStr)(new Uint8Array(s)).trim().replace(r,`
`).split(`
`),x=[],b=Object($.toMpegTsClockFromTimescale)(i,t),h="00:00.000",f=0,C=0,E,_=!0,W=!1;A.oncue=function(j){var w=u[o],F=u.ccOffset,P=(f-b)/9e4;if(w!=null&&w.new&&(C!==void 0?F=u.ccOffset=w.start:a(u,o,P)),P&&(F=P-u.presentationOffset),W){var v=j.endTime-j.startTime,H=Object(z.normalizePts)((j.startTime+F-C)*9e4,R*9e4)/9e4;j.startTime=H,j.endTime=H+v}var Y=j.text.trim();j.text=decodeURIComponent(encodeURIComponent(Y)),j.id||(j.id=p(j.startTime,j.endTime,Y)),j.endTime>0&&x.push(j)},A.onparsingerror=function(j){E=j},A.onflush=function(){if(E){S(E);return}T(x)},I.forEach(function(j){if(_)if(D(j,"X-TIMESTAMP-MAP=")){_=!1,W=!0,j.substr(16).split(",").forEach(function(w){D(w,"LOCAL:")?h=w.substr(6):D(w,"MPEGTS:")&&(f=parseInt(w.substr(7)))});try{C=m(h)/1e3}catch(w){W=!1,E=w}return}else j===""&&(_=!1);A.parse(j+`
`)}),A.flush()}},"./src/utils/xhr-loader.ts":function(te,Q,B){"use strict";B.r(Q);var J=B("./src/utils/logger.ts"),K=B("./src/loader/load-stats.ts"),N=/^age:\s*[\d.]+\s*$/m,$=function(){function z(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 K.LoadStats,this.retryDelay=0}var r=z.prototype;return r.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},r.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()))},r.abort=function(){var m;this.abortInternal(),(m=this.callbacks)!==null&&m!==void 0&&m.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},r.load=function(m,g,p){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=p,this.retryDelay=g.retryDelay,this.loadInternal()},r.loadInternal=function(){var m=this.config,g=this.context;if(!m)return;var p=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var c=this.xhrSetup;try{if(c)try{c(p,g.url)}catch(t){p.open("GET",g.url,!0),c(p,g.url)}p.readyState||p.open("GET",g.url,!0);var s=this.context.headers;if(s)for(var i in s)p.setRequestHeader(i,s[i])}catch(t){this.callbacks.onError({code:p.status,text:t.message},g,p);return}g.rangeEnd&&p.setRequestHeader("Range","bytes="+g.rangeStart+"-"+(g.rangeEnd-1)),p.onreadystatechange=this.readystatechange.bind(this),p.onprogress=this.loadprogress.bind(this),p.responseType=g.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),m.timeout),p.send()},r.readystatechange=function(){var m=this.context,g=this.loader,p=this.stats;if(!m||!g)return;var a=g.readyState,c=this.config;if(p.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),p.loading.first===0&&(p.loading.first=Math.max(self.performance.now(),p.loading.start)),a===4){g.onreadystatechange=null,g.onprogress=null;var s=g.status;if(s>=200&&s<300){p.loading.end=Math.max(self.performance.now(),p.loading.first);var i,t;if(m.responseType==="arraybuffer"?(i=g.response,t=i.byteLength):(i=g.responseText,t=i.length),p.loaded=p.total=t,!this.callbacks)return;var u=this.callbacks.onProgress;if(u&&u(p,m,i,g),!this.callbacks)return;var o={url:g.responseURL,data:i};this.callbacks.onSuccess(o,p,m,g)}else p.retry>=c.maxRetry||s>=400&&s<499?(J.logger.error(s+" while loading "+m.url),this.callbacks.onError({code:s,text:g.statusText},m,g)):(J.logger.warn(s+" 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,c.maxRetryDelay),p.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),c.timeout)},r.loadtimeout=function(){J.logger.warn("timeout while loading "+this.context.url);var m=this.callbacks;m&&(this.abortInternal(),m.onTimeout(this.stats,this.context,this.loader))},r.loadprogress=function(m){var g=this.stats;g.loaded=m.loaded,m.lengthComputable&&(g.total=m.total)},r.getCacheAge=function(){var m=null;if(this.loader&&N.test(this.loader.getAllResponseHeaders())){var g=this.loader.getResponseHeader("age");m=g?parseFloat(g):null}return m},z}();Q.default=$}}).default})},vHTk:function(It,Oe,U){It.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}},wCXF:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return Vt});var te=U("rePB"),Q=U("VTBJ"),B=U("KQm4"),J=U("U8pU"),K=U("ODXe"),N=U("q1tI"),$=U("TSYQ"),z=U.n($),r=U("Gytx"),D=U.n(r),m=U("Kwbf"),g=U("t23M"),p=U("qx4F"),a=U("6eGT"),c=U("IBYe"),s=U("Ff2n"),i=U("c+Xe"),t=U("fyJ8"),u=U("biw7");function o(qe,Ze,Ct,At,ct){var ft=Ct[qe]||{},He=Ct[Ze]||{},Ne,Ue;ft.fixed==="left"?Ne=At.left[qe]:He.fixed==="right"&&(Ue=At.right[Ze]);var ge=!1,Ee=!1,De=!1,ue=!1,Fe=Ct[Ze+1],at=Ct[qe-1];if(ct==="rtl"){if(Ne!==void 0){var xt=at&&at.fixed==="left";ue=!xt}else if(Ue!==void 0){var Kt=Fe&&Fe.fixed==="right";De=!Kt}}else if(Ne!==void 0){var Xt=Fe&&Fe.fixed==="left";ge=!Xt}else if(Ue!==void 0){var $t=at&&at.fixed==="right";Ee=!$t}return{fixLeft:Ne,fixRight:Ue,lastFixLeft:ge,firstFixRight:Ee,lastFixRight:De,firstFixLeft:ue,isSticky:At.isSticky}}var R=U("sR1s");function T(qe){var Ze=qe.cells,Ct=qe.stickyOffsets,At=qe.flattenColumns,ct=qe.rowComponent,ft=qe.cellComponent,He=qe.onHeaderRow,Ne=qe.index,Ue=N.useContext(u.a),ge=Ue.prefixCls,Ee=Ue.direction,De;He&&(De=He(Ze.map(function(Fe){return Fe.column}),Ne));var ue=Object(R.a)(Ze.map(function(Fe){return Fe.column}));return N.createElement(ct,Object.assign({},De),Ze.map(function(Fe,at){var xt=Fe.column,Kt=o(Fe.colStart,Fe.colEnd,At,Ct,Ee),Xt;return xt&&xt.onHeaderCell&&(Xt=Fe.column.onHeaderCell(xt)),N.createElement(t.a,Object.assign({},Fe,{ellipsis:xt.ellipsis,align:xt.align,component:ft,prefixCls:ge,key:ue[at]},Kt,{additionalProps:Xt,rowType:"header"}))}))}T.displayName="HeaderRow";var S=T;function A(qe){var Ze=[];function Ct(He,Ne){var Ue=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;Ze[Ue]=Ze[Ue]||[];var ge=Ne,Ee=He.filter(Boolean).map(function(De){var ue={key:De.key,className:De.className||"",children:De.title,column:De,colStart:ge},Fe=1,at=De.children;return at&&at.length>0&&(Fe=Ct(at,ge,Ue+1).reduce(function(xt,Kt){return xt+Kt},0),ue.hasSubColumns=!0),"colSpan"in De&&(Fe=De.colSpan),"rowSpan"in De&&(ue.rowSpan=De.rowSpan),ue.colSpan=Fe,ue.colEnd=ue.colStart+Fe-1,Ze[Ue].push(ue),ge+=Fe,Fe});return Ee}Ct(qe,0);for(var At=Ze.length,ct=function(Ne){Ze[Ne].forEach(function(Ue){!("rowSpan"in Ue)&&!Ue.hasSubColumns&&(Ue.rowSpan=At-Ne)})},ft=0;ft<At;ft+=1)ct(ft);return Ze}function I(qe){var Ze=qe.stickyOffsets,Ct=qe.columns,At=qe.flattenColumns,ct=qe.onHeaderRow,ft=N.useContext(u.a),He=ft.prefixCls,Ne=ft.getComponent,Ue=N.useMemo(function(){return A(Ct)},[Ct]),ge=Ne(["header","wrapper"],"thead"),Ee=Ne(["header","row"],"tr"),De=Ne(["header","cell"],"th");return N.createElement(ge,{className:"".concat(He,"-thead")},Ue.map(function(ue,Fe){var at=N.createElement(S,{key:Fe,flattenColumns:At,cells:ue,stickyOffsets:Ze,rowComponent:Ee,cellComponent:De,onHeaderRow:ct,index:Fe});return at}))}var x=I,b=U("hW8S");function h(qe){for(var Ze=qe.colWidths,Ct=qe.columns,At=qe.columCount,ct=[],ft=At||Ct.length,He=!1,Ne=ft-1;Ne>=0;Ne-=1){var Ue=Ze[Ne],ge=Ct&&Ct[Ne],Ee=ge&&ge[b.a];(Ue||Ee||He)&&(ct.unshift(N.createElement("col",Object.assign({key:Ne,style:{width:Ue,minWidth:Ue}},Ee))),He=!0)}return N.createElement("colgroup",null,ct)}var f=h;function C(qe,Ze){return Object(N.useMemo)(function(){for(var Ct=[],At=0;At<Ze;At+=1){var ct=qe[At];if(ct!==void 0)Ct[At]=ct;else return null}return Ct},[qe.join("_"),Ze])}var E=N.forwardRef(function(qe,Ze){var Ct=qe.noData,At=qe.columns,ct=qe.flattenColumns,ft=qe.colWidths,He=qe.columCount,Ne=qe.stickyOffsets,Ue=qe.direction,ge=qe.fixHeader,Ee=qe.offsetHeader,De=qe.stickyClassName,ue=qe.onScroll,Fe=Object(s.a)(qe,["noData","columns","flattenColumns","colWidths","columCount","stickyOffsets","direction","fixHeader","offsetHeader","stickyClassName","onScroll"]),at=N.useContext(u.a),xt=at.prefixCls,Kt=at.scrollbarSize,Xt=at.isSticky,$t=Xt&&!ge?0:Kt,$n=N.useRef(null),vn=N.useCallback(function(br){Object(i.b)(Ze,br),Object(i.b)($n,br)},[]);N.useEffect(function(){var br;function Rr(Jt){var Ar=Jt.currentTarget,Nn=Jt.deltaX;Nn&&(ue({currentTarget:Ar,scrollLeft:Ar.scrollLeft+Nn}),Jt.preventDefault())}return(br=$n.current)===null||br===void 0||br.addEventListener("wheel",Rr),function(){var Jt;(Jt=$n.current)===null||Jt===void 0||Jt.removeEventListener("wheel",Rr)}},[]);var ln=ct[ct.length-1],hn={fixed:ln?ln.fixed:null,onHeaderCell:function(){return{className:"".concat(xt,"-cell-scrollbar")}}},Gn=Object(N.useMemo)(function(){return $t?[].concat(Object(B.a)(At),[hn]):At},[$t,At]),fr=Object(N.useMemo)(function(){return $t?[].concat(Object(B.a)(ct),[hn]):ct},[$t,ct]),vr=Object(N.useMemo)(function(){var br=Ne.right,Rr=Ne.left;return Object(Q.a)(Object(Q.a)({},Ne),{},{left:Ue==="rtl"?[].concat(Object(B.a)(Rr.map(function(Jt){return Jt+$t})),[0]):Rr,right:Ue==="rtl"?br:[].concat(Object(B.a)(br.map(function(Jt){return Jt+$t})),[0]),isSticky:Xt})},[$t,Ne,Xt]),ir=C(ft,He);return N.createElement("div",{style:Object(Q.a)({overflow:"hidden"},Xt?{top:Ee}:{}),ref:vn,className:z()("".concat(xt,"-header"),Object(te.a)({},De,!!De))},N.createElement("table",{style:{tableLayout:"fixed",visibility:Ct||ir?null:"hidden"}},N.createElement(f,{colWidths:ir?[].concat(Object(B.a)(ir),[$t]):[],columCount:He+1,columns:fr}),N.createElement(x,Object.assign({},Fe,{stickyOffsets:vr,columns:Gn,flattenColumns:fr}))))});E.displayName="FixedHeader";var _=E,W=N.createContext(null),j=W;function w(qe){var Ze=qe.prefixCls,Ct=qe.children,At=qe.component,ct=qe.cellComponent,ft=qe.fixHeader,He=qe.fixColumn,Ne=qe.horizonScroll,Ue=qe.className,ge=qe.expanded,Ee=qe.componentWidth,De=qe.colSpan,ue=N.useContext(u.a),Fe=ue.scrollbarSize;return N.useMemo(function(){var at=Ct;return He&&(at=N.createElement("div",{style:{width:Ee-(ft?Fe:0),position:"sticky",left:0,overflow:"hidden"},className:"".concat(Ze,"-expanded-row-fixed")},at)),N.createElement(At,{className:Ue,style:{display:ge?null:"none"}},N.createElement(t.a,{component:ct,prefixCls:Ze,colSpan:De},at))},[Ct,At,ft,Ne,Ue,ge,Ee,De,Fe])}var F=w;function P(qe){var Ze=qe.className,Ct=qe.style,At=qe.record,ct=qe.index,ft=qe.rowKey,He=qe.getRowKey,Ne=qe.rowExpandable,Ue=qe.expandedKeys,ge=qe.onRow,Ee=qe.indent,De=Ee===void 0?0:Ee,ue=qe.rowComponent,Fe=qe.cellComponent,at=qe.childrenColumnName,xt=N.useContext(u.a),Kt=xt.prefixCls,Xt=xt.fixedInfoList,$t=N.useContext(j),$n=$t.fixHeader,vn=$t.fixColumn,ln=$t.horizonScroll,hn=$t.componentWidth,Gn=$t.flattenColumns,fr=$t.expandableType,vr=$t.expandRowByClick,ir=$t.onTriggerExpand,br=$t.rowClassName,Rr=$t.expandedRowClassName,Jt=$t.indentSize,Ar=$t.expandIcon,Nn=$t.expandedRowRender,Tn=$t.expandIconColumnIndex,pr=N.useState(!1),_r=Object(K.a)(pr,2),Pr=_r[0],yr=_r[1],mt=Ue&&Ue.has(qe.recordKey);N.useEffect(function(){mt&&yr(!0)},[mt]);var Ke=fr==="row"&&(!Ne||Ne(At)),Ot=fr==="nest",Me=at&&At&&At[at],ye=Ke||Ot,ve;ge&&(ve=ge(At,ct));var or=function(O){if(vr&&ye&&ir(At,O),ve&&ve.onClick){for(var M,X=arguments.length,se=new Array(X>1?X-1:0),Z=1;Z<X;Z++)se[Z-1]=arguments[Z];(M=ve).onClick.apply(M,[O].concat(se))}},en;typeof br=="string"?en=br:typeof br=="function"&&(en=br(At,ct,De));var Ie=Object(R.a)(Gn),gt=N.createElement(ue,Object.assign({},ve,{"data-row-key":ft,className:z()(Ze,"".concat(Kt,"-row"),"".concat(Kt,"-row-level-").concat(De),en,ve&&ve.className),style:Object(Q.a)(Object(Q.a)({},Ct),ve?ve.style:null),onClick:or}),Gn.map(function(q,O){var M=q.render,X=q.dataIndex,se=q.className,Z=Ie[O],Pe=Xt[O],st;O===(Tn||0)&&Ot&&(st=N.createElement(N.Fragment,null,N.createElement("span",{style:{paddingLeft:"".concat(Jt*De,"px")},className:"".concat(Kt,"-row-indent indent-level-").concat(De)}),Ar({prefixCls:Kt,expanded:mt,expandable:Me,record:At,onExpand:ir})));var wt;return q.onCell&&(wt=q.onCell(At,ct)),N.createElement(t.a,Object.assign({className:se,ellipsis:q.ellipsis,align:q.align,component:Fe,prefixCls:Kt,key:Z,record:At,index:ct,dataIndex:X,render:M,shouldCellUpdate:q.shouldCellUpdate},Pe,{appendNode:st,additionalProps:wt}))})),Ce;if(Ke&&(Pr||mt)){var dn=Nn(At,ct,De+1,mt),hr=Rr&&Rr(At,ct,De);Ce=N.createElement(F,{expanded:mt,className:z()("".concat(Kt,"-expanded-row"),"".concat(Kt,"-expanded-row-level-").concat(De+1),hr),prefixCls:Kt,fixHeader:$n,fixColumn:vn,horizonScroll:ln,component:ue,componentWidth:hn,cellComponent:Fe,colSpan:Gn.length},dn)}var mr;return Me&&mt&&(mr=(At[at]||[]).map(function(q,O){var M=He(q,O);return N.createElement(P,Object.assign({},qe,{key:M,rowKey:M,record:q,recordKey:M,index:O,indent:De+1}))})),N.createElement(N.Fragment,null,gt,Ce,mr)}P.displayName="BodyRow";var v=P,H=N.createContext(null),Y=H;function ie(qe){var Ze=qe.columnKey,Ct=qe.onColumnResize,At=N.useRef();return N.useEffect(function(){At.current&&Ct(Ze,At.current.offsetWidth)},[]),N.createElement(g.a,{onResize:function(ft){var He=ft.offsetWidth;Ct(Ze,He)}},N.createElement("td",{ref:At,style:{padding:0,border:0,height:0}},N.createElement("div",{style:{height:0,overflow:"hidden"}},"\xA0")))}function le(qe){var Ze=qe.data,Ct=qe.getRowKey,At=qe.measureColumnWidth,ct=qe.expandedKeys,ft=qe.onRow,He=qe.rowExpandable,Ne=qe.emptyNode,Ue=qe.childrenColumnName,ge=N.useContext(Y),Ee=ge.onColumnResize,De=N.useContext(u.a),ue=De.prefixCls,Fe=De.getComponent,at=N.useContext(j),xt=at.fixHeader,Kt=at.horizonScroll,Xt=at.flattenColumns,$t=at.componentWidth;return N.useMemo(function(){var $n=Fe(["body","wrapper"],"tbody"),vn=Fe(["body","row"],"tr"),ln=Fe(["body","cell"],"td"),hn;Ze.length?hn=Ze.map(function(fr,vr){var ir=Ct(fr,vr);return N.createElement(v,{key:ir,rowKey:ir,record:fr,recordKey:ir,index:vr,rowComponent:vn,cellComponent:ln,expandedKeys:ct,onRow:ft,getRowKey:Ct,rowExpandable:He,childrenColumnName:Ue})}):hn=N.createElement(F,{expanded:!0,className:"".concat(ue,"-placeholder"),prefixCls:ue,fixHeader:xt,fixColumn:Kt,horizonScroll:Kt,component:vn,componentWidth:$t,cellComponent:ln,colSpan:Xt.length},Ne);var Gn=Object(R.a)(Xt);return N.createElement($n,{className:"".concat(ue,"-tbody")},At&&N.createElement("tr",{"aria-hidden":"true",className:"".concat(ue,"-measure-row"),style:{height:0}},Gn.map(function(fr){return N.createElement(ie,{key:fr,columnKey:fr,onColumnResize:Ee})})),hn)},[Ze,ue,ft,At,ct,Ct,Fe,$t,Ne,Xt])}var he=N.memo(le);he.displayName="Body";var xe=he,Le=U("wRmb"),we=U("xEkU"),Ae=U.n(we);function pe(qe){var Ze=Object(N.useRef)(qe),Ct=Object(N.useState)({}),At=Object(K.a)(Ct,2),ct=At[1],ft=Object(N.useRef)(null),He=Object(N.useRef)([]);function Ne(Ue){ft.current===null&&(He.current=[],ft.current=Ae()(function(){He.current.forEach(function(ge){Ze.current=ge(Ze.current)}),ft.current=null,ct({})})),He.current.push(Ue)}return Object(N.useEffect)(function(){return function(){Ae.a.cancel(ft.current)}},[]),[Ze.current,Ne]}function be(qe){var Ze=Object(N.useRef)(qe),Ct=Object(N.useRef)(null);function At(){window.clearTimeout(Ct.current)}function ct(He){Ze.current=He,At(),Ct.current=window.setTimeout(function(){Ze.current=null,Ct.current=null},100)}function ft(){return Ze.current}return Object(N.useEffect)(function(){return At},[]),[ct,ft]}function ne(qe,Ze,Ct){var At=Object(N.useMemo)(function(){for(var ct=[],ft=[],He=0,Ne=0,Ue=0;Ue<Ze;Ue+=1)if(Ct==="rtl"){ft[Ue]=Ne,Ne+=qe[Ue]||0;var ge=Ze-Ue-1;ct[ge]=He,He+=qe[ge]||0}else{ct[Ue]=He,He+=qe[Ue]||0;var Ee=Ze-Ue-1;ft[Ee]=Ne,Ne+=qe[Ee]||0}return{left:ct,right:ft}},[qe,Ze,Ct]);return At}var fe=ne;function _e(qe){var Ze=qe.className,Ct=qe.children;return N.createElement("div",{className:Ze},Ct)}var ke=_e,et=U("n6Qo");function je(qe){var Ze,Ct=qe.prefixCls,At=qe.record,ct=qe.onExpand,ft=qe.expanded,He=qe.expandable,Ne="".concat(Ct,"-row-expand-icon");if(!He)return N.createElement("span",{className:z()(Ne,"".concat(Ct,"-row-spaced"))});var Ue=function(Ee){ct(At,Ee),Ee.stopPropagation()};return N.createElement("span",{className:z()(Ne,(Ze={},Object(te.a)(Ze,"".concat(Ct,"-row-expanded"),ft),Object(te.a)(Ze,"".concat(Ct,"-row-collapsed"),!ft),Ze)),onClick:Ue})}function ot(qe,Ze,Ct){var At=[];function ct(ft){(ft||[]).forEach(function(He,Ne){At.push(Ze(He,Ne)),ct(He[Ct])})}return ct(qe),At}var _t=U("zT1h"),Re=U("y0+3"),Be=function(Ze,Ct){var At,ct,ft=Ze.scrollBodyRef,He=Ze.onScroll,Ne=Ze.offsetScroll,Ue=N.useContext(u.a),ge=Ue.prefixCls,Ee=((At=ft.current)===null||At===void 0?void 0:At.scrollWidth)||0,De=((ct=ft.current)===null||ct===void 0?void 0:ct.clientWidth)||0,ue=Ee&&De*(De/Ee),Fe=N.useRef(),at=pe({scrollLeft:0,isHiddenScrollBar:!1}),xt=Object(K.a)(at,2),Kt=xt[0],Xt=xt[1],$t=N.useRef({delta:0,x:0}),$n=N.useState(!1),vn=Object(K.a)($n,2),ln=vn[0],hn=vn[1],Gn=function(){hn(!1)},fr=function(Jt){Jt.persist(),$t.current.delta=Jt.pageX-Kt.scrollLeft,$t.current.x=0,hn(!0),Jt.preventDefault()},vr=function(Jt){var Ar,Nn=Jt||((Ar=window)===null||Ar===void 0?void 0:Ar.event),Tn=Nn.buttons;if(!ln||Tn===0){ln&&hn(!1);return}var pr=$t.current.x+Jt.pageX-$t.current.x-$t.current.delta;pr<=0&&(pr=0),pr+ue>=De&&(pr=De-ue),He({scrollLeft:pr/De*(Ee+2)}),$t.current.x=Jt.pageX},ir=function(){var Jt=Object(Re.b)(ft.current).top,Ar=Jt+ft.current.offsetHeight,Nn=document.documentElement.scrollTop+window.innerHeight;Ar-Object(p.a)()<=Nn||Jt>=Nn-Ne?Xt(function(Tn){return Object(Q.a)(Object(Q.a)({},Tn),{},{isHiddenScrollBar:!0})}):Xt(function(Tn){return Object(Q.a)(Object(Q.a)({},Tn),{},{isHiddenScrollBar:!1})})},br=function(Jt){Xt(function(Ar){return Object(Q.a)(Object(Q.a)({},Ar),{},{scrollLeft:Jt/Ee*De||0})})};return N.useImperativeHandle(Ct,function(){return{setScrollLeft:br}}),N.useEffect(function(){var Rr=Object(_t.a)(document.body,"mouseup",Gn,!1),Jt=Object(_t.a)(document.body,"mousemove",vr,!1);return ir(),function(){Rr.remove(),Jt.remove()}},[ue,ln]),N.useEffect(function(){var Rr=Object(_t.a)(window,"scroll",ir,!1),Jt=Object(_t.a)(window,"resize",ir,!1);return function(){Rr.remove(),Jt.remove()}},[]),N.useEffect(function(){Kt.isHiddenScrollBar||Xt(function(Rr){var Jt,Ar;return Object(Q.a)(Object(Q.a)({},Rr),{},{scrollLeft:ft.current.scrollLeft/((Jt=ft.current)===null||Jt===void 0?void 0:Jt.scrollWidth)*((Ar=ft.current)===null||Ar===void 0?void 0:Ar.clientWidth)})})},[Kt.isHiddenScrollBar]),Ee<=De||!ue||Kt.isHiddenScrollBar?null:N.createElement("div",{style:{height:Object(p.a)(),width:De,bottom:Ne},className:"".concat(ge,"-sticky-scroll")},N.createElement("div",{onMouseDown:fr,ref:Fe,className:z()("".concat(ge,"-sticky-scroll-bar"),Object(te.a)({},"".concat(ge,"-sticky-scroll-bar-active"),ln)),style:{width:"".concat(ue,"px"),transform:"translate3d(".concat(Kt.scrollLeft,"px, 0, 0)")}}))},Qe=N.forwardRef(Be);function Ve(qe,Ze){return N.useMemo(function(){var Ct=!!qe;return{isSticky:Ct,stickyClassName:Ct?"".concat(Ze,"-sticky-header"):"",offsetHeader:Object(J.a)(qe)==="object"&&qe.offsetHeader||0,offsetScroll:Object(J.a)(qe)==="object"&&qe.offsetScroll||0}},[qe,Ze])}var Et=[],kt={},Vt="rc-table-internal-hook",Qt=N.memo(function(qe){var Ze=qe.children;return Ze},function(qe,Ze){return D()(qe.props,Ze.props)?qe.pingLeft!==Ze.pingLeft||qe.pingRight!==Ze.pingRight:!1});function an(qe){var Ze,Ct=qe.prefixCls,At=qe.className,ct=qe.rowClassName,ft=qe.style,He=qe.data,Ne=qe.rowKey,Ue=qe.scroll,ge=qe.tableLayout,Ee=qe.direction,De=qe.title,ue=qe.footer,Fe=qe.summary,at=qe.id,xt=qe.showHeader,Kt=qe.components,Xt=qe.emptyText,$t=qe.onRow,$n=qe.onHeaderRow,vn=qe.internalHooks,ln=qe.transformColumns,hn=qe.internalRefs,Gn=qe.sticky,fr=He||Et,vr=!!fr.length,ir=N.useState(0),br=Object(K.a)(ir,2),Rr=br[0],Jt=br[1];N.useEffect(function(){Jt(Object(p.a)())});var Ar=N.useMemo(function(){return Object(R.c)(Kt,{})},[Kt]),Nn=N.useCallback(function(er,tr){return Object(R.b)(Ar,er)||tr},[Ar]),Tn=N.useMemo(function(){return typeof Ne=="function"?Ne:function(er){var tr=er&&er[Ne];return tr}},[Ne]),pr=Object(b.c)(qe),_r=pr.expandIcon,Pr=pr.expandedRowKeys,yr=pr.defaultExpandedRowKeys,mt=pr.defaultExpandAllRows,Ke=pr.expandedRowRender,Ot=pr.onExpand,Me=pr.onExpandedRowsChange,ye=pr.expandRowByClick,ve=pr.rowExpandable,or=pr.expandIconColumnIndex,en=pr.expandedRowClassName,Ie=pr.childrenColumnName,gt=pr.indentSize,Ce=_r||je,dn=Ie||"children",hr=N.useMemo(function(){return Ke?"row":qe.expandable&&vn===Vt&&qe.expandable.__PARENT_RENDER_ICON__||fr.some(function(er){return er&&Object(J.a)(er)==="object"&&er[dn]})?"nest":!1},[!!Ke,fr]),mr=N.useState(function(){return yr||(mt?ot(fr,Tn,dn):[])}),q=Object(K.a)(mr,2),O=q[0],M=q[1],X=N.useMemo(function(){return new Set(Pr||O||[])},[Pr,O]),se=N.useCallback(function(er){var tr=Tn(er,fr.indexOf(er)),Yt,Rn=X.has(tr);Rn?(X.delete(tr),Yt=Object(B.a)(X)):Yt=[].concat(Object(B.a)(X),[tr]),M(Yt),Ot&&Ot(!Rn,er),Me&&Me(Yt)},[Tn,X,fr,Ot,Me]),Z=N.useState(0),Pe=Object(K.a)(Z,2),st=Pe[0],wt=Pe[1],Pt=Object(Le.b)(Object(Q.a)(Object(Q.a)(Object(Q.a)({},qe),pr),{},{expandable:!!Ke,expandedKeys:X,getRowKey:Tn,onTriggerExpand:se,expandIcon:Ce,expandIconColumnIndex:or,direction:Ee}),vn===Vt?ln:null),dt=Object(K.a)(Pt,2),bt=dt[0],Mt=dt[1],Cn=N.useMemo(function(){return{columns:bt,flattenColumns:Mt}},[bt,Mt]),Yn=N.useRef(),Hn=N.useRef(),fn=N.useRef(),Wt=N.useState(!1),rn=Object(K.a)(Wt,2),qt=rn[0],Ft=rn[1],Qn=N.useState(!1),Bn=Object(K.a)(Qn,2),xn=Bn[0],Jn=Bn[1],pn=pe(new Map),Sn=Object(K.a)(pn,2),un=Sn[0],Un=Sn[1],Xn=Object(R.a)(Mt),nr=Xn.map(function(er){return un.get(er)}),Ln=N.useMemo(function(){return nr},[nr.join("_")]),Kn=fe(Ln,Mt.length,Ee),nn=Ue&&Object(R.d)(Ue.y),_n=Ue&&Object(R.d)(Ue.x),In=_n&&Mt.some(function(er){var tr=er.fixed;return tr}),wn=N.useRef(),Zn=Ve(Gn,Ct),yn=Zn.isSticky,Vn=Zn.offsetHeader,qn=Zn.offsetScroll,kn=Zn.stickyClassName,Pn,Mn,Dn;nn&&(Mn={overflowY:"scroll",maxHeight:Ue.y}),_n&&(Pn={overflowX:"auto"},nn||(Mn={overflowY:"hidden"}),Dn={width:Ue.x===!0?"auto":Ue.x,minWidth:"100%"});var cn=N.useCallback(function(er,tr){Un(function(Yt){var Rn=new Map(Yt);return Rn.set(er,tr),Rn})},[]),Ut=be(null),Gt=Object(K.a)(Ut,2),zt=Gt[0],jt=Gt[1];function tn(er,tr){if(!tr)return;typeof tr=="function"?tr(er):tr.scrollLeft!==er&&(tr.scrollLeft=er)}var bn=function(tr){var Yt=tr.currentTarget,Rn=tr.scrollLeft,zn=typeof Rn=="number"?Rn:Yt.scrollLeft,rr=Yt||kt;if(!jt()||jt()===rr){var On;zt(rr),tn(zn,Hn.current),tn(zn,fn.current),tn(zn,(On=wn.current)===null||On===void 0?void 0:On.setScrollLeft)}if(Yt){var Ir=Yt.scrollWidth,jr=Yt.clientWidth;Ft(zn>0),Jn(zn<Ir-jr)}},gn=function(){fn.current&&bn({currentTarget:fn.current})},yt=function(tr){var Yt=tr.width;gn(),wt(Yn.current?Yn.current.offsetWidth:Yt)};N.useEffect(function(){return gn},[]),N.useEffect(function(){_n&&gn()},[_n]),N.useEffect(function(){vn===Vt&&hn&&(hn.body.current=fn.current)});var lt=Nn(["table"],"table"),Je=N.useMemo(function(){return ge||(In?Ue.x==="max-content"?"auto":"fixed":nn||Mt.some(function(er){var tr=er.ellipsis;return tr})?"fixed":"auto")},[nn,In,Mt,ge]),nt,Ge={colWidths:Ln,columCount:Mt.length,stickyOffsets:Kn,onHeaderRow:$n,fixHeader:nn},pt=N.useMemo(function(){return vr?null:typeof Xt=="function"?Xt():Xt},[vr,Xt]),rt=N.createElement(xe,{data:fr,measureColumnWidth:nn||_n||yn,expandedKeys:X,rowExpandable:ve,getRowKey:Tn,onRow:$t,emptyNode:pt,childrenColumnName:dn}),Tt=N.createElement(f,{colWidths:Mt.map(function(er){var tr=er.width;return tr}),columns:Mt}),Nt=Fe&&N.createElement(et.b,null,Fe(fr)),St=Nn(["body"]);if(nn||yn){var Ht;typeof St=="function"?(Ht=St(fr,{scrollbarSize:Rr,ref:fn,onScroll:bn}),Ge.colWidths=Mt.map(function(er,tr){var Yt=er.width,Rn=tr===bt.length-1?Yt-Rr:Yt;return typeof Rn=="number"&&!Number.isNaN(Rn)?Rn:(Object(m.a)(!1,"When use `components.body` with render props. Each column should have a fixed value."),0)})):Ht=N.createElement("div",{style:Object(Q.a)(Object(Q.a)({},Pn),Mn),onScroll:bn,ref:fn,className:z()("".concat(Ct,"-body"))},N.createElement(lt,{style:Object(Q.a)(Object(Q.a)({},Dn),{},{tableLayout:Je})},Tt,rt,Nt),yn&&N.createElement(Qe,{ref:wn,offsetScroll:qn,scrollBodyRef:fn,onScroll:bn})),nt=N.createElement(N.Fragment,null,xt!==!1&&N.createElement(_,Object.assign({noData:!fr.length},Ge,Cn,{direction:Ee,offsetHeader:Vn,stickyClassName:kn,ref:Hn,onScroll:bn})),Ht)}else nt=N.createElement("div",{style:Object(Q.a)(Object(Q.a)({},Pn),Mn),className:z()("".concat(Ct,"-content")),onScroll:bn,ref:fn},N.createElement(lt,{style:Object(Q.a)(Object(Q.a)({},Dn),{},{tableLayout:Je})},Tt,xt!==!1&&N.createElement(x,Object.assign({},Ge,Cn)),rt,Nt));var Rt=Object(b.b)(qe),Lt=N.createElement("div",Object.assign({className:z()(Ct,At,(Ze={},Object(te.a)(Ze,"".concat(Ct,"-rtl"),Ee==="rtl"),Object(te.a)(Ze,"".concat(Ct,"-ping-left"),qt),Object(te.a)(Ze,"".concat(Ct,"-ping-right"),xn),Object(te.a)(Ze,"".concat(Ct,"-layout-fixed"),ge==="fixed"),Object(te.a)(Ze,"".concat(Ct,"-fixed-header"),nn),Object(te.a)(Ze,"".concat(Ct,"-fixed-column"),In),Object(te.a)(Ze,"".concat(Ct,"-scroll-horizontal"),_n),Object(te.a)(Ze,"".concat(Ct,"-has-fix-left"),Mt[0]&&Mt[0].fixed),Object(te.a)(Ze,"".concat(Ct,"-has-fix-right"),Mt[Mt.length-1]&&Mt[Mt.length-1].fixed==="right"),Ze)),style:ft,id:at,ref:Yn},Rt),N.createElement(Qt,{pingLeft:qt,pingRight:xn,props:Object(Q.a)(Object(Q.a)({},qe),{},{stickyOffsets:Kn,mergedExpandedKeys:X})},De&&N.createElement(ke,{className:"".concat(Ct,"-title")},De(fr)),N.createElement("div",{className:"".concat(Ct,"-container")},nt),ue&&N.createElement(ke,{className:"".concat(Ct,"-footer")},ue(fr))));_n&&(Lt=N.createElement(g.a,{onResize:yt},Lt));var En=N.useMemo(function(){return{prefixCls:Ct,getComponent:Nn,scrollbarSize:Rr,direction:Ee,fixedInfoList:Mt.map(function(er,tr){return o(tr,tr,Mt,Kn,Ee)}),isSticky:yn}},[Ct,Nn,Rr,Ee,Mt,Kn,Ee,yn]),on=N.useMemo(function(){return Object(Q.a)(Object(Q.a)({},Cn),{},{tableLayout:Je,rowClassName:ct,expandedRowClassName:en,componentWidth:st,fixHeader:nn,fixColumn:In,horizonScroll:_n,expandIcon:Ce,expandableType:hr,expandRowByClick:ye,expandedRowRender:Ke,onTriggerExpand:se,expandIconColumnIndex:or,indentSize:gt})},[Cn,Je,ct,en,st,nn,In,_n,Ce,hr,ye,Ke,se,or,gt]),gr=N.useMemo(function(){return{onColumnResize:cn}},[cn]);return N.createElement(u.a.Provider,{value:En},N.createElement(j.Provider,{value:on},N.createElement(Y.Provider,{value:gr},Lt)))}an.Column=c.a,an.ColumnGroup=a.a,an.Summary=et.a,an.defaultProps={rowKey:"key",prefixCls:"rc-table",emptyText:function(){return"No Data"}};var sn=Oe.b=an},wRmb:function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return D});var te=U("rePB"),Q=U("KQm4"),B=U("VTBJ"),J=U("Ff2n"),K=U("q1tI"),N=U.n(K),$=U("Kwbf"),z=U("Zm9Q"),r=U("hW8S");function D(c){return Object(z.a)(c).filter(function(s){return K.isValidElement(s)}).map(function(s){var i=s.key,t=s.props,u=t.children,o=Object(J.a)(t,["children"]),R=Object(B.a)({key:i},o);return u&&(R.children=D(u)),R})}function m(c){return c.reduce(function(s,i){var t=i.fixed,u=t===!0?"left":t,o=i.children;return o&&o.length>0?[].concat(Object(Q.a)(s),Object(Q.a)(m(o).map(function(R){return Object(B.a)({fixed:u},R)}))):[].concat(Object(Q.a)(s),[Object(B.a)(Object(B.a)({},i),{},{fixed:u})])},[])}function g(c){for(var s=!0,i=0;i<c.length;i+=1){var t=c[i];if(s&&t.fixed!=="left")s=!1;else if(!s&&t.fixed==="left"){Object($.a)(!1,"Index ".concat(i-1," of `columns` missing `fixed='left'` prop."));break}}for(var u=!0,o=c.length-1;o>=0;o-=1){var R=c[o];if(u&&R.fixed!=="right")u=!1;else if(!u&&R.fixed==="right"){Object($.a)(!1,"Index ".concat(o+1," of `columns` missing `fixed='right'` prop."));break}}}function p(c){return c.map(function(s){var i=s.fixed,t=Object(J.a)(s,["fixed"]),u=i;return i==="left"?u="right":i==="right"&&(u="left"),Object(B.a)({fixed:u},t)})}function a(c,s){var i=c.prefixCls,t=c.columns,u=c.children,o=c.expandable,R=c.expandedKeys,T=c.getRowKey,S=c.onTriggerExpand,A=c.expandIcon,I=c.rowExpandable,x=c.expandIconColumnIndex,b=c.direction,h=c.expandRowByClick,f=K.useMemo(function(){return t||D(u)},[t,u]),C=K.useMemo(function(){if(o){var W,j=x||0,w=f[j],F=(W={},Object(te.a)(W,r.a,{className:"".concat(i,"-expand-icon-col")}),Object(te.a)(W,"title",""),Object(te.a)(W,"fixed",w?w.fixed:null),Object(te.a)(W,"className","".concat(i,"-row-expand-icon-cell")),Object(te.a)(W,"render",function(H,Y,ie){var le=T(Y,ie),he=R.has(le),xe=I?I(Y):!0,Le=A({prefixCls:i,expanded:he,expandable:xe,record:Y,onExpand:S});return h?K.createElement("span",{onClick:function(Ae){return Ae.stopPropagation()}},Le):Le}),W),P=f.slice();return j>=0&&P.splice(j,0,F),P}return f},[o,f,T,R,A,b]),E=K.useMemo(function(){var W=C;return s&&(W=s(W)),W.length||(W=[{render:function(){return null}}]),W},[s,C,b]),_=K.useMemo(function(){return b==="rtl"?p(m(E)):m(E)},[E,b]);return[E,_]}Oe.b=a},"y0+3":function(It,Oe,U){"use strict";U.d(Oe,"a",function(){return m}),U.d(Oe,"b",function(){return p});var te=/margin|padding|width|height|max|min|offset/,Q={left:!0,top:!0},B={cssFloat:1,styleFloat:1,float:1};function J(a){return a.nodeType===1?a.ownerDocument.defaultView.getComputedStyle(a,null):{}}function K(a,c,s){if(c=c.toLowerCase(),s==="auto"){if(c==="height")return a.offsetHeight;if(c==="width")return a.offsetWidth}return c in Q||(Q[c]=te.test(c)),Q[c]?parseFloat(s)||0:s}function N(a,c){var s=arguments.length,i=J(a);return c=B[c]?"cssFloat"in a.style?"cssFloat":"styleFloat":c,s===1?i:K(a,c,i[c]||a.style[c])}function $(a,c,s){var i=arguments.length;if(c=B[c]?"cssFloat"in a.style?"cssFloat":"styleFloat":c,i===3)return typeof s=="number"&&te.test(c)&&(s="".concat(s,"px")),a.style[c]=s,s;for(var t in c)c.hasOwnProperty(t)&&$(a,t,c[t]);return J(a)}function z(a){return a===document.body?document.documentElement.clientWidth:a.offsetWidth}function r(a){return a===document.body?window.innerHeight||document.documentElement.clientHeight:a.offsetHeight}function D(){var a=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth),c=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);return{width:a,height:c}}function m(){var a=document.documentElement.clientWidth,c=window.innerHeight||document.documentElement.clientHeight;return{width:a,height:c}}function g(){return{scrollLeft:Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),scrollTop:Math.max(document.documentElement.scrollTop,document.body.scrollTop)}}function p(a){var c=a.getBoundingClientRect(),s=document.documentElement;return{left:c.left+(window.pageXOffset||s.scrollLeft)-(s.clientLeft||document.body.clientLeft||0),top:c.top+(window.pageYOffset||s.scrollTop)-(s.clientTop||document.body.clientTop||0)}}},"yTi+":function(It,Oe,U){It.exports=U.p+"static/AssistantCode3.fdd8db3c.jpeg"},zWo0:function(It,Oe,U){It.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"}}}]);